Build fixes for CUDA 6.5

Build fixes for CUDA 6.5

--- modules/gpu/src/nvidia/core/NCVPixelOperations.hpp
+++ modules/gpu/src/nvidia/core/NCVPixelOperations.hpp
@@ -48,24 +48,24 @@
 #include "NCV.hpp"

 template<typename TBase> inline __host__ __device__ TBase _pixMaxVal();
-template<> static inline __host__ __device__ Ncv8u  _pixMaxVal<Ncv8u>()  {return UCHAR_MAX;}
-template<> static inline __host__ __device__ Ncv16u _pixMaxVal<Ncv16u>() {return USHRT_MAX;}
-template<> static inline __host__ __device__ Ncv32u _pixMaxVal<Ncv32u>() {return  UINT_MAX;}
-template<> static inline __host__ __device__ Ncv8s  _pixMaxVal<Ncv8s>()  {return  SCHAR_MAX;}
-template<> static inline __host__ __device__ Ncv16s _pixMaxVal<Ncv16s>() {return  SHRT_MAX;}
-template<> static inline __host__ __device__ Ncv32s _pixMaxVal<Ncv32s>() {return   INT_MAX;}
-template<> static inline __host__ __device__ Ncv32f _pixMaxVal<Ncv32f>() {return   FLT_MAX;}
-template<> static inline __host__ __device__ Ncv64f _pixMaxVal<Ncv64f>() {return   DBL_MAX;}
+template<>  inline __host__ __device__ Ncv8u  _pixMaxVal<Ncv8u>()  {return UCHAR_MAX;}
+template<>  inline __host__ __device__ Ncv16u _pixMaxVal<Ncv16u>() {return USHRT_MAX;}
+template<>  inline __host__ __device__ Ncv32u _pixMaxVal<Ncv32u>() {return  UINT_MAX;}
+template<>  inline __host__ __device__ Ncv8s  _pixMaxVal<Ncv8s>()  {return  SCHAR_MAX;}
+template<>  inline __host__ __device__ Ncv16s _pixMaxVal<Ncv16s>() {return  SHRT_MAX;}
+template<>  inline __host__ __device__ Ncv32s _pixMaxVal<Ncv32s>() {return   INT_MAX;}
+template<>  inline __host__ __device__ Ncv32f _pixMaxVal<Ncv32f>() {return   FLT_MAX;}
+template<>  inline __host__ __device__ Ncv64f _pixMaxVal<Ncv64f>() {return   DBL_MAX;}

 template<typename TBase> inline __host__ __device__ TBase _pixMinVal();
-template<> static inline __host__ __device__ Ncv8u  _pixMinVal<Ncv8u>()  {return 0;}
-template<> static inline __host__ __device__ Ncv16u _pixMinVal<Ncv16u>() {return 0;}
-template<> static inline __host__ __device__ Ncv32u _pixMinVal<Ncv32u>() {return 0;}
-template<> static inline __host__ __device__ Ncv8s  _pixMinVal<Ncv8s>()  {return SCHAR_MIN;}
-template<> static inline __host__ __device__ Ncv16s _pixMinVal<Ncv16s>() {return SHRT_MIN;}
-template<> static inline __host__ __device__ Ncv32s _pixMinVal<Ncv32s>() {return INT_MIN;}
-template<> static inline __host__ __device__ Ncv32f _pixMinVal<Ncv32f>() {return FLT_MIN;}
-template<> static inline __host__ __device__ Ncv64f _pixMinVal<Ncv64f>() {return DBL_MIN;}
+template<>  inline __host__ __device__ Ncv8u  _pixMinVal<Ncv8u>()  {return 0;}
+template<>  inline __host__ __device__ Ncv16u _pixMinVal<Ncv16u>() {return 0;}
+template<>  inline __host__ __device__ Ncv32u _pixMinVal<Ncv32u>() {return 0;}
+template<>  inline __host__ __device__ Ncv8s  _pixMinVal<Ncv8s>()  {return SCHAR_MIN;}
+template<>  inline __host__ __device__ Ncv16s _pixMinVal<Ncv16s>() {return SHRT_MIN;}
+template<>  inline __host__ __device__ Ncv32s _pixMinVal<Ncv32s>() {return INT_MIN;}
+template<>  inline __host__ __device__ Ncv32f _pixMinVal<Ncv32f>() {return FLT_MIN;}
+template<>  inline __host__ __device__ Ncv64f _pixMinVal<Ncv64f>() {return DBL_MIN;}

 template<typename Tvec> struct TConvVec2Base;
 template<> struct TConvVec2Base<uchar1>  {typedef Ncv8u TBase;};
@@ -116,21 +116,21 @@
 template<typename Tin> static inline __host__ __device__ void _TDemoteClampNN(Tin &a, Ncv32f &out) {out = (Ncv32f)a;}

 template<typename Tout> inline Tout _pixMakeZero();
-template<> static inline __host__ __device__ uchar1 _pixMakeZero<uchar1>() {return make_uchar1(0);}
-template<> static inline __host__ __device__ uchar3 _pixMakeZero<uchar3>() {return make_uchar3(0,0,0);}
-template<> static inline __host__ __device__ uchar4 _pixMakeZero<uchar4>() {return make_uchar4(0,0,0,0);}
-template<> static inline __host__ __device__ ushort1 _pixMakeZero<ushort1>() {return make_ushort1(0);}
-template<> static inline __host__ __device__ ushort3 _pixMakeZero<ushort3>() {return make_ushort3(0,0,0);}
-template<> static inline __host__ __device__ ushort4 _pixMakeZero<ushort4>() {return make_ushort4(0,0,0,0);}
-template<> static inline __host__ __device__ uint1 _pixMakeZero<uint1>() {return make_uint1(0);}
-template<> static inline __host__ __device__ uint3 _pixMakeZero<uint3>() {return make_uint3(0,0,0);}
-template<> static inline __host__ __device__ uint4 _pixMakeZero<uint4>() {return make_uint4(0,0,0,0);}
-template<> static inline __host__ __device__ float1 _pixMakeZero<float1>() {return make_float1(0.f);}
-template<> static inline __host__ __device__ float3 _pixMakeZero<float3>() {return make_float3(0.f,0.f,0.f);}
-template<> static inline __host__ __device__ float4 _pixMakeZero<float4>() {return make_float4(0.f,0.f,0.f,0.f);}
-template<> static inline __host__ __device__ double1 _pixMakeZero<double1>() {return make_double1(0.);}
-template<> static inline __host__ __device__ double3 _pixMakeZero<double3>() {return make_double3(0.,0.,0.);}
-template<> static inline __host__ __device__ double4 _pixMakeZero<double4>() {return make_double4(0.,0.,0.,0.);}
+template<>  inline __host__ __device__ uchar1 _pixMakeZero<uchar1>() {return make_uchar1(0);}
+template<>  inline __host__ __device__ uchar3 _pixMakeZero<uchar3>() {return make_uchar3(0,0,0);}
+template<>  inline __host__ __device__ uchar4 _pixMakeZero<uchar4>() {return make_uchar4(0,0,0,0);}
+template<>  inline __host__ __device__ ushort1 _pixMakeZero<ushort1>() {return make_ushort1(0);}
+template<>  inline __host__ __device__ ushort3 _pixMakeZero<ushort3>() {return make_ushort3(0,0,0);}
+template<>  inline __host__ __device__ ushort4 _pixMakeZero<ushort4>() {return make_ushort4(0,0,0,0);}
+template<>  inline __host__ __device__ uint1 _pixMakeZero<uint1>() {return make_uint1(0);}
+template<>  inline __host__ __device__ uint3 _pixMakeZero<uint3>() {return make_uint3(0,0,0);}
+template<>  inline __host__ __device__ uint4 _pixMakeZero<uint4>() {return make_uint4(0,0,0,0);}
+template<>  inline __host__ __device__ float1 _pixMakeZero<float1>() {return make_float1(0.f);}
+template<>  inline __host__ __device__ float3 _pixMakeZero<float3>() {return make_float3(0.f,0.f,0.f);}
+template<>  inline __host__ __device__ float4 _pixMakeZero<float4>() {return make_float4(0.f,0.f,0.f,0.f);}
+template<>  inline __host__ __device__ double1 _pixMakeZero<double1>() {return make_double1(0.);}
+template<>  inline __host__ __device__ double3 _pixMakeZero<double3>() {return make_double3(0.,0.,0.);}
+template<>  inline __host__ __device__ double4 _pixMakeZero<double4>() {return make_double4(0.,0.,0.,0.);}

 static inline __host__ __device__ uchar1 _pixMake(Ncv8u x) {return make_uchar1(x);}
 static inline __host__ __device__ uchar3 _pixMake(Ncv8u x, Ncv8u y, Ncv8u z) {return make_uchar3(x,y,z);}


planning: fix compile warning.

planning: fix compile warning.

--- modules/planning/planner/rtk/rtk_replay_planner.cc
+++ modules/planning/planner/rtk/rtk_replay_planner.cc
@@ -86,10 +86,12 @@
   std::uint32_t matched_index =
       QueryPositionMatchedPoint(planning_init_point, complete_rtk_trajectory_);

-  std::uint32_t forward_buffer = FLAGS_rtk_trajectory_forward;
+  std::uint32_t forward_buffer =
+      static_cast<std::uint32_t>(FLAGS_rtk_trajectory_forward);
   // end_index is excluded.
   std::uint32_t end_index = std::min<std::uint32_t>(
-      complete_rtk_trajectory_.size(), matched_index + forward_buffer);
+      static_cast<std::uint32_t>(complete_rtk_trajectory_.size()),
+      matched_index + forward_buffer);

   //  auto* trajectory_points = trajectory_pb->mutable_trajectory_point();
   std::vector<TrajectoryPoint> trajectory_points(


Prediction: small fixes

Prediction: small fixes

--- modules/prediction/container/obstacles/obstacle.cc
+++ modules/prediction/container/obstacles/obstacle.cc
@@ -838,6 +838,10 @@
   }
   double min_heading_diff = std::numeric_limits<double>::infinity();
   for (std::shared_ptr<const LaneInfo> current_lane : current_lanes) {
+    if (current_lane == nullptr) {
+      continue;
+    }
+
     int turn_type = map->LaneTurnType(current_lane->id().id());
     std::string lane_id = current_lane->id().id();
     double s = 0.0;


silence msvc warning

silence msvc warning

--- include/libtorrent/http_tracker_connection.hpp
+++ include/libtorrent/http_tracker_connection.hpp
@@ -52,7 +52,7 @@
 namespace libtorrent
 {

-	class http_connection;
+	struct http_connection;
 	class entry;
 	class http_parser;
 	class connection_queue;


mpeg2lg helper: simplify getting frame layout for detecting flavour

If frame layout is missing then for purposes of checking the
MPEG-2 LongGOP flavour the frame layout is assumed to be 'separate
fields'

--- src/mxf_helper/MPEG2LGMXFDescriptorHelper.cpp
+++ src/mxf_helper/MPEG2LGMXFDescriptorHelper.cpp
@@ -135,11 +135,9 @@
     if (pic_descriptor->haveStoredWidth())
         stored_width = pic_descriptor->getStoredWidth();

-    uint8_t frame_layout = 255;
+    uint8_t frame_layout = MXF_SEPARATE_FIELDS;
     if (pic_descriptor->haveFrameLayout())
         frame_layout = pic_descriptor->getFrameLayout();
-    else
-        frame_layout = MXF_SEPARATE_FIELDS;

     mxfUL pc_label = pic_descriptor->getPictureEssenceCoding();
     size_t i;


Do not assert if a wait on mutex fails

Do not assert if a wait on mutex fails

--- include/oqpi/synchronization/win/win_mutex.hpp
+++ include/oqpi/synchronization/win/win_mutex.hpp
@@ -113,7 +113,7 @@
         bool internalWait(DWORD dwMilliseconds, BOOL bAlertable)
         {
             const auto result = WaitForSingleObjectEx(handle_, dwMilliseconds, bAlertable);
-            if (oqpi_failed(result == WAIT_OBJECT_0 || result == WAIT_TIMEOUT))
+            if (result == WAIT_FAILED)
             {
                 oqpi_error("WaitForSingleObjectEx failed with error code 0x%x", GetLastError());
             }


Initialize pointers to NULL to avoid uninitialized variable warning.

git-svn-id: ffc1bc5b3feaf8644044862cc38c386ade156493@1862 434f946d-2f3d-0410-ba4c-cb9f52fb0dbf

--- src/numerics/patch_recovery_error_estimator.C
+++ src/numerics/patch_recovery_error_estimator.C
@@ -1,4 +1,4 @@
-// $Id: patch_recovery_error_estimator.C,v 1.24 2007-02-13 21:21:16 roystgnr Exp $
+// $Id: patch_recovery_error_estimator.C,v 1.25 2007-02-14 02:30:32 jwpeterson Exp $

 // The libMesh Finite Element Library.
 // Copyright (C) 2002-2005  Benjamin S. Kirk, John W. Peterson
@@ -201,11 +201,11 @@
 	  const std::vector<Real>&                       JxW     = fe->get_JxW();
 	  const std::vector<Point>&                      q_point = fe->get_xyz();
 	  const std::vector<std::vector<Real> >&         phi     = fe->get_phi();
-	  const std::vector<std::vector<RealGradient> > *dphi;
+	  const std::vector<std::vector<RealGradient> > *dphi = NULL;
           if (_sobolev_order == 1)
             dphi = &(fe->get_dphi());
 #ifdef ENABLE_SECOND_DERIVATIVES
-	  const std::vector<std::vector<RealTensor> >  *d2phi;
+	  const std::vector<std::vector<RealTensor> >  *d2phi = NULL;
           if (_sobolev_order == 2)
             d2phi = &(fe->get_d2phi());
 #endif


Refactor

Refactor

--- src/EratMedium.cpp
+++ src/EratMedium.cpp
@@ -73,6 +73,7 @@
     buckets_.resize(64);
     currentBuckets_.resize(64);
     std::fill_n(buckets_.begin(), 64, nullptr);
+    std::fill_n(currentBuckets_.begin(), 64, nullptr);
   }

   if (Bucket::isFull(buckets_[wheelIndex]))
@@ -85,7 +86,6 @@
 void EratMedium::crossOff(pod_vector<uint8_t>& sieve)
 {
   std::swap(buckets_, currentBuckets_);
-  std::fill_n(buckets_.begin(), 64, nullptr);

   // Iterate over the 64 bucket lists.
   // The 1st list contains sieving primes with wheelIndex = 0.
@@ -98,6 +98,7 @@
     {
       Bucket* bucket = Bucket::get(currentBuckets_[i]);
       bucket->setEnd(currentBuckets_[i]);
+      currentBuckets_[i] = nullptr;
       uint64_t wheelIndex = i;

       // Iterate over the current bucket list.


FIX unused case

FIX unused case

--- src/Expression.cpp
+++ src/Expression.cpp
@@ -25,8 +25,8 @@
 {
 	auto lhs = First->Eval();
 	auto rhs = Second->Eval();
+
 	switch (Op) {
-
 	case BinaryOperator::Plus:
 		return lhs + rhs;
 	case BinaryOperator::Minus:
@@ -35,7 +35,6 @@
 		return lhs * rhs;
 	case BinaryOperator::Divide:
 		return lhs / rhs;
-	default: throw Exception(nullptr, nullptr);
 	}
 }


Changing variable name

Changing variable name

--- src/FileSystem.cpp
+++ src/FileSystem.cpp
@@ -69,16 +69,16 @@
   auto it = atoms.begin();
   if (!parseName(*it)) // if the first name is invalid
     return false;
-  string tmp = *it;
+  string reassembledPath = *it;
   it++;
   for (int i = 1; i < int(atoms.size()); i++) { // if there's an invalid name
     if (!parseName(*it))
       return false;
-    tmp += '/';
-    tmp += (*it);
+    reassembledPath += '/';
+    reassembledPath += (*it);
     it++;
   }
-  return tmp == path; // if the reassembled path is equals to the parsed
+  return reassembledPath == path;
 }

 bool FileSystem::createFolder(const string& fullPath) {


Fix keyboard navigation in Find/Replace.

--- src/FindWindow.cpp
+++ src/FindWindow.cpp
@@ -126,8 +126,10 @@
 	fReplaceString = new BStringView("replaceString", B_TRANSLATE("Replace:"));
 	fFindTC = new BScintillaView("findText", 0, true, true);
 	fFindTC->SetExplicitMinSize(BSize(200, 100));
+	fFindTC->Target()->SetFlags(fFindTC->Target()->Flags() | B_NAVIGABLE);
 	fReplaceTC = new BScintillaView("replaceText", 0, true, true);
 	fReplaceTC->SetExplicitMinSize(BSize(200, 100));
+	fReplaceTC->Target()->SetFlags(fReplaceTC->Target()->Flags() | B_NAVIGABLE);

 	fFindButton = new BButton(B_TRANSLATE("Find"), new BMessage((uint32) FINDWINDOW_FIND));
 	fFindButton->MakeDefault(true);


Cleaned up a pointless statement warning.

--- src/GUI/Plater.cpp
+++ src/GUI/Plater.cpp
@@ -409,7 +409,7 @@
 ObjRef Plater::selected_object() {
     Slic3r::Log::info(LogChannel, L"Calling selected_object()");
     auto it {this->objects.begin()};
-    for (it; it != this->objects.end(); it++)
+    for (; it != this->objects.end(); it++)
         if (it->selected) return it;
     Slic3r::Log::info(LogChannel, L"No object selected.");
     return this->objects.end();


Good fix

Good fix

--- src/GraphUtils.cpp
+++ src/GraphUtils.cpp
@@ -367,6 +367,9 @@
                     v = u;
                 }

+
+                cleanGraph(g);
+
                 break;
             }
         }
@@ -375,7 +378,6 @@

     }

-    cleanGraph(g);

     #undef D
 }


Updates for Tektronix extended hex language.

--- src/IFaceTable.cxx
+++ src/IFaceTable.cxx
@@ -986,6 +986,7 @@
 	{"SCE_HEX_DATA_UNKNOWN",13},
 	{"SCE_HEX_DEFAULT",0},
 	{"SCE_HEX_EXTENDEDADDRESS",10},
+	{"SCE_HEX_GARBAGE",18},
 	{"SCE_HEX_NOADDRESS",5},
 	{"SCE_HEX_RECCOUNT",7},
 	{"SCE_HEX_RECSTART",1},
@@ -2481,8 +2482,8 @@
 	{"SCLEX_TAL",91},
 	{"SCLEX_TCL",25},
 	{"SCLEX_TCMD",103},
+	{"SCLEX_TEHEX",119},
 	{"SCLEX_TEX",49},
-	{"SCLEX_THEX",119},
 	{"SCLEX_TXT2TAGS",99},
 	{"SCLEX_VB",8},
 	{"SCLEX_VBSCRIPT",28},
@@ -3232,7 +3233,7 @@

 enum {
 	ifaceFunctionCount = 288,
-	ifaceConstantCount = 2581,
+	ifaceConstantCount = 2582,
 	ifacePropertyCount = 218
 };


Attempt to make comment clearer

Attempt to make comment clearer

--- plugins/mongo_db_plugin/mongo_db_plugin.cpp
+++ plugins/mongo_db_plugin/mongo_db_plugin.cpp
@@ -1462,10 +1462,10 @@
          }

          try {
-            // Due to the vast amounts of data, we suggest MongoDB administrators:
+            // MongoDB administrators (to enable sharding) :
             //   1. enableSharding database (default to EOS)
             //   2. shardCollection: blocks, action_traces, transaction_traces, especially action_traces
-            //   3. Use compound index with shard key (default to _id), to improve query performance.
+            //   3. Compound index with shard key (default to _id below), to improve query performance.

             // blocks indexes
             auto blocks = mongo_conn[db_name][blocks_col];


Fix another dangling reference problem

Fix another dangling reference problem

--- plugins/producer_plugin/producer_plugin.cpp
+++ plugins/producer_plugin/producer_plugin.cpp
@@ -435,7 +435,7 @@
                   };
                   try {
                      auto result = future.get();
-                     if( !self->process_incoming_transaction_async( result, persist_until_expired, std::move( next ) ) ) {
+                     if( !self->process_incoming_transaction_async( result, persist_until_expired, next ) ) {
                         if( self->_pending_block_mode == pending_block_mode::producing ) {
                            self->schedule_maybe_produce_block( true );
                         }


Init show frame number to false

Init show frame number to false

--- src/rendering/renderengine.cpp
+++ src/rendering/renderengine.cpp
@@ -129,6 +129,7 @@
     , _currentFadeTime(0.f)
     , _fadeDirection(0)
     , _frameNumber(0)
+    , _showFrameNumber(false)
     , _frametimeType(FrametimeType::DtTimeAvg)
     //    , _sgctRenderStatisticsVisible(false)
 {


cpuid.cpp: don't skip identification of other processors

Signed-off-by: Steven Noonan <4068f0880b399410602d694b3cc711c8a8f4727e@uplinklabs.net>

--- source/cpuid.cpp
+++ source/cpuid.cpp
@@ -518,12 +518,6 @@

 			for (params.processor = 0; params.processor < iCount;
 			     params.processor++) {
-				if (params.processor > 0)
-				{
-					proc[params.processor] = new X86Processor(*proc[0]);
-					proc[params.processor]->m_index = params.processor;
-					break;
-				}
 				proc[params.processor] = new X86Processor();
 				HANDLE hThread =
 				        CreateThread(NULL, 0, ( LPTHREAD_START_ROUTINE )s_GoThreadProc,


Fix compile

Fix compile

Change-Id: I3ec711b1b56e59172f54738e64faff0fd7dd707f
Reviewed-by: Daniel Teske <d8a411aec9a206efedb4d45b75fe8d13f1e2b628@digia.com>

--- src/plugins/projectexplorer/projectwindow.cpp
+++ src/plugins/projectexplorer/projectwindow.cpp
@@ -301,12 +301,12 @@

     QList<ProjectPanelFactory *> fac = ProjectPanelFactory::factories();

-    int factoryIndex = factoryIndex(projectIndex, supportsIndex);
-    if (factoryIndex < 0 ||factoryIndex >= m_projects.at(projectIndex).widgets.size())
+    int factoryIdx = factoryIndex(projectIndex, supportsIndex);
+    if (factoryIdx < 0 ||factoryIdx >= m_projects.at(projectIndex).widgets.size())
         return 0;
-    if (!m_projects.at(projectIndex).widgets.at(factoryIndex))
-        m_projects[projectIndex].widgets[factoryIndex] = fac.at(factoryIndex)->createWidget(project);
-    return m_projects.at(projectIndex).widgets.at(factoryIndex);
+    if (!m_projects.at(projectIndex).widgets.at(factoryIdx))
+        m_projects[projectIndex].widgets[factoryIdx] = fac.at(factoryIdx)->createWidget(project);
+    return m_projects.at(projectIndex).widgets.at(factoryIdx);
 }

 bool WidgetCache::isRegistered(Project *project) const
@@ -354,7 +354,7 @@
 int WidgetCache::recheckFactories(Project *project, int oldSupportsIndex)
 {
     int projectIndex = indexForProject(project);
-    int factoryIndex = factoryIndex(projectIndex, oldSupportsIndex);
+    int factoryIdx = factoryIndex(projectIndex, oldSupportsIndex);

     ProjectInfo &info = m_projects[projectIndex];
     QList<ProjectPanelFactory *> fac = ProjectPanelFactory::factories();
@@ -368,14 +368,14 @@
         }
     }

-    if (factoryIndex < 0)
+    if (factoryIdx < 0)
         return -1;

-    if (!info.supports.at(factoryIndex))
+    if (!info.supports.at(factoryIdx))
         return -1;

     int newIndex = 0;
-    for (int i = 0; i < factoryIndex; ++i) {
+    for (int i = 0; i < factoryIdx; ++i) {
         if (info.supports.at(i))
             ++newIndex;
     }


micro

micro

--- src/MainWindow.cpp
+++ src/MainWindow.cpp
@@ -211,6 +211,7 @@

         /* leave out disabled controls */
         if (qobject_cast<QWidget*>(itControls->first)->isEnabled() == false) continue;
+
         struct v4l2_control currentValue;
         currentValue.id = itControls->second.id;
         if (itControls->second.device->control(currentValue) == true) {
@@ -460,6 +461,7 @@
             break;
         }

+
         QHBoxLayout *controlLayout = new QHBoxLayout();

         if (controlLabel != 0) {


cpuid: fix compilation on Linux

cpuid: fix compilation on Linux

Variable names changed during the consolidation and I forgot to
update the GCC side of things.

Signed-off-by: Steven Noonan <4068f0880b399410602d694b3cc711c8a8f4727e@uplinklabs.net>


QmlJSInspector: Make string translatable

--- src/plugins/qmljsinspector/qmljsinspector.cpp
+++ src/plugins/qmljsinspector/qmljsinspector.cpp
@@ -734,7 +734,7 @@
     pathAndFilterWidget->setMaximumHeight(m_crumblePath->height());

     m_filterExp = new QLineEdit;
-    m_filterExp->setPlaceholderText("Filter properties");
+    m_filterExp->setPlaceholderText(tr("Filter properties"));
     m_filterExp->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);

     QHBoxLayout *pathAndFilterLayout = new QHBoxLayout(pathAndFilterWidget);


In some Arduino cores (<1.0?) flush clears the Rx buffer this change attempts to limit the impact of this by only calling flush if debug is enabed.

--- src/MicroTasks.cpp
+++ src/MicroTasks.cpp
@@ -86,7 +86,9 @@
     }
   }

+#ifdef ENABLE_DEBUG_MICROTASKS
   DEBUG_PORT.flush();
+#endif
   return uiNextEvent;
 }


fixed cleanup of curl handlers in se_handler unit test

--- src/plugins/websearch/tests/ut-se-handler.cpp
+++ src/plugins/websearch/tests/ut-se-handler.cpp
@@ -59,6 +59,7 @@
     }
   ASSERT_EQ(WB_ERR_NO_ENGINE,code);
   parameters.clear();
+  se_handler::cleanup_handlers();
 }

 TEST_F(SEHandlerTest,query_to_ses_fail_connect)
@@ -87,6 +88,7 @@
   ASSERT_EQ(WB_ERR_NO_ENGINE_OUTPUT,code);
   delete websearch::_wconfig;
   miscutil::free_map(parameters);
+  se_handler::cleanup_handlers();
 }

 int main(int argc, char **argv)


Print prime tower shells in the pre-determined order

The actual order in which it is printed is not fixed as this depends on what exactly is present in the layers, but this is the ordering from outside to inside.

Contributes to issue CURA-5457.

--- src/PrimeTower.cpp
+++ src/PrimeTower.cpp
@@ -94,15 +94,16 @@
     coord_t extra_infill_shift = 0;
     coord_t tower_size = storage.getSettingInMicrons("prime_tower_size");

+    patterns_per_extruder.resize(extruder_order.size());
     coord_t cumulative_inset = 0; //Each tower shape is going to be printed inside the other. This is the inset we're doing for each extruder.
     coord_t z = 0; // (TODO) because the prime tower stores the paths for each extruder for once instead of generating each layer, we don't know the z position
     EFillMethod first_layer_infill_method;
-    for (unsigned int extruder = 0; extruder < extruder_count; extruder++)
+    for (unsigned int extruder : extruder_order)
     {
         const coord_t line_width = storage.meshgroup->getExtruderTrain(extruder)->getSettingInMicrons("prime_tower_line_width");
         const coord_t wall_thickness = storage.meshgroup->getExtruderTrain(extruder)->getSettingInMicrons("prime_tower_wall_thickness");
-        patterns_per_extruder.emplace_back(n_patterns);
-        std::vector<ExtrusionMoves>& patterns = patterns_per_extruder.back();
+        patterns_per_extruder[extruder] = std::vector<ExtrusionMoves>(n_patterns);
+        std::vector<ExtrusionMoves>& patterns = patterns_per_extruder[extruder];
         patterns.resize(n_patterns);

         // If the prime tower is circular, instead of creating a concentric infill in the normal layers, the tower is


Put character in key field

Put character in key field

--- src/Screenplay.cpp
+++ src/Screenplay.cpp
@@ -272,7 +272,7 @@
 		void start_node(NodeKind kind, const std::string& value)
 		{
 			finalize_current_node();
-			curr_node = { kind, value };
+			curr_node = { kind, value, "" };

 			if (kind == NodeKind::Dialog)
 			{
@@ -286,6 +286,7 @@
 			{
 				curr_sequence->nodes.push_back(curr_node);
 				curr_node.kind = NodeKind::Unknown;
+				curr_node.key = "";
 				curr_node.content = "";
 			}
 		}
@@ -319,7 +320,8 @@
 		ScriptEdit edit = { &script, &script.title };
 		std::vector<std::string> lines = TextScanner::SplitLines(text);

-		const char* title_page_tags[] = {
+		const char* title_page_tags[] =
+		{
 			"Title:", "Credit:", "Author:", "Source:", "Draft Date:",
 			"Notes:", "Contact:", "Copyright:"
 		};
@@ -358,7 +360,7 @@

 			if (isTransition(s))
 			{
-				edit.start_node(NodeKind::Transition, parseTransition(s));
+				edit.start_node(NodeKind::Transition, ToUpper(parseTransition(s)));
 				edit.finalize_current_node();
 				continue;
 			}


sort functions for computer added in service class

--- Hopur21Verkefni/Verkefni/services/service.cpp
+++ Hopur21Verkefni/Verkefni/services/service.cpp
@@ -123,20 +123,20 @@
     return searchByYOD;
 }

-vector<Computer> searchComputerByName(const string searchString)
+vector<Computer> Service::searchComputerByName(const string searchString)
 {
     // TODO
     vector <Computer> searchByName;
     return searchByName;
 }

-vector<Computer> searchComputerByType(const string searchString)
+vector<Computer> Service::searchComputerByType(const string searchString)
 {
     // TODO
     vector <Computer> searchByType;
     return searchByType;
 }
-vector<Computer> searchComputerByYear(const string searchString)
+vector<Computer> Service::searchComputerByYear(const string searchString)
 {
     // TODO
     vector <Computer> searchByYear;


fixes for x and y values

fixes for x and y values

--- InOut/virtual_keyboard/FLTKKeyboardWidget.cpp
+++ InOut/virtual_keyboard/FLTKKeyboardWidget.cpp
@@ -82,17 +82,20 @@

     this->begin();

-    int row1 = 0;
+    int baseX = this->x();
+    int baseY = this->y();
+
+    int row1 = baseY;
     int row2 = row1 + 20;
     int row3 = row2 + 20;

-    this->channelSpinner = new Fl_Spinner(60, row1, 80, 20, "Channel");
+    this->channelSpinner = new Fl_Spinner(baseX + 60, row1, 80, 20, "Channel");
     channelSpinner->maximum(16);
     channelSpinner->minimum(1);
     this->channelSpinner->callback((Fl_Callback*) channelChange, this);

-    this->bankChoice = new Fl_Choice(180, row1, 180, 20, "Bank");
-    this->programChoice = new Fl_Choice(420, row1, 200, 20, "Program");
+    this->bankChoice = new Fl_Choice(baseX + 180, row1, 180, 20, "Bank");
+    this->programChoice = new Fl_Choice(baseX + 420, row1, 200, 20, "Program");

     bankChoice->clear();

@@ -108,10 +111,10 @@
     this->programChoice->callback((Fl_Callback*)programChange, this);

-    this->allNotesOffButton = new Fl_Button(0, row2, 623, 20, "All Notes Off");
+    this->allNotesOffButton = new Fl_Button(baseX, row2, 623, 20, "All Notes Off");
     this->allNotesOffButton->callback((Fl_Callback*) allNotesOff, this);

-    this->keyboard = new FLTKKeyboard(csound, 0, row3, 624, 80, "Keyboard");
+    this->keyboard = new FLTKKeyboard(csound, baseX, row3, 624, 80, "Keyboard");

     this->end();

@@ -140,8 +143,6 @@
 }

 int FLTKKeyboardWidget::handle(int event) {
-    //this->csound->Message(this->csound, "Keyboard event: %d\n", event);
-
     switch(event) {
         case FL_KEYDOWN:
                 return this->keyboard->handle(event);
@@ -152,6 +153,7 @@
 //              csound->Message(csound, "Deactivate\n");
 //              return 1;
         default:
+//        this->csound->Message(this->csound, "Keyboard event: %d\n", event);
             return Fl_Group::handle(event);
     }


Fix linter warnings

Fix linter warnings

--- atom/browser/api/atom_api_web_contents.cc
+++ atom/browser/api/atom_api_web_contents.cc
@@ -1272,7 +1272,9 @@
   host->CopyFromBackingStore(
       gfx::Rect(rect.origin(), view_size),
       bitmap_size,
-      base::Bind(&WebContents::OnCapturePageDone, base::Unretained(this), callback),
+      base::Bind(&WebContents::OnCapturePageDone,
+                base::Unretained(this),
+                callback),
       kBGRA_8888_SkColorType);
 }


forward port SVN commit 696980 by winterz:

fix the following bugs:
* Cannot login When using TLS
* Retrieving scripts from the server always failed with a protocol error report

svn path=/trunk/KDE/kdepim/; revision=696987

--- kioslave/sieve/sieve.cpp
+++ kioslave/sieve/sieve.cpp
@@ -355,7 +355,7 @@
 			if (retval == 1) {
 				ksDebug() << "TLS enabled successfully." << endl;
 				// reparse capabilities:
-				parseCapabilities(true);
+				parseCapabilities(false);
 			} else {
 				ksDebug() << "TLS initiation failed, code " << retval << endl;
 				disconnect(true);
@@ -625,10 +625,16 @@

 				// clear the rest of the incoming data
 				receiveData();
-			} else
+                        } else if (r.getType() == kio_sieveResponse::KEY_VAL_PAIR) {
+                              error(ERR_INTERNAL_SERVER,
+                                              i18n("The script did not upload successfully.\n"
+                                                       "This is probably due to errors in the script.\n"
+                                                       "The server responded:\n%1", QString::fromUtf8(r.getKey())));
+                        } else {
 				error(ERR_INTERNAL_SERVER,
 					i18n("The script did not upload successfully.\n"
 						"The script may contain errors."));
+                        }
 		} else
 			error(ERR_INTERNAL_SERVER,
 				i18n("The script did not upload successfully.\n"
@@ -1138,7 +1144,7 @@
 		  {
 			// expecting {quantity}
 			start = 0;
-			end = interpret.indexOf('}', start + 1);
+			end = interpret.indexOf('}', start + 1) - 1;

 			bool ok = false;
 			r.setQuantity(interpret.mid(start + 1, end - start - 1).toUInt( &ok ));


handed warnings

handed warnings

--- writerfilter/source/dmapper/GraphicImport.cxx
+++ writerfilter/source/dmapper/GraphicImport.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: GraphicImport.cxx,v $
  *
- *  $Revision: 1.4 $
+ *  $Revision: 1.5 $
  *
- *  last change: $Author: os $ $Date: 2006-11-22 14:03:57 $
+ *  last change: $Author: hbrinkm $ $Date: 2006-11-23 09:56:15 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -135,7 +135,7 @@
     static const sal_uInt8 aHeader[] =
         {0x42, 0x4d, 0xe6, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 };
     m_pBMPHeader = aHeader;
-    m_nHeaderLength = m_bBmp ? sizeof( aHeader ) / sizeof sal_uInt8 : 0;
+    m_nHeaderLength = m_bBmp ? sizeof( aHeader ) / sizeof(sal_uInt8) : 0;

 }
 /*-- 01.11.2006 13:56:20---------------------------------------------------
@@ -280,6 +280,13 @@
         ,nTopCrop (0)
         ,nRightCrop (0)
         ,nBottomCrop(0)
+        ,nWrap(0)
+        ,bContour(false)
+        ,bIgnoreWRK(true)
+        ,nContrast(0)
+        ,nBrightness(0)
+        ,fGamma( -1.0 )
+        ,eColorMode( drawing::ColorMode_STANDARD )
         ,nCurrentBorderLine(BORDER_TOP)
         ,bIsBitmap(false)
         ,bIsTiff(false)
@@ -287,14 +294,6 @@
         ,bHoriFlip(false)
         ,bVertFlip(false)
         ,bInShapeOptionMode(false)
-        ,nShapeOptionType(0)
-        ,nWrap(0)
-        ,bContour(false)
-        ,bIgnoreWRK(true)
-        ,nContrast(0)
-        ,nBrightness(0)
-        ,eColorMode( drawing::ColorMode_STANDARD )
-        ,fGamma( -1.0 )
         {}
 };
 /*-- 01.11.2006 09:42:42---------------------------------------------------
@@ -1414,9 +1413,9 @@
             {
                 if( !m_pImpl->bIsShapeImport || !nBorder )
                 {
-                    aBorderLine.Color = m_pImpl->aBorders[m_pImpl->bIsShapeImport ? BORDER_TOP : nBorder ].nLineColor;
+                    aBorderLine.Color = m_pImpl->aBorders[m_pImpl->bIsShapeImport ? BORDER_TOP : static_cast<BorderPosition>(nBorder) ].nLineColor;
                     aBorderLine.InnerLineWidth = 0;
-                    aBorderLine.OuterLineWidth = (sal_Int16)m_pImpl->aBorders[m_pImpl->bIsShapeImport ? BORDER_TOP : nBorder ].nLineWidth;
+                    aBorderLine.OuterLineWidth = (sal_Int16)m_pImpl->aBorders[m_pImpl->bIsShapeImport ? BORDER_TOP : static_cast<BorderPosition>(nBorder) ].nLineWidth;
                     aBorderLine.LineDistance = 0;
                 }
                 PropertyIds aBorderProps[4] =


Actually use the transport API if available.

--- libecasound/plugins/audioio_jack_manager.cpp
+++ libecasound/plugins/audioio_jack_manager.cpp
@@ -15,6 +15,10 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
 // ------------------------------------------------------------------------
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif

 #include <algorithm> /* std::count() */
 #include <iostream>


[libsailfishapp] Resize root object to the view size. Fixes JB#40253

As Sailfish applications are fullscreen it makes to define resize mode
accordignly. Now QtQuick UI and Sailfish Silica applications do start similarly
to the full screen.

--- src/sailfishapp.cpp
+++ src/sailfishapp.cpp
@@ -64,6 +64,7 @@

     // Add import path to allow private QML import modules in /usr/share/<name>/
     view->engine()->addImportPath(SailfishAppPriv::dataDir());
+    view->setResizeMode(QQuickView::SizeRootObjectToView);

     return view;
 }


Fix missing signal disconnect

Fix missing signal disconnect

--- libhoomd/computes_gpu/NeighborListGPUTree.cc
+++ libhoomd/computes_gpu/NeighborListGPUTree.cc
@@ -96,6 +96,8 @@
     {
     m_exec_conf->msg->notice(5) << "Destroying NeighborListGPUTree" << endl;
     m_boxchange_connection.disconnect();
+    m_max_numchange_conn.disconnect();
+    m_sort_conn.disconnect();
     }

 void NeighborListGPUTree::buildNlist(unsigned int timestep)


Crossport r978207 by tmcguire from trunk to the enterprise4 branch:

Fix the 'Mark as' filter action having a combobox that was too big vertically

svn path=/branches/kdepim/enterprise4/kdepim/; revision=979669

--- kmail/kmfilteraction.cpp
+++ kmail/kmfilteraction.cpp
@@ -1508,6 +1508,7 @@
 {
   QWidget *addressAndTemplate = new QWidget( parent );
   QHBoxLayout *hBox = new QHBoxLayout( addressAndTemplate );
+  hBox->setMargin( 0 );
   QWidget *addressEdit = KMFilterActionWithAddress::createParamWidget( addressAndTemplate );
   addressEdit->setObjectName( "addressEdit" );
   hBox->addWidget( addressEdit );


Don't nuke the whole search file but only the index when invalidating a
folder. Proposed by and discusses with Don.

svn path=/trunk/kdepim/; revision=336108

--- kmail/kmfoldersearch.cpp
+++ kmail/kmfoldersearch.cpp
@@ -1069,7 +1069,11 @@
     if (mSearch)
         mSearch->stop();

-    removeContents();
+    if (!mUnlinked) {
+        unlink(QFile::encodeName(indexLocation()));
+        mUnlinked = true;
+    }
+
     if (!isOpened()) //give up, until the user manually opens the folder
         return;


remove abuse of KShell::homeDir()

remove abuse of KShell::homeDir()

svn path=/trunk/KDE/kdepim/; revision=688537

--- kmail/templateparser.cpp
+++ kmail/templateparser.cpp
@@ -30,6 +30,7 @@
 #include <kmessagebox.h>
 #include <kshell.h>
 #include <qfileinfo.h>
+#include <qdir.h>

 #include "kmmessage.h"
 #include "kmmsgbase.h"
@@ -226,7 +227,7 @@
         QString path = KShell::tildeExpand( q );
         QFileInfo finfo( path );
         if (finfo.isRelative() ) {
-          path = KShell::homeDir( "" );
+          path = QDir::homePath();
           path += '/';
           path += q;
         }
@@ -260,7 +261,7 @@
         QString path = KShell::tildeExpand( q );
         QFileInfo finfo( path );
         if (finfo.isRelative() ) {
-          path = KShell::homeDir( "" );
+          path = QDir::homePath();
           path += '/';
           path += q;
         }


cdecl

cdecl

--- ksp_plugin/interface.hpp
+++ ksp_plugin/interface.hpp
@@ -8,11 +8,28 @@

 #if defined(DLLEXPORT)
 #error "DLLEXPORT already defined"
+#elif defined(CDECL)
+#error "CDECL already defined"
 #else
-#if defined(_WIN32)
+#if defined(_WIN32) || defined(_WIN64)
 #define DLLEXPORT __declspec(dllexport)
 #else
 #define DLLEXPORT __attribute__((visibility("default")))
+#endif
+// Architecture macros from http://goo.gl/ZypnO8.
+// We use cdecl on x86, the calling convention is unambiguous on x86-64.
+#if defined(__i386) || defined(_M_IX86)
+#if defined(_MSC_VER) || defined(__clang__)
+#define CDECL __cdecl
+#elif defined(__GNUC__) || defined(__INTEL_COMPILER)
+#define CDECL __attribute__((cdecl))
+#else
+#error "Get a real compiler"
+#endif
+#elif defined(_M_X64) || defined(__x86_64__)
+#define CDECL
+#else
+#error "Have you tried a Cray-1?"
 #endif
 #endif

@@ -37,25 +54,25 @@
 // TODO(egg): libglog should really be statically linked, what happens if two
 // plugins use glog?
 extern "C" DLLEXPORT
-void InitGoogleLogging();
+void CDECL InitGoogleLogging();

 // Exports |LOG(SEVERITY) << message| for fast logging from the C# adapter.
 // This will always evaluate its argument even if the corresponding log severity
 // is disabled, so it is less efficient than LOG(INFO). It will not report the
 // line and file of the caller.
 extern "C" DLLEXPORT
-void LogInfo(char const* message);
+void CDECL LogInfo(char const* message);
 extern "C" DLLEXPORT
-void LogWarning(char const* message);
+void CDECL LogWarning(char const* message);
 extern "C" DLLEXPORT
-void LogError(char const* message);
+void CDECL LogError(char const* message);
 extern "C" DLLEXPORT
-void LogFatal(char const* message);
+void CDECL LogFatal(char const* message);

 // Returns a pointer to a plugin constructed with the arguments given.
 // The caller takes ownership of the result.
 extern "C" DLLEXPORT
-Plugin* NewPlugin(double const initial_time,
+Plugin* CDECL NewPlugin(double const initial_time,
                   int const sun_index,
                   double const sun_gravitational_parameter,
                   double const planetarium_rotation_in_degrees);
@@ -64,12 +81,12 @@
 // |plugin| should not be null. No transfer of ownership of |*plugin|,
 // takes ownership of |**plugin|.
 extern "C" DLLEXPORT
-void DeletePlugin(Plugin const** const plugin);
+void CDECL DeletePlugin(Plugin const** const plugin);

 // Calls |plugin->InsertCelestial| with the arguments given.
 // |plugin| should not be null. No transfer of ownership.
 extern "C" DLLEXPORT
-void InsertCelestial(Plugin* const plugin,
+void CDECL InsertCelestial(Plugin* const plugin,
                      int const celestial_index,
                      double const gravitational_parameter,
                      int const parent_index,
@@ -79,54 +96,55 @@
 // Calls |plugin->UpdateCelestialHierarchy| with the arguments given.
 // |plugin| should not be null. No transfer of ownership.
 extern "C" DLLEXPORT
-void UpdateCelestialHierarchy(Plugin const* const plugin,
+void CDECL UpdateCelestialHierarchy(Plugin const* const plugin,
                               int const celestial_index,
                               int const parent_index);

 // Calls |plugin->InsertOrKeepVessel| with the arguments given.
 // |plugin| should not be null. No transfer of ownership.
 extern "C" DLLEXPORT
-void InsertOrKeepVessel(Plugin* const plugin,
-                        char const* vessel_guid,
-                        int const parent_index);
+void CDECL InsertOrKeepVessel(Plugin* const plugin,
+                              char const* vessel_guid,
+                              int const parent_index);

 // Calls |plugin->SetVesselStateOffset| with the arguments given.
 // |plugin| should not be null. No transfer of ownership.
 extern "C" DLLEXPORT
-void SetVesselStateOffset(Plugin const* const plugin,
-                          char const* vessel_guid,
-                          XYZ const from_parent_position,
-                          XYZ const from_parent_velocity);
+void CDECL SetVesselStateOffset(Plugin const* const plugin,
+                                char const* vessel_guid,
+                                XYZ const from_parent_position,
+                                XYZ const from_parent_velocity);

 // Calls |plugin->VesselDisplacementFromParent| with the arguments given.
 // |plugin| should not be null. No transfer of ownership.
 extern "C" DLLEXPORT
-XYZ VesselDisplacementFromParent(Plugin const* const plugin,
-                                 char const* vessel_guid);
+XYZ CDECL VesselDisplacementFromParent(Plugin const* const plugin,
+                                       char const* vessel_guid);

 // Calls |plugin->VesselParentRelativeVelocity| with the arguments given.
 // |plugin| should not be null. No transfer of ownership.
 extern "C" DLLEXPORT
-XYZ VesselParentRelativeVelocity(Plugin const* const plugin,
-                                 char const* vessel_guid);
+XYZ CDECL VesselParentRelativeVelocity(Plugin const* const plugin,
+                                       char const* vessel_guid);

 // Calls |plugin->CelestialDisplacementFromParent| with the arguments given.
 // |plugin| should not be null. No transfer of ownership.
 extern "C" DLLEXPORT
-XYZ CelestialDisplacementFromParent(Plugin const* const plugin,
-                                    int const celestial_index);
+XYZ CDECL CelestialDisplacementFromParent(Plugin const* const plugin,
+                                          int const celestial_index);

 // Calls |plugin->CelestialParentRelativeVelocity| with the arguments given.
 // |plugin| should not be null. No transfer of ownership.
 extern "C" DLLEXPORT
-XYZ CelestialParentRelativeVelocity(Plugin const* const plugin,
-                                    int const celestial_index);
+XYZ CDECL CelestialParentRelativeVelocity(Plugin const* const plugin,
+                                          int const celestial_index);

 // Says hello, convenient for checking that calls to the DLL work.
 extern "C" DLLEXPORT
-char const* SayHello();
+char const* CDECL SayHello();

 }  // namespace ksp_plugin
 }  // namespace principia

 #undef DLLEXPORT
+#undef CDECL


fixed memory corruption in CvEM::read() (ticket #1399)

--- modules/ml/src/em.cpp
+++ modules/ml/src/em.cpp
@@ -137,7 +137,6 @@
     clear();

     size_t data_size;
-    CvEMParams _params;
     CvSeqReader reader;
     CvFileNode* em_node = 0;
     CvFileNode* tmp_node = 0;
@@ -157,7 +156,7 @@
     CV_CALL( inv_eigen_values = (CvMat*)cvReadByName( fs, em_node, "inv_eigen_values" ));

     // Size of all the following data
-    data_size = _params.nclusters*2*sizeof(CvMat*);
+    data_size = params.nclusters*2*sizeof(CvMat*);

     CV_CALL( tmp_covs = (CvMat**)cvAlloc( data_size ));
     memset( tmp_covs, 0, data_size );


intermediate subdirs creation support added to SHCreateDirectoryEx function

--- src/NanoWinShellEx.cpp
+++ src/NanoWinShellEx.cpp
@@ -5,10 +5,16 @@

 // ShellEx functions

+#include <string.h>
+
 #include "NanoWinShellEx.h"

 #include "NanoWinError.h"
 #include "NanoWinFileSys.h"
+#include "NanoWinStrConvert.h"
+
+#define NanoWinShellExDirSepChar    ('/')
+#define NanoWinShellExDirSepAltChar ('\\')

 NW_EXTERN_C_BEGIN

@@ -19,26 +25,29 @@
             const SECURITY_ATTRIBUTES *psa
            )
 {
-  // TODO: Refine implemenation (create folders among full path)
+  try
+  {
+    return SHCreateDirectoryExA(hwnd,NanoWin::StrConverter::Convert(pszPath).c_str(),psa);
+  }
+  catch (NanoWin::StrConverter::Error)
+  {
+    SetLastError(ERROR_NO_UNICODE_TRANSLATION);

-  // Error codes: (at least): [see doc]
-  // ERROR_SUCCESS:
-  // ERROR_FILE_EXISTS:
-  // ERROR_ALREADY_EXISTS:
+    return ERROR_NO_UNICODE_TRANSLATION;
+  }
+}

-  if (hwnd != NULL) { return(NanoWinSetLastError(NW_DEFAULT_ERROR_AT_FAIL)); }
-  if (CreateDirectoryW(pszPath, const_cast<SECURITY_ATTRIBUTES*>(psa)))
+// returns either position of found char or strlen(str) if char wasn't found
+static size_t StrFindChars(const char *str, char ch, char altCh)
+{
+  const char *ptr = str;
+
+  while (*ptr != '\0' && *ptr != ch && *ptr != altCh)
   {
-    return(ERROR_SUCCESS);
+    ptr++;
   }
-  else if (GetLastError() != ERROR_SUCCESS)
-  {
-    return(GetLastError());
-  }
-  else // GetLastError() not set, but we have failed to action
-  {
-    return(NanoWinSetLastError(NW_DEFAULT_ERROR_AT_FAIL));
-  }
+
+  return (size_t)(ptr - str);
 }

 extern int SHCreateDirectoryExA
@@ -48,15 +57,84 @@
             const SECURITY_ATTRIBUTES *psa
            )
 {
-  // TODO: Refine implemenation (create folders among full path)
-
   // Error codes: (at least): [see doc]
   // ERROR_SUCCESS:
   // ERROR_FILE_EXISTS:
   // ERROR_ALREADY_EXISTS:

+  constexpr size_t PATH_MAX_LEN = (248 - 1); // according to MS documentation
+
   if (hwnd != NULL) { return(NanoWinSetLastError(NW_DEFAULT_ERROR_AT_FAIL)); }
-  if (CreateDirectoryA(pszPath, const_cast<SECURITY_ATTRIBUTES*>(psa)))
+
+  bool   ok     = true;
+  size_t sepPos = StrFindChars(pszPath,NanoWinShellExDirSepChar,NanoWinShellExDirSepAltChar);
+
+  if (pszPath[sepPos] != '\0')
+  {
+    // subdirs(or absolute path) found in path, need to check if parent dirs need to be created
+
+    char subPath[PATH_MAX_LEN + 1];
+
+    if (sepPos < PATH_MAX_LEN)
+    {
+      memcpy(subPath,pszPath,sepPos);
+
+      subPath[sepPos] = NanoWinShellExDirSepChar;
+      subPath[++sepPos]   = '\0';
+
+      size_t startPos = 0;
+      bool   pathExists = false;
+
+      // sepPos points to the char after separator
+      // subPath contains current path prefix with trailing path separator (if any)
+      do
+      {
+        pathExists = PathFileExistsA(subPath);
+
+        if (!pathExists)
+        {
+          ok = CreateDirectoryA(subPath, const_cast<SECURITY_ATTRIBUTES*>(psa));
+        }
+
+        if (ok)
+        {
+          startPos = sepPos;
+
+          if (pszPath[startPos] != '\0')
+          {
+            sepPos += StrFindChars(&pszPath[startPos],NanoWinShellExDirSepChar,NanoWinShellExDirSepAltChar);
+
+            memcpy(&subPath[startPos],&pszPath[startPos],sepPos - startPos + 1);
+
+            if (subPath[sepPos] != '\0')
+            {
+              subPath[sepPos]   = NanoWinShellExDirSepChar;
+              subPath[++sepPos] = '\0';
+            }
+          }
+        }
+      } while (ok && pszPath[startPos] != '\0');
+
+      if (ok && pathExists)
+      {
+        ok = false; SetLastError(ERROR_ALREADY_EXISTS);
+      }
+    }
+    else
+    {
+      ok = false;
+
+      SetLastError(ERROR_FILENAME_EXCED_RANGE);
+    }
+  }
+  else
+  {
+    // no subdirs found in path, just create directory
+
+    ok = CreateDirectoryA(pszPath, const_cast<SECURITY_ATTRIBUTES*>(psa));
+  }
+
+  if (ok)
   {
     return(ERROR_SUCCESS);
   }


removed useless forward declaration

removed useless forward declaration

--- test/test_impedance_spectroscopy.cc
+++ test/test_impedance_spectroscopy.cc
@@ -15,11 +15,6 @@

 namespace cap {
-
-std::complex<double>
-measure_impedance(std::shared_ptr<cap::EnergyStorageDevice> dev, std::shared_ptr<boost::property_tree::ptree const> database);
-
-

 std::complex<double>
 measure_impedance(std::shared_ptr<cap::EnergyStorageDevice> dev, std::shared_ptr<boost::property_tree::ptree const> database)


fixed typo

fixed typo

git-svn-id: c39a6fcb73c71bf990fd9353909696546eb40440@5756 a83610d8-ad2a-0410-a6ab-fc0612d85776


client_test now works on linux again.

client_test now works on linux again.

--- examples/client_test.cpp
+++ examples/client_test.cpp
@@ -54,6 +54,49 @@
 	return false;
 };

+#else
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <termios.h>
+#include <string.h>
+
+struct set_keypress
+{
+	set_keypress()
+	{
+		termios new_settings;
+		tcgetattr(0,&stored_settings);
+		new_settings = stored_settings;
+		// Disable canonical mode, and set buffer size to 1 byte
+		new_settings.c_lflag &= (~ICANON);
+		new_settings.c_cc[VTIME] = 0;
+		new_settings.c_cc[VMIN] = 1;
+		tcsetattr(0,TCSANOW,&new_settings);
+	}
+	~set_keypress() { tcsetattr(0,TCSANOW,&stored_settings); }
+	termios stored_settings;
+};
+
+bool sleep_and_input(char* c)
+{
+	// sets the terminal to single-character mode
+	// and resets when destructed
+	set_keypress s;
+
+	fd_set set;
+	FD_ZERO(&set);
+	FD_SET(0, &set);
+	timeval tv = {1, 0};
+	if (select(1, &set, 0, 0, &tv) > 0)
+	{
+		*c = getc(stdin);
+		return true;
+	}
+	return false;
+}
+
 #endif

 std::string add_suffix(float val)


fix client_test bug introduced by recent patch

--- examples/client_test.cpp
+++ examples/client_test.cpp
@@ -605,6 +605,18 @@
 		"/-_!.~*()ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
 		"0123456789";

+	// make sure the path is an absolute path
+#ifdef TORRENT_WINDOWS
+	if (f[1] != ':')
+#else
+	if (f[0] != '/')
+#endif
+	{
+		char cwd[TORRENT_MAX_PATH];
+		getcwd(cwd, sizeof(cwd));
+		f = path_append(cwd, f);
+	}
+
 	for (int i = 0; i < f.size(); ++i)
 	{
 #ifdef TORRENT_WINDOWS
@@ -619,7 +631,7 @@
 			ret.push_back(hex_chars[f[i] & 0xf]);
 		}
 	}
-	return f;
+	return ret;
 }

 // monitored_dir is true if this torrent is added because


reverted unintentional change

reverted unintentional change

git-svn-id: 6ed3528c1be4534134272ad6dd050eeaa1f628d3@3965 f43f7eb3-cfe1-5f9d-1b5f-e45aa6702bda

--- examples/client_test.cpp
+++ examples/client_test.cpp
@@ -770,7 +770,7 @@
 	// be able to remove torrents that were added via the directory
 	// monitor when they're not in the directory anymore.
 	handles_t handles;
-	session ses(fingerprint("LT", LIBTORRENT_VERSION_MAJOR, LIBTORRENT_VERSION_MINOR-1, 0, 0)
+	session ses(fingerprint("LT", LIBTORRENT_VERSION_MAJOR, LIBTORRENT_VERSION_MINOR, 0, 0)
 		, session::add_default_plugins
 		, alert::all_categories
 			& ~(alert::dht_notification


no message

no message

git-svn-id: 6ed3528c1be4534134272ad6dd050eeaa1f628d3@470 f43f7eb3-cfe1-5f9d-1b5f-e45aa6702bda

--- examples/client_test.cpp
+++ examples/client_test.cpp
@@ -376,12 +376,7 @@
 				handles.back().set_max_connections(100);
 				handles.back().set_max_uploads(-1);
 				handles.back().set_ratio(1.02f);
-/*
-				for (int i = 0; i < t.num_pieces(); ++i)
-				{
-					handles.back().filter_piece(i, i % 2 == 0);
-				}
-*/
+
 			}
 			catch (std::exception& e)
 			{


INTEGRATION: CWS iconswitching1 (1.41.10); FILE MERGED 2005/11/30 14:54:37 kendy 1.41.10.3: RESYNC: (1.42-1.43); FILE MERGED 2005/11/02 00:07:41 kendy 1.41.10.2: RESYNC: (1.41-1.42); FILE MERGED 2005/07/20 14:29:03 kendy 1.41.10.1: #i36518# Icon switching for the help

--- xmlhelp/source/cxxhelp/provider/databases.cxx
+++ xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: databases.cxx,v $
  *
- *  $Revision: 1.43 $
+ *  $Revision: 1.44 $
  *
- *  last change: $Author: rt $ $Date: 2005-11-11 12:16:51 $
+ *  last change: $Author: kz $ $Date: 2006-01-05 18:17:52 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -63,6 +63,9 @@
 #ifndef _RTL_USTRBUF_HXX_
 #include <rtl/ustrbuf.hxx>
 #endif
+#ifndef INCLUDED_SVTOOLS_MISCOPT_HXX
+#include <svtools/miscopt.hxx>
+#endif
 #include "inputstream.hxx"
 #include <algorithm>

@@ -77,7 +80,7 @@

 Databases::Databases( sal_Bool showBasic,
                       const rtl::OUString& instPath,
-                      const rtl::OUString& imageZip,
+                      const com::sun::star::uno::Sequence< rtl::OUString >& imagesZipPaths,
                       const rtl::OUString& productName,
                       const rtl::OUString& productVersion,
                       const rtl::OUString& vendorName,
@@ -92,12 +95,9 @@
       m_nCustomCSSDocLength( 0 ),
       m_pCustomCSSDoc( 0 ),
       m_aCSS(styleSheet.toAsciiLowerCase()),
-      m_aImagesZipFileURL(rtl::OUStringToOString(
-                              rtl::Uri::encode(
-                                  imageZip,
-                                  rtl_UriCharClassPchar,
-                                  rtl_UriEncodeIgnoreEscapes,
-                                  RTL_TEXTENCODING_UTF8 ),RTL_TEXTENCODING_UTF8)),
+      m_aImagesZipPaths( imagesZipPaths ),
+      m_aImagesZipFileURL(),
+      m_nSymbolsStyle( 0 ),
       newProdName(rtl::OUString::createFromAscii( "$[officename]" ) ),
       newProdVersion(rtl::OUString::createFromAscii( "$[officeversion]" ) ),
       prodName( rtl::OUString::createFromAscii( "%PRODUCTNAME" ) ),
@@ -174,9 +174,66 @@

 }

+static bool impl_getZipFile(
+        Sequence< rtl::OUString > & rImagesZipPaths,
+        const rtl::OUString & rZipName,
+        rtl::OUString & rFileName )
+{
+    const rtl::OUString *pPathArray = rImagesZipPaths.getArray();
+    for ( int i = 0; i < rImagesZipPaths.getLength(); ++i )
+    {
+        rFileName = pPathArray[ i ];
+        if ( rFileName.getLength() )
+        {
+            if ( 1 + rFileName.lastIndexOf( '/' ) != rFileName.getLength() )
+            {
+                rFileName += rtl::OUString::createFromAscii( "/" );
+            }
+            rFileName += rZipName;
+
+            // test existence
+            osl::DirectoryItem aDirItem;
+            if ( osl::DirectoryItem::get( rFileName, aDirItem ) == osl::FileBase::E_None )
+                return true;
+        }
+    }
+    return false;
+}

 rtl::OString Databases::getImagesZipFileURL()
 {
+    sal_Int16 nSymbolsStyle = SvtMiscOptions().GetCurrentSymbolsStyle();
+    if ( !m_aImagesZipFileURL.getLength() || ( m_nSymbolsStyle != nSymbolsStyle ) )
+    {
+        m_nSymbolsStyle = nSymbolsStyle;
+
+        rtl::OUString aImageZip;
+        rtl::OUString aSymbolsStyleName = SvtMiscOptions().GetCurrentSymbolsStyleName();
+        bool bFound = false;
+
+        if ( aSymbolsStyleName.getLength() != 0 )
+        {
+            rtl::OUString aZipName = rtl::OUString::createFromAscii( "images_" );
+            aZipName += aSymbolsStyleName;
+            aZipName += rtl::OUString::createFromAscii( ".zip" );
+
+            bFound = impl_getZipFile( m_aImagesZipPaths, aZipName, aImageZip );
+        }
+
+        if ( ! bFound )
+            bFound = impl_getZipFile( m_aImagesZipPaths, rtl::OUString::createFromAscii( "images.zip" ), aImageZip );
+
+        if ( ! bFound )
+            aImageZip = rtl::OUString();
+
+        m_aImagesZipFileURL = rtl::OUStringToOString(
+                    rtl::Uri::encode(
+                        aImageZip,
+                        rtl_UriCharClassPchar,
+                        rtl_UriEncodeIgnoreEscapes,
+                        RTL_TEXTENCODING_UTF8 ), RTL_TEXTENCODING_UTF8 );
+    }
+
     return m_aImagesZipFileURL;
 }


Make test_threads more generic

Make test_threads more generic

--- msvc/projects/vc2015/test_threads/test_threads.cpp
+++ msvc/projects/vc2015/test_threads/test_threads.cpp
@@ -10,88 +10,77 @@
 #include <vector>
 #include <stdio.h>
 #include <jemalloc/jemalloc.h>
-#include <windows.h>

 using std::vector;
 using std::thread;
 using std::uniform_int_distribution;
 using std::minstd_rand;

-#if NDEBUG && JEMALLOC_ISSUE_318_WORKAROUND
-extern "C" JEMALLOC_EXPORT void _malloc_thread_cleanup(void);
-
-static thread_local struct JeMallocThreadHelper {
-	~JeMallocThreadHelper() {
-		_malloc_thread_cleanup();
-	}
-} tls_jemallocThreadHelper;
-#endif
-
 int test_threads()
 {
-	je_malloc_conf = "narenas:3";
-	int narenas = 0;
-	size_t sz = sizeof(narenas);
-	je_mallctl("opt.narenas", &narenas, &sz, NULL, 0);
-	if (narenas != 3) {
-		printf("Error: unexpected number of arenas: %d\n", narenas);
-		return 1;
-	}
-	static const int sizes[] = { 7, 16, 32, 60, 91, 100, 120, 144, 169, 199, 255, 400, 670, 900, 917, 1025, 3333, 5190, 13131, 49192, 99999, 123123, 255265, 2333111 };
-	static const int numSizes = (int)(sizeof(sizes) / sizeof(sizes[0]));
-	vector<thread> workers;
-	static const int numThreads = narenas + 1, numAllocsMax = 25, numIter1 = 50, numIter2 = 50;
-	je_malloc_stats_print(NULL, NULL, NULL);
+  je_malloc_conf = "narenas:3";
+  int narenas = 0;
+  size_t sz = sizeof(narenas);
+  je_mallctl("opt.narenas", &narenas, &sz, NULL, 0);
+  if (narenas != 3) {
+    printf("Error: unexpected number of arenas: %d\n", narenas);
+    return 1;
+  }
+  static const int sizes[] = { 7, 16, 32, 60, 91, 100, 120, 144, 169, 199, 255, 400, 670, 900, 917, 1025, 3333, 5190, 13131, 49192, 99999, 123123, 255265, 2333111 };
+  static const int numSizes = (int)(sizeof(sizes) / sizeof(sizes[0]));
+  vector<thread> workers;
+  static const int numThreads = narenas + 1, numAllocsMax = 25, numIter1 = 50, numIter2 = 50;
+  je_malloc_stats_print(NULL, NULL, NULL);
   size_t allocated1;
   size_t sz1 = sizeof(allocated1);
   je_mallctl("stats.active", &allocated1, &sz1, NULL, 0);
   printf("\nPress Enter to start threads...\n");
-	getchar();
-	printf("Starting %d threads x %d x %d iterations...\n", numThreads, numIter1, numIter2);
-	for (int i = 0; i < numThreads; i++) {
-		workers.emplace_back([tid=i]() {
-			uniform_int_distribution<int> sizeDist(0, numSizes - 1);
-			minstd_rand rnd(tid * 17);
-			uint8_t* ptrs[numAllocsMax];
-			int ptrsz[numAllocsMax];
-			for (int i = 0; i < numIter1; ++i) {
-				thread t([&]() {
-					for (int i = 0; i < numIter2; ++i) {
-						const int numAllocs = numAllocsMax - sizeDist(rnd);
-						for (int j = 0; j < numAllocs; j += 64) {
-							const int x = sizeDist(rnd);
-							const int sz = sizes[x];
-							ptrsz[j] = sz;
-							ptrs[j] = (uint8_t*)je_malloc(sz);
-							if (!ptrs[j]) {
-								printf("Unable to allocate %d bytes in thread %d, iter %d, alloc %d. %d\n", sz, tid, i, j, x);
-								exit(1);
-							}
-							for (int k = 0; k < sz; k++)
-								ptrs[j][k] = tid + k;
-						}
-						for (int j = 0; j < numAllocs; j += 64) {
-							for (int k = 0, sz = ptrsz[j]; k < sz; k++)
-								if (ptrs[j][k] != (uint8_t)(tid + k)) {
-									printf("Memory error in thread %d, iter %d, alloc %d @ %d : %02X!=%02X\n", tid, i, j, k, ptrs[j][k], (uint8_t)(tid + k));
-									exit(1);
-								}
-							je_free(ptrs[j]);
-						}
-					}
-				});
-				t.join();
-			}
-		});
-	}
-	for (thread& t : workers) {
-		t.join();
-	}
+  getchar();
+  printf("Starting %d threads x %d x %d iterations...\n", numThreads, numIter1, numIter2);
+  for (int i = 0; i < numThreads; i++) {
+    workers.emplace_back([tid=i]() {
+      uniform_int_distribution<int> sizeDist(0, numSizes - 1);
+      minstd_rand rnd(tid * 17);
+      uint8_t* ptrs[numAllocsMax];
+      int ptrsz[numAllocsMax];
+      for (int i = 0; i < numIter1; ++i) {
+        thread t([&]() {
+          for (int i = 0; i < numIter2; ++i) {
+            const int numAllocs = numAllocsMax - sizeDist(rnd);
+            for (int j = 0; j < numAllocs; j += 64) {
+              const int x = sizeDist(rnd);
+              const int sz = sizes[x];
+              ptrsz[j] = sz;
+              ptrs[j] = (uint8_t*)je_malloc(sz);
+              if (!ptrs[j]) {
+                printf("Unable to allocate %d bytes in thread %d, iter %d, alloc %d. %d\n", sz, tid, i, j, x);
+                exit(1);
+              }
+              for (int k = 0; k < sz; k++)
+                ptrs[j][k] = tid + k;
+            }
+            for (int j = 0; j < numAllocs; j += 64) {
+              for (int k = 0, sz = ptrsz[j]; k < sz; k++)
+                if (ptrs[j][k] != (uint8_t)(tid + k)) {
+                  printf("Memory error in thread %d, iter %d, alloc %d @ %d : %02X!=%02X\n", tid, i, j, k, ptrs[j][k], (uint8_t)(tid + k));
+                  exit(1);
+                }
+              je_free(ptrs[j]);
+            }
+          }
+        });
+        t.join();
+      }
+    });
+  }
+  for (thread& t : workers) {
+    t.join();
+  }
   je_malloc_stats_print(NULL, NULL, NULL);
   size_t allocated2;
   je_mallctl("stats.active", &allocated2, &sz1, NULL, 0);
   size_t leaked = allocated2 - allocated1;
-  printf("\nDone. Leaked: %Id bytes\n", leaked);
+  printf("\nDone. Leaked: %zd bytes\n", leaked);
   bool failed = leaked > 65536; // in case C++ runtime allocated something (e.g. iostream locale or facet)
   printf("\nTest %s!\n", (failed ? "FAILED" : "successful"));
   printf("\nPress Enter to continue...\n");


Chests don't open if obstructed

Chests don't open if obstructed

* Fixes FS383

--- src/BlockEntities/ChestEntity.cpp
+++ src/BlockEntities/ChestEntity.cpp
@@ -122,6 +122,13 @@

 void cChestEntity::OpenNewWindow(void)
 {
+	// TODO: cats are an obstruction
+	if ((GetPosY() + 1 < cChunkDef::Height) && cBlockInfo::IsSolid(GetWorld()->GetBlock(GetPosX(), GetPosY() + 1, GetPosZ())))
+	{
+		// Obstruction, don't open
+		return;
+	}
+
 	// Callback for opening together with neighbor chest:
 	class cOpenDouble :
 		public cChestCallback
@@ -135,6 +142,12 @@

 		virtual bool Item(cChestEntity * a_Chest) override
 		{
+			if ((a_Chest->GetPosY() + 1 < cChunkDef::Height) && cBlockInfo::IsSolid(a_Chest->GetWorld()->GetBlock(a_Chest->GetPosX(), a_Chest->GetPosY() + 1, a_Chest->GetPosZ())))
+			{
+				// Obstruction, don't open
+				return false;
+			}
+
 			// The primary chest should eb the one with lesser X or Z coord:
 			cChestEntity * Primary = a_Chest;
 			cChestEntity * Secondary = m_ThisChest;


Fix for issue #390: object.GetHashCode not working (#852)

I've improved the GetHashCode method and return the CRC32 of the heap block address if the instance has no fields.

Signed-off-by: Matthias Jentsch <59bd0a3ff43b32849b319e645d4798d8a5d1e889@matthias-jentsch.de>

--- src/CLR/Core/CLR_RT_HeapBlock.cpp
+++ src/CLR/Core/CLR_RT_HeapBlock.cpp
@@ -967,9 +967,16 @@
             CLR_RT_TypeDef_Instance cls; cls.InitializeFromIndex( ptr->ObjectCls() );
             int                    totFields = cls.CrossReference().m_totalFields;

-            while(totFields-- > 0)
-            {
-                crc = GetHashCode( ++ptr, false, crc );
+            if (totFields > 0)
+            {
+                while(totFields-- > 0)
+                {
+                    crc = GetHashCode( ++ptr, false, crc );
+                }
+            }
+            else
+            {
+                crc = SUPPORT_ComputeCRC( &ptr, sizeof(ptr), crc );
             }
         }
         break;


INTEGRATION: CWS sdksample (1.9.40); FILE MERGED 2005/01/12 15:17:56 jsc 1.9.40.3: #i39890# change to new OpenDocument format 2004/07/21 16:17:16 jsc 1.9.40.2: #i29308# take care of full qualified path 2004/07/21 14:28:17 jsc 1.9.40.1: #i29308# take care of full qualified path

--- odk/examples/cpp/DocumentLoader/DocumentLoader.cxx
+++ odk/examples/cpp/DocumentLoader/DocumentLoader.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: DocumentLoader.cxx,v $
  *
- *  $Revision: 1.9 $
+ *  $Revision: 1.10 $
  *
- *  last change: $Author: hr $ $Date: 2004-02-02 20:07:32 $
+ *  last change: $Author: rt $ $Date: 2005-01-31 17:02:04 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  the BSD license.
@@ -46,6 +46,7 @@
  *****************************************************************************
  *****************************************************************************/
 #include <stdio.h>
+#include <wchar.h>

 #include <cppuhelper/bootstrap.hxx>

@@ -74,14 +75,13 @@
      if (argc < 2)
     {
         printf("using: DocumentLoader <file_url> [<uno_connection_url>]\n\n"
-               "example: DocumentLoader  \"file:///e:/temp/test.sxw\" \"uno:socket,host=localhost,port=2083;urp;StarOffice.ServiceManager\"\n");
+               "example: DocumentLoader  \"file:///e:/temp/test.odt\" \"uno:socket,host=localhost,port=2083;urp;StarOffice.ServiceManager\"\n");
         exit(1);
     }
      if (argc == 3)
     {
         sConnectionString = OUString::createFromAscii(argv[2]);
     }
-

     // Creates a simple registry service instance.
     Reference< XSimpleRegistry > xSimpleRegistry(
@@ -101,28 +101,6 @@
     */
     Reference< XComponentContext > xComponentContext(
         ::cppu::bootstrap_InitialComponentContext( xSimpleRegistry ) );
-
-    /* Bootstraps an initial component context with service manager upon default
-       types and services registry. This includes insertion of initial services:
-       - (registry) service manager, shared lib loader,
-       - simple registry, nested registry,
-       - implementation registration
-       - registry typedescription provider, typedescription manager (also
-         installs it into cppu core)
-
-       This function tries to find its parameters via these bootstrap variables:
-       - UNO_TYPES        -- a space separated list of file urls of type rdbs
-       - UNO_SERVICES     -- a space separated list of file urls of service rdbs
-       - UNO_WRITERDB     -- a file url of a write rdb (e.g. user.rdb)
-
-       For further info, please look at:
-       http://udk.openoffice.org/common/man/concept/uno_default_bootstrapping.html
-    */
-    /*
-    Reference< XComponentContext > xComponentContext(
-        ::cppu::defaultBootstrap_InitialComponentContext() );
-    OSL_ASSERT( xcomponentcontext.is() );
-    */

     /* Gets the service manager instance to be used (or null). This method has
        been added for convenience, because the service manager is a often used
@@ -174,12 +152,13 @@
     /* Loads a component specified by an URL into the specified new or existing
        frame.
     */
-    OUString sDocUrl, sWorkingDir;
+    OUString sAbsoluteDocUrl, sWorkingDir, sDocPathUrl;
     osl_getProcessWorkingDir(&sWorkingDir.pData);
-    osl::FileBase::getAbsoluteFileURL( sWorkingDir, OUString::createFromAscii(argv[1]), sDocUrl);
+    osl::FileBase::getFileURLFromSystemPath( OUString::createFromAscii(argv[1]), sDocPathUrl);
+    osl::FileBase::getAbsoluteFileURL( sWorkingDir, sDocPathUrl, sAbsoluteDocUrl);

     Reference< XComponent > xComponent = xComponentLoader->loadComponentFromURL(
-        sDocUrl, OUString( RTL_CONSTASCII_USTRINGPARAM("_blank") ), 0,
+        sAbsoluteDocUrl, OUString( RTL_CONSTASCII_USTRINGPARAM("_blank") ), 0,
         Sequence < ::com::sun::star::beans::PropertyValue >() );

     // dispose the local service manager


Using old constructor syntax.

Using old constructor syntax.

--- src/ResourceLoader.cpp
+++ src/ResourceLoader.cpp
@@ -22,5 +22,5 @@
     LPVOID dataFirstByte = ::LockResource(resourceData);
     DWORD dataSize = ::SizeofResource(moduleHandle, resourceHandle);

-    return {static_cast<const char*>(dataFirstByte), dataSize};
+    return std::string(static_cast<const char*>(dataFirstByte), dataSize);
 }


SDLAudioDriver: fix invalid filestream access after shutdown and signed/unsigned mismatch warning

--- src/SDLAudioDriver.cpp
+++ src/SDLAudioDriver.cpp
@@ -97,10 +97,9 @@
     }

     void Shutdown() {
-        m_rawAudioOutputFS.Close();
-
         SDL_CloseAudioDevice(m_audioDeviceID);
         SDL_QuitSubSystem(SDL_INIT_AUDIO);
+        m_rawAudioOutputFS.Close();
     }

     void Update(double /*frameTime*/) {
@@ -200,7 +199,7 @@
         }

         if constexpr (OutputRawAudioFileStream.Enabled && !OutputRawAudioFileStream.SourceSamples) {
-            for (int i = 0; i < numSamplesToRead; ++i) {
+            for (size_t i = 0; i < numSamplesToRead; ++i) {
                 audioDriver->m_rawAudioOutputFS.WriteValue(stream[i]);
             }
         }


llvm, C++ readability-redundant-pp: add actual functionality

--- llvm/libtooling/readability-redundant-pp.cxx
+++ llvm/libtooling/readability-redundant-pp.cxx
@@ -1,4 +1,5 @@
 #include <iostream>
+#include <stack>

 #include <clang/Frontend/CompilerInstance.h>
 #include <clang/Frontend/FrontendActions.h>
@@ -9,6 +10,12 @@
 namespace
 {

+struct Entry
+{
+    clang::SourceLocation m_aLoc;
+    std::string m_aMacroName;
+};
+
 class RedundantPPCallbacks : public clang::PPCallbacks
 {
   public:
@@ -17,9 +24,17 @@
                 const clang::MacroDefinition& rMacroDefinition) override;
     void Endif(clang::SourceLocation aLoc,
                clang::SourceLocation aIfLoc) override;
+    ~RedundantPPCallbacks() override;

   private:
+    clang::DiagnosticBuilder reportWarning(llvm::StringRef aString,
+                                           clang::SourceLocation aLocation);
+    clang::DiagnosticBuilder report(clang::DiagnosticIDs::Level eLevel,
+                                    llvm::StringRef aString,
+                                    clang::SourceLocation aLocation);
+
     clang::Preprocessor& m_rPP;
+    std::vector<Entry> m_aStack;
 };

 RedundantPPCallbacks::RedundantPPCallbacks(clang::Preprocessor& rPP)
@@ -27,24 +42,62 @@
 {
 }

+RedundantPPCallbacks::~RedundantPPCallbacks() {}
+
 void RedundantPPCallbacks::Ifndef(
     clang::SourceLocation aLoc, const clang::Token& rMacroNameTok,
     const clang::MacroDefinition& /*rMacroDefinition*/)
 {
-    std::cerr << "debug, RedundantPPCallbacks::Ifndef: aLoc is ";
-    aLoc.dump(m_rPP.getSourceManager());
-    std::cerr << ", rMacroNameTok is '" << m_rPP.getSpelling(rMacroNameTok)
-              << "'" << std::endl;
+    if (m_rPP.getSourceManager().isInMainFile(aLoc))
+    {
+        std::string aMacroName = m_rPP.getSpelling(rMacroNameTok);
+        for (const auto& rEntry : m_aStack)
+        {
+            if (rEntry.m_aMacroName == aMacroName)
+            {
+                reportWarning("nested ifdef", aLoc);
+                report(clang::DiagnosticIDs::Note, "previous ifdef",
+                       rEntry.m_aLoc);
+            }
+        }
+    }
+
+    Entry aEntry;
+    aEntry.m_aLoc = aLoc;
+    aEntry.m_aMacroName = m_rPP.getSpelling(rMacroNameTok);
+    m_aStack.push_back(aEntry);
 }

-void RedundantPPCallbacks::Endif(clang::SourceLocation aLoc,
+void RedundantPPCallbacks::Endif(clang::SourceLocation /*aLoc*/,
                                  clang::SourceLocation aIfLoc)
 {
-    std::cerr << "debug, RedundantPPCallbacks::Endif: aLoc is ";
-    aLoc.dump(m_rPP.getSourceManager());
-    std::cerr << ", IfLoc is ";
-    aIfLoc.dump(m_rPP.getSourceManager());
-    std::cerr << std::endl;
+    if (m_aStack.empty())
+        return;
+
+    if (aIfLoc == m_aStack.back().m_aLoc)
+        m_aStack.pop_back();
+}
+
+clang::DiagnosticBuilder
+RedundantPPCallbacks::reportWarning(llvm::StringRef aString,
+                                    clang::SourceLocation aLocation)
+{
+    clang::DiagnosticsEngine& rEngine = m_rPP.getDiagnostics();
+    clang::DiagnosticIDs::Level eLevel = clang::DiagnosticIDs::Level::Warning;
+    if (rEngine.getWarningsAsErrors())
+        eLevel = clang::DiagnosticIDs::Level::Error;
+    return report(eLevel, aString, aLocation);
+}
+
+clang::DiagnosticBuilder
+RedundantPPCallbacks::report(clang::DiagnosticIDs::Level eLevel,
+                             llvm::StringRef aString,
+                             clang::SourceLocation aLocation)
+{
+    clang::DiagnosticsEngine& rEngine = m_rPP.getDiagnostics();
+    return rEngine.Report(
+        aLocation,
+        rEngine.getDiagnosticIDs()->getCustomDiagID(eLevel, aString));
 }

 class RedundantPPConsumer : public clang::ASTConsumer


add warnings for timeouts

add warnings for timeouts

--- Code/PgSQL/rdkit/adapter.cpp
+++ Code/PgSQL/rdkit/adapter.cpp
@@ -1980,6 +1980,8 @@
     try {
         MCSResult res = RDKit::findMCS(molecules, &p);
         mcs = res.SmartsString;
+        if(!res.isCompleted())
+          ereport(WARNING, (errcode(ERRCODE_WARNING), errmsg("findMCS timed out, result is not maximal")));
     } catch (...) {
         ereport(WARNING, (errcode(ERRCODE_WARNING), errmsg("findMCS: failed")));
         mcs.clear();
@@ -2033,6 +2035,8 @@

     try {
         MCSResult res = RDKit::findMCS(*molecules, &p);
+        if(!res.isCompleted())
+          ereport(WARNING, (errcode(ERRCODE_WARNING), errmsg("findMCS timed out, result is not maximal")));
         mcs = res.SmartsString;
     } catch (...) {
         ereport(WARNING, (errcode(ERRCODE_WARNING), errmsg("findMCS: failed")));


update molcmp to do more of a real equality check; speedup is_valid_smiles()

--- Code/PgSQL/rdkit/adapter.cpp
+++ Code/PgSQL/rdkit/adapter.cpp
@@ -158,11 +158,16 @@

 extern "C" bool
 isValidSmiles(char *data) {
-  ROMol   *mol = NULL;
+  RWMol   *mol = NULL;
   bool res;
   try {
     StringData.assign(data);
-    mol = SmilesToMol(StringData);
+    mol = SmilesToMol(StringData,0,0);
+    MolOps::cleanUp(*mol);
+    mol->updatePropertyCache();
+    MolOps::Kekulize(*mol);
+    MolOps::assignRadicals(*mol);
+    MolOps::setAromaticity(*mol);
   } catch (...) {
     mol=NULL;
   }
@@ -229,6 +234,36 @@
 	}

 	return ret;
+}
+
+extern "C" int
+molcmp(CROMol i, CROMol a) {
+  ROMol *im = (ROMol*)i;
+  ROMol *am = (ROMol*)a;
+
+  if(!im){
+    if(!am) return 0;
+    return -1;
+  } if(!am) return 1;
+
+  int res=im->getNumAtoms()-am->getNumAtoms();
+  if(res) return res;
+
+  res=im->getNumBonds()-am->getNumBonds();
+  if(res) return res;
+
+  res=int(RDKit::Descriptors::CalcAMW(*im,false))-
+    int(RDKit::Descriptors::CalcAMW(*am,false));
+  if(res) return res;
+
+  res=im->getRingInfo()->numRings()-am->getRingInfo()->numRings();
+  if(res) return res;
+
+  RDKit::MatchVectType matchVect;
+  if(RDKit::SubstructMatch(*im,*am,matchVect)){
+    return 0;
+  }
+  return -1;
 }

 extern "C" int


Removendo delay para animação do personagem ao retirar overlay

--- MasmorraDados/Classes/scene/GameplayScene.cpp
+++ MasmorraDados/Classes/scene/GameplayScene.cpp
@@ -252,7 +252,6 @@
   auto overlayLayer = this->getObjectsLayer()->getChildByTag(OVERLAY_LAYER_TAG);

   auto fadeOut = FadeOut::create(OVERLAY_DURATION);
-  auto delayToFinishCharacterAnimation = DelayTime::create(RETURN_CHARACTER_DURATION);
   auto changeLayer = CallFunc::create([=]() {
     for (auto node : this->getInteractableNodes()) {
       auto oldZOrder = node->getLocalZOrder() - OVERLAY_Z_ORDER;
@@ -264,8 +263,7 @@
     this->_enableInteractions();
   });

-  overlayLayer->runAction(Sequence::create(fadeOut, delayToFinishCharacterAnimation,
-                                      changeLayer, removeSelf, animationEnded, NULL));
+  overlayLayer->runAction(Sequence::create(fadeOut, changeLayer, removeSelf, animationEnded, NULL));
 }

 Vec2 GameplayScene::_centerOfScene() {


STYLE: itkFixedArray.hxx using std::equal, and C++11 fill_n and copy_n

Replaced handwritten loops from `Begin()` to `End()` by calls to
`std::equal`, and C++11 `std::fill_n` and `std::copy_n`.

Aims to ease maintenance and increase code readability.

--- Modules/Core/Common/include/itkFixedArray.hxx
+++ Modules/Core/Common/include/itkFixedArray.hxx
@@ -29,10 +29,7 @@
 FixedArray< TValue, VLength >
 ::FixedArray(const ValueType & r)
 {
-  for ( Iterator i = Begin(); i != End(); ++i )
-    {
-    *i = r;
-    }
+  std::fill_n(m_InternalArray, VLength, r);
 }

 /**
@@ -44,13 +41,7 @@
 FixedArray< TValue, VLength >
 ::FixedArray(const ValueType r[VLength])
 {
-  ConstIterator input = r;
-  Iterator      i = this->Begin();
-
-  while ( i != this->End() )
-    {
-    *i++ = *input++;
-    }
+  std::copy_n(r, VLength, m_InternalArray);
 }

 /**
@@ -65,12 +56,7 @@
 {
   if ( r != m_InternalArray )
     {
-    ConstIterator input = r;
-    Iterator      i = this->Begin();
-    while ( i != this->End() )
-      {
-      *i++ = *input++;
-      }
+    std::copy_n(r, VLength, m_InternalArray);
     }
   return *this;
 }
@@ -83,23 +69,7 @@
 FixedArray< TValue, VLength >
 ::operator==(const FixedArray & r) const
 {
-  ConstIterator i = this->Begin();
-  ConstIterator j = r.Begin();
-
-  while ( i != this->End() )
-    {
-CLANG_PRAGMA_PUSH
-CLANG_SUPPRESS_Wfloat_equal
-    if ( *i != *j )
-CLANG_PRAGMA_POP
-      {
-      return false;
-      }
-    ++j;
-    ++i;
-    }
-
-  return true;
+  return std::equal(m_InternalArray, m_InternalArray + VLength, r.m_InternalArray);
 }

 /**
@@ -213,12 +183,7 @@
 FixedArray< TValue, VLength >
 ::Fill(const ValueType & value)
 {
-  Iterator i = this->Begin();
-
-  while ( i != this->End() )
-    {
-    *i++ = value;
-    }
+  std::fill_n(m_InternalArray, VLength, value);
 }

 /**


BUG: itkTestDriver should only print usage once

The usage was being printed twice for the itkTestDriver
executable. The other module test drivers were ok. This patch has been
manually verified to preserve the correct behavior or both types of
drivers.

Change-Id: I0f43fa627878058ee104d42fce61849758836f28

--- Modules/Core/TestKernel/src/itkTestDriver.cxx
+++ Modules/Core/TestKernel/src/itkTestDriver.cxx
@@ -268,6 +268,13 @@

   result = ProcessArguments(&ac, &av, &po);

+  if( result )
+    {
+    // There was a problem parsing the arguments, so usage has already
+    // been printed, just return
+    return 1;
+    }
+
   if ( po.externalProcessMustBeCalled && po.args.empty() )
     {
     usage();


주석 추가. 일부 코드 리팩토링

주석 추가. 일부 코드 리팩토링

--- NNGameFramework/ProjectWugargar/Character.cpp
+++ NNGameFramework/ProjectWugargar/Character.cpp
@@ -25,10 +25,12 @@
 Ÿ ϰ   Ÿ Ͽ شϴ idx  Ÿ ȯѴ.

   : 2013/11/03
-  : 2013/11/04
+  : 2013/11/14

 ISSUE : 1 . switch ݺǴ For ϳ   ãƾ .
  .
+
+11/14 : Enemy   (NULL) attackTarget  Base ϵ
 */
 void  CCharacter::DetermineAttackTarget()
 {
@@ -72,11 +74,6 @@
 	default:
 		break;
 	}
-
-
-
-
-
 }

 void CCharacter::InitSprite( std::wstring imagePath )
@@ -127,6 +124,8 @@

 void CCharacter::Update( float dTime )
 {
+	//AttackTarget ϰ Attack ϸ(Ÿ üũ)
+	//ϰ ׷  Attack Target
 	DetermineAttackTarget();
 	if(IsAttack())
 		Attack();
@@ -144,6 +143,12 @@
 	}
 }

+
+/*
+ȣ. 11/14
+Attack_target Ÿ Ͽ   ϵ .
+Issue :  ϴ MakeCharacterWalk 
+*/
 void CCharacter::GoToAttackTarget(float dTime)
 {
 	float gap_x = m_AttackTarget->GetPositionX() - m_Position.GetX();
@@ -152,13 +157,14 @@
 	float t_y = (gap_y) / (gap_x+gap_y);

 	this->SetPosition(this->m_Position - NNPoint( (m_MovingSpeed*t_x),( m_MovingSpeed*t_y) )*dTime);
+}

-
-
-
-}
-
+/*
+ȣ. 11/14
+ Ȳ AttackTarget  Ÿ ȿ ִ üũ.
+ ϸ True,  (־) False
+*/
 bool CCharacter::IsAttack()
 {
 	float distance_attacktarget;


TPM quote method in makeAttestation

TPM quote method in makeAttestation

--- Code/tao/taoHostServices.cpp
+++ Code/tao/taoHostServices.cpp
@@ -481,7 +481,12 @@
     }

     // set up data
-    if(!oAttestation.setAttestAlg((const char*)ATTESTMETHODSHA256FILEHASHRSA2048)) {
+    const char* szAttestalg= NULL;
+    if(hostType()==PLATFORMTYPEHW)
+        szAttestalg= (const char*)ATTESTMETHODTPM12RSA2048;
+    else
+        szAttestalg= (const char*)ATTESTMETHODSHA256FILEHASHRSA2048;
+    if(!oAttestation.setAttestAlg(szAttestalg)) {
         fprintf(g_logFile, "taoHostServices::makeAttestion: cant set attest alg\n");
         return NULL;
     }
@@ -493,7 +498,7 @@
         fprintf(g_logFile, "taoHostServices::makeAttestion: cant get code digest\n");
         return NULL;
     }
-    if(!oAttestation.setcodeDigest(sizecodeDigest, codeDigest)) {
+    if(!oAttestation.setcodeDigest(sizecodeDigest, codeDigest)) {TTESTMETHODTPM12RSA2048
         fprintf(g_logFile, "taoHostServices::makeAttestion: cant set code digest\n");
         return NULL;
     }


tests: logalloc_test: Print debugging info and abort on failure

The test started to fail sporadically on jenkins after
7a00dd698564a7993ae4f62b79ef15c74d2332c9 due to quiesce() timing out. It's not
clear though if this is a regression because before the series such timeouts
would not cause test failure if the future resulves eventually, timeout was
only logged.

I was not able to reproduce it on my setup nor on jenkins, so let's add more
debugging output and trigger a coredump next time the test fails.

Message-Id: <9a6c821f8cc47374eeead39f6faf71f79880359e@scylladb.com>

--- tests/logalloc_test.cc
+++ tests/logalloc_test.cc
@@ -603,16 +603,32 @@
         big_region->alloc();

         // We should not be permitted to go forward with a new allocation now...
+        BOOST_MESSAGE(sprint("now = %s", lowres_clock::now().time_since_epoch().count()));
         fut = simple.run_when_memory_available([&simple_region] { simple_region->alloc_small(); });
         BOOST_REQUIRE_EQUAL(fut.available(), false);
         BOOST_REQUIRE_GT(simple.memory_used(), logalloc::segment_size);
+
+        BOOST_MESSAGE(sprint("now = %s", lowres_clock::now().time_since_epoch().count()));
+        BOOST_MESSAGE(sprint("used = %d", simple.memory_used()));
+
+        BOOST_MESSAGE("Resetting");

         // But when we remove the big bytes allocator from the region, then we should.
         // Internally, we can't guarantee that just freeing the object will give the segment back,
         // that's up to the internal policies. So to make sure we need to remove the whole region.
         big_region.reset();

-        quiesce(std::move(fut));
+        BOOST_MESSAGE(sprint("used = %d", simple.memory_used()));
+        BOOST_MESSAGE(sprint("now = %s", lowres_clock::now().time_since_epoch().count()));
+        try {
+            quiesce(std::move(fut));
+        } catch (...) {
+            BOOST_MESSAGE(sprint("Aborting: %s", std::current_exception()));
+            BOOST_MESSAGE(sprint("now = %s", lowres_clock::now().time_since_epoch().count()));
+            BOOST_MESSAGE(sprint("used = %d", simple.memory_used()));
+            abort();
+        }
+        BOOST_MESSAGE(sprint("now = %s", lowres_clock::now().time_since_epoch().count()));
     });
 }


simplify if run number logic

simplify if run number logic

--- PWG/CaloTrackCorrBase/AliCalorimeterUtils.cxx
+++ PWG/CaloTrackCorrBase/AliCalorimeterUtils.cxx
@@ -1306,12 +1306,10 @@

   if(fEMCALGeoName=="")
   {
-    if     (fRunNumber <  140000 &&
-            fRunNumber >= 100000)   fEMCALGeoName = "EMCAL_FIRSTYEARV1";
-    else if(fRunNumber >= 140000 &&
-            fRunNumber <  171000)   fEMCALGeoName = "EMCAL_COMPLETEV1";
-    else if(fRunNumber <  198000)   fEMCALGeoName = "EMCAL_COMPLETE12SMV1";
-    else                            fEMCALGeoName = "EMCAL_COMPLETE12SMV1_DCAL_8SM";
+    if     (fRunNumber <  140000) fEMCALGeoName = "EMCAL_FIRSTYEARV1";
+    else if(fRunNumber <  171000) fEMCALGeoName = "EMCAL_COMPLETEV1";
+    else if(fRunNumber <  198000) fEMCALGeoName = "EMCAL_COMPLETE12SMV1";
+    else                          fEMCALGeoName = "EMCAL_COMPLETE12SMV1_DCAL_8SM";
   }

   AliInfo(Form("Set EMCAL geometry name to <%s> for run %d",fEMCALGeoName.Data(),fRunNumber));
@@ -1324,12 +1322,10 @@
     if(fImportGeometryFilePath=="") // If not specified, set location depending on run number
     {
       // "$ALICE_ROOT/EVE/alice-data/default_geo.root"
-      if     (fRunNumber <  140000 &&
-              fRunNumber >= 100000)   fImportGeometryFilePath = "$ALICE_PHYSICS/OADB/EMCAL/geometry_2010.root";
-      else if(fRunNumber >= 140000 &&
-              fRunNumber <  171000)   fImportGeometryFilePath = "$ALICE_PHYSICS/OADB/EMCAL/geometry_2011.root";
-      else if(fRunNumber <  198000)   fImportGeometryFilePath = "$ALICE_PHYSICS/OADB/EMCAL/geometry_2012.root"; // 2012-2013
-      else                            fImportGeometryFilePath = "$ALICE_PHYSICS/OADB/EMCAL/geometry_2015.root"; // >= 2015
+      if     (fRunNumber <  140000) fImportGeometryFilePath = "$ALICE_PHYSICS/OADB/EMCAL/geometry_2010.root";
+      else if(fRunNumber <  171000) fImportGeometryFilePath = "$ALICE_PHYSICS/OADB/EMCAL/geometry_2011.root";
+      else if(fRunNumber <  198000) fImportGeometryFilePath = "$ALICE_PHYSICS/OADB/EMCAL/geometry_2012.root"; // 2012-2013
+      else                          fImportGeometryFilePath = "$ALICE_PHYSICS/OADB/EMCAL/geometry_2015.root"; // >= 2015
     }

     AliInfo(Form("Import %s",fImportGeometryFilePath.Data()));


Bugfix #117 - Limit the number of cores, no more than 32.

--- Common++/src/SystemUtils.cpp
+++ Common++/src/SystemUtils.cpp
@@ -117,7 +117,7 @@

 CoreMask getCoreMaskForAllMachineCores()
 {
-	int numOfCores = getNumOfCores();
+	int numOfCores = getNumOfCores() < 32 ? getNumOfCores() : 32;
 	CoreMask result = 0;
 	for (int i = 0; i < numOfCores; i++)
 	{


update (Alessandro)

update (Alessandro)

--- PWG3/vertexingHF/macros/AddTaskDStarSpectra.C
+++ PWG3/vertexingHF/macros/AddTaskDStarSpectra.C
@@ -1,8 +1,10 @@
-//DEFINITION OF A FEW CONSTANTS
+//if like define a different number of signal for TPC PID
+//by default the task is anyway computing 1, 2 and 3 sigmas
 const Int_t    numberOfSigmasPID  = 3;
-// ANALYSIS TYPE
+// option to switch on and off the TPC PID.
+const Bool_t usePID = kTRUE;
+// analysis type... TO BE REMOVED!!!
 const Bool_t anaType   = 1;//0 HD; 1 UU;
-const Bool_t usePID = kTRUE;
 //----------------------------------------------------

 AliAnalysisTaskSEDStarSpectra *AddTaskDStarSpectra(Bool_t theMCon=kFALSE)
@@ -14,317 +16,23 @@
     return NULL;
   }

-  TString cutobjname="Dstar";
-
-  // D0 daughters pre-selections
-  //
-  AliRDHFCutsDStartoKpipi* RDHFDStartoKpipi=new AliRDHFCutsDStartoKpipi();
-  RDHFDStartoKpipi->SetName("DstartoKpipi");
-  RDHFDStartoKpipi->SetTitle("cuts for D* analysis");
-
-  AliESDtrackCuts* esdTrackCuts=new AliESDtrackCuts();
-  esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
-  //default
-  esdTrackCuts->SetRequireTPCRefit(kTRUE);
-  esdTrackCuts->SetRequireITSRefit(kTRUE);
-  esdTrackCuts->SetMinNClustersITS(4); // default is 5
-  esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
-  					 AliESDtrackCuts::kAny); //test d0 asimmetry
-                                                                 // default is kBoth, otherwise kAny
-  esdTrackCuts->SetMinDCAToVertexXY(0.);
-  esdTrackCuts->SetPtRange(0.1,1.e10);
-
-  //
-  // soft pion pre-selections
-  //
-  AliESDtrackCuts* esdSoftPicuts=new AliESDtrackCuts();
-  esdSoftPicuts->SetRequireSigmaToVertex(kFALSE);
-  //default
-  esdSoftPicuts->SetRequireTPCRefit(kFALSE);
-  esdSoftPicuts->SetRequireITSRefit(kFALSE);
-  esdSoftPicuts->SetMinNClustersITS(4); // default is 4
-  esdSoftPicuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
-					  AliESDtrackCuts::kAny); //test d0 asimmetry
-  esdSoftPicuts->SetPtRange(0.0,1.e10);
-
-  // set pre selections
-  RDHFDStartoKpipi->AddTrackCuts(esdTrackCuts);
-  RDHFDStartoKpipi->AddTrackCutsSoftPi(esdSoftPicuts);
-
-  const Int_t nvars=14;
-
-  const Int_t nptbins=7;
-  Float_t* ptbins;
-  ptbins=new Float_t[nptbins+1];
-  ptbins[0]=0.7;
-  ptbins[1]=1.;
-  ptbins[2]=2.;
-  ptbins[3]=3.;
-  ptbins[4]=5.;
-  ptbins[5]=8.;
-  ptbins[6]=12.;
-  ptbins[7]=18.;
-
-  RDHFDStartoKpipi->SetPtBins(nptbins+1,ptbins);
-
-
-  Float_t** rdcutsvalmine;
-  rdcutsvalmine=new Float_t*[nvars];
-  for(Int_t iv=0;iv<nvars;iv++){
-    rdcutsvalmine[iv]=new Float_t[nptbins];
+  // cuts are stored in a TFile generated by makeTFile4CutsDStartoKpipi.C in ./macros/
+  // set there the cuts!!!!!
+  TFile* filecuts=new TFile("DStartoKpipiCuts.root");
+  if(!filecuts->IsOpen()){
+    cout<<"Input file not found: exit"<<endl;
+    return;
   }

-  if(anaType==1){ // UU cuts
+  AliRDHFCutsDStartoKpipi* RDHFDStartoKpipi=new AliRDHFCutsDStartoKpipi();
+  RDHFDStartoKpipi = (AliRDHFCutsDStartoKpipi*)filecuts->Get("DStartoKpipiCuts");
+  RDHFDStartoKpipi->SetName("DStartoKpipiCuts");

-    rdcutsvalmine[0][0]=0.7;
-    rdcutsvalmine[1][0]=0.022;
-    rdcutsvalmine[2][0]=0.7;
-    rdcutsvalmine[3][0]=0.21;
-    rdcutsvalmine[4][0]=0.21;
-    rdcutsvalmine[5][0]=0.05;
-    rdcutsvalmine[6][0]=0.05;
-    rdcutsvalmine[7][0]=-0.00005;
-    rdcutsvalmine[8][0]=0.85;
-    rdcutsvalmine[9][0]=0.3.;
-    rdcutsvalmine[10][0]=0.1;
-    rdcutsvalmine[11][0]=0.05;
-    rdcutsvalmine[12][0]=100.;
-    rdcutsvalmine[13][0]=0.5;
-
-    rdcutsvalmine[0][1]=0.7;
-    rdcutsvalmine[1][1]=0.03;
-    rdcutsvalmine[2][1]=0.8;
-    rdcutsvalmine[3][1]=0.45;
-    rdcutsvalmine[4][1]=0.45;
-    rdcutsvalmine[5][1]=0.09;
-    rdcutsvalmine[6][1]=0.09;
-    rdcutsvalmine[7][1]=-0.00029;
-    rdcutsvalmine[8][1]=0.8;
-    rdcutsvalmine[9][1]=0.3;
-    rdcutsvalmine[10][1]=0.1;
-    rdcutsvalmine[11][1]=0.05;
-    rdcutsvalmine[12][1]=100.;
-    rdcutsvalmine[13][1]=1.0;
-
-    rdcutsvalmine[0][2]=0.7;
-    rdcutsvalmine[1][2]=0.02;
-    rdcutsvalmine[2][2]=0.8;
-    rdcutsvalmine[3][2]=0.7;
-    rdcutsvalmine[4][2]=0.7;
-    rdcutsvalmine[5][2]=0.08;
-    rdcutsvalmine[6][2]=0.08;
-    rdcutsvalmine[7][2]=-0.00018;
-    rdcutsvalmine[8][2]=0.90;
-    rdcutsvalmine[9][2]=0.3;
-    rdcutsvalmine[10][2]=0.1;
-    rdcutsvalmine[11][2]=0.05;
-    rdcutsvalmine[12][2]=100.;
-    rdcutsvalmine[13][2]=0.5;
-
-    rdcutsvalmine[0][3]=0.7;
-    rdcutsvalmine[1][3]=0.05;
-    rdcutsvalmine[2][3]=0.8;
-    rdcutsvalmine[3][3]=1.;
-    rdcutsvalmine[4][3]=1.;
-    rdcutsvalmine[5][3]=0.042;
-    rdcutsvalmine[6][3]=0.056;
-    rdcutsvalmine[7][3]=-0.000065;
-    rdcutsvalmine[8][3]=0.9;
-    rdcutsvalmine[9][3]=0.3;
-    rdcutsvalmine[10][3]=0.1;
-    rdcutsvalmine[11][3]=0.05;
-    rdcutsvalmine[12][3]=100.;
-    rdcutsvalmine[13][3]=0.5;
-
-    rdcutsvalmine[0][4]=0.7;
-    rdcutsvalmine[1][4]=0.08;
-    rdcutsvalmine[2][4]=0.9;
-    rdcutsvalmine[3][4]=1.2;
-    rdcutsvalmine[4][4]=1.2;
-    rdcutsvalmine[5][4]=0.07;
-    rdcutsvalmine[6][4]=0.07;
-    rdcutsvalmine[7][4]=0.0001;
-    rdcutsvalmine[8][4]=0.9;
-    rdcutsvalmine[9][4]=0.3;
-    rdcutsvalmine[10][4]=0.1;
-    rdcutsvalmine[11][4]=0.05;
-    rdcutsvalmine[12][4]=100.;
-    rdcutsvalmine[13][4]=0.5;
-
-
-    rdcutsvalmine[0][5]=0.7;
-    rdcutsvalmine[1][5]=0.1;
-    rdcutsvalmine[2][5]=1.0;
-    rdcutsvalmine[3][5]=1.;
-    rdcutsvalmine[4][5]=1.;
-    rdcutsvalmine[5][5]=0.08;
-    rdcutsvalmine[6][5]=0.08;
-    rdcutsvalmine[7][5]=0.0004;
-    rdcutsvalmine[8][5]=0.9;
-    rdcutsvalmine[9][5]=0.3;
-    rdcutsvalmine[10][5]=0.1;
-    rdcutsvalmine[11][5]=0.05;
-    rdcutsvalmine[12][5]=100000.;
-    rdcutsvalmine[13][5]=0.5;
-
-    rdcutsvalmine[0][6]=0.7;
-    rdcutsvalmine[1][6]=0.1;
-    rdcutsvalmine[2][6]=1.0;
-    rdcutsvalmine[3][6]=1.;
-    rdcutsvalmine[4][6]=1.;
-    rdcutsvalmine[5][6]=0.1;
-    rdcutsvalmine[6][6]=0.1;
-    rdcutsvalmine[7][6]=0.0005;
-    rdcutsvalmine[8][6]=0.9;
-    rdcutsvalmine[9][6]=0.3;
-    rdcutsvalmine[10][6]=0.1;
-    rdcutsvalmine[11][6]=0.05;
-    rdcutsvalmine[12][6]=100.;
-    rdcutsvalmine[13][6]=0.5;
-
-    rdcutsvalmine[0][7]=0.7;
-    rdcutsvalmine[1][7]=0.1;
-    rdcutsvalmine[2][7]=1.0;
-    rdcutsvalmine[3][7]=1.;
-    rdcutsvalmine[4][7]=1.;
-    rdcutsvalmine[5][7]=0.1;
-    rdcutsvalmine[6][7]=0.1;
-    rdcutsvalmine[7][7]=0.001;
-    rdcutsvalmine[8][7]=0.9;
-    rdcutsvalmine[9][7]=0.3;
-    rdcutsvalmine[10][7]=0.1;
-    rdcutsvalmine[11][7]=0.05;
-    rdcutsvalmine[12][7]=100.;
-    rdcutsvalmine[13][7]=0.5;
-
-
-  }else{ // HD cuts - To be setted
-
-    rdcutsvalmine[0][0]=0.450;
-    rdcutsvalmine[1][0]=0.02;
-    rdcutsvalmine[2][0]=0.7;
-    rdcutsvalmine[3][0]=0.8;
-    rdcutsvalmine[4][0]=0.8;
-    rdcutsvalmine[5][0]=0.1;
-    rdcutsvalmine[6][0]=0.1;
-    rdcutsvalmine[7][0]=0.000002;
-    rdcutsvalmine[8][0]=0.9;
-    rdcutsvalmine[9][0]=200.;
-    rdcutsvalmine[10][0]=200.;
-    rdcutsvalmine[11][0]=0.021;
-    rdcutsvalmine[12][0]=100.;
-    rdcutsvalmine[13][0]=0.5;
-
-    rdcutsvalmine[0][1]=0.45;
-    rdcutsvalmine[1][1]=0.03;
-    rdcutsvalmine[2][1]=0.7;
-    rdcutsvalmine[3][1]=0.8;
-    rdcutsvalmine[4][1]=0.8;
-    rdcutsvalmine[5][1]=0.1;
-    rdcutsvalmine[6][1]=0.1;
-    rdcutsvalmine[7][1]=-0.00002;
-    rdcutsvalmine[8][1]=0.9;
-    rdcutsvalmine[9][1]=200.;
-    rdcutsvalmine[10][1]=200.;
-    rdcutsvalmine[11][1]=0.021;
-    rdcutsvalmine[12][1]=100.;
-    rdcutsvalmine[13][1]=0.5;
-
-    rdcutsvalmine[0][2]=0.450;
-    rdcutsvalmine[1][2]=0.03;
-    rdcutsvalmine[2][2]=0.7;
-    rdcutsvalmine[3][2]=0.8;
-    rdcutsvalmine[4][2]=0.8;
-    rdcutsvalmine[5][2]=0.1;
-    rdcutsvalmine[6][2]=0.1;
-    rdcutsvalmine[7][2]=-0.00002;
-    rdcutsvalmine[8][2]=0.9;
-    rdcutsvalmine[9][2]=200.;
-    rdcutsvalmine[10][2]=200.;
-    rdcutsvalmine[11][2]=0.021;
-    rdcutsvalmine[12][2]=100.;
-    rdcutsvalmine[13][2]=0.5;
-
-    rdcutsvalmine[0][3]=0.45;
-    rdcutsvalmine[1][3]=0.03;
-    rdcutsvalmine[2][3]=0.7;
-    rdcutsvalmine[3][3]=0.9;
-    rdcutsvalmine[4][3]=0.9;
-    rdcutsvalmine[5][3]=0.1;
-    rdcutsvalmine[6][3]=0.1;
-    rdcutsvalmine[7][3]=0.000002;
-    rdcutsvalmine[8][3]=0.8;
-    rdcutsvalmine[9][3]=200.;
-    rdcutsvalmine[10][3]=200.;
-    rdcutsvalmine[11][3]=0.021;
-    rdcutsvalmine[12][3]=100.;
-    rdcutsvalmine[13][3]=0.5;
-
-    rdcutsvalmine[0][4]=0.45;
-    rdcutsvalmine[1][4]=0.03;
-    rdcutsvalmine[2][4]=0.7;
-    rdcutsvalmine[3][4]=1.;
-    rdcutsvalmine[4][4]=1.;
-    rdcutsvalmine[5][4]=0.1;
-    rdcutsvalmine[6][4]=0.1;
-    rdcutsvalmine[7][4]=0.000002;
-    rdcutsvalmine[8][4]=0.8;
-    rdcutsvalmine[9][4]=200.;
-    rdcutsvalmine[10][4]=200.;
-    rdcutsvalmine[11][4]=0.021;
-    rdcutsvalmine[12][4]=100.;
-    rdcutsvalmine[13][4]=0.5;
-
-    rdcutsvalmine[0][5]=0.45;
-    rdcutsvalmine[1][5]=0.03;
-    rdcutsvalmine[2][5]=0.7;
-    rdcutsvalmine[3][5]=1.;
-    rdcutsvalmine[4][5]=1.;
-    rdcutsvalmine[5][5]=0.1;
-    rdcutsvalmine[6][5]=0.1;
-    rdcutsvalmine[7][5]=0.000002;
-    rdcutsvalmine[8][5]=0.8;
-    rdcutsvalmine[9][5]=200.;
-    rdcutsvalmine[10][5]=200.;
-    rdcutsvalmine[11][5]=0.021;
-    rdcutsvalmine[12][5]=100.;
-    rdcutsvalmine[13][5]=0.5;
-
-    rdcutsvalmine[0][6]=0.45;
-    rdcutsvalmine[1][6]=0.03;
-    rdcutsvalmine[2][6]=0.7;
-    rdcutsvalmine[3][6]=1.;
-    rdcutsvalmine[4][6]=1.;
-    rdcutsvalmine[5][6]=0.1;
-    rdcutsvalmine[6][6]=0.1;
-    rdcutsvalmine[7][6]=0.000002;
-    rdcutsvalmine[8][6]=0.8;
-    rdcutsvalmine[9][6]=200.;
-    rdcutsvalmine[10][6]=200.;
-    rdcutsvalmine[11][6]=0.021;
-    rdcutsvalmine[12][6]=100.;
-    rdcutsvalmine[13][6]=0.5;
-
-    rdcutsvalmine[0][7]=0.45;
-    rdcutsvalmine[1][7]=0.03;
-    rdcutsvalmine[2][7]=0.7;
-    rdcutsvalmine[3][7]=1.;
-    rdcutsvalmine[4][7]=1.;
-    rdcutsvalmine[5][7]=0.1;
-    rdcutsvalmine[6][7]=0.1;
-    rdcutsvalmine[7][7]=0.000002;
-    rdcutsvalmine[8][7]=0.8;
-    rdcutsvalmine[9][7]=200.;
-    rdcutsvalmine[10][7]=200.;
-    rdcutsvalmine[11][7]=0.021;
-    rdcutsvalmine[12][7]=100.;
-    rdcutsvalmine[13][7]=0.5;
-
+  // mm let's see if everything is ok
+  if(!RDHFDStartoKpipi){
+    cout<<"Specific AliRDHFCuts not found"<<endl;
+    return;
   }
-
-  RDHFDStartoKpipi->SetCuts(nvars,nptbins,rdcutsvalmine);
-  RDHFDStartoKpipi->PrintAll();
-

   //CREATE THE TASK
   printf("CREATE TASK\n");
@@ -341,8 +49,7 @@
   // Create and connect containers for input/output

   TString outputfile = AliAnalysisManager::GetCommonFileName();
-  if (anaType == 0) outputfile += ":PWG3_D2H_DStarSpectraHD";
-  if (anaType == 1) outputfile += ":PWG3_D2H_DStarSpectraUU";
+  outputfile += ":PWG3_D2H_DStarSpectra";

   // ------ input data ------


Fix bug in Button::on_mouse_up (wrong event emission)

The button emits the correct event -- ON_MOUSE_UP / MOUSE_UP;
was emitting ON_MOUSE_DOWN / MOUSE_DOWN.

--- src/gui/Button.cpp
+++ src/gui/Button.cpp
@@ -282,10 +282,10 @@
   UIWidgetEvent evt( this->button_state(), this->name(), ev.event(), this->id() );

   // Send the UI event object to the registered private event callback.
-  this->dispatcher()->emit( UIEvent::ON_MOUSE_DOWN, evt );
+  this->dispatcher()->emit( UIEvent::ON_MOUSE_UP, evt );

   // Send the UI event object to the registered public event callback.
-  this->dispatcher()->emit( UIEvent::MOUSE_DOWN, evt );
+  this->dispatcher()->emit( UIEvent::MOUSE_UP, evt );
 }

 void Button::on_mouse_enter( const UIWidgetEvent& ev )


PWGGA/GammaConv: Added EDC cut without NCell cut

--- PWGGA/GammaConv/macros/AddTask_GammaCalo_pp.C
+++ PWGGA/GammaConv/macros/AddTask_GammaCalo_pp.C
@@ -2410,6 +2410,9 @@
     cuts.AddCutCalo("0008e113","411792106fe32220003","0r631031000000d0"); // EG2  NL 12 + TB dir. gamma
     cuts.AddCutCalo("0008d113","411792106fe32220003","0r631031000000d0"); // EG1  NL 12 + TB dir. gamma

+  } else if (trainConfig == 2069){  // EMCAL+DCAL without NCell cut
+    cuts.AddCutCalo("00010113","411792106fe30220000","0r631031000000d0"); // INT7 NL 12 + TB dir. gamma
+

   // TM studies (std cut f has fEOverPMax = 1.75)


refactor(Scripts/Event): convert pilgrims_bounty into new system (#9608)


Small fix for the gray values.

Small fix for the gray values.

--- src/searchImage.cpp
+++ src/searchImage.cpp
@@ -103,7 +103,7 @@
     for ( unsigned int DM = 0; DM < nrDMs; DM++ ) {
       float snr = snrSpace[(period * nrDMs) + DM];
       if ( gray ) {
-        searchImage(DM, (nrPeriods - 1) - period, 0, 0) = static_cast< unsigned char >(((snr - minSNR) * 256.0) / snrSpaceDim);
+        searchImage(DM, (nrPeriods - 1) - period, 0, 0) = static_cast< unsigned char >(((snr - minSNR) * 255.0) / snrSpaceDim);
       } else {
         searchImage(DM, (nrPeriods - 1) - period, 0, 0) = (colorMap[static_cast< unsigned int >(((snr - minSNR) * 256.0) / snrSpaceDim)]).getR();
         searchImage(DM, (nrPeriods - 1) - period, 0, 1) = (colorMap[static_cast< unsigned int >(((snr - minSNR) * 256.0) / snrSpaceDim)]).getG();


Register TableSource and TableSourceVec3.

--- OpenSim/Common/RegisterTypes_osimCommon.cpp
+++ OpenSim/Common/RegisterTypes_osimCommon.cpp
@@ -44,6 +44,7 @@
 #include "ObjectGroup.h"

 #include "Reporter.h"
+#include "TableSource.h"

 #include <string>
 #include <iostream>
@@ -89,6 +90,8 @@
     Object::registerType(PolynomialFunction());
     Object::registerType( ObjectGroup() );

+    Object::registerType( TableSource() );
+    Object::registerType( TableSourceVec3() );
     Object::registerType( TableReporter() );
     Object::registerType( TableReporterVec3() );
     Object::registerType( TableReporterVector() );


explicitly state "copy" for tests of the copy assignment operator

--- tests/optional_test.cc
+++ tests/optional_test.cc
@@ -21,7 +21,7 @@
     EXPECT_TRUE(copy_constructed.get());
 }

-TEST(optional, assignment_operator) {
+TEST(optional, copy_assignment_operator_for_convertible_type) {
     Optional<bool> value;
     EXPECT_TRUE(value.isEmpty());

@@ -77,7 +77,7 @@
     EXPECT_TRUE(value.isEmpty());
 }

-TEST(optional, assignment_operator_none) {
+TEST(optional, copy_assignment_operator_none) {
     Optional<bool> value(Pistache::None());
     EXPECT_TRUE(value.isEmpty());


Refactoring AeadTicketCipher to use TicketPolicy instead of tracking time directly

Summary:
This factors out the ticket/ResumptionState acceptance logic into a separate
class, enabling future reuse.

Reviewed By: mingtaoy

Differential Revision: D19510599

fbshipit-source-id: b071922b40afeaa289c713f7acd6d5b2b5f8ba09

--- mcrouter/lib/network/FizzContextProvider.cpp
+++ mcrouter/lib/network/FizzContextProvider.cpp
@@ -138,8 +138,10 @@
     }
     auto cipher = std::make_shared<fizz::server::AES128TicketCipher>();
     cipher->setTicketSecrets(std::move(ticketSecrets));
-    cipher->setTicketValidity(std::chrono::seconds(kSessionLifeTime));
-    cipher->setHandshakeValidity(std::chrono::seconds(kHandshakeValidity));
+    fizz::server::TicketPolicy policy;
+    policy.setTicketValidity(std::chrono::seconds(kSessionLifeTime));
+    policy.setHandshakeValidity(std::chrono::seconds(kHandshakeValidity));
+    cipher->setPolicy(std::move(policy));
     ctx->setTicketCipher(std::move(cipher));
   }
   // TODO: allow for custom FizzFactory