DOC: Segmentation application doc minor change.

--- Applications/Segmentation/otbSegmentation.cxx
+++ Applications/Segmentation/otbSegmentation.cxx
@@ -132,17 +132,17 @@

     // Documentation
     SetDocName("Segmentation");
-    SetDocLongDescription("This application allows to perform various segmentation algorithm on an multispectral image. "
-                          "Available segmentation algorithms are two different version of Mean-Shift segmentation algorithm (one being multi-threaded),"
-                          " simple pixel based connected components according to a user-defined criterion, and watershed from the gradient of the intensity "
-                          "(norm of spectral bands vector). The application has two different modes that affects the nature of its output.\n\nIn raster mode,"
-                          " the output of the application is a classical image of unique labels identifying the segmented regions. The labeled output can be passed to the "
-                          " ColorMapping application to render regions with contrasted colours. Please note that this mode loads the whole input image into memory, and as such "
-                          " can not handle large images. \n\nTo segment large data, one can use the vector mode. In this case, the output of the application is a "
-                          " vector file or database. The input image is split into tiles (whose size can be set using the tilesize parameter), and each tile is loaded, segmented "
-                          " with the chosen algorithm, vectorized, and written into the output file or database. This piece-wise behaviour ensure that memory will never get overloaded, "
-                          " and that images of any size can be processed. There are few more options in the vector mode. The simplify option allows to simplify the geometry "
-                          " (i.e. remove nodes in polygons) according to a user-defined tolerance. The stitch option allows to application to try to stitch together polygons corresponding "
+    SetDocLongDescription("This application allows to perform various segmentation algorithms on an multispectral image."
+                          "Available segmentation algorithms are two different versions of Mean-Shift segmentation algorithm (one being multi-threaded),"
+                          " simple pixel based connected components according to a user-defined criterion, and watershed from the gradient of the intensity"
+                          " (norm of spectral bands vector). The application has two different modes that affects the nature of its output.\n\nIn raster mode,"
+                          " the output of the application is a classical image of unique labels identifying the segmented regions. The labeled output can be passed to the"
+                          " ColorMapping application to render regions with contrasted colours. Please note that this mode loads the whole input image into memory, and as such"
+                          " can not handle large images. \n\nTo segment large data, one can use the vector mode. In this case, the output of the application is a"
+                          " vector file or database. The input image is split into tiles (whose size can be set using the tilesize parameter), and each tile is loaded, segmented"
+                          " with the chosen algorithm, vectorized, and written into the output file or database. This piece-wise behaviour ensure that memory will never get overloaded,"
+                          " and that images of any size can be processed. There are few more options in the vector mode. The simplify option allows to simplify the geometry"
+                          " (i.e. remove nodes in polygons) according to a user-defined tolerance. The stitch option allows to application to try to stitch together polygons corresponding"
                           " to segmented region that may have been splitted by the tiling scheme. ");

     SetDocLimitations("In raster mode, the application can not handle large input images. Stitching step of vector mode might become slow with very large input images.");


64bit build fix.

64bit build fix.

Change-Id: I8c597217955d12b215bdcf1d92ca5fab9a7ed6e0

--- runtime/reflection.cc
+++ runtime/reflection.cc
@@ -231,7 +231,7 @@
             mh.GetClassFromTypeIdx(classes->GetTypeItem(args_offset).type_idx_);
         if (UNLIKELY(arg == nullptr || !arg->InstanceOf(dst_class))) {
           ThrowIllegalArgumentException(nullptr,
-              StringPrintf("method %s argument %d has type %s, got %s",
+              StringPrintf("method %s argument %zd has type %s, got %s",
                   PrettyMethod(mh.GetMethod(), false).c_str(),
                   args_offset + 1,  // Humans don't count from 0.
                   PrettyDescriptor(dst_class).c_str(),
@@ -259,7 +259,7 @@
               ThrowIllegalPrimitiveArgumentException(expected, src_descriptor); \
             } else { \
               ThrowIllegalArgumentException(nullptr, \
-                  StringPrintf("method %s argument %d has type %s, got %s", \
+                  StringPrintf("method %s argument %zd has type %s, got %s", \
                       PrettyMethod(mh.GetMethod(), false).c_str(), \
                       args_offset + 1, \
                       expected, \


Test an alternate metric construction of the cover tree.

--- src/mlpack/tests/tree_test.cpp
+++ src/mlpack/tests/tree_test.cpp
@@ -1438,18 +1438,20 @@
   BOOST_REQUIRE_EQUAL(root.TreeDepth(), 7);
 }

-void RecurseTreeCountLeaves(const CoverTree<>& node, arma::vec& counts)
+template<typename TreeType>
+void RecurseTreeCountLeaves(const TreeType& node, arma::vec& counts)
 {
   for (size_t i = 0; i < node.NumChildren(); ++i)
   {
     if (node.Child(i).NumChildren() == 0)
       counts[node.Child(i).Point()]++;
     else
-      RecurseTreeCountLeaves(node.Child(i), counts);
+      RecurseTreeCountLeaves<TreeType>(node.Child(i), counts);
   }
 }

-void CheckSelfChild(const CoverTree<>& node)
+template<typename TreeType>
+void CheckSelfChild(const TreeType& node)
 {
   if (node.NumChildren() == 0)
     return; // No self-child applicable here.
@@ -1468,7 +1470,8 @@
   BOOST_REQUIRE_EQUAL(found, true);
 }

-void CheckCovering(const CoverTree<>& node)
+template<typename TreeType, typename MetricType>
+void CheckCovering(const TreeType& node)
 {
   // Return if a leaf.  No checking necessary.
   if (node.NumChildren() == 0)
@@ -1484,18 +1487,19 @@
   {
     const size_t childPoint = node.Child(i).Point();

-    double distance = metric::LMetric<2>::Evaluate(dataset.col(nodePoint),
+    double distance = MetricType::Evaluate(dataset.col(nodePoint),
         dataset.col(childPoint));

     BOOST_REQUIRE_LE(distance, maxDistance);

     // Check the child.
-    CheckCovering(node.Child(i));
+    CheckCovering<TreeType, MetricType>(node.Child(i));
   }
 }

-void CheckIndividualSeparation(const CoverTree<>& constantNode,
-                               const CoverTree<>& node)
+template<typename TreeType, typename MetricType>
+void CheckIndividualSeparation(const TreeType& constantNode,
+                               const TreeType& node)
 {
   // Don't check points at a lower scale.
   if (node.Scale() < constantNode.Scale())
@@ -1508,7 +1512,8 @@
     {
       // Don't recurse into leaves.
       if (node.Child(i).NumChildren() > 0)
-        CheckIndividualSeparation(constantNode, node.Child(i));
+        CheckIndividualSeparation<TreeType, MetricType>(constantNode,
+            node.Child(i));
     }

     return;
@@ -1528,22 +1533,23 @@
   double minDistance = pow(constantNode.ExpansionConstant(),
       constantNode.Scale());

-  double distance = metric::LMetric<2>::Evaluate(dataset.col(constantPoint),
+  double distance = MetricType::Evaluate(dataset.col(constantPoint),
       dataset.col(nodePoint));

   BOOST_REQUIRE_GT(distance, minDistance);
 }

-void CheckSeparation(const CoverTree<>& node, const CoverTree<>& root)
+template<typename TreeType, typename MetricType>
+void CheckSeparation(const TreeType& node, const TreeType& root)
 {
   // Check the separation between this point and all other points on this scale.
-  CheckIndividualSeparation(node, root);
+  CheckIndividualSeparation<TreeType, MetricType>(node, root);

   // Check the children, but only if they are not leaves.  Leaves don't need to
   // be checked.
   for (size_t i = 0; i < node.NumChildren(); ++i)
     if (node.Child(i).NumChildren() > 0)
-      CheckSeparation(node.Child(i), root);
+      CheckSeparation<TreeType, MetricType>(node.Child(i), root);
 }

@@ -1592,14 +1598,14 @@
     BOOST_REQUIRE_EQUAL(counts[i], 1);

   // Each non-leaf should have a self-child.
-  CheckSelfChild(tree);
+  CheckSelfChild<CoverTree<> >(tree);

   // Each node must satisfy the covering principle (its children must be less
   // than or equal to a certain distance apart).
-  CheckCovering(tree);
+  CheckCovering<CoverTree<>, LMetric<2> >(tree);

   // Each node's children must be separated by at least a certain value.
-  CheckSeparation(tree, tree);
+  CheckSeparation<CoverTree<>, LMetric<2> >(tree, tree);
 }

 /**
@@ -1622,14 +1628,44 @@
     BOOST_REQUIRE_EQUAL(counts[i], 1);

   // Each non-leaf should have a self-child.
-  CheckSelfChild(tree);
+  CheckSelfChild<CoverTree<> >(tree);

   // Each node must satisfy the covering principle (its children must be less
   // than or equal to a certain distance apart).
-  CheckCovering(tree);
+  CheckCovering<CoverTree<>, LMetric<2> >(tree);

   // Each node's children must be separated by at least a certain value.
-  CheckSeparation(tree, tree);
+  CheckSeparation<CoverTree<>, LMetric<2> >(tree, tree);
+}
+
+/**
+ * Make sure cover trees work in different metric spaces.
+ */
+BOOST_AUTO_TEST_CASE(CoverTreeAlternateMetricTest)
+{
+  arma::mat dataset;
+  // 5-dimensional, 300-point dataset.
+  dataset.randu(5, 300);
+
+  CoverTree<LMetric<1> > tree(dataset);
+
+  // Ensure each leaf is only created once.
+  arma::vec counts;
+  counts.zeros(300);
+  RecurseTreeCountLeaves<CoverTree<LMetric<1> > >(tree, counts);
+
+  for (size_t i = 0; i < 300; ++i)
+    BOOST_REQUIRE_EQUAL(counts[i], 1);
+
+  // Each non-leaf should have a self-child.
+  CheckSelfChild<CoverTree<LMetric<1> > >(tree);
+
+  // Each node must satisfy the covering principle (its children must be less
+  // than or equal to a certain distance apart).
+  CheckCovering<CoverTree<LMetric<1> >, LMetric<1> >(tree);
+
+  // Each node's children must be separated by at least a certain value.
+  CheckSeparation<CoverTree<LMetric<1> >, LMetric<1> >(tree, tree);
 }

 BOOST_AUTO_TEST_SUITE_END();


Delete Shapes.cpp

Delete Shapes.cpp

--- Shapes.cpp
+++ Shapes.cpp
@@ -1,79 +0,0 @@
-
-#include "include/Shapes.h"
-
-double sumOfArea(const std::vector<Shape *> & shapes) {
-
-    double total =0;
-
-    for (Shape *shapePoint: shapes)
-        total += shapePoint->area();
-
-    return total;
-
-}
-
-double sumOfPerimeter(const std::vector<Shape *> & shapes){
-
-    double total = 0;
-
-    for (Shape *shapePoint: shapes)
-        total += shapePoint->perimeter();
-
-    return total;
-
-}
-
-Shape* theLargestArea(const std::vector<Shape *> & shapes){
-
-    Shape *largestShape = nullptr;
-    double largestArea = 0;
-
-    for (Shape *shapePoint: shapes)
-        if(shapePoint->area() >= largestArea){
-            largestArea = shapePoint->area();
-            largestShape = shapePoint;
-        }
-
-    return largestShape;
-
-}
-
-double distanceOfVertexs(const vertex vertex_1, const vertex vertex_2) {
-    double diff_X, diff_Y, distance;
-
-    diff_X = vertex_1.x - vertex_2.x;
-    diff_Y = vertex_1.y - vertex_2.y;
-
-    distance = sqrt(((diff_X * diff_X) + (diff_Y * diff_Y)));
-
-    return distance;
-}
-
-void sortByDecreasingPerimeter(std::vector<Shape *> & shapes) {
-    // use the shakeSort
-    int left = 0;
-    int right = shapes.size()-1;
-    int shift = 0;
-    Shape *temp;
-
-    while(left < right){
-        for(int i = left; i < right; i++) {
-            if(shapes[i]->perimeter() < shapes[i+1]->perimeter()){
-                temp = shapes[i];
-                shapes[i] = shapes[i+1];
-                shapes[i+1] = temp;
-                shift = i;
-            }
-        }
-        right = shift;
-        for(int i = right; i > left; i--){
-            if(shapes[i]->perimeter() > shapes[i-1]->perimeter()){
-                temp = shapes[i];
-                shapes[i] = shapes[i-1];
-                shapes[i-1] = temp;
-                shift = i;
-            }
-        }
-        left = shift;
-    }
-}


little bump

little bump

--- vowpalwabbit/oaa.cc
+++ vowpalwabbit/oaa.cc
@@ -12,7 +12,6 @@
 #include "vw.h"

 using namespace std;
-
 struct oaa
 { size_t k;
   vw* all; // for raw


Add a test that fails about an LLL macro with no arguments

--- test/liblll/Parser.cpp
+++ test/liblll/Parser.cpp
@@ -174,6 +174,12 @@
 	BOOST_CHECK(!successParse("()"));
 }

+BOOST_AUTO_TEST_CASE(macro_with_zero_args)
+{
+	char const* text = "(def 'zeroargs () (asm INVALID))";
+	BOOST_CHECK(successParse(text));
+}
+
 BOOST_AUTO_TEST_SUITE_END()

 }


remove some warnings CR12832

remove some warnings CR12832

--- targets/libraries/C12832/C12832.cpp
+++ targets/libraries/C12832/C12832.cpp
@@ -31,7 +31,7 @@
 C12832::C12832(SPI *spi, PinName reset, PinName a0, PinName ncs, const char* name)
     : _reset(reset),_A0(a0),_CS(ncs),GraphicsDisplay(name)
 {
-	  _spi = spi;
+    _spi = spi;
     orientation = 1;
     draw_mode = NORMAL;
     char_x = 0;
@@ -473,7 +473,7 @@
     if (value == '\n') {    // new line
         char_x = 0;
         char_y = char_y + font[2];
-        if (char_y >= height() - font[2]) {
+        if (char_y >= (unsigned int)height() - font[2]) {
             char_y = 0;
         }
     } else {
@@ -497,10 +497,10 @@
     vert = font[2];                      // get vert size of font
     bpl = font[3];                       // bytes per line

-    if (char_x + hor > width()) {
+    if (char_x + hor > (unsigned int)width()) {
         char_x = 0;
         char_y = char_y + vert;
-        if (char_y >= height() - font[2]) {
+        if (char_y >= (unsigned int)height() - font[2]) {
             char_y = 0;
         }
     }


[HB] Remove unused code

[HB] Remove unused code

--- pango/opentype/hb-ot-layout-gdef-private.hh
+++ pango/opentype/hb-ot-layout-gdef-private.hh
@@ -31,16 +31,6 @@

 #include "hb-font-private.h"

-
-struct GlyphClassDef : ClassDef
-{
-  enum {
-    BaseGlyph		= 0x0001u,
-    LigatureGlyph	= 0x0002u,
-    MarkGlyph		= 0x0003u,
-    ComponentGlyph	= 0x0004u,
-  };
-};

 /*
  * Attachment List Table


Send the content of the chat message in WP push notification

--- src/module-pushnotification.cc
+++ src/module-pushnotification.cc
@@ -258,9 +258,15 @@
 						(sip->sip_request->rq_method == sip_method_invite) ? call_snd : msg_snd,
 						call_id);
 			} else if (strcmp(type,"wp")==0) {
+				bool is_message = sip->sip_request->rq_method != sip_method_invite;
+				string message = "";
+				if (is_message) {
+					sip_payload_t *payload=sip->sip_payload;
+					message = new string(payload->pl_data, payload->pl_len);
+				}
 				pn = make_shared<WindowsPhonePushNotificationRequest>(appId, deviceToken,
-						sip->sip_request->rq_method != sip_method_invite,
-						"", //TODO: send the message
+						is_message,
+						message,
 						contact,
 						url_as_string(ms->getHome(), sip->sip_from->a_url));
 			} else if (strcmp(type,"google")==0) {


oops. uncomment the critical line.

oops. uncomment the critical line.

--- compiler/src/desugar.cpp
+++ compiler/src/desugar.cpp
@@ -229,7 +229,7 @@
                                              new ExprList());
         StatementPtr stmt = new ExprStatement(continueException.ptr());
         block->statements.push_back(stmt);
-//         block->statements.push_back(new Unreachable());
+        block->statements.push_back(new Unreachable());
         lastIf->elsePart = block.ptr();
     }
     return result;


Fixed ambiguous call to log on Windows MSVC9

git-svn-id: f26ccc5efe72c2bd8e1c40f599fe313f2692e4de@12140 a612230a-c5fa-0310-af8b-88eea846685b

--- sipXcallLib/src/cp/CpPeerCall.cpp
+++ sipXcallLib/src/cp/CpPeerCall.cpp
@@ -1,5 +1,5 @@
 //
-// Copyright (C) 2005-2012 SIPez LLC. All rights reserved.
+// Copyright (C) 2005-2013 SIPez LLC. All rights reserved.
 //
 // Copyright (C) 2004-2007 SIPfoundry Inc.
 // Licensed by SIPfoundry under the LGPL license.
@@ -2701,7 +2701,7 @@
                else
                {
                   int energyLevel = intNotif.getValue();
-                  double ledLevel = log(energyLevel) / log(10.0) * 1.2;
+                  double ledLevel = log((double)energyLevel) / log((double)10.0) * 1.2;
                   OsSysLog::add(FAC_CP, PRI_DEBUG, "Ignoring MI_NOTF_ENERGY_LEVEL focus: %s resource name: %s energy: %d led: %f",
                      isInFocus() ? "true" : "false", resourceName.data(), intNotif.getValue(), ledLevel);
                }


Initialize pLineAliases member of SIPX_LINE_DATA on creation.

git-svn-id: 5274dacc98e2a95d0b0452670772bfdffe61ca90@9830 a612230a-c5fa-0310-af8b-88eea846685b

--- sipXcallLib/src/tapi/sipXtapi.cpp
+++ sipXcallLib/src/tapi/sipXtapi.cpp
@@ -168,6 +168,7 @@
    pData->lineURI = new Url(uri);
    pData->pInst = pInst;
    pData->pMutex = new OsRWMutex(OsRWMutex::Q_FIFO);
+   pData->pLineAliases = NULL;

    pInst->pLock->acquire();
    pInst->nLines++;


Compile fixes for EKF2

Compile fixes for EKF2

--- src/modules/ekf2/ekf2_main.cpp
+++ src/modules/ekf2/ekf2_main.cpp
@@ -261,7 +261,8 @@

 void Ekf2::print_status()
 {
-	warnx("position OK %s", (_ekf->position_is_valid()) ? "[YES]" : "[NO]");
+	warnx("local position OK %s", (_ekf->local_position_is_valid()) ? "[YES]" : "[NO]");
+	warnx("global position OK %s", (_ekf->global_position_is_valid()) ? "[YES]" : "[NO]");
 }

 void Ekf2::task_main()
@@ -426,15 +427,15 @@
 		lpos.vz = vel[2];

 		// TODO: better status reporting
-		lpos.xy_valid = _ekf->position_is_valid();
+		lpos.xy_valid = _ekf->local_position_is_valid();
 		lpos.z_valid = true;
-		lpos.v_xy_valid = _ekf->position_is_valid();
+		lpos.v_xy_valid = _ekf->local_position_is_valid();
 		lpos.v_z_valid = true;

 		// Position of local NED origin in GPS / WGS84 frame
 		struct map_projection_reference_s ekf_origin = {};
 		_ekf->get_ekf_origin(&lpos.ref_timestamp, &ekf_origin, &lpos.ref_alt); 	// true if position (x, y) is valid and has valid global reference (ref_lat, ref_lon)
-		lpos.xy_global = _ekf->position_is_valid();
+		lpos.xy_global = _ekf->global_position_is_valid();
 		lpos.z_global = true;                                // true if z is valid and has valid global reference (ref_alt)
 		lpos.ref_lat = ekf_origin.lat_rad * 180.0 / M_PI; // Reference point latitude in degrees
 		lpos.ref_lon = ekf_origin.lon_rad * 180.0 / M_PI; // Reference point longitude in degrees
@@ -502,7 +503,7 @@
 		// generate and publish global position data
 		struct vehicle_global_position_s global_pos = {};

-		if (_ekf->position_is_valid()) {
+		if (_ekf->global_position_is_valid()) {
 			// TODO: local origin is currenlty at GPS height origin - this is different to ekf_att_pos_estimator

 			global_pos.timestamp = hrt_absolute_time(); // Time of this estimate, in microseconds since system start


INTEGRATION: CWS ooo19126 (1.15.76); FILE MERGED 2005/09/05 12:06:47 rt 1.15.76.1: #i54170# Change license header: remove SISSL

--- psprint/source/printergfx/common_gfx.cxx
+++ psprint/source/printergfx/common_gfx.cxx
@@ -1,61 +1,35 @@
 /*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
  *
  *  $RCSfile: common_gfx.cxx,v $
  *
- *  $Revision: 1.15 $
+ *  $Revision: 1.16 $
  *
- *  last change: $Author: kz $ $Date: 2004-05-18 10:46:21 $
+ *  last change: $Author: rt $ $Date: 2005-09-08 16:45:48 $
  *
- *  The Contents of this file are made available subject to the terms of
- *  either of the following licenses
- *
- *         - GNU Lesser General Public License Version 2.1
- *         - Sun Industry Standards Source License Version 1.1
- *
- *  Sun Microsystems Inc., October, 2000
- *
- *  GNU Lesser General Public License Version 2.1
- *  =============================================
- *  Copyright 2000 by Sun Microsystems, Inc.
- *  901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License version 2.1, as published by the Free Software Foundation.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *  MA  02111-1307  USA
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
  *
  *
- *  Sun Industry Standards Source License Version 1.1
- *  =================================================
- *  The contents of this file are subject to the Sun Industry Standards
- *  Source License Version 1.1 (the "License"); You may not use this file
- *  except in compliance with the License. You may obtain a copy of the
- *  License at http://www.openoffice.org/license.html.
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 by Sun Microsystems, Inc.
+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
  *
- *  Software provided under this License is provided on an "AS IS" basis,
- *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
- *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
- *  See the License for the specific provisions governing your rights and
- *  obligations concerning the Software.
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+ *    License version 2.1, as published by the Free Software Foundation.
  *
- *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *    This library is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *    Lesser General Public License for more details.
  *
- *  Copyright: 2000 by Sun Microsystems, Inc.
- *
- *  All Rights Reserved.
- *
- *  Contributor(s): _______________________________________
- *
+ *    You should have received a copy of the GNU Lesser General Public
+ *    License along with this library; if not, write to the Free Software
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *    MA  02111-1307  USA
  *
  ************************************************************************/


Kaon Femto: new macro for MC (from Elena)

--- PWGCF/FEMTOSCOPY/macros/Train/pPbKKfemto/MC/conf/1/ConfigFemtoAnalysis.C
+++ PWGCF/FEMTOSCOPY/macros/Train/pPbKKfemto/MC/conf/1/ConfigFemtoAnalysis.C
@@ -25,7 +25,8 @@
 #include "AliFemtoCutMonitorEventMult.h"
 #include "AliFemtoCutMonitorEventVertex.h"
 #include "AliFemtoShareQualityTPCEntranceSepPairCut.h"
-#include "AliFemtoPairCutAntiGammaAlpha.h"
+//#include "AliFemtoPairCutAntiGammaAlpha.h"
+#include "AliFemtoPairCutAntiGamma.h"
 #include "AliFemtoPairCutRadialDistance.h"
 #include "AliFemtoQinvCorrFctn.h"
 #include "AliFemtoShareQualityCorrFctn.h"
@@ -128,8 +129,8 @@
   AliFemtoCutMonitorParticlePID *cutFail1PIDetaphitpc[20];
   AliFemtoCutMonitorParticlePID *cutPass2PIDetaphitpc[20];
   AliFemtoCutMonitorParticlePID *cutFail2PIDetaphitpc[20];
-  //AliFemtoPairCutAntiGamma      *sqpcetaphitpc[20];
-  AliFemtoPairCutAntiGammaAlpha      *sqpcetaphitpc[20];
+  AliFemtoPairCutAntiGamma      *sqpcetaphitpc[20];
+  //AliFemtoPairCutAntiGammaAlpha      *sqpcetaphitpc[20];
   //AliFemtoShareQualityPairCut      *sqpcetaphitpc[20];
   //AliFemtoPairCutRadialDistance      *sqpcetaphitpc[20];
   AliFemtoCorrFctnDirectYlm     *cylmetaphitpc[20];
@@ -147,8 +148,8 @@
   AliFemtoShareQualityCorrFctn  *cqinvsqtpc[20*10];
   AliFemtoChi2CorrFctn          *cqinvchi2tpc[20];
   AliFemtoTPCInnerCorrFctn      *cqinvinnertpc[20*10];
-  //AliFemtoCorrFctnGammaMonitor  *cgamma[20*10];
-  AliFemtoCorrFctnGammaMonitorAlpha  *cgamma[20*10];
+  AliFemtoCorrFctnGammaMonitor  *cgamma[20*10];
+  //AliFemtoCorrFctnGammaMonitorAlpha  *cgamma[20*10];

   // *** Begin pion-pion analysis ***
   int aniter = 0;
@@ -278,8 +279,8 @@
 	  cutFail1PIDetaphitpc[aniter] = new AliFemtoCutMonitorParticlePID(Form("cutFail1%stpcM%i", chrgs[ichg], imult),1);
 	  dtc1etaphitpc[aniter]->AddCutMonitor(cutPass1PIDetaphitpc[aniter], cutFail1PIDetaphitpc[aniter]);

-	  //sqpcetaphitpc[aniter] = new AliFemtoPairCutAntiGamma();
-	  sqpcetaphitpc[aniter] = new AliFemtoPairCutAntiGammaAlpha();
+	  sqpcetaphitpc[aniter] = new AliFemtoPairCutAntiGamma();
+	  //sqpcetaphitpc[aniter] = new AliFemtoPairCutAntiGammaAlpha();
 	  //sqpcetaphitpc[aniter] = new AliFemtoShareQualityPairCut();
 	  //sqpcetaphitpc[aniter] = new AliFemtoShareQualityTPCEntranceSepPairCut();
 	  //sqpcetaphitpc[aniter] = new AliFemtoPairCutRadialDistance();
@@ -290,18 +291,17 @@
 	  //sqpcetaphitpc[aniter]->SetPhiStarDifferenceMinimum(0.02);
 	  //runtype==0

-	  //sqpcetaphitpc[aniter]->SetMaxEEMinv(0.01);
-	  //sqpcetaphitpc[aniter]->SetMaxThetaDiff(0.1);
-	  //sqpcetaphitpc[aniter]->SetMaxAlphaDiff(0.99);
-	  //sqpcetaphitpc[aniter]->SetTPCEntranceSepMinimum(0.00001);
+	  sqpcetaphitpc[aniter]->SetMaxEEMinv(0.0);
+	  sqpcetaphitpc[aniter]->SetMaxThetaDiff(0.0);
+	  sqpcetaphitpc[aniter]->SetTPCEntranceSepMinimum(0.0);

 	  ////sqpcetaphitpc[aniter]->SetMaxEEMinv(0.025);
 	  ////sqpcetaphitpc[aniter]->SetMaxAlphaDiff(0.998);
 	  ////sqpcetaphitpc[aniter]->SetTPCEntranceSepMinimum(0.0);

-	  sqpcetaphitpc[aniter]->SetMaxEEMinv(0.0);
-	  sqpcetaphitpc[aniter]->SetMaxAlphaDiff(0.0);
-	  sqpcetaphitpc[aniter]->SetTPCEntranceSepMinimum(0.0);
+	  //sqpcetaphitpc[aniter]->SetMaxEEMinv(0.0);
+	  //sqpcetaphitpc[aniter]->SetMaxAlphaDiff(0.0);
+	  //sqpcetaphitpc[aniter]->SetTPCEntranceSepMinimum(0.0);

 	  // sqpcetaphitpc[aniter]->SetPhiStarDistanceMinimum(0.03);
 	  // sqpcetaphitpc[aniter]->SetRadialDistanceMinimum(0.12, 0.03);
@@ -370,8 +370,9 @@
 	      cqinvinnertpc[ktm]->SetRadius(1.6);
 	      anetaphitpc[aniter]->AddCorrFctn(cqinvinnertpc[ktm]);

+              cgamma[aniter] = new AliFemtoCorrFctnGammaMonitor(Form("cgammaM%ikT%i", imult, ikt),200,200);
               //cgamma[aniter] = new AliFemtoCorrFctnGammaMonitorAlpha(Form("cgammaM%ikT%i", imult, ikt),200,200);
-              cgamma[aniter] = new AliFemtoCorrFctnGammaMonitorAlpha(Form("cgammaM%ikT%i", imult, ikt),1000,200);
+              //cgamma[aniter] = new AliFemtoCorrFctnGammaMonitorAlpha(Form("cgammaM%ikT%i", imult, ikt),1000,200);
               anetaphitpc[aniter]->AddCorrFctn(cgamma[aniter]);


that didn't help

that didn't help

--- src/Band/residuals.hpp
+++ src/Band/residuals.hpp
@@ -294,6 +294,7 @@
     int n{0};
     if (converge_by_energy) {

+        /* main trick here: first estimate energy difference, and only then compute unconverged residuals */
         auto get_ev_idx = [&](double tol__)
         {
             std::vector<int> ev_idx;
@@ -308,25 +309,16 @@

         auto ev_idx = get_ev_idx(itso.energy_tolerance_);

-        ///* main trick here: first estimate energy difference, and only then compute unconverged residuals */
-        //std::vector<int> ev_idx;
-        //for (int i = 0; i < num_bands__; i++) {
-        //    double tol = itso.energy_tolerance_ + 1e-7 * std::abs(kp__->band_occupancy(i + ispn__ * ctx_.num_fv_states()) / ctx_.max_occupancy() - 1);
-        //    if (std::abs(eval__[i] - eval_old__[i]) > tol) {
-        //        ev_idx.push_back(i);
-        //    }
-        //}
-
         if ((n = static_cast<int>(ev_idx.size())) == 0) {
             return 0;
         }

-        if (n < 4) {
-            printf("small number of residuals is found: %i\n", n);
-            ev_idx = get_ev_idx(std::max(1e-12, itso.energy_tolerance_ * 0.01));
-            n = static_cast<int>(ev_idx.size());
-            printf("new number of residuals: %i\n", n);
-        }
+        //if (n < 4) {
+        //    printf("small number of residuals is found: %i\n", n);
+        //    ev_idx = get_ev_idx(std::max(1e-12, itso.energy_tolerance_ * 0.01));
+        //    n = static_cast<int>(ev_idx.size());
+        //    printf("new number of residuals: %i\n", n);
+        //}

         std::vector<double> eval_tmp(n);


Void returing functions implemented

Void returing functions implemented

--- include/asmith/reflection/reflection_function.hpp
+++ include/asmith/reflection/reflection_function.hpp
@@ -89,18 +89,67 @@
 		const std::string mName;
 		const ptr_t mPointer;
 		const size_t mModifiers;
-
-		//! \todo Implement for void return functions

 		template<class R>
-		void call__(void* aObject, void* aReturn, const void* aParams) const {
+		typename std::enable_if<std::is_same<R, void>::value, void>::type call__(void* aObject, void* aReturn, const void* aParams) const {
+			CLASS& obj = *reinterpret_cast<CLASS*>(aObject);
+			((obj).*(mPointer))();
+		}
+
+		template<class R, class P1>
+		typename std::enable_if<std::is_same<R, void>::value, void>::type call__(void* aObject, void* aReturn, const void* aParams) const {
+			CLASS& obj = *reinterpret_cast<CLASS*>(aObject);
+			const P1* const p1 = reinterpret_cast<const P1*>(aParams);
+			((obj).*(mPointer))(*p1);
+		}
+
+		template<class R, class P1, class P2>
+		typename std::enable_if<std::is_same<R, void>::value, void>::type call__(void* aObject, void* aReturn, const void* aParams) const {
+			CLASS& obj = *reinterpret_cast<CLASS*>(aObject);
+			const P1* const p1 = reinterpret_cast<const P1*>(aParams);
+			const P2* const p2 = reinterpret_cast<const P2*>(reinterpret_cast<const uint8_t*>(p1) + sizeof(P1));
+			((obj).*(mPointer))(*p1, *p2);
+		}
+
+		template<class R, class P1, class P2, class P3>
+		typename std::enable_if<std::is_same<R, void>::value, void>::type call__(void* aObject, void* aReturn, const void* aParams) const {
+			CLASS& obj = *reinterpret_cast<CLASS*>(aObject);
+			const P1* const p1 = reinterpret_cast<const P1*>(aParams);
+			const P2* const p2 = reinterpret_cast<const P2*>(reinterpret_cast<const uint8_t*>(p1) + sizeof(P1));
+			const P3* const p3 = reinterpret_cast<const P3*>(reinterpret_cast<const uint8_t*>(p2) + sizeof(P2));
+			((obj).*(mPointer))(*p1, *p2, *p3);
+		}
+
+		template<class R, class P1, class P2, class P3, class P4>
+		typename std::enable_if<std::is_same<R, void>::value, void>::type call__(void* aObject, void* aReturn, const void* aParams) const {
+			CLASS& obj = *reinterpret_cast<CLASS*>(aObject);
+			const P1* const p1 = reinterpret_cast<const P1*>(aParams);
+			const P2* const p2 = reinterpret_cast<const P2*>(reinterpret_cast<const uint8_t*>(p1) + sizeof(P1));
+			const P3* const p3 = reinterpret_cast<const P3*>(reinterpret_cast<const uint8_t*>(p2) + sizeof(P2));
+			const P4* const p3 = reinterpret_cast<const P4*>(reinterpret_cast<const uint8_t*>(p3) + sizeof(P3));
+			((obj).*(mPointer))(*p1, *p2, *p3, *p4);
+		}
+
+		template<class R, class P1, class P2, class P3, class P4, class P5>
+		typename std::enable_if<std::is_same<R, void>::value, void>::type call__(void* aObject, void* aReturn, const void* aParams) const {
+			CLASS& obj = *reinterpret_cast<CLASS*>(aObject);
+			const P1* const p1 = reinterpret_cast<const P1*>(aParams);
+			const P2* const p2 = reinterpret_cast<const P2*>(reinterpret_cast<const uint8_t*>(p1) + sizeof(P1));
+			const P3* const p3 = reinterpret_cast<const P3*>(reinterpret_cast<const uint8_t*>(p2) + sizeof(P2));
+			const P4* const p3 = reinterpret_cast<const P4*>(reinterpret_cast<const uint8_t*>(p3) + sizeof(P3));
+			const P5* const p3 = reinterpret_cast<const P5*>(reinterpret_cast<const uint8_t*>(p4) + sizeof(P4));
+			((obj).*(mPointer))(*p1, *p2, *p3, *p4, *p5);
+		}
+
+		template<class R>
+		typename std::enable_if<! std::is_same<R,void>::value, void>::type call__(void* aObject, void* aReturn, const void* aParams) const {
 			CLASS& obj = *reinterpret_cast<CLASS*>(aObject);
 			R& ret = *reinterpret_cast<RETURN*>(aReturn);
 			ret = ((obj).*(mPointer))();
 		}

 		template<class R, class P1>
-		void call__(void* aObject, void* aReturn, const void* aParams) const {
+		typename std::enable_if<!std::is_same<R, void>::value, void>::type call__(void* aObject, void* aReturn, const void* aParams) const {
 			CLASS& obj = *reinterpret_cast<CLASS*>(aObject);
 			R& ret = *reinterpret_cast<RETURN*>(aReturn);
 			const P1* const p1 = reinterpret_cast<const P1*>(aParams);
@@ -108,7 +157,7 @@
 		}

 		template<class R, class P1, class P2>
-		void call__(void* aObject, void* aReturn, const void* aParams) const {
+		typename std::enable_if<!std::is_same<R, void>::value, void>::type call__(void* aObject, void* aReturn, const void* aParams) const {
 			CLASS& obj = *reinterpret_cast<CLASS*>(aObject);
 			R& ret = *reinterpret_cast<RETURN*>(aReturn);
 			const P1* const p1 = reinterpret_cast<const P1*>(aParams);
@@ -117,7 +166,7 @@
 		}

 		template<class R, class P1, class P2, class P3>
-		void call__(void* aObject, void* aReturn, const void* aParams) const {
+		typename std::enable_if<!std::is_same<R, void>::value, void>::type call__(void* aObject, void* aReturn, const void* aParams) const {
 			CLASS& obj = *reinterpret_cast<CLASS*>(aObject);
 			R& ret = *reinterpret_cast<RETURN*>(aReturn);
 			const P1* const p1 = reinterpret_cast<const P1*>(aParams);
@@ -127,7 +176,7 @@
 		}

 		template<class R, class P1, class P2, class P3, class P4>
-		void call__(void* aObject, void* aReturn, const void* aParams) const {
+		typename std::enable_if<!std::is_same<R, void>::value, void>::type call__(void* aObject, void* aReturn, const void* aParams) const {
 			CLASS& obj = *reinterpret_cast<CLASS*>(aObject);
 			R& ret = *reinterpret_cast<RETURN*>(aReturn);
 			const P1* const p1 = reinterpret_cast<const P1*>(aParams);
@@ -138,7 +187,7 @@
 		}

 		template<class R, class P1, class P2, class P3, class P4, class P5>
-		void call__(void* aObject, void* aReturn, const void* aParams) const {
+		typename std::enable_if<!std::is_same<R, void>::value, void>::type call__(void* aObject, void* aReturn, const void* aParams) const {
 			CLASS& obj = *reinterpret_cast<CLASS*>(aObject);
 			R& ret = *reinterpret_cast<RETURN*>(aReturn);
 			const P1* const p1 = reinterpret_cast<const P1*>(aParams);


Fix race condition in LayoutAnimationKeyFrameManager::currentAnimation_

Summary:
Changelog: [internal]

`currentAnimation_` is accessed on multiple threads and has dedicated mutex, but it was not acquiring the mutex in `LayoutAnimationKeyFrameManager::shouldAnimateFrame`

Reviewed By: JoshuaGross

Differential Revision: D25121654

fbshipit-source-id: 38b1c82eaabab283beab18dc210ea21379edbe93

--- ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp
+++ ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp
@@ -323,9 +323,7 @@
 }

 bool LayoutAnimationKeyFrameManager::shouldAnimateFrame() const {
-  // There is potentially a race here between getting and setting
-  // `currentMutation_`. We don't want to lock around this because then we're
-  // creating contention between pullTransaction and the JS thread.
+  std::lock_guard<std::mutex> lock(currentAnimationMutex_);
   return currentAnimation_ || !inflightAnimations_.empty();
 }


delete from winnertable when deleting from winnertree

--- Spider.cpp
+++ Spider.cpp
@@ -3979,6 +3979,8 @@
 			oldwk = (key192_t *)m_winnerTable.getDataFromSlot ( winSlot );
 			// are we lower priority? (or equal)
 			if(KEYCMP((char *)&wk,(char *)oldwk,sizeof(key192_t))<=0) continue;
+			// from table too. no it's a dup uh48!
+			//m_winnerTable.deleteKey ( &uh48 );
 			// otherwise we supplant it. remove old key from tree.
 			m_winnerTree.deleteNode ( 0 , oldwk );
 			// supplant in table and tree... just add below...
@@ -4018,8 +4020,11 @@
 				continue;
 			// get lowest scoring node in tree
 			long tailNode = m_winnerTree.getLastNode();
+			// from table too
+			m_winnerTable.removeKey ( &m_tailUh48 );
 			// delete the tail so new spiderrequest can enter
 			m_winnerTree.deleteNode ( tailNode , true );
+
 		}

 		// somestimes the firstip in its key does not match the


suppress already mapped SamplingCount

suppress already mapped SamplingCount

--- Source/MediaInfo/Export/Export_PBCore2.cpp
+++ Source/MediaInfo/Export/Export_PBCore2.cpp
@@ -311,6 +311,7 @@
             MI.Get(StreamKind, StreamPos, Pos, Info_Name)!=__T("Resolution") &&
             MI.Get(StreamKind, StreamPos, Pos, Info_Name)!=__T("Sampled_Height") &&
             MI.Get(StreamKind, StreamPos, Pos, Info_Name)!=__T("Sampled_Width") &&
+            MI.Get(StreamKind, StreamPos, Pos, Info_Name)!=__T("SamplingCount") &&
             MI.Get(StreamKind, StreamPos, Pos, Info_Name)!=__T("SamplingRate") &&
             MI.Get(StreamKind, StreamPos, Pos, Info_Name)!=__T("ScanType") &&
             MI.Get(StreamKind, StreamPos, Pos, Info_Name)!=__T("ScanOrder") &&


Implemented copy-out benchmark and extended the command line interface accordingly.

--- samples/copy/copy.cpp
+++ samples/copy/copy.cpp
@@ -43,16 +43,17 @@
 int main(int argc, char* argv[])
 {
   try {
+    const bool copyin = 1 < argc ? ('i' == *argv[1]) : true;
 #if defined(_OPENMP)
-    const int nthreads = std::min(std::max(1 < argc ? std::atoi(argv[1]) : 1, 1), omp_get_max_threads());
+    const int nthreads = std::min(std::max(2 < argc ? std::atoi(argv[2]) : 1, 1), omp_get_max_threads());
 #else
-    const int nthreads = std::min(std::max(1 < argc ? std::atoi(argv[1]) : 1, 1), 1);
+    const int nthreads = std::min(std::max(2 < argc ? std::atoi(argv[2]) : 1, 1), 1);
     LIBXSTREAM_PRINT0(1, "OpenMP support needed for performance results!");
     libxstream_use_sink(&nthreads);
 #endif
-    const int nstreams = std::min(std::max(2 < argc ? std::atoi(argv[2]) : 1, 1), LIBXSTREAM_MAX_NSTREAMS);
-    const size_t maxsize = static_cast<size_t>(std::min(std::max(3 < argc ? std::atoi(argv[3]) : 2048, 1), 8192)) * (1 << 20), minsize = 8;
-    int nrepeat = std::min(std::max(4 < argc ? std::atoi(argv[4]) : 7, 3), 100);
+    const int nstreams = std::min(std::max(3 < argc ? std::atoi(argv[3]) : 1, 1), LIBXSTREAM_MAX_NSTREAMS);
+    const size_t maxsize = static_cast<size_t>(std::min(std::max(4 < argc ? std::atoi(argv[4]) : 2048, 1), 8192)) * (1 << 20), minsize = 8;
+    int nrepeat = std::min(std::max(5 < argc ? std::atoi(argv[5]) : 7, 3), 100);

     size_t ndevices = 0;
     if (LIBXSTREAM_ERROR_NONE != libxstream_get_ndevices(&ndevices) || 0 == ndevices) {
@@ -66,18 +67,32 @@
       }
     }

-    void *buffer = 0;
-    LIBXSTREAM_CHECK_CALL_THROW(libxstream_mem_allocate(-1, &buffer, maxsize, 0));
-
     struct {
       libxstream_stream* stream;
-      void* buffer;
+      void *mem_hst, *mem_dev;
     } copy[LIBXSTREAM_MAX_NSTREAMS];
     for (int i = 0; i < nstreams; ++i) {
       char name[128];
       LIBXSTREAM_SNPRINTF(name, sizeof(name), "Stream %i", i + 1);
       LIBXSTREAM_CHECK_CALL_THROW(libxstream_stream_create(&copy[i].stream, 0, 0, name));
-      LIBXSTREAM_CHECK_CALL_THROW(libxstream_mem_allocate(0/*device*/, &copy[i].buffer, maxsize, 0));
+      if (copyin) {
+        if (0 == i) {
+          LIBXSTREAM_CHECK_CALL_THROW(libxstream_mem_allocate(-1/*host*/, &copy[i].mem_hst, maxsize, 0));
+        }
+        else {
+          copy[i].mem_hst = copy[0].mem_hst;
+        }
+        LIBXSTREAM_CHECK_CALL_THROW(libxstream_mem_allocate(0/*device*/, &copy[i].mem_dev, maxsize, 0));
+      }
+      else { // copy-out
+        LIBXSTREAM_CHECK_CALL_THROW(libxstream_mem_allocate(-1/*host*/, &copy[i].mem_hst, maxsize, 0));
+        if (0 == i) {
+          LIBXSTREAM_CHECK_CALL_THROW(libxstream_mem_allocate(0/*device*/, &copy[i].mem_dev, maxsize, 0));
+        }
+        else {
+          copy[i].mem_dev = copy[0].mem_dev;
+        }
+      }
     }

     int n = 1;
@@ -93,7 +108,12 @@
 #endif
       for (int i = 0; i < nrepeat; ++i) {
         const int j = i % nstreams;
-        LIBXSTREAM_CHECK_CALL_ASSERT(libxstream_memcpy_h2d(buffer, copy[j].buffer, size, copy[j].stream));
+        if (copyin) {
+          LIBXSTREAM_CHECK_CALL_ASSERT(libxstream_memcpy_h2d(copy[j].mem_hst, copy[j].mem_dev, size, copy[j].stream));
+        }
+        else {
+          LIBXSTREAM_CHECK_CALL_ASSERT(libxstream_memcpy_d2h(copy[j].mem_dev, copy[j].mem_hst, size, copy[j].stream));
+        }

 #if defined(COPY_ISYNC)
         const int k = (j + 1) % nstreams;
@@ -106,7 +126,6 @@

 #if defined(_OPENMP)
       const double duration = omp_get_wtime() - start;
-      LIBXSTREAM_FLOCK(stdout);
       fprintf(stdout, "%lu Byte x %i: ", static_cast<unsigned long>(size), nrepeat);
       if (0 < duration) {
         const double bandwidth = (1.0 * size * nrepeat) / ((1ul << 20) * duration), factor = 1 < n ? 0.5 : 1.0;
@@ -117,7 +136,7 @@
       else {
         fprintf(stdout, "-\n");
       }
-      LIBXSTREAM_FUNLOCK(stdout);
+      fflush(stdout);
 #endif
     }


[FIX]

[FIX]

--- sksat/optparse.hpp
+++ sksat/optparse.hpp
@@ -65,7 +65,10 @@
 				if(argv[0][1] == '-'){ // long option
 					opt_num = search_long_opt(argv[0]+2);
 				}else{ // short option
-					opt_num = search_short_opt(argv[0][1]);
+					if(argv[0][1] != '\0'){
+						if(argv[0][2] == '\0')
+							opt_num = search_short_opt(argv[0][1]);
+					}
 				}
 			}
 			if(opt_num > -1){ // option found


Style fix

Style fix

--- src/CCPACSFarField.cpp
+++ src/CCPACSFarField.cpp
@@ -122,7 +122,7 @@
     shape.Nullify();
     gp_Pnt center(0,0,0);

-    switch(fieldType){
+    switch (fieldType) {
     case NONE:
         return shape;
     case FULL_SPHERE:


fixed some bugs in the BoundingBox implementation

--- source/Data/BoundingBox.cpp
+++ source/Data/BoundingBox.cpp
@@ -56,7 +56,7 @@
     Float3 minimum(coordinates[0].x(), coordinates[0].y(), coordinates[0].z());
     Float3 maximum(coordinates[0].x(), coordinates[0].y(), coordinates[0].z());
     for(uint i = 1; i < coordinates.size(); i++) {
-        Float3 coordinate = coordinates[0];
+        Float3 coordinate = coordinates[i];
         for(uint j = 0; j < 4; j++) {
             if(coordinate[j] < minimum[j]) {
                 minimum[j] = coordinate[j];
@@ -69,7 +69,11 @@

     // Make new bounding box
     Float3 size(maximum.x()-minimum.x(), maximum.y()-minimum.y(), maximum.z()-minimum.z());
-    BoundingBox(minimum, size);
+    mIsInitialized = true;
+    std::cout << minimum[0] << " " << minimum[1] << std::endl;
+    std::cout << maximum[0] << " " << maximum[1] << std::endl;
+    std::cout << size[0] << " " << size[1] << std::endl;
+    createCorners(minimum, size);
 }

 BoundingBox BoundingBox::getTransformedBoundingBox(


Use -### instead of -ccc-echo.

Use -### instead of -ccc-echo.

This is still a fairly odd test. Clang wants to run gcc for assembling. At
least with -### it only prints that instead of actually trying to run it with
-ccc-echo.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@186945 91177308-0d34-0410-b5e6-96231b3b80d8

--- test/Driver/x86_64-nacl-defines.cpp
+++ test/Driver/x86_64-nacl-defines.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang -target x86_64-unknown-nacl -ccc-echo %s -emit-llvm-only -c -o %t.o 2>&1 | FileCheck %s -check-prefix=ECHO
+// RUN: %clang -target x86_64-unknown-nacl -### %s -emit-llvm-only -c -o %t.o 2>&1 | FileCheck %s -check-prefix=ECHO
 // RUN: %clang -target x86_64-unknown-nacl %s -emit-llvm -S -c -o - | FileCheck %s
 // RUN: %clang -target x86_64-unknown-nacl %s -emit-llvm -S -c -pthread -o - | FileCheck %s -check-prefix=THREADS


exempt bulk jobs from maxtoprocess

exempt bulk jobs from maxtoprocess

--- Spider.cpp
+++ Spider.cpp
@@ -5454,7 +5454,7 @@

 		// hit pages to process max?
 		if ( cr->m_maxToProcess > 0 &&
-		     cr->m_isCustomCrawl &&
+		     cr->m_isCustomCrawl == 1 && // bulk jobs exempt!
 		     cr->m_globalCrawlInfo.m_pageProcessSuccessesThisRound >=
 		     cr->m_maxToProcess ) {
 			cr->m_localCrawlInfo.m_hasUrlsReadyToSpider = false;


Host: linux: Use llvm::sys::getHostTriple for the default host ArchSpec.

Previously we were using a set of preprocessor defines and returning an ArchSpec
without any OS/Vendor information.  This fixes an issue with plugin resolution
on Linux where a valid OS component is needed.

git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@126404 91177308-0d34-0410-b5e6-96231b3b80d8

--- source/Host/common/Host.cpp
+++ source/Host/common/Host.cpp
@@ -17,6 +17,8 @@
 #include "lldb/Host/Config.h"
 #include "lldb/Host/Endian.h"
 #include "lldb/Host/Mutex.h"
+
+#include "llvm/Support/Host.h"

 #include <dlfcn.h>
 #include <errno.h>
@@ -288,34 +290,31 @@
     }

 #else // #if defined (__APPLE__)
-
+
     if (g_supports_32 == false && g_supports_64 == false)
     {
-#if defined (__x86_64__)
-
-        g_host_arch_64.SetTriple ("x86_64");
-
-#elif defined (__i386__)
-
-        g_host_arch_32.SetTriple ("i386");
-
-#elif defined (__arm__)
-
-        g_host_arch_32.SetTriple ("arm");
-
-#elif defined (__ppc64__)
-
-        g_host_arch_64.SetTriple ("ppc64");
-
-#elif defined (__powerpc__) || defined (__ppc__)
-
-        g_host_arch_32.SetTriple ("ppc");
-
-#else
-
-#error undefined architecture, define your architecture here
-
-#endif
+        llvm::Triple triple(llvm::sys::getHostTriple());
+
+        g_host_arch_32.Clear();
+        g_host_arch_64.Clear();
+
+        switch (triple.getArch())
+        {
+        default:
+            g_host_arch_32.SetTriple(triple);
+            g_supports_32 = true;
+            break;
+
+        case llvm::Triple::alpha:
+        case llvm::Triple::x86_64:
+        case llvm::Triple::sparcv9:
+        case llvm::Triple::ppc64:
+        case llvm::Triple::systemz:
+        case llvm::Triple::cellspu:
+            g_host_arch_64.SetTriple(triple);
+            g_supports_64 = true;
+            break;
+        }

         g_supports_32 = g_host_arch_32.IsValid();
         g_supports_64 = g_host_arch_64.IsValid();


Development of image drawing in progress

--- test/Graphics/test_ImageDrawing.cpp
+++ test/Graphics/test_ImageDrawing.cpp
@@ -1,4 +1,4 @@
-// ========================================================================== //
+// ========================================================================== //
 // This file is part of DO++, a basic set of libraries in C++ for computer
 // vision.
 //
@@ -10,73 +10,10 @@
 // ========================================================================== //

 #include <DO/Graphics.hpp>
+#include "ImageDrawing.hpp"

 using namespace DO;

-struct Bresenham
-{
-  template <typename Color>
-  static inline void putColor(Image<Color>& image, int x, int y,
-                              const Color& color)
-  {
-    if (x < 0 || x >= image.width() || y < 0 || y >= image.height())
-      return;
-    image(x,y) = color;
-  }
-
-  template <typename Color>
-  static void drawLine(Image<Color>& image, int x0, int y0, int x1, int y1,
-                       const Color& color)
-  {
-    const int dx = abs(x1-x0);
-    const int dy = abs(y1-y0);
-    const int sx = x0 < x1 ? 1 : -1;
-    const int sy = y0 < y1 ? 1 : -1;
-    int err = dx-dy;
-
-    while (true)
-    {
-      // Put color to image at current point $(x_0, y_0)$
-      putColor(image, x0, y0, color);
-
-      // Stop drawing when we reach the end point $(x_1, y_1)$
-      if (x0 == x1 && y0 == y1)
-        return;
-      const int e2 = 2*err;
-      if (e2 > -dy)
-      {
-        err -= dy;
-        x0 += sx;
-      }
-
-      // Stop drawing when we reach the end point $(x_1, y_1)$
-      if (x0 == x1 && y0 == y1)
-      {
-        putColor(image, x0, y0, color);
-        return;
-      }
-      if (e2 < dx)
-      {
-        err += dx;
-        y0 += sy;
-      }
-    }
-  }
-
-  template <typename Color>
-  static void drawCircle(Image<Color>& image, int x1, int y1, int r,
-                         const Color& color)
-  {
-
-  }
-
-  template <typename Color>
-  static void drawEllipse(Image<Color>& image, int x1, int y1, int r1, int r2,
-                          const Color& color)
-  {
-
-  }
-};

 int main()
 {
@@ -87,7 +24,6 @@
   // Check line drawing when "start point < end point"
   for (float i = 0; i < max_slope_value; i += 0.2f)
     Bresenham::drawLine(img, 10, 10, 290, 290*i+10, Black8);
-
   // Check line drawing when "start point > end point"
   for (float i = 0.1f; i < max_slope_value; i += 0.2f)
     Bresenham::drawLine(img, 290, 290*i+10, 10, 10, Red8);
@@ -95,25 +31,4 @@
   viewImage(img);

   return 0;
-}
-
-struct Wu
-{
-  template <typename T>
-  void drawLine(Image<T>& image, int x1, int y1, int x2, int y2, const T& Color)
-  {
-
-  }
-
-  template <typename T>
-  void drawCircle(Image<T>& image, int x1, int y1, int r, const T& Color)
-  {
-
-  }
-
-  template <typename T>
-  void drawEllipse(Image<T>& image, int x1, int y1, int r1, int r2, const T& Color)
-  {
-
-  }
-};
+}


Fix logic for getting the script file name in web Urho3DPlayer in case arguments were already specified and the command line file is not used.

--- Source/Tools/Urho3DPlayer/Urho3DPlayer.cpp
+++ Source/Tools/Urho3DPlayer/Urho3DPlayer.cpp
@@ -47,14 +47,13 @@

 void Urho3DPlayer::Setup()
 {
-    FileSystem* filesystem = GetSubsystem<FileSystem>();
-
-    // Web platform depends on the resource system to read any data files. Skip parsing the command line now
+    // Web platform depends on the resource system to read any data files. Skip parsing the command line file now
     // and try later when the resource system is live
 #ifndef EMSCRIPTEN
     // Read command line from a file if no arguments given. This is primarily intended for mobile platforms.
     // Note that the command file name uses a hardcoded path that does not utilize the resource system
     // properly (including resource path prefix), as the resource system is not yet initialized at this point
+    FileSystem* filesystem = GetSubsystem<FileSystem>();
     const String commandFileName = filesystem->GetProgramDir() + "Data/CommandLine.txt";
     if (GetArguments().Empty() && filesystem->FileExists(commandFileName))
     {
@@ -144,9 +143,10 @@
             String commandLine = commandFile->ReadLine();
             commandFile->Close();
             ParseArguments(commandLine, false);
-            GetScriptFileName();
         }
     }
+
+    GetScriptFileName();

     if (scriptFileName_.Empty())
     {


Don't mix manually configured and autodetected ips

dbus-fronius remembers the addresses of detected PV inverters and
stores it in localsettings. It however used to also duplicate manually
configured addresses into this storage as if they were auto-detected.
Of course this means that any address, once manually configured, is
always remembered and always tried in future, but if users are allowed
to delete manually configured addresses on the GUI it makes sense that
we also stop scanning for them here.

--- software/src/inverter_gateway.cpp
+++ software/src/inverter_gateway.cpp
@@ -115,12 +115,17 @@

 void InverterGateway::onInverterFound(const DeviceInfo &deviceInfo)
 {
-	QList<QHostAddress> addresses = mSettings->knownIpAddresses();
 	QHostAddress addr(deviceInfo.hostName);
 	mDevicesFound.insert(addr);
-	if (!addresses.contains(addr)) {
-		addresses.append(addr);
-		mSettings->setKnownIpAddresses(addresses);
+
+	// If the found address is already in the list of manually configured
+	// addresses, do not append it to the list of discovered addresses.
+	if (!mSettings->ipAddresses().contains(addr)) {
+		QList<QHostAddress> addresses = mSettings->knownIpAddresses();
+		if (!addresses.contains(addr)) {
+			addresses.append(addr);
+			mSettings->setKnownIpAddresses(addresses);
+		}
 	}
 	emit inverterFound(deviceInfo);
 }


shifted some functions

shifted some functions

--- scalyc/CppVisitor.cpp
+++ scalyc/CppVisitor.cpp
@@ -373,24 +373,6 @@
 void CppVisitor::closeUseDeclaration(UseDeclaration* useDeclaration) {
 }

-bool CppVisitor::openPathIdentifier(PathIdentifier* pathIdentifier) {
-    return true;
-}
-
-void CppVisitor::closePathIdentifier(PathIdentifier* pathIdentifier) {
-}
-
-void CppVisitor::visitPathItem(PathItem* pathItem) {
-}
-
-bool CppVisitor::openInitializer(Initializer* initializer) {
-    sourceFile->append(" = ");
-    return true;
-}
-
-void CppVisitor::closeInitializer(Initializer* initializer) {
-}
-
 bool CppVisitor::openConstantDeclaration(ConstantDeclaration* constantDeclaration) {
     constDeclaration = true;
     if (constantDeclaration->parent->parent->parent->_isClassDeclaration()) {
@@ -422,33 +404,6 @@

 void CppVisitor::closeMutableDeclaration(MutableDeclaration* mutableDeclaration) {
     suppressSource = false;
-}
-
-bool CppVisitor::openBindingInitializer(BindingInitializer* bindingInitializer) {
-    firstBindingInitializer = true;
-    return true;
-}
-
-void CppVisitor::closeBindingInitializer(BindingInitializer* bindingInitializer) {
-}
-
-bool CppVisitor::openPatternInitializer(PatternInitializer* patternInitializer) {
-    if (!firstBindingInitializer)
-        headerFile->append(", ");
-    else
-        firstBindingInitializer = false;
-
-    return true;
-}
-
-void CppVisitor::closePatternInitializer(PatternInitializer* patternInitializer) {
-}
-
-bool CppVisitor::openAdditionalInitializer(AdditionalInitializer* additionalInitializer) {
-    return true;
-}
-
-void CppVisitor::closeAdditionalInitializer(AdditionalInitializer* additionalInitializer) {
 }

 bool CppVisitor::openFunctionDeclaration(FunctionDeclaration* functionDeclaration) {
@@ -479,6 +434,51 @@
     staticFunction = false;
     suppressHeader = false;
     suppressSource = false;
+}
+
+bool CppVisitor::openPathIdentifier(PathIdentifier* pathIdentifier) {
+    return true;
+}
+
+void CppVisitor::closePathIdentifier(PathIdentifier* pathIdentifier) {
+}
+
+void CppVisitor::visitPathItem(PathItem* pathItem) {
+}
+
+bool CppVisitor::openInitializer(Initializer* initializer) {
+    sourceFile->append(" = ");
+    return true;
+}
+
+void CppVisitor::closeInitializer(Initializer* initializer) {
+}
+
+bool CppVisitor::openBindingInitializer(BindingInitializer* bindingInitializer) {
+    firstBindingInitializer = true;
+    return true;
+}
+
+void CppVisitor::closeBindingInitializer(BindingInitializer* bindingInitializer) {
+}
+
+bool CppVisitor::openPatternInitializer(PatternInitializer* patternInitializer) {
+    if (!firstBindingInitializer)
+        headerFile->append(", ");
+    else
+        firstBindingInitializer = false;
+
+    return true;
+}
+
+void CppVisitor::closePatternInitializer(PatternInitializer* patternInitializer) {
+}
+
+bool CppVisitor::openAdditionalInitializer(AdditionalInitializer* additionalInitializer) {
+    return true;
+}
+
+void CppVisitor::closeAdditionalInitializer(AdditionalInitializer* additionalInitializer) {
 }

 bool CppVisitor::openInitializerDeclaration(InitializerDeclaration* initializerDeclaration) {


hopcount precedence fix

hopcount precedence fix

--- Spider.cpp
+++ Spider.cpp
@@ -4047,9 +4047,8 @@
 			// get the spider time of lowest scoring req in tree
 			long long tm2 = m_tailTimeMS;
 			// if they are both overdue, make them the same
-			// no, because we should spider one we got first first
-			//if ( tm1 < nowGlobalMS ) tm1 = 1;
-			//if ( tm2 < nowGlobalMS ) tm2 = 1;
+			if ( tm1 < nowGlobalMS ) tm1 = 1;
+			if ( tm2 < nowGlobalMS ) tm2 = 1;
 			// skip spider request if its time is past winner's
 			if ( tm1 > tm2 )
 				continue;


Do not iterate over map when removing its values

(cherry picked from commit 29b288238108ca34b25a58a9376f418d61e55420)

--- scene/2d/tile_map.cpp
+++ scene/2d/tile_map.cpp
@@ -1049,8 +1049,9 @@
 void TileMap::fix_invalid_tiles() {

 	ERR_FAIL_COND_MSG(tile_set.is_null(), "Cannot fix invalid tiles if Tileset is not open.");
-	for (Map<PosKey, Cell>::Element *E = tile_map.front(); E; E = E->next()) {
-
+
+	Map<PosKey, Cell> temp_tile_map = tile_map;
+	for (Map<PosKey, Cell>::Element *E = temp_tile_map.front(); E; E = E->next()) {
 		if (!tile_set->has_tile(get_cell(E->key().x, E->key().y))) {
 			set_cell(E->key().x, E->key().y, INVALID_CELL);
 		}


Decimal bug fix

Decimal bug fix

--- CSClasses/CSClasses/CSClasses/KMC/Decimal.cpp
+++ CSClasses/CSClasses/CSClasses/KMC/Decimal.cpp
@@ -119,6 +119,7 @@
 {
 	mInteger = d.mInteger;
 	mReal = d.mReal;
+	isN = d.isN;

 	Clean();

@@ -129,6 +130,7 @@
 {
 	mInteger = d.mInteger;
 	mReal = d.mReal;
+	isN = d.isN;

 	Clean();

@@ -490,20 +492,20 @@
 				if (i == 0) break; // NOTE: size_t = unsigned long long̱   ó ؼ
 			}
 		}
-	}
+	}
 	// a
 	else if (!a.isN && b.isN)
 	{
 		Decimal d = b;
 		d.isN = false;
-		c = a + d;
+		c = d + b;
 	}
 	// b
 	else if (a.isN && !b.isN)
 	{
-		Decimal d = a;
+		Decimal d = b;
 		d.isN = true;
-		c = b + d;
+		c = a + d;
 	}

 	c.Clean();


Follow instructions on death tests *correctly* this time.

The instructions in the "Advanced Guide" say you should use as test
*case* whose name ends in "DeathTest", but I misread the instructions.

--- SurgSim/Framework/UnitTests/AssertTest.cpp
+++ SurgSim/Framework/UnitTests/AssertTest.cpp
@@ -62,6 +62,9 @@
 	std::unique_ptr<SurgSim::Framework::Logger> testLogger;
 	SurgSim::Framework::AssertMessage::DeathCallback savedCallback;
 };
+
+typedef AssertTest AssertDeathTest;
+

 TEST_F(AssertTest, DefaultAssertLogger)
 {
@@ -171,14 +174,7 @@
 	EXPECT_EQ(2, numIgnoredAssertions);
 }

-TEST_F(AssertTest, DebuggerBehaviorSuccess)
-{
-	logOutput->reset();
-	SurgSim::Framework::AssertMessage::setFailureBehaviorToDebugger();
-	EXPECT_NO_THROW({SURGSIM_ASSERT(3 == 3) << "extra information would go here";});
-}
-
-TEST_F(AssertTest, DebuggerBehaviorAssertFailedDeathTest)
+TEST_F(AssertDeathTest, DebuggerBehaviorAssertFailed)
 {
 	logOutput->reset();
 	SurgSim::Framework::AssertMessage::setFailureBehaviorToDebugger();
@@ -186,7 +182,14 @@
 	ASSERT_DEATH_IF_SUPPORTED({SURGSIM_ASSERT(1 == 2) << "extra information would go here";}, "^$");
 }

-TEST_F(AssertTest, DebuggerBehaviorFailureDeathTest)
+TEST_F(AssertDeathTest, DebuggerBehaviorAssertSucceded)
+{
+	logOutput->reset();
+	SurgSim::Framework::AssertMessage::setFailureBehaviorToDebugger();
+	EXPECT_NO_THROW({SURGSIM_ASSERT(3 == 3) << "extra information would go here";});
+}
+
+TEST_F(AssertDeathTest, DebuggerBehaviorFailure)
 {
 	logOutput->reset();
 	SurgSim::Framework::AssertMessage::setFailureBehaviorToDebugger();


Swap condition to prevent spam in editor.

--- scene/gui/control.cpp
+++ scene/gui/control.cpp
@@ -769,7 +769,7 @@
 void Control::set_drag_preview(Control *p_control) {

 	ERR_FAIL_COND(!is_inside_tree());
-	ERR_FAIL_COND(get_viewport()->gui_is_dragging());
+	ERR_FAIL_COND(!get_viewport()->gui_is_dragging());
 	get_viewport()->_gui_set_drag_preview(this, p_control);
 }


Clicking backgrd. dimming of editor popup stops input event propagation

A click on the dimmed background of a popup in the editor should stop the input event from propagating to the background.

This solution reuses the system introduced in commit efc3ffb8, taking advantage of the hide() notifications from the modal where we will set the flag "pass_on_modal_close_click(false)" to stop event handling at the viewport input event handling.
The viewport first hides the modal and after marks the input as handled if the flag mentioned above is set.

Fixes #36341

--- scene/gui/dialogs.cpp
+++ scene/gui/dialogs.cpp
@@ -247,8 +247,10 @@
 		} break;

 		case NOTIFICATION_POPUP_HIDE: {
-			if (get_tree() && Engine::get_singleton()->is_editor_hint() && EditorNode::get_singleton() && !was_editor_dimmed)
+			if (get_tree() && Engine::get_singleton()->is_editor_hint() && EditorNode::get_singleton() && !was_editor_dimmed) {
 				EditorNode::get_singleton()->dim_editor(false);
+				set_pass_on_modal_close_click(false);
+			}
 		} break;
 #endif
 	}


Linear regression: - Use abstraction for triangular view of matrix

--- src/modules/regress/linear.cpp
+++ src/modules/regress/linear.cpp
@@ -167,10 +167,9 @@
     state.y_sum += y;
     state.y_square_sum += y * y;
     state.X_transp_Y.noalias() += x * y;
-    // FIXME: The following line is Eigen-specific
     // X^T X is symmetric, so it is sufficient to only fill a triangular part
     // of the matrix
-    state.X_transp_X.triangularView<Eigen::Lower>() += x * trans(x);
+    triangularView<Lower>(state.X_transp_X) += x * trans(x);

     return state;
 }


`void charmods_callback` prints also `mods` (for testing purposes).

Added a comment.

All tests pass.

	modified:   cpp/ylikuutio/console/console_keypress_callbacks.cpp

--- cpp/ylikuutio/console/console_keypress_callbacks.cpp
+++ cpp/ylikuutio/console/console_keypress_callbacks.cpp
@@ -21,7 +21,12 @@
     // So: `unsigned int codepoint`, `int mods`.
     void charmods_callback(GLFWwindow* window, unsigned int codepoint, int mods)
     {
-        std::cout << "Hello from character_callback! codepoint: " << codepoint << "\n";
+        // `int mods` values:
+        // No modificators:       0x00
+        // Shift (left or right): 0x01
+        // Alt (not AltGr):       0x04
+        // Shift + Alt:           0x05
+        std::cout << "Hello from character_callback! codepoint: 0x" << std::hex << codepoint << ", mods: 0x" << mods << "\n";

         global_console_pointer->add_character(codepoint);
     }


vision: ACFDepthChannel - filter valid points in all methods

--- csapex_vision/src/features/acf/acf_depth_channel.cpp
+++ csapex_vision/src/features/acf/acf_depth_channel.cpp
@@ -98,7 +98,7 @@
 {
     cv::Mat aggregated_depth_map;
     cv::resize(depth_map, aggregated_depth_map, cv::Size(depth_map.cols / block_size_, depth_map.rows / block_size_));
-    const cv::Mat valid_pixel_mask = aggregated_depth_map != 0;
+    const cv::Mat valid_pixel_mask = aggregated_depth_map > 0;

     double min_value;
     double max_value;
@@ -109,7 +109,7 @@
     {
         case Method::HISTOGRAM:
         {
-            const const float BIN_SIZE = 0.25f;
+            const static float BIN_SIZE = 0.25f;
             static const int channels[] = { 0 };
             const int bins[] = { int((max_value - min_value) / BIN_SIZE) };
             const float value_range[] = { float(min_value), float(max_value) + std::numeric_limits<float>::epsilon() };
@@ -127,14 +127,15 @@
         case Method::MEDIAN:
         {
             cv::Mat values = aggregated_depth_map.reshape(0, 1).clone();
-
-            const auto middle = values.cols / 2;
+            const int invalid_pixel_count = values.cols - cv::countNonZero(valid_pixel_mask);
+
+            const auto middle = invalid_pixel_count + (values.cols - invalid_pixel_count) / 2;
             std::nth_element(values.begin<float>(), values.begin<float>() + middle, values.end<float>());
             center = values.at<float>(0, middle);
             break;
         }
         case Method::MEAN:
-            center = cv::mean(aggregated_depth_map)[0];
+            center = cv::mean(aggregated_depth_map, valid_pixel_mask)[0];
             break;
     }


added: test for multiple calls to CharmmFF::setup() -- this doesn't work on several platforms (Intel C++)

--- source/TEST/CharmmFF_test.C
+++ source/TEST/CharmmFF_test.C
@@ -1,7 +1,7 @@
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
-// $Id: CharmmFF_test.C,v 1.6 2002/12/19 21:01:35 oliver Exp $
+// $Id: CharmmFF_test.C,v 1.7 2003/04/18 12:02:03 oliver Exp $
 #include <BALL/CONCEPT/classTest.h>

 ///////////////////////////
@@ -11,7 +11,7 @@
 #include <BALL/STRUCTURE/fragmentDB.h>
 ///////////////////////////

-START_TEST(CharmmFF, "$Id: CharmmFF_test.C,v 1.6 2002/12/19 21:01:35 oliver Exp $")
+START_TEST(CharmmFF, "$Id: CharmmFF_test.C,v 1.7 2003/04/18 12:02:03 oliver Exp $")

 /////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////
@@ -28,9 +28,9 @@
 	delete charmm;
 RESULT

-CHECK(CharmmFF(const CharmmFF& force_field, bool clone_deep = true))
+CHECK(CharmmFF(const CharmmFF& force_field))
 	CharmmFF a1;
-	// CharmmFF a2(a1);
+	CharmmFF a2(a1);
 RESULT

 CHECK(specificSetup())
@@ -127,6 +127,47 @@
 		}
 	RESULT

+}
+
+{
+	// read the PDB file containing a single GLY
+	PDBFile f("data/CharmmFF_test_1.pdb");
+	System s;
+	f >> s;
+	f.close();
+
+	// normalize the names and build the bonds
+	s.apply(frag_db.normalize_names);
+	s.apply(frag_db.build_bonds);
+
+	// setup the force field
+	Options options;
+	options[CharmmFF::Option::ASSIGN_CHARGES] = "true";
+	options[CharmmFF::Option::ASSIGN_TYPENAMES] = "true";
+	options[CharmmFF::Option::ASSIGN_TYPES] = "true";
+	options[CharmmFF::Option::FILENAME] = "CHARMM/EEF1/param19_eef1.ini";
+	CharmmFF eef1;
+	CHECK(multiple calls to setup)
+		eef1.setup(s, options);
+		eef1.setup(s, options);
+		eef1.setup(s, options);
+	RESULT
+
+	CHECK(energy test 2 (GLY) [EEF1])
+		// check whether we got the right number of atoms
+		TEST_EQUAL(s.countAtoms(), 8)
+
+		eef1.updateEnergy();
+		PRECISION(5e-3)
+		TEST_REAL_EQUAL(eef1.getEnergy(), 157.4572251)
+		TEST_REAL_EQUAL(eef1.getStretchEnergy(), 30.83411352)
+		TEST_REAL_EQUAL(eef1.getBendEnergy(), 307.4544619)
+		TEST_REAL_EQUAL(eef1.getProperTorsionEnergy(), 2.11036776)
+		TEST_REAL_EQUAL(eef1.getImproperTorsionEnergy(), 5.48237888)
+		TEST_REAL_EQUAL(eef1.getVdWEnergy(), 26.64563664)
+		TEST_REAL_EQUAL(eef1.getESEnergy(), -53.3215644)
+		TEST_REAL_EQUAL(eef1.getSolvationEnergy(), -161.7481263)
+	RESULT
 }

 CHECK(force test 2 (GLY, bend only) [EEF1])


fixed: missing type declaration in information output (CHECKING...), incorrect PRECISION() calls

--- source/TEST/Function_test.C
+++ source/TEST/Function_test.C
@@ -1,4 +1,4 @@
-// $Id: Function_test.C,v 1.4 2001/03/09 14:35:01 anker Exp $
+// $Id: Function_test.C,v 1.5 2001/03/09 16:05:46 oliver Exp $
 #include <BALL/CONCEPT/classTest.h>

 ///////////////////////////
@@ -8,7 +8,7 @@

 ///////////////////////////

-START_TEST(class_name, "$Id: Function_test.C,v 1.4 2001/03/09 14:35:01 anker Exp $")
+START_TEST(class_name, "$Id: Function_test.C,v 1.5 2001/03/09 16:05:46 oliver Exp $")

 /////////////////////////////////////////////////////////////
 /////////////////////////////////////////////////////////////
@@ -540,6 +540,7 @@
 	MutableConstant<> c3(4711.0);
 	SquareFunction<MutableConstant<> > sq1;
 	sq1.setFunction(c3);
+	PRECISION(1.0)
 	TEST_REAL_EQUAL(sq1.operator() (13), 22193521)
 RESULT

@@ -608,6 +609,7 @@
 	MutableConstant<> c3(11.5);
 	CubicFunction<MutableConstant<> > cu1;
 	cu1.setFunction(c3);
+	PRECISION(0.001)
 	TEST_REAL_EQUAL(cu1.operator() (13), 1520.875)
 RESULT

@@ -639,7 +641,7 @@
 	delete mpiprocal_pointer;
 RESULT

-CHECK(MutablePower::MutablePower(const mp))
+CHECK(MutablePower::MutablePower(const MutablePower& mp))
 	MutableConstant<> c1(3.0);
 	MutablePower<MutableConstant<> > mp1;
 	mp1.setFunction(c1);


fixe typo in menus

fixe typo in menus

--- source/globals.cpp
+++ source/globals.cpp
@@ -290,7 +290,7 @@
       "2. Average\v"
       "3. Normal\v"
       "4. Professional\v"
-      "4. Godlike\v"
+      "5. Godlike\v\v"
       "0. Exit"
    },


BSE: integrity: always use SIGQUIT instead of abort() to avoid apport

Signed-off-by: Tim Janik <6ec6ff229c4e1c5bbd5933ee92e6c5832ff023bb@gnu.org>

--- bse/tests/integrity.cc
+++ bse/tests/integrity.cc
@@ -45,6 +45,7 @@
 main (int argc, char *argv[])
 {
   bse_init_test (&argc, argv);
+  Bse::set_debug_flags (Bse::DebugFlags::SIGQUIT_ON_ABORT);

   if (argc >= 2 && String ("--backtrace") == argv[1])
     {
@@ -58,19 +59,16 @@
     }
   else if (argc >= 2 && String ("--assert_return0") == argv[1])
     {
-      Bse::set_debug_flags (Bse::DebugFlags::SIGQUIT_ON_ABORT);
       assert_return (0, 0);
       return 0;
     }
   else if (argc >= 2 && String ("--assert_return_unreached") == argv[1])
     {
-      Bse::set_debug_flags (Bse::DebugFlags::SIGQUIT_ON_ABORT);
       assert_return_unreached (0);
       return 0;
     }
   else if (argc >= 2 && String ("--fatal_error") == argv[1])
     {
-      Bse::set_debug_flags (Bse::DebugFlags::SIGQUIT_ON_ABORT);
       Bse::fatal_error ("got argument --fatal_error");
       return 0;
     }


tests: sstables: Test sstable write fails on missing partition_end mid-stream

Reviewed-by: Benny Halevy <23c997c90eb8537635e9392d48e7af1bf1b2ca22@scylladb.com>
Message-Id: <5b186880a7f790bc28c99b14de0533a2f6dff999@scylladb.com>

--- test/boost/sstable_datafile_test.cc
+++ test/boost/sstable_datafile_test.cc
@@ -6814,6 +6814,45 @@

       test_interposer_on_flush(true);
       test_interposer_on_flush(false);
+  });
+}
+
+SEASTAR_TEST_CASE(test_missing_partition_end_fragment) {
+    return test_setup::do_with_tmp_directory([] (test_env& env, sstring tmpdir_path) {
+        simple_schema ss;
+        auto s = ss.schema();
+
+        auto pkeys = ss.make_pkeys(2);
+
+        set_abort_on_internal_error(false);
+        auto enable_aborts = defer([] { set_abort_on_internal_error(true); }); // FIXME: restore to previous value
+
+        for (const auto version : all_sstable_versions) {
+            testlog.info("version={}", sstables::to_string(version));
+
+            std::deque<mutation_fragment> frags;
+            frags.push_back(mutation_fragment(*s, tests::make_permit(), partition_start(pkeys[0], tombstone())));
+            frags.push_back(mutation_fragment(*s, tests::make_permit(), clustering_row(ss.make_ckey(0))));
+            // partition_end is missing
+            frags.push_back(mutation_fragment(*s, tests::make_permit(), partition_start(pkeys[1], tombstone())));
+            frags.push_back(mutation_fragment(*s, tests::make_permit(), clustering_row(ss.make_ckey(0))));
+            frags.push_back(mutation_fragment(*s, tests::make_permit(), partition_end()));
+
+            auto mr = make_flat_mutation_reader_from_fragments(s, tests::make_permit(), std::move(frags));
+
+            auto sst = env.make_sstable(s, tmpdir_path, 0, version, big);
+            sstable_writer_config cfg = env.manager().configure_writer();
+
+            try {
+                auto wr = sst->get_writer(*s, 1, cfg, encoding_stats{}, default_priority_class());
+                mr.consume_in_thread(std::move(wr), db::no_timeout);
+                BOOST_FAIL("write_components() should have failed");
+            } catch (const std::runtime_error&) {
+                testlog.info("failed as expected: {}", std::current_exception());
+            }
+        }
+
+        return make_ready_future<>();
     });
 }


bugfix

bugfix

--- NaoTHSoccer/Source/Cognition/Modules/Modeling/SelfLocator/MonteCarloSelfLocator/MonteCarloSelfLocator.cpp
+++ NaoTHSoccer/Source/Cognition/Modules/Modeling/SelfLocator/MonteCarloSelfLocator/MonteCarloSelfLocator.cpp
@@ -431,7 +431,7 @@

   if(parameters.updateByShortLinePercept)
   {
-    if(!getLinePercept().lines.empty()) {
+    if(!getLinePercept().short_lines.empty()) {
       updateByShortLines(getLinePercept(), sampleSet);
     }
   }


FileManager: fix folder sync editor, multifoldermodel indexForPath method

--- liteidex/src/utils/folderview/multifoldermodel.cpp
+++ liteidex/src/utils/folderview/multifoldermodel.cpp
@@ -345,10 +345,10 @@
     QString findPath = QDir::cleanPath(QDir::fromNativeSeparators(path));
     foreach (QAbstractItemModel *model, this->sourceModelList()) {
         QFileSystemModel *fs = (QFileSystemModel*)model;
-        if (!findPath.startsWith(fs->rootPath())) {
+        if (!findPath.startsWith(fs->rootPath()+"/")) {
             continue;
         }
-        QModelIndex index = fs->index(path);
+        QModelIndex index = fs->index(findPath);
         if (index.isValid()) {
             pathList << this->mapFromSourceEx(model,index);
         }


- bumped up minor version

- bumped up minor version

--- bangra.cpp
+++ bangra.cpp
@@ -12,7 +12,7 @@
 enum {
     // semver style versioning
     BANGRA_VERSION_MAJOR = 0,
-    BANGRA_VERSION_MINOR = 5,
+    BANGRA_VERSION_MINOR = 6,
     BANGRA_VERSION_PATCH = 0,
 };


Less traces

Less traces

--- VosVideo.GSCameraPlayer/GSCameraPlayer.cpp
+++ VosVideo.GSCameraPlayer/GSCameraPlayer.cpp
@@ -126,7 +126,6 @@

 PlayerState GSCameraPlayer::GetState() const
 {
-	LOG_TRACE("GSCameraPlayer GetState called");
 	return _state;
 }


memtable: switch flush reader implementation to flat streams

--- memtable.cc
+++ memtable.cc
@@ -428,40 +428,72 @@
     }
 };

-class flush_reader final : public mutation_reader::impl, private iterator_reader {
+class flush_reader final : public flat_mutation_reader::impl, private iterator_reader {
+    // FIXME: Similarly to scanning_reader we have an underlying
+    // flat_mutation_reader for each partition. This is suboptimal.
+    // Partition snapshot reader should be devirtualised and called directly
+    // without using any intermediate buffers.
+    flat_mutation_reader_opt _partition_reader;
     flush_memory_accounter _flushed_memory;
 public:
     flush_reader(schema_ptr s, lw_shared_ptr<memtable> m)
-        : iterator_reader(std::move(s), m, query::full_partition_range)
+        : impl(s)
+        , iterator_reader(std::move(s), m, query::full_partition_range)
         , _flushed_memory(*m)
     {}
     flush_reader(const flush_reader&) = delete;
     flush_reader(flush_reader&&) = delete;
     flush_reader& operator=(flush_reader&&) = delete;
     flush_reader& operator=(const flush_reader&) = delete;
-
-    virtual future<streamed_mutation_opt> operator()() override {
+private:
+    void get_next_partition() {
         return read_section()(region(), [&] {
             return with_linearized_managed_bytes([&] {
                 memtable_entry* e = fetch_entry();
-                if (!e) {
-                    return make_ready_future<streamed_mutation_opt>(stdx::nullopt);
-                } else {
+                if (e) {
                     auto cr = query::clustering_key_filter_ranges::get_ranges(*schema(), schema()->full_slice(), e->key().key());
                     auto snp = e->partition().read(region(), schema());
-                    auto mpsr = make_partition_snapshot_reader<partition_snapshot_accounter>(schema(), e->key(), std::move(cr),
+                    auto mpsr = make_partition_snapshot_flat_reader<partition_snapshot_accounter>(schema(), e->key(), std::move(cr),
                             snp, region(), read_section(), mtbl(), streamed_mutation::forwarding::no, _flushed_memory);
                     _flushed_memory.account_component(*e);
                     _flushed_memory.account_component(*snp);
-                    auto ret = make_ready_future<streamed_mutation_opt>(std::move(mpsr));
+                    _partition_reader = std::move(mpsr);
                     advance();
-                    return ret;
                 }
             });
         });
     }
-    virtual future<> fast_forward_to(const dht::partition_range& pr) override {
-        return iterator_reader::fast_forward_to(pr);
+public:
+    virtual future<> fill_buffer() override {
+        return do_until([this] { return is_end_of_stream() || is_buffer_full(); }, [this] {
+            if (!_partition_reader) {
+                get_next_partition();
+                if (!_partition_reader) {
+                    _end_of_stream = true;
+                    return make_ready_future<>();
+                }
+            }
+            return _partition_reader->consume_pausable([this] (mutation_fragment mf) {
+                push_mutation_fragment(std::move(mf));
+                return stop_iteration(is_buffer_full());
+            }).then([this] {
+                if (_partition_reader->is_end_of_stream() && _partition_reader->is_buffer_empty()) {
+                    _partition_reader = stdx::nullopt;
+                }
+            });
+        });
+    }
+    virtual void next_partition() override {
+        clear_buffer_to_next_partition();
+        if (is_buffer_empty()) {
+            _partition_reader = stdx::nullopt;
+        }
+    }
+    virtual future<> fast_forward_to(const dht::partition_range&) override {
+        throw std::bad_function_call();
+    }
+    virtual future<> fast_forward_to(position_range) override {
+        throw std::bad_function_call();
     }
 };

@@ -510,8 +542,7 @@
 flat_mutation_reader
 memtable::make_flush_reader(schema_ptr s, const io_priority_class& pc) {
     if (group()) {
-        return flat_mutation_reader_from_mutation_reader(s, make_mutation_reader<flush_reader>(s, shared_from_this()),
-                                                         streamed_mutation::forwarding::no);
+        return make_flat_mutation_reader<flush_reader>(s, shared_from_this());
     } else {
         auto& full_slice = s->full_slice();
         return make_flat_mutation_reader<scanning_reader>(std::move(s), shared_from_this(),


use enum instead of define

use enum instead of define

--- jitify.hpp
+++ jitify.hpp
@@ -1420,13 +1420,11 @@
     "#define SCHAR_MIN   (-128)\n"
     "#define SCHAR_MAX   127\n"
     "#define UCHAR_MAX   255\n"
-    "#ifdef __CHAR_UNSIGNED__\n"
-    " #define CHAR_MIN   0\n"
-    " #define CHAR_MAX   UCHAR_MAX\n"
-    "#else\n"
-    " #define CHAR_MIN   SCHAR_MIN\n"
-    " #define CHAR_MAX   SCHAR_MAX\n"
-    "#endif\n"
+    "enum {\n"
+    " _JITIFY_CHAR_IS_UNSIGNED = (char)-1 >= 0,\n"
+    " CHAR_MIN = _JITIFY_CHAR_IS_UNSIGNED ? 0 : SCHAR_MIN,\n"
+    " CHAR_MAX = _JITIFY_CHAR_IS_UNSIGNED ? UCHAR_MAX : SCHAR_MAX,\n"
+    " };\n"
     "#define SHRT_MIN    (-32768)\n"
     "#define SHRT_MAX    32767\n"
     "#define USHRT_MAX   65535\n"
@@ -1521,10 +1519,8 @@
     "};\n"
     "template<> struct numeric_limits<bool>               : public "
     "__jitify_detail::IntegerLimits<bool,              false,    true,1> {};\n"
-    "enum char_is_signed_enum { char_is_signed = (char)-1 < 0 };\n"
-    "template<> struct numeric_limits<char>               : public\n "
-    "__jitify_detail::IntegerLimits<char, char_is_signed ? SCHAR_MIN : 0,\n "
-    "                                     char_is_signed ? SCHAR_MAX : UCHAR_MAX>\n"
+    "template<> struct numeric_limits<char>               : public "
+    "__jitify_detail::IntegerLimits<char,              CHAR_MIN, CHAR_MAX> "
     "{};\n"
     "template<> struct numeric_limits<signed char>        : public "
     "__jitify_detail::IntegerLimits<signed char,       SCHAR_MIN,SCHAR_MAX> "


Add audit trail for subdoc access

Add audit trail for subdoc access

Change-Id: I3f27ce7c52f8ff68472b204199597bbe2679c914
Reviewed-on: http://review.couchbase.org/79959
Tested-by: Build Bot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Dave Rigby <a09264da4832c7ff1d3bf1608a19f4b870f93750@couchbase.com>

--- daemon/subdocument.cc
+++ daemon/subdocument.cc
@@ -19,6 +19,7 @@

 #include "connections.h"
 #include "debug_helpers.h"
+#include "mcaudit.h"
 #include "mcbp.h"
 #include "protocol/mcbp/engine_wrapper.h"
 #include "subdoc/util.h"
@@ -1322,6 +1323,14 @@
         context.response_val_len = mloc.length;
     }

+    if (context.traits.is_mutator) {
+        cb::audit::document::add(connection,
+                                 cb::audit::document::Operation::Modify);
+    } else {
+        cb::audit::document::add(connection,
+                                 cb::audit::document::Operation::Read);
+    }
+
     auto status_code = PROTOCOL_BINARY_RESPONSE_SUCCESS;
     if (context.in_document_state == DocumentState::Deleted) {
         status_code = PROTOCOL_BINARY_RESPONSE_SUBDOC_SUCCESS_DELETED;
@@ -1386,6 +1395,9 @@
     size_t response_buf_needed;
     size_t iov_len = 0;
     if (context.overall_status == PROTOCOL_BINARY_RESPONSE_SUCCESS) {
+        cb::audit::document::add(connection,
+                                 cb::audit::document::Operation::Modify);
+
         // on success, one per each non-zero length result.
         response_buf_needed = 0;
         for (auto phase : phases) {
@@ -1505,9 +1517,12 @@

     // Allocated required resource - build the header.
     auto status_code = context.overall_status;
-    if ((status_code == PROTOCOL_BINARY_RESPONSE_SUCCESS) &&
-        (context.in_document_state == DocumentState::Deleted)) {
-        status_code = PROTOCOL_BINARY_RESPONSE_SUBDOC_SUCCESS_DELETED;
+    if (status_code == PROTOCOL_BINARY_RESPONSE_SUCCESS) {
+        cb::audit::document::add(connection,
+                                 cb::audit::document::Operation::Read);
+        if (context.in_document_state == DocumentState::Deleted) {
+            status_code = PROTOCOL_BINARY_RESPONSE_SUBDOC_SUCCESS_DELETED;
+        }
     }

     // Lookups to a deleted document which (partially) succeeded need


Issue 1702647 fix for TDTMolSupplier (http://sourceforge.net/tracker/index.php?func=detail&aid=1702647&group_id=160139&atid=814650)

--- Code/GraphMol/FileParsers/testMolSupplier.cpp
+++ Code/GraphMol/FileParsers/testMolSupplier.cpp
@@ -1138,6 +1138,63 @@
   }
   TEST_ASSERT(ok);
   delete nSup;
+
+
+  fname = rdbase + "/Code/GraphMol/FileParsers/test_data/acd_few.tdt";
+  TDTMolSupplier *tSup;
+  tSup = new TDTMolSupplier(fname);
+  TEST_ASSERT(tSup);
+  TEST_ASSERT(tSup->length()==10);
+  mol=(*tSup)[0];
+  TEST_ASSERT(mol);
+  TEST_ASSERT(mol->getNumAtoms()==9);
+  delete mol;
+  delete tSup;
+
+  tSup = new TDTMolSupplier(fname);
+  TEST_ASSERT(tSup);
+  mol=(*tSup)[0];
+  TEST_ASSERT(mol);
+  TEST_ASSERT(mol->getNumAtoms()==9);
+  TEST_ASSERT(tSup->length()==10);
+  delete mol;
+  delete tSup;
+
+  tSup = new TDTMolSupplier(fname);
+  TEST_ASSERT(tSup);
+  mol=tSup->next();
+  TEST_ASSERT(mol);
+  TEST_ASSERT(mol->getNumAtoms()==9);
+  TEST_ASSERT(tSup->length()==10);
+  delete mol;
+  mol=(*tSup)[0];
+  TEST_ASSERT(mol);
+  TEST_ASSERT(mol->getNumAtoms()==9);
+  TEST_ASSERT(tSup->length()==10);
+  delete mol;
+  mol=tSup->next();
+  TEST_ASSERT(mol);
+  mol=tSup->next();
+  TEST_ASSERT(mol);
+  mol=tSup->next();
+  TEST_ASSERT(mol);
+  TEST_ASSERT(mol->getNumAtoms()==10);
+  delete tSup;
+  delete mol;
+
+  tSup = new TDTMolSupplier(fname);
+  TEST_ASSERT(tSup);
+  mol=0;
+  try {
+    mol=(*tSup)[20];
+    ok = false;
+  } catch (FileParseException &) {
+    ok=true;
+  }
+  TEST_ASSERT(ok);
+  delete tSup;
+
+

   return 1;
 }


search for mugen characters in the user directory as well

git-svn-id: 39e099a8ed5324aded674b764a67f7a08796d9a7@5785 662fdd30-d327-0410-a531-f549c87e1e9e

--- src/mugen/character-select.cpp
+++ src/mugen/character-select.cpp
@@ -2261,10 +2261,17 @@
     return grid.isUniqueCharacter(character);
 }

+static void addFiles(vector<Filesystem::AbsolutePath> & where, const Filesystem::AbsolutePath & path){
+    try{
+        vector<Filesystem::AbsolutePath> more = Storage::instance().getFilesRecursive(path, "*.def");
+        where.insert(where.end(), more.begin(), more.end());
+    } catch (const Filesystem::NotFound & fail){
+    }
+}
+
 static void addFiles(vector<Filesystem::AbsolutePath> & where, const Filesystem::RelativePath & path){
     try{
-        vector<Filesystem::AbsolutePath> more = Storage::instance().getFilesRecursive(Storage::instance().find(path), "*.def");
-        where.insert(where.end(), more.begin(), more.end());
+        addFiles(where, Storage::instance().find(path));
     } catch (const Filesystem::NotFound & fail){
     }
 }
@@ -2279,6 +2286,9 @@

         /* search in the mugen/chars directory */
         addFiles(candidates, Data::getInstance().getCharDirectory());
+
+        /* search in the <user>/mugen directory */
+        addFiles(candidates, Storage::instance().userDirectory().join(Filesystem::RelativePath("mugen")));

         bool ok = true;
         for (vector<Filesystem::AbsolutePath>::iterator it = candidates.begin(); ok && !select->searchingCheck.get() && it != candidates.end(); it++){


[ADD] move func

[ADD] move func

--- sksat/window.hpp
+++ sksat/window.hpp
@@ -36,6 +36,11 @@
 	size_t get_xsize() const { return xsize; }
 	size_t get_ysize() const { return ysize; }

+	void move(size_t x, size_t y){ xpos=x; ypos=y; api_move(x,y); }
+	void set_pos(size_t x, size_t y){ move(x,y); }
+	void set_xpos(size_t x){ move(x,ypos); }
+	void set_ypos(size_t y){ move(xpos,y); }
+
 	operator bool () const { return opend; }

 	// 描画関数
@@ -64,6 +69,7 @@
 	virtual void api_set_title(const char *t) = 0;
 	virtual void api_set_size(size_t x, size_t y) = 0;
 	virtual void api_flush() = 0;
+	virtual void api_move() = 0;
 	virtual bool api_step_loop() = 0;
 public:
 	static size_t default_xsize, default_ysize;


Follow interface change.

Follow interface change.

--- interpreter/cling/lib/Interpreter/Interpreter.cpp
+++ interpreter/cling/lib/Interpreter/Interpreter.cpp
@@ -174,8 +174,7 @@
                                                      /*isTemp*/true), this));

     if (!isInSyntaxOnlyMode())
-      m_Executor.reset(new IncrementalExecutor(SemaRef.Diags,
-                                               getCI()->getCodeGenOpts()));
+      m_Executor.reset(new IncrementalExecutor(SemaRef.Diags, *getCI()));

     // Tell the diagnostic client that we are entering file parsing mode.
     DiagnosticConsumer& DClient = getCI()->getDiagnosticClient();


Fix variable mismatch between signature and body

I updated the signature to conform to the LLDB coding style but
accidentally forgot to update the function body.

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@368962 91177308-0d34-0410-b5e6-96231b3b80d8

--- source/Utility/FileSpec.cpp
+++ source/Utility/FileSpec.cpp
@@ -73,7 +73,7 @@
 }

 FileSpec::FileSpec(llvm::StringRef path, const llvm::Triple &triple)
-    : FileSpec{path, Triple.isOSWindows() ? Style::windows : Style::posix} {}
+    : FileSpec{path, triple.isOSWindows() ? Style::windows : Style::posix} {}

 // Copy constructor
 FileSpec::FileSpec(const FileSpec *rhs) : m_directory(), m_filename() {
@@ -228,8 +228,8 @@
     m_directory.SetString(directory);
 }

-void FileSpec::SetFile(llvm::StringRef path, const llvm::Triple &Triple) {
-  return SetFile(path, Triple.isOSWindows() ? Style::windows : Style::posix);
+void FileSpec::SetFile(llvm::StringRef path, const llvm::Triple &triple) {
+  return SetFile(path, triple.isOSWindows() ? Style::windows : Style::posix);
 }

 // Convert to pointer operator. This allows code to check any FileSpec objects


add explicit cast for global_weight

add explicit cast for global_weight

--- jubatus/core/fv_converter/weight_manager.cpp
+++ jubatus/core/fv_converter/weight_manager.cpp
@@ -48,7 +48,7 @@
 void weight_manager::get_weight(common::sfv_t& fv) const {
   for (common::sfv_t::iterator it = fv.begin(); it != fv.end(); ++it) {
     double global_weight = get_global_weight(it->first);
-    it->second *= global_weight;
+    it->second = static_cast<float>(it->second * global_weight);
   }
   fv.erase(remove_if(fv.begin(), fv.end(), is_zero()), fv.end());
 }