enh: Separate compose-dofs -scale option also when -bch approximation not used [Applications]

--- Applications/src/compose-dofs.cc
+++ Applications/src/compose-dofs.cc
@@ -63,17 +63,19 @@
   cout << "      Whether to allow shearing when composite transformation is affine. (default: on)\n";
   cout << "  -approximate\n";
   cout << "      Approximate the composed transformation using a single FFD. (default: off)\n";
-  cout << "  -bch [<n> [yes|no [e1...]]]\n";
+  cout << "  -scale <s1> [s2...]\n";
+  cout << "      Scaling factors for each input (SV) FFD in the same order as the positional\n";
+  cout << "      input file name arguments. These factors can only be applied to single FFDs,\n";
+  cout << "      and are mainly useful for velocity based transformations. For rigid, similarity,\n";
+  cout << "      or affine transformations, use -1 to invert the input transformation. (default: 1)\n";
+  cout << "  -bch [<n> [yes|no]]\n";
   cout << "      Use Baker-Campbell-Hausdorff (BCH) formula to approximate composition of SV FFDs.\n";
   cout << "      All input transformations must be of type cubic B-spline SV FFD. Arguments\n";
   cout << "      are optional. The first argument is the number of BCH terms to use. The minimum\n";
   cout << "      is 2 terms, i.e., the sum of left and right velocity fields. The second argument\n";
   cout << "      is a boolean flag indicating whether or not the Lie brackets should be computed\n";
   cout << "      using the Jacobian of the vector fields (yes) or if it should be approximated\n";
-  cout << "      as the difference of the compositions in either order. The remaining optional\n";
-  cout << "      arguments are scaling factors of each stationary input velocity field in the\n";
-  cout << "      same order as the SV FFDs are given as positional arguments. When omitted, the\n";
-  cout << "      \"Cross-sectional time interval\" of the SV FFD is used.\n";
+  cout << "      as the difference of the compositions in either order. (default: 6 yes)\n";
   cout << "  -nobch\n";
   cout << "      Do not use BCH formula to compose SV FFDs. Instead, evaluate composite displacements\n";
   cout << "      and approximate these even when all input transformations are of type SV FFD.\n";
@@ -218,7 +220,7 @@
   bool approximate    = false;
   int  no_bch_terms   = -1;
   bool lie_derivative = true;
-  Array<double> svffd_exponent;
+  Array<double> scales;
   double dx = 0., dy = 0., dz = 0.;

   for (ALL_OPTIONS) {
@@ -226,6 +228,19 @@
       InitializeIOLibrary();
       GreyImage target(ARGUMENT);
       attr = target.Attributes();
+    }
+    else if (OPTION("-scale")) {
+      do {
+        double s;
+        PARSE_ARGUMENT(s);
+        if (AreEqual(s, 0.) || IsNaN(s) || IsInf(s)) {
+          FatalError("Scaling factor must be neither zero, +/- inf, or NaN!");
+        }
+        scales.push_back(s);
+        if (scales.size() > static_cast<size_t>(N)) {
+          FatalError("Too many arguments for option -scale!");
+        }
+      } while (HAS_ARGUMENT);
     }
     else if (OPTION("-bch")) {
       approximate = true;
@@ -234,14 +249,6 @@
         PARSE_ARGUMENT(no_bch_terms);
         if (HAS_ARGUMENT) {
           PARSE_ARGUMENT(lie_derivative);
-          while (HAS_ARGUMENT) {
-            double e;
-            PARSE_ARGUMENT(e);
-            svffd_exponent.push_back(e);
-            if (svffd_exponent.size() > static_cast<size_t>(N)) {
-              FatalError("Too many time interval arguments for option -bch!");
-            }
-          }
         }
       }
     }
@@ -325,6 +332,23 @@
     mffd   = dynamic_cast<MultiLevelFreeFormTransformation           *>(dof.get());
     svmffd = dynamic_cast<MultiLevelStationaryVelocityTransformation *>(dof.get());
     fluid  = dynamic_cast<FluidFreeFormTransformation                *>(dof.get());
+
+    if (n <= static_cast<int>(scales.size()) && !AreEqual(scales[n - 1], 1.)) {
+      if (aff) {
+        if (AreEqual(scales[n - 1], -1.)) {
+          aff->Invert();
+        } else {
+          FatalError("Cannot -scale affine transformation, use '-1' to invert it!");
+        }
+      } else if (ffd) {
+        const double scale = scales[n - 1];
+        for (int i = 0; i < ffd->NumberOfDOFs(); ++i) {
+          ffd->Put(i, scale * ffd->Get(i));
+        }
+      } else {
+        FatalError("Cannot -scale non-FFD transformation! Option mainly used for SV FFDs.");
+      }
+    }

     // Compose current composite transformation with n-th transformation
     const bool last = (n == N);
@@ -399,11 +423,6 @@
       }
       UniquePtr<BSplineFreeFormTransformationSV> svffd;
       auto *first = dynamic_cast<BSplineFreeFormTransformationSV *>(t.GetLocalTransformation(0));
-      if (!svffd_exponent.empty()) {
-        first->T(first->T() * svffd_exponent[0]);
-        first->ScaleVelocities(1. / first->T());
-        first->T(1.);
-      }
       if (attr) {
         svffd.reset(new BSplineFreeFormTransformationSV());
         svffd->Initialize(domain, dx, dy, dz, first);
@@ -416,9 +435,6 @@
       svffd->LieDerivative(lie_derivative);
       for (int i = 1; i < t.NumberOfLevels(); ++i) {
         auto *next = dynamic_cast<BSplineFreeFormTransformationSV *>(t.GetLocalTransformation(i));
-        if (static_cast<size_t>(i) < svffd_exponent.size()) {
-          next->T(next->T() * svffd_exponent[i]);
-        }
         svffd->CombineWith(next);
       }
       svffd->NumberOfBCHTerms(orig_no_bch_terms);


Reformat and remove goto

Reformat and remove goto

--- sdch_module.cc
+++ sdch_module.cc
@@ -265,115 +265,103 @@
   return 0;
 }

-static ngx_int_t
-ngx_http_sdch_ok(ngx_http_request_t *r)
-{
-    time_t                     date, expires;
-    ngx_uint_t                 p;
-    ngx_array_t               *cc;
-    ngx_table_elt_t           *e, *d;
-    Config                 *clcf;
-
-    if (r != r->main) {
+static ngx_int_t ngx_http_sdch_ok(ngx_http_request_t* r) {
+  time_t date, expires;
+  ngx_uint_t p;
+  ngx_array_t* cc;
+  ngx_table_elt_t* e, *d;
+  Config* clcf;
+
+  if (r != r->main) {
+    return NGX_DECLINED;
+  }
+
+  clcf = Config::get(r);
+
+  if (r->headers_in.via == nullptr) {
+    return NGX_OK;
+  }
+
+  p = clcf->sdch_proxied;
+
+  if (p & NGX_HTTP_GZIP_PROXIED_OFF) {
+    return NGX_DECLINED;
+  }
+
+  if (p & NGX_HTTP_GZIP_PROXIED_ANY) {
+    return NGX_OK;
+  }
+
+  if (r->headers_in.authorization && (p & NGX_HTTP_GZIP_PROXIED_AUTH)) {
+    return NGX_OK;
+  }
+
+  e = r->headers_out.expires;
+
+  if (e) {
+
+    if (!(p & NGX_HTTP_GZIP_PROXIED_EXPIRED)) {
+      return NGX_DECLINED;
+    }
+
+    expires = ngx_http_parse_time(e->value.data, e->value.len);
+    if (expires == NGX_ERROR) {
+      return NGX_DECLINED;
+    }
+
+    d = r->headers_out.date;
+
+    if (d) {
+      date = ngx_http_parse_time(d->value.data, d->value.len);
+      if (date == NGX_ERROR) {
         return NGX_DECLINED;
-    }
-
-    clcf = Config::get(r);
-
-    if (r->headers_in.via == nullptr) {
-        goto ok;
-    }
-
-    p = clcf->sdch_proxied;
-
-    if (p & NGX_HTTP_GZIP_PROXIED_OFF) {
-        return NGX_DECLINED;
-    }
-
-    if (p & NGX_HTTP_GZIP_PROXIED_ANY) {
-        goto ok;
-    }
-
-    if (r->headers_in.authorization && (p & NGX_HTTP_GZIP_PROXIED_AUTH)) {
-        goto ok;
-    }
-
-    e = r->headers_out.expires;
-
-    if (e) {
-
-        if (!(p & NGX_HTTP_GZIP_PROXIED_EXPIRED)) {
-            return NGX_DECLINED;
-        }
-
-        expires = ngx_http_parse_time(e->value.data, e->value.len);
-        if (expires == NGX_ERROR) {
-            return NGX_DECLINED;
-        }
-
-        d = r->headers_out.date;
-
-        if (d) {
-            date = ngx_http_parse_time(d->value.data, d->value.len);
-            if (date == NGX_ERROR) {
-                return NGX_DECLINED;
-            }
-
-        } else {
-            date = ngx_time();
-        }
-
-        if (expires < date) {
-            goto ok;
-        }
-
-        return NGX_DECLINED;
-    }
-
-    cc = &r->headers_out.cache_control;
-
-    if (cc->elts) {
-
-        if ((p & NGX_HTTP_GZIP_PROXIED_NO_CACHE)
-            && ngx_http_parse_multi_header_lines(cc, &ngx_http_gzip_no_cache,
-                                                 nullptr)
-               >= 0)
-        {
-            goto ok;
-        }
-
-        if ((p & NGX_HTTP_GZIP_PROXIED_NO_STORE)
-            && ngx_http_parse_multi_header_lines(cc, &ngx_http_gzip_no_store,
-                                                 nullptr)
-               >= 0)
-        {
-            goto ok;
-        }
-
-        if ((p & NGX_HTTP_GZIP_PROXIED_PRIVATE)
-            && ngx_http_parse_multi_header_lines(cc, &ngx_http_gzip_private,
-                                                 nullptr)
-               >= 0)
-        {
-            goto ok;
-        }
-
-        return NGX_DECLINED;
-    }
-
-    if ((p & NGX_HTTP_GZIP_PROXIED_NO_LM) && r->headers_out.last_modified) {
-        return NGX_DECLINED;
-    }
-
-    if ((p & NGX_HTTP_GZIP_PROXIED_NO_ETAG) && r->headers_out.etag) {
-        return NGX_DECLINED;
-    }
-
-ok:
-
-    //r->gzip_ok = 1;
-
-    return NGX_OK;
+      }
+
+    } else {
+      date = ngx_time();
+    }
+
+    if (expires < date) {
+      return NGX_OK;
+    }
+
+    return NGX_DECLINED;
+  }
+
+  cc = &r->headers_out.cache_control;
+
+  if (cc->elts) {
+
+    if ((p & NGX_HTTP_GZIP_PROXIED_NO_CACHE) &&
+        ngx_http_parse_multi_header_lines(
+            cc, &ngx_http_gzip_no_cache, nullptr) >= 0) {
+      return NGX_OK;
+    }
+
+    if ((p & NGX_HTTP_GZIP_PROXIED_NO_STORE) &&
+        ngx_http_parse_multi_header_lines(
+            cc, &ngx_http_gzip_no_store, nullptr) >= 0) {
+      return NGX_OK;
+    }
+
+    if ((p & NGX_HTTP_GZIP_PROXIED_PRIVATE) &&
+        ngx_http_parse_multi_header_lines(
+            cc, &ngx_http_gzip_private, nullptr) >= 0) {
+      return NGX_OK;
+    }
+
+    return NGX_DECLINED;
+  }
+
+  if ((p & NGX_HTTP_GZIP_PROXIED_NO_LM) && r->headers_out.last_modified) {
+    return NGX_DECLINED;
+  }
+
+  if ((p & NGX_HTTP_GZIP_PROXIED_NO_ETAG) && r->headers_out.etag) {
+    return NGX_DECLINED;
+  }
+
+  return NGX_OK;
 }

 static Storage::ValueHolder find_quasidict(ngx_http_request_t* r, u_char* h) {


Assert that a nary operation has always more than 1 operand

--- sdd/dd/nary.hh
+++ sdd/dd/nary.hh
@@ -51,6 +51,7 @@
     : operands(new char[builder.size_to_allocate()])
     , size(static_cast<typename C::operands_size_type>(builder.size()))
   {
+    assert(size > 1);
     // Will place (with a placement new combined with a move) operands in the raw storage.
     builder.consolidate(operands);
   }


Bug Fix: Fixes incremental drawing in conjunction with the highlighting filter for the OpenGL widget.

Review URL: https://codereview.appspot.com/6441141

--- debugger/QT/SkGLWidget.cpp
+++ debugger/QT/SkGLWidget.cpp
@@ -50,7 +50,6 @@

 void SkGLWidget::paintGL() {
     if (!this->isHidden()) {
-        glClearColor(1, 1, 1, 0);
         fDebugger->draw(fCanvas);
         // TODO(chudy): Implement an optional flush button in Gui.
         fCanvas->flush();


Add protection for infinity recursion.

Add protection for infinity recursion.

--HG--
branch : ogre-gsoc2013-progressive-mesh-improvements

--- OgreMain/src/OgreEntity.cpp
+++ OgreMain/src/OgreEntity.cpp
@@ -183,6 +183,14 @@
 				const MeshLodUsage& usage = mMesh->getLodLevel(i);
 				Entity* lodEnt;
 				if(!usage.manualName.empty()){
+					// Disabled to prevent recursion when a.mesh has manualLod to b.mesh and b.mesh has manualLod to a.mesh.
+					OgreAssert(usage.manualMesh->getNumLodLevels() == 1, "Manual Lod Mesh can't have Lod levels!");
+
+					if(usage.manualMesh->getNumLodLevels() != 1) {
+						// To prevent crash in release builds, we will remove Lod levels.
+						usage.manualMesh->removeLodLevels();
+					}
+
 					// Manually create entity
 					lodEnt = OGRE_NEW Entity(mName + "Lod" + StringConverter::toString(i),
 						usage.manualMesh);
@@ -416,9 +424,9 @@
             // Get the index at this biased depth
             ushort newMeshLodIndex = mMesh->getLodIndex(biasedMeshLodValue);
             // Apply maximum detail restriction (remember lower = higher detail)
-            newMeshLodIndex = std::max(mMaxMeshLodIndex, newMeshLodIndex);
+            newMeshLodIndex = std::max<ushort>(mMaxMeshLodIndex, newMeshLodIndex);
             // Apply minimum detail restriction (remember higher = lower detail)
-            newMeshLodIndex = std::min(mMinMeshLodIndex, newMeshLodIndex);
+            newMeshLodIndex = std::min<ushort>(mMinMeshLodIndex, newMeshLodIndex);

             // Construct event object
             EntityMeshLodChangedEvent evt;


Fix click-drag placing tiles in MT editable scene

--- src/gui-qt/metatiles/mttileset/abstractcursorgraphicsitem.cpp
+++ src/gui-qt/metatiles/mttileset/abstractcursorgraphicsitem.cpp
@@ -29,7 +29,7 @@
 {
     bool moved = processMouseScenePosition(event->scenePos());

-    if (moved && _enableClickDrag && event->button() == Qt::LeftButton) {
+    if (moved && _enableClickDrag && event->buttons() == Qt::LeftButton) {
         processClick();
     }
 }


Updating ATTR_PROC_CHIP_MEM_TO_USE to use all bits of group and chip ID

When first created, we assumed the group ID and chip ID's were
both 2 bits, but they're actually 3. This is updating the attribute.

Change-Id: I231e813e8b046e836fcab7d05333bbc7c59bb6d8
Original-Change-Id: Iabc112f7202d410bd7bceab53c3ad79a1df17368
RTC:176434
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/56039
Tested-by: FSP CI Jenkins <aa9e4d9ac7cd25905e9c0dd36d4150516e73dd86@us.ibm.com>
Reviewed-by: Sachin Gupta <285b19a698aa558fba6ab25cf25b393d072fd749@in.ibm.com>
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Tested-by: HWSV CI <ae069ce3805842f4ed79e0ef7868baadb5df0a6b@us.ibm.com>
Tested-by: PPE CI <dc75934ba5befb9221434e67a247b93aec46b36b@us.ibm.com>
Tested-by: Hostboot CI <52521565bd8ea18a2b112942dce4f4220a97c2c8@us.ibm.com>
Reviewed-by: William G. Hoffa <7dd6aa5e78423995d9d7c7ecada5b77ee07f88cc@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <ab93eca12e43608f33daa16a67357cd7b7e867ab@us.ibm.com>

--- src/import/chips/p9/procedures/hwp/perv/p9_setup_sbe_config.C
+++ src/import/chips/p9/procedures/hwp/perv/p9_setup_sbe_config.C
@@ -96,8 +96,6 @@
     ATTR_DISABLE_HBBL_VECTORS_BIT      = 3,
     ATTR_MC_SYNC_MODE_BIT              = 4,
     ATTR_SLOW_PCI_REF_CLOCK_BIT        = 5,
-    ATTR_PROC_CHIP_MEM_TO_USE_STARTBIT = 6,
-    ATTR_PROC_CHIP_MEM_TO_USE_LENGTH   = 4,

     // Scratch_reg_6
     ATTR_PROC_EFF_FABRIC_GROUP_ID_STARTBIT = 17,
@@ -109,6 +107,8 @@
     ATTR_PROC_FABRIC_GROUP_ID_LENGTH   = 3,
     ATTR_PROC_FABRIC_CHIP_ID_STARTBIT  = 29,
     ATTR_PROC_FABRIC_CHIP_ID_LENGTH    = 3,
+    ATTR_PROC_CHIP_MEM_TO_USE_STARTBIT = 1,
+    ATTR_PROC_CHIP_MEM_TO_USE_LENGTH   = 6,
 };

@@ -424,7 +424,6 @@
         uint8_t l_disable_hbbl_vectors;
         uint32_t l_pll_mux;
         uint8_t l_mc_sync_mode;
-        uint8_t l_proc_chip_mem_to_use;
         uint8_t l_slow_pci_ref_clock;

         FAPI_DBG("Reading Scratch_reg5");
@@ -447,7 +446,6 @@
         FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_SYS_FORCE_ALL_CORES, FAPI_SYSTEM, l_force_all_cores));
         FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_DISABLE_HBBL_VECTORS, FAPI_SYSTEM, l_disable_hbbl_vectors));
         FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_MC_SYNC_MODE, i_target_chip, l_mc_sync_mode));
-        FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_PROC_CHIP_MEM_TO_USE, FAPI_SYSTEM, l_proc_chip_mem_to_use));
         FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_DD1_SLOW_PCI_REF_CLOCK, FAPI_SYSTEM, l_slow_pci_ref_clock));

         // set cache contained flag
@@ -492,11 +490,6 @@
         {
             l_read_scratch_reg.clearBit<ATTR_MC_SYNC_MODE_BIT>();
         }
-
-        // set which proc memory to use
-        l_read_scratch_reg.insert<ATTR_PROC_CHIP_MEM_TO_USE_STARTBIT,
-                                  ATTR_PROC_CHIP_MEM_TO_USE_LENGTH,
-                                  4>(l_proc_chip_mem_to_use);

         // set slow PCI ref clock bit
         if (l_slow_pci_ref_clock == fapi2::ENUM_ATTR_DD1_SLOW_PCI_REF_CLOCK_SLOW)
@@ -534,6 +527,7 @@
     //set_scratch6_reg
     {
         uint8_t l_pump_mode;
+        uint8_t l_proc_chip_mem_to_use;

         FAPI_DBG("Reading Scratch_reg6");

@@ -596,6 +590,14 @@
         (l_read_1);
         l_read_scratch_reg.insertFromRight< ATTR_PROC_EFF_FABRIC_CHIP_ID_STARTBIT, ATTR_PROC_EFF_FABRIC_CHIP_ID_LENGTH >
         (l_read_2);
+
+        FAPI_DBG("Reading ATTR_PROC_CHIP_MEM_TO_USE");
+        FAPI_TRY(FAPI_ATTR_GET(fapi2::ATTR_PROC_CHIP_MEM_TO_USE, i_target_chip, l_proc_chip_mem_to_use));
+
+        l_read_scratch_reg.setBit<0>();
+        // set which proc memory to use
+        l_read_scratch_reg.insertFromRight<ATTR_PROC_CHIP_MEM_TO_USE_STARTBIT,
+                                           ATTR_PROC_CHIP_MEM_TO_USE_LENGTH>(l_proc_chip_mem_to_use);

         FAPI_DBG("Setting up value of Scratch_reg6");


Also symbol lookup needs to remove the leading "_" on MacOS.

--- interpreter/cling/lib/Interpreter/IncrementalJIT.cpp
+++ interpreter/cling/lib/Interpreter/IncrementalJIT.cpp
@@ -12,6 +12,13 @@
 #include "IncrementalExecutor.h"

 #include "llvm/Support/DynamicLibrary.h"
+
+#ifdef __APPLE__
+// Apple adds an extra '_'
+# define MANGLE_PREFIX "_"
+#else
+# define MANGLE_PREFIX ""
+#endif

 using namespace llvm;

@@ -136,7 +143,13 @@
   /// possible weak symbols by the ExecutionEngine.
   /// It is used to resolve symbols during module linking.
   uint64_t getMissingSymbolAddress(const std::string &Name) override {
-    return (uint64_t) m_jit.getParent().NotifyLazyFunctionCreators(Name);
+    std::string NameNoPrefix;
+    if (MANGLE_PREFIX[0]
+        && !Name.compare(0, strlen(MANGLE_PREFIX), MANGLE_PREFIX))
+      NameNoPrefix = Name.substr(strlen(MANGLE_PREFIX), -1);
+    else
+      NameNoPrefix = std::move(Name);
+    return (uint64_t) m_jit.getParent().NotifyLazyFunctionCreators(NameNoPrefix);
   }

@@ -182,12 +195,6 @@

 uint64_t IncrementalJIT::getSymbolAddressWithoutMangling(llvm::StringRef Name) {
-#ifdef __APPLE__
-  // Apple adds an extra '_'
-# define MANGLE_PREFIX "_"
-#else
-# define MANGLE_PREFIX ""
-#endif
   if (Name == MANGLE_PREFIX "__cxa_atexit") {
     // Rewire __cxa_atexit to ~Interpreter(), thus also global destruction
     // coming from the JIT.
@@ -196,7 +203,6 @@
     // Provide IncrementalExecutor as the third argument to __cxa_atexit.
     return (uint64_t)&m_Parent;
   }
-#undef MANGLE_PREFIX
   if (uint64_t Addr = m_ExeMM->getSymbolAddress(Name))
     return Addr;
   if (uint64_t Addr = m_LazyEmitLayer.getSymbolAddress(Name, false))


filter-range: nothing really...

filter-range: nothing really...

--- filter/range/range_filter.cpp
+++ filter/range/range_filter.cpp
@@ -26,11 +26,48 @@

 using namespace std;

+typedef enum { NONE, RANGE, FUSABLE, STREAMABLE } tag_t;
+
+bh_error void ref_count(bh_ir* bhir, dag)
+{
+    for(bh_intp i=0; i< bhir->dag_list[dag].nnode; ++i) {
+        bh_intp id = bhir->dag_list[dag].node_map[i];
+        if (id < 0) {
+            id = -1*id-1;
+            bh_error err = ref_count(bhir, );
+            if (err != BH_SUCCESS)
+                return err;
+        } else {
+            bh_error err = func(&bhir->instr_list[id]);
+            if (err != BH_SUCCESS)
+                return err;
+        }
+    }
+    return BH_SUCCESS;
+}
+
 void range_filter(bh_ir* bhir)
 {
-    bh_intp nodes[] = {0};
-    cout << "### Range-filter searching through. ndag="<< bhir->ndag  << "." << endl;
-    bh_dag_split(bhir, 1, nodes, 0, -1);
+    cout << "### range-filter on bhir->ninstr = " << bhir->ninstr << endl;
+    for(bh_intp dag=0; dag<bhir->ndag; ++dag) {
+
+        cout << "Looking at dag[" << dag << "] " << dag+1 << " of "<< bhir->ndag << \
+                ", containing " << bhir->dag_list[dag].nnode << " node(s)" << endl;
+
+        if (bhir->dag_list[dag].tag != NONE) {      // Already tagged, skipping it.
+            cout << "Skipping it..." << endl;
+            continue;
+        }
+
+        for(bh_intp max_nodes=bhir->dag_list[dag].nnode; max_nodes>0; max_nodes--) {
+
+            bh_intp nodes[] = {0};
+            bh_dag_split(bhir, 1, nodes, dag, -1);  // Sub-graphing
+            bh_intp dag_idx = bhir->ndag-1;         // Index of sub-graph
+            bhir->dag_list[dag_idx].tag = RANGE;    // Tagging
+
+        }
+    }
     cout << "###" << endl;
 }


Be more accepting of spaces in range specification.

--- filters/range/RangeFilter.cpp
+++ filters/range/RangeFilter.cpp
@@ -95,6 +95,9 @@
             lb = std::numeric_limits<double>::min();
         pos += (end - start);

+        count = Utils::extract(r, pos, (int(*)(int))std::isspace);
+        pos += count;
+
         if (r[pos] != ':')
             throw std::string("Missing ':' limit separator.");
         pos++;
@@ -104,6 +107,9 @@
         if (start == end)
             ub = std::numeric_limits<double>::max();
         pos += (end - start);
+
+        count = Utils::extract(r, pos, (int(*)(int))std::isspace);
+        pos += count;

         if (r[pos] == ')')
             iub = false;


r1274@wxz:  (no author) | 2009-11-18 17:48:41 +0800  Let gtkmozembed display error messages on network errors.

--- extensions/gtkmoz_browser_element/browser_child.cc
+++ extensions/gtkmoz_browser_element/browser_child.cc
@@ -63,6 +63,8 @@
 #include <nsIGenericFactory.h>
 #include <nsIInterfaceRequestor.h>
 #include <nsIInterfaceRequestorUtils.h>
+#include <nsIPrefBranch.h>
+#include <nsIPrefService.h>
 #include <nsIScriptExternalNameSet.h>
 #include <nsIScriptGlobalObject.h>
 #include <nsIScriptNameSpaceManager.h>
@@ -1300,6 +1302,13 @@

   gtk_moz_embed_push_startup();
   InitCustomComponents();
+
+  nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
+  if (prefs) {
+    // To let mozilla display appropriate error messages on network errors.
+    prefs->SetBoolPref("browser.xul.error_pages.enabled", PR_TRUE);
+  }
+
   if (g_down_fd != 0) {
     // Only start ping timer in actual environment to ease testing.
     // Use high priority to ensure the callback is called even if the main


nothrow

nothrow

--- src/FbTk/TextureRender.cc
+++ src/FbTk/TextureRender.cc
@@ -1,5 +1,5 @@
 // TextureRender.cc for fluxbox
-// Copyright (c) 2002 - 2003 Henrik Kinnunen (fluxgen at users.sourceforge.net)
+// Copyright (c) 2002 - 2004 Henrik Kinnunen (fluxgen at users.sourceforge.net)
 //
 // from Image.cc for Blackbox - an X11 Window manager
 // Copyright (c) 1997 - 2000 Brad Hughes (bhughes at tcac.net)
@@ -22,7 +22,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.

-// $Id: TextureRender.cc,v 1.7 2004/01/21 14:16:41 fluxgen Exp $
+// $Id: TextureRender.cc,v 1.8 2004/01/21 20:19:50 fluxgen Exp $

 #include "TextureRender.hh"

@@ -59,7 +59,7 @@
         height = 3200;
     }

-    red = new unsigned char[width * height];
+    red = new(nothrow) unsigned char[width * height];
     if (red == 0) {
         char sbuf[128];
         sprintf(sbuf, "%d", width*height);
@@ -67,14 +67,14 @@
     }

-    green = new unsigned char[width * height];
+    green = new(nothrow) unsigned char[width * height];
     if (green == 0) {
         char sbuf[128];
         sprintf(sbuf, "%d", width*height);
         throw string("TextureRender::TextureRender(): Out of memory while allocating green buffer. size " + string(sbuf));
     }

-    blue = new unsigned char[width * height];
+    blue = new(nothrow) unsigned char[width * height];
     if (blue == 0) {
         char sbuf[128];
         sprintf(sbuf, "%d", width*height);


BLE: tag API uses in GenericGap.

BLE: tag API uses in GenericGap.

--- features/FEATURE_BLE/source/generic/GenericGap.cpp
+++ features/FEATURE_BLE/source/generic/GenericGap.cpp
@@ -466,9 +466,7 @@
 {
 }

-bool GenericGap::isFeatureSupported(
-    controller_supported_features_t feature
-)
+bool GenericGap::isFeatureSupported(controller_supported_features_t feature)
 {
     return _pal_gap.is_feature_supported(feature);
 }
@@ -548,6 +546,7 @@

 ble_error_t GenericGap::stopAdvertising()
 {
+    useVersionOneAPI();
     ble_error_t err = _pal_gap.advertising_enable(false);
     if (err) {
         return err;
@@ -588,6 +587,7 @@
     const GapScanningParams *scanParams
 )
 {
+    useVersionOneAPI();
     if (connectionParams == NULL) {
         connectionParams = &default_connection_params;
     }
@@ -631,6 +631,7 @@
     const GapScanningParams *scanParams
 )
 {
+    useVersionOneAPI();
     return connect(
         peerAddr,
         to_peer_address_type(peerAddrType),
@@ -646,6 +647,8 @@
     const ConnectionParameters &connectionParams
 )
 {
+    useVersionTwoAPI();
+
     if (!connectionParams.getNumberOfEnabledPhys()) {
         return BLE_ERROR_INVALID_PARAM;
     }
@@ -729,6 +732,8 @@
     conn_event_length_t maxConnectionEventLength
 )
 {
+    useVersionTwoAPI();
+
     if (supervisionTimeout <= minSupervisionTimeout(maxConnectionInterval, slaveLatency)) {
         return BLE_ERROR_INVALID_PARAM;
     }
@@ -754,6 +759,8 @@
     conn_event_length_t maxConnectionEventLength
 )
 {
+    useVersionTwoAPI();
+
     if (supervisionTimeout <= minSupervisionTimeout(maxConnectionInterval, slaveLatency)) {
         return BLE_ERROR_INVALID_PARAM;
     }
@@ -773,6 +780,8 @@
     connection_handle_t connectionHandle
 )
 {
+    useVersionTwoAPI();
+
     return _pal_gap.reject_connection_parameter_request(
         connectionHandle,
         pal::hci_error_code_t::UNACCEPTABLE_CONNECTION_PARAMETERS
@@ -781,6 +790,7 @@

 ble_error_t GenericGap::cancelConnect()
 {
+    useVersionTwoAPI();
     return _pal_gap.cancel_connection_creation();
 }

@@ -851,11 +861,15 @@
     local_disconnection_reason_t reason
 )
 {
+    useVersionTwoAPI();
+
     return _pal_gap.disconnect(connectionHandle, reason);
 }

 ble_error_t GenericGap::disconnect(Handle_t connectionHandle, DisconnectionReason_t reason)
 {
+    useVersionOneAPI();
+
     if (is_disconnection_reason_valid(reason) == false) {
         return BLE_ERROR_INVALID_PARAM;
     }
@@ -867,6 +881,8 @@

 ble_error_t GenericGap::updateConnectionParams(Handle_t handle, const ConnectionParams_t *params)
 {
+    useVersionOneAPI();
+
     if (is_connection_params_valid(params) == false) {
         return BLE_ERROR_PARAM_OUT_OF_RANGE;
     }
@@ -1078,6 +1094,8 @@

 ble_error_t GenericGap::setAdvertisingPolicyMode(AdvertisingPolicyMode_t mode)
 {
+    useVersionOneAPI();
+
     if (mode > ::Gap::ADV_POLICY_FILTER_ALL_REQS) {
         return BLE_ERROR_INVALID_PARAM;
     }
@@ -1090,6 +1108,8 @@
 {
     useVersionOneAPI();

+    useVersionOneAPI();
+
     if (mode > ::Gap::SCAN_POLICY_FILTER_ALL_ADV) {
         return BLE_ERROR_INVALID_PARAM;
     }
@@ -1100,6 +1120,8 @@

 ble_error_t GenericGap::setInitiatorPolicyMode(InitiatorPolicyMode_t mode)
 {
+    useVersionOneAPI();
+
     if (mode > ::Gap::INIT_POLICY_FILTER_ALL_ADV) {
         return BLE_ERROR_INVALID_PARAM;
     }
@@ -1110,6 +1132,7 @@

 ::Gap::AdvertisingPolicyMode_t GenericGap::getAdvertisingPolicyMode(void) const
 {
+    useVersionOneAPI();
     return (AdvertisingPolicyMode_t) _advertising_filter_policy.value();
 }

@@ -1121,6 +1144,7 @@

 ::Gap::InitiatorPolicyMode_t GenericGap::getInitiatorPolicyMode(void) const
 {
+    useVersionOneAPI();
     return (InitiatorPolicyMode_t) _initiator_policy_mode.value();
 }

@@ -1240,6 +1264,8 @@

 ble_error_t GenericGap::setAdvertisingData(const GapAdvertisingData &advData, const GapAdvertisingData &scanResponse)
 {
+    useVersionOneAPI();
+
     ble_error_t err = _pal_gap.set_advertising_data(
         advData.getPayloadLen(),
         pal::advertising_data_t(advData.getPayload(), advData.getPayloadLen())
@@ -1256,6 +1282,8 @@

 ble_error_t GenericGap::startAdvertising(const GapAdvertisingParams &params)
 {
+    useVersionOneAPI();
+
     if (is_advertising_params_valid(params) == false) {
         return BLE_ERROR_INVALID_PARAM;
     }
@@ -1605,7 +1633,7 @@
             (::Gap::DisconnectionReason_t) e.reason
         );
     } else {
-        // TODO: define what to do in case of faillure
+        // TODO: define what to do in case of failure
     }
 }

@@ -1842,12 +1870,14 @@

 uint8_t GenericGap::getMaxAdvertisingSetNumber()
 {
+    useVersionTwoAPI();
     uint8_t set_number = _pal_gap.get_max_number_of_advertising_sets();
     return std::min(MAX_ADVERTISING_SETS, set_number);
 }

 uint8_t GenericGap::getMaxAdvertisingDataLength()
 {
+    useVersionTwoAPI();
     return _pal_gap.get_maximum_advertising_data_length();
 }

@@ -1856,6 +1886,8 @@
     const AdvertisingParameters &parameters
 )
 {
+    useVersionTwoAPI();
+
     if (is_extended_advertising_available()) {
         return BLE_ERROR_OPERATION_NOT_PERMITTED;
     }
@@ -1885,6 +1917,8 @@

 ble_error_t GenericGap::destroyAdvertisingSet(advertising_handle_t handle)
 {
+    useVersionTwoAPI();
+
     if (is_extended_advertising_available()) {
         return BLE_ERROR_OPERATION_NOT_PERMITTED;
     }
@@ -1923,6 +1957,8 @@
     const AdvertisingParameters &params
 )
 {
+    useVersionTwoAPI();
+
     if (handle >= getMaxAdvertisingSetNumber()) {
         return BLE_ERROR_INVALID_PARAM;
     }
@@ -2001,6 +2037,8 @@
     mbed::Span<const uint8_t> payload
 )
 {
+    useVersionTwoAPI();
+
     return setAdvertisingData(
         handle,
         payload,
@@ -2014,6 +2052,8 @@
     mbed::Span<const uint8_t> response
 )
 {
+    useVersionTwoAPI();
+
     return setAdvertisingData(
         handle,
         response,
@@ -2124,6 +2164,8 @@
     uint8_t maxEvents
 )
 {
+    useVersionTwoAPI();
+
     ble_error_t error = BLE_ERROR_NONE;

     if (handle >= getMaxAdvertisingSetNumber()) {
@@ -2187,6 +2229,8 @@

 ble_error_t GenericGap::stopAdvertising(advertising_handle_t handle)
 {
+    useVersionTwoAPI();
+
     if (handle >= getMaxAdvertisingSetNumber()) {
         return BLE_ERROR_INVALID_PARAM;
     }
@@ -2218,6 +2262,8 @@

 bool GenericGap::isAdvertisingActive(advertising_handle_t handle)
 {
+    useVersionTwoAPI();
+
     if (handle >= getMaxAdvertisingSetNumber()) {
         return BLE_ERROR_INVALID_PARAM;
     }
@@ -2232,6 +2278,8 @@
     bool advertiseTxPower
 )
 {
+    useVersionTwoAPI();
+
     if (periodicAdvertisingIntervalMin.value() > periodicAdvertisingIntervalMax.value()) {
         return BLE_ERROR_INVALID_PARAM;
     }
@@ -2261,6 +2309,8 @@
     mbed::Span<const uint8_t> payload
 )
 {
+    useVersionTwoAPI();
+
     if (handle == LEGACY_ADVERTISING_HANDLE) {
         return BLE_ERROR_INVALID_PARAM;
     }
@@ -2316,6 +2366,8 @@

 ble_error_t GenericGap::startPeriodicAdvertising(advertising_handle_t handle)
 {
+    useVersionTwoAPI();
+
     if (handle == LEGACY_ADVERTISING_HANDLE) {
         return BLE_ERROR_INVALID_PARAM;
     }
@@ -2347,6 +2399,8 @@

 ble_error_t GenericGap::stopPeriodicAdvertising(advertising_handle_t handle)
 {
+    useVersionTwoAPI();
+
     if (handle == LEGACY_ADVERTISING_HANDLE) {
         return BLE_ERROR_INVALID_PARAM;
     }
@@ -2362,7 +2416,6 @@
     if (_active_periodic_sets.get(handle) == false) {
         return BLE_ERROR_INVALID_STATE;
     }
-

     ble_error_t err = _pal_gap.periodic_advertising_enable(false, handle);
     if (err) {
@@ -2375,6 +2428,8 @@

 bool GenericGap::isPeriodicAdvertisingActive(advertising_handle_t handle)
 {
+    useVersionTwoAPI();
+
     if (handle >= getMaxAdvertisingSetNumber()) {
         return BLE_ERROR_INVALID_PARAM;
     }
@@ -2722,6 +2777,8 @@
     sync_timeout_t timeout
 )
 {
+    useVersionTwoAPI();
+
     if (is_extended_advertising_available() == false) {
         return BLE_ERROR_NOT_IMPLEMENTED;
     }
@@ -2751,6 +2808,8 @@
     sync_timeout_t timeout
 )
 {
+    useVersionTwoAPI();
+
     if (is_extended_advertising_available() == false) {
         return BLE_ERROR_NOT_IMPLEMENTED;
     }
@@ -2767,6 +2826,8 @@

 ble_error_t GenericGap::cancelCreateSync()
 {
+    useVersionTwoAPI();
+
     if (is_extended_advertising_available() == false) {
         return BLE_ERROR_NOT_IMPLEMENTED;
     }
@@ -2776,6 +2837,8 @@

 ble_error_t GenericGap::terminateSync(periodic_sync_handle_t handle)
 {
+    useVersionTwoAPI();
+
     if (is_extended_advertising_available() == false) {
         return BLE_ERROR_NOT_IMPLEMENTED;
     }
@@ -2789,6 +2852,8 @@
     advertising_sid_t sid
 )
 {
+    useVersionTwoAPI();
+
     if (is_extended_advertising_available() == false) {
         return BLE_ERROR_NOT_IMPLEMENTED;
     }
@@ -2816,6 +2881,8 @@
     advertising_sid_t sid
 )
 {
+    useVersionTwoAPI();
+
     if (is_extended_advertising_available() == false) {
         return BLE_ERROR_NOT_IMPLEMENTED;
     }
@@ -2839,6 +2906,8 @@

 ble_error_t GenericGap::clearPeriodicAdvertiserList()
 {
+    useVersionTwoAPI();
+
     if (is_extended_advertising_available() == false) {
         return BLE_ERROR_NOT_IMPLEMENTED;
     }
@@ -2848,6 +2917,8 @@

 uint8_t GenericGap::getMaxPeriodicAdvertiserListSize()
 {
+    useVersionTwoAPI();
+
     if (is_extended_advertising_available() == false) {
         return BLE_ERROR_NOT_IMPLEMENTED;
     }


share the setting for the device name length

Change-Id: I5605d05240bc110916400239db203eeb6b8dde35

--- sc/source/core/opencl/openclwrapper.cxx
+++ sc/source/core/opencl/openclwrapper.cxx
@@ -38,6 +38,8 @@
 #else
 #define OPENCL_DLL_NAME "libOpenCL.so"
 #endif
+
+#define DEVICE_NAME_LENGTH 1024

 using namespace std;

@@ -218,7 +220,7 @@
         char fileName[256] = { 0 }, cl_name[128] = { 0 };
         if ( gpuEnv.mpArryDevsID[i] != 0 )
         {
-            char deviceName[1024];
+            char deviceName[DEVICE_NAME_LENGTH];
             clStatus = clGetDeviceInfo( gpuEnv.mpArryDevsID[i], CL_DEVICE_NAME, sizeof(deviceName), deviceName, NULL );
             CHECK_OPENCL( clStatus, "clGetDeviceInfo" );
             str = (char*) strstr( clFileName, (char*) ".cl" );
@@ -301,7 +303,7 @@

         if ( binarySizes[i] != 0 )
         {
-            char deviceName[1024];
+            char deviceName[DEVICE_NAME_LENGTH];
             clStatus = clGetDeviceInfo(mpArryDevsID[i], CL_DEVICE_NAME,
                            sizeof(deviceName), deviceName, NULL);
             CHECK_OPENCL( clStatus, "clGetDeviceInfo" );
@@ -2633,15 +2635,15 @@
     OpenclDeviceInfo aDeviceInfo;
     aDeviceInfo.device = aDeviceId;

-    char pName[64];
-    cl_int nState = clGetDeviceInfo(aDeviceId, CL_DEVICE_NAME, 64, pName, NULL);
+    char pName[DEVICE_NAME_LENGTH];
+    cl_int nState = clGetDeviceInfo(aDeviceId, CL_DEVICE_NAME, DEVICE_NAME_LENGTH, pName, NULL);
     if(nState != CL_SUCCESS)
         return;

     aDeviceInfo.maName = OUString::createFromAscii(pName);

-    char pVendor[64];
-    nState = clGetDeviceInfo(aDeviceId, CL_DEVICE_VENDOR, 64, pName, NULL);
+    char pVendor[DEVICE_NAME_LENGTH];
+    nState = clGetDeviceInfo(aDeviceId, CL_DEVICE_VENDOR, DEVICE_NAME_LENGTH, pName, NULL);
     if(nState != CL_SUCCESS)
         return;


Revertback

Revertback

--- firmware/Spark-Websockets.cpp
+++ firmware/Spark-Websockets.cpp
@@ -525,7 +525,7 @@
 	#ifdef HANDSHAKE
 		  Serial.println("Reading handshake!");
 	#endif
-	bool result = false;
+	bool result = true;
 	char line[128];
 	int maxAttempts = 300, attempts = 0;


simplify call

simplify call

--- features/FEATURE_BLE/source/generic/GenericGap.tpp
+++ features/FEATURE_BLE/source/generic/GenericGap.tpp
@@ -1613,11 +1613,7 @@
         _event_queue.post(
             mbed::callback(
                 this,
-                &GenericGap<
-                    PalGapImpl,
-                    PalSecurityManager,
-                    ConnectionEventMonitorEventHandler
-                >::process_legacy_scan_timeout
+                &GenericGap::process_legacy_scan_timeout
             )
         );
     } else {


Fix to correctly set the number of channels per buffer

--- Player/DecoderStateData.cpp
+++ Player/DecoderStateData.cpp
@@ -61,7 +61,7 @@
 	AudioStreamBasicDescription formatDescription = mDecoder->GetFormat();

 	UInt32 numBuffers = (kAudioFormatFlagIsNonInterleaved & formatDescription.mFormatFlags) ? formatDescription.mChannelsPerFrame : 1;
-	UInt32 channelsPerBuffer = numBuffers;
+	UInt32 channelsPerBuffer = (kAudioFormatFlagIsNonInterleaved & formatDescription.mFormatFlags) ? 1 : formatDescription.mChannelsPerFrame;

 	mBufferList = static_cast<AudioBufferList *>(calloc(1, offsetof(AudioBufferList, mBuffers) + (sizeof(AudioBuffer) * numBuffers)));


Modified: IBL example

Modified: IBL example

--- Source/Examples/Rendering/13_IBL.cpp
+++ Source/Examples/Rendering/13_IBL.cpp
@@ -71,11 +71,14 @@
     "    return vec2(diff, spec);                                               \n"
     "}                                                                          \n"
     "                                                                           \n"
-    "float fresnel(float ndotl, float bias, float pow)                          \n"
+    "float fresnel(float ndotl, float reflectance, float pow)                   \n"
     "{                                                                          \n"
     "    float facing = (1.0 - ndotl);                                          \n"
-    "    return max(bias + (1.0 - bias) * pow(facing, pow), 0.0);               \n"
-    "}                                                                          \n"
+    "    return max(reflectance + (1.0 - reflectance) * pow(facing, pow), 0.0); \n"
+    "}                                                                          \n"
+    "                                                                           \n"
+    "const float Eta = 0.66; // Ratio of indices of refraction                  \n"
+    "const float F = ((1.0-Eta) * (1.0-Eta)) / ((1.0+Eta) * (1.0+Eta));         \n"
     "                                                                           \n"
     "void main()                                                                \n"
     "{                                                                          \n"
@@ -86,7 +89,7 @@
     "   vec2  bln   = blinn(ldir, norm, cdir);                                  \n"
     "   vec2  lc    = lit(bln.x, bln.y, 0.95);                                  \n"
     "   float fs    = fresnel(bln.x, 0.2, 5.0);                                 \n"
-    "   float fe    = fresnel(dot(-cdir, norm), 0.2, 5.0);                       \n"
+    "   float fe    = fresnel(dot(-cdir, norm), F, 2.0);                        \n"
     "   float spec  = fs * pow(lc.y, 64.0);                                     \n"
     "   vec3  final = light.color * light.intensity * (lc.x + pow(lc.y, 64.0)); \n"
     "   gl_FragColor = vec4(mix(final, env, fe), 1.0);                          \n"
@@ -161,7 +164,7 @@
     {
         Logger::setStandardLogger();

-        if (!initialize(800 / 3, 600 / 3))
+        if (!initialize(800, 600))
         {
             application->quit(-1);
         }


shaving shaving shaving

shaving shaving shaving

--- demo/snes_spc/SNES_SPC.cpp
+++ demo/snes_spc/SNES_SPC.cpp
@@ -111,8 +111,6 @@

 //// Memory access extras
-
-#define MEM_ACCESS( time, addr )

 // divided into multiple functions to keep rarely-used functionality separate
 // so often-used functionality can be optimized better by compiler
@@ -221,8 +219,6 @@

 void SNES_SPC::cpu_write( int data, int addr, rel_time_t time )
 {
-	MEM_ACCESS( time, addr )
-
 	// RAM
 	RAM [addr] = (uint8_t) data;
 	int reg = addr - 0xF0;
@@ -275,8 +271,6 @@

 int SNES_SPC::cpu_read( int addr, rel_time_t time )
 {
-	MEM_ACCESS( time, addr )
-
 	// RAM
 	int result = RAM [addr];
 	int reg = addr - 0xF0;


include config.h

include config.h

--- Cantera/src/CVodesIntegrator.cpp
+++ Cantera/src/CVodesIntegrator.cpp
@@ -4,6 +4,7 @@
  */

 // Copyright 2001  California Institute of Technology
+#include "config.h"

 #include "CVodesIntegrator.h"
 #include "stringUtils.h"


Simplify WatchPoint constructor

Simplify WatchPoint constructor

--- file-events/src/file-events/cpp/win_fsnotifier.cpp
+++ file-events/src/file-events/cpp/win_fsnotifier.cpp
@@ -12,7 +12,8 @@
 WatchPoint::WatchPoint(Server* server, size_t eventBufferSize, const wstring& path)
     : pathW(path)
     , path(u16string(path.begin(), path.end()))
-    , status(WatchPointStatus::NOT_LISTENING) {
+    , status(WatchPointStatus::NOT_LISTENING)
+    , server(server) {
     HANDLE directoryHandle = CreateFileW(
         pathW.c_str(),          // pointer to the file name
         FILE_LIST_DIRECTORY,    // access (read/write) mode
@@ -26,8 +27,6 @@
         throw FileWatcherException("Couldn't add watch", this->path, GetLastError());
     }
     this->directoryHandle = directoryHandle;
-
-    this->server = server;
     this->eventBuffer.reserve(eventBufferSize);
     ZeroMemory(&this->overlapped, sizeof(OVERLAPPED));
     this->overlapped.hEvent = this;


+ Workaround for crash in webkit engine for Qt 4.8.5

--- src/Gui/BitmapFactory.cpp
+++ src/Gui/BitmapFactory.cpp
@@ -194,6 +194,9 @@
 {
     QFileInfo fi(filename);
     if (fi.exists()) {
+        // There is a crash when using the Webkit engine in debug mode
+        // for a couple of SVG files. Thus, use the qsvg plugin.
+#if QT_VERSION < 0x040800 || !defined(_DEBUG)
         // first check if it's an SVG because Qt's qsvg4 module shouldn't be used therefore
         if (fi.suffix().toLower() == QLatin1String("svg")) {
             QFile svgFile(filename);
@@ -206,6 +209,9 @@
             // try with Qt plugins
             icon.load(filename);
         }
+#else
+        icon.load(filename);
+#endif
     }

     return !icon.isNull();
@@ -314,15 +320,20 @@
     webView.setPalette(pal);
     webView.setContent(contents, QString::fromAscii("image/svg+xml"));
     QString node = QString::fromAscii("document.rootElement.nodeName");
-    QString root = webView.page()->mainFrame()->evaluateJavaScript(node).toString();
+    QWebFrame* frame = webView.page()->mainFrame();
+    if (!frame) {
+        return QPixmap();
+    }
+
+    QString root = frame->evaluateJavaScript(node).toString();
     if (root.isEmpty() || root.compare(QLatin1String("svg"), Qt::CaseInsensitive)) {
         return QPixmap();
     }

     QString w = QString::fromAscii("document.rootElement.width.baseVal.value");
     QString h = QString::fromAscii("document.rootElement.height.baseVal.value");
-    double ww = webView.page()->mainFrame()->evaluateJavaScript(w).toDouble();
-    double hh = webView.page()->mainFrame()->evaluateJavaScript(h).toDouble();
+    double ww = frame->evaluateJavaScript(w).toDouble();
+    double hh = frame->evaluateJavaScript(h).toDouble();
     if (ww == 0.0 || hh == 0.0)
         return QPixmap();
 #endif
@@ -341,7 +352,7 @@
     p.setRenderHint(QPainter::TextAntialiasing);
     p.setRenderHint(QPainter::SmoothPixmapTransform);
     p.setOpacity(0); // important to keep transparent background
-    webView.page()->mainFrame()->render(&p);
+    frame->render(&p);
 #else
     // tmp. disable the report window to suppress some bothering warnings
     Base::Console().SetEnabledMsgType("ReportOutput", ConsoleMsgType::MsgType_Wrn, false);


Fixed SceneCache build problem on OS X.

Fixed SceneCache build problem on OS X.

--- src/IECore/SceneCache.cpp
+++ src/IECore/SceneCache.cpp
@@ -862,7 +862,7 @@
 				h.append( it->value() );
 				h.append( '/' );
 			}
-			h.append(sample);
+			h.append( (uint64_t)sample );
 			return h;
 		}

@@ -906,7 +906,7 @@
 				h.append( '/' );
 			}
 			h.append(name.value());
-			h.append(sample);
+			h.append( (uint64_t)sample );
 			return h;
 		}


add tests for popback in all scenarios

add tests for popback in all scenarios

--- Project2Tests/listTests.cpp
+++ Project2Tests/listTests.cpp
@@ -304,5 +304,118 @@
 			Assert::IsTrue(test.head() == nullptr);
 			Assert::IsTrue(test.tail() == nullptr);
 		}
+
+		TEST_METHOD(TestPopBackEmptyList) {
+			bool exceptionThrown = false;
+			auto test = CDLL<int>();
+			try {
+				test.pop_back();
+			}
+			catch (runtime_error) {
+				exceptionThrown = true;
+			}
+			Assert::IsTrue(exceptionThrown);
+		}
+
+		TEST_METHOD(TestPopBackAfterPushBack) {
+			auto test = CDLL<int>();
+			test.push_back(1);
+			Assert::AreEqual(1, test.pop_back());
+			Assert::IsTrue(test.head() == nullptr);
+			Assert::IsTrue(test.tail() == nullptr);
+		}
+
+		TEST_METHOD(TestPopBackAfterTwoPushBack) {
+			auto test = CDLL<int>();
+			test.push_back(1);
+			test.push_back(2);
+			Assert::AreEqual(2, test.pop_back());
+			Assert::IsTrue(test.tail()->next->prev == test.tail());
+			Assert::IsTrue(test.tail()->prev->next == test.tail());
+			Assert::AreEqual(1, test.pop_back());
+			Assert::IsTrue(test.head() == nullptr);
+			Assert::IsTrue(test.tail() == nullptr);
+		}
+
+		TEST_METHOD(TestPopBackAfterThreePushBack) {
+			auto test = CDLL<int>();
+			test.push_back(1);
+			test.push_back(2);
+			test.push_back(3);
+			Assert::AreEqual(3, test.pop_back());
+			Assert::IsTrue(test.tail()->next->prev == test.tail());
+			Assert::IsTrue(test.tail()->prev->next == test.tail());
+			Assert::AreEqual(2, test.pop_back());
+			Assert::IsTrue(test.tail()->next->prev == test.tail());
+			Assert::IsTrue(test.tail()->prev->next == test.tail());
+			Assert::AreEqual(1, test.pop_back());
+			Assert::IsTrue(test.head() == nullptr);
+			Assert::IsTrue(test.tail() == nullptr);
+		}
+
+		TEST_METHOD(TestPopBackAfterPushFront) {
+			auto test = CDLL<int>();
+			test.push_front(1);
+			Assert::AreEqual(1, test.pop_back());
+			Assert::IsTrue(test.head() == nullptr);
+			Assert::IsTrue(test.tail() == nullptr);
+		}
+
+		TEST_METHOD(TestPopBackAfterTwoPushFront) {
+			auto test = CDLL<int>();
+			test.push_front(1);
+			test.push_front(2);
+			Assert::AreEqual(1, test.pop_back());
+			Assert::IsTrue(test.tail()->next->prev == test.tail());
+			Assert::IsTrue(test.tail()->prev->next == test.tail());
+			Assert::AreEqual(2, test.pop_back());
+			Assert::IsTrue(test.head() == nullptr);
+			Assert::IsTrue(test.tail() == nullptr);
+		}
+
+		TEST_METHOD(TestPopBackAfterThreePushFront) {
+			auto test = CDLL<int>();
+			test.push_front(1);
+			test.push_front(2);
+			test.push_front(3);
+			Assert::AreEqual(1, test.pop_back());
+			Assert::IsTrue(test.tail()->next->prev == test.tail());
+			Assert::IsTrue(test.tail()->prev->next == test.tail());
+			Assert::AreEqual(2, test.pop_back());
+			Assert::IsTrue(test.tail()->next->prev == test.tail());
+			Assert::IsTrue(test.tail()->prev->next == test.tail());
+			Assert::AreEqual(3, test.pop_back());
+			Assert::IsTrue(test.head() == nullptr);
+			Assert::IsTrue(test.tail() == nullptr);
+		}
+
+		TEST_METHOD(TestPopBackRandomPushSeries) {
+			auto test = CDLL<int>();
+			test.push_back(1);
+			test.push_front(4);
+			test.push_back(3);
+			test.push_front(2);
+			test.push_back(5);
+			test.push_back(6);
+
+			Assert::AreEqual(6, test.pop_back());
+			Assert::IsTrue(test.tail()->next->prev == test.tail());
+			Assert::IsTrue(test.tail()->prev->next == test.tail());
+			Assert::AreEqual(5, test.pop_back());
+			Assert::IsTrue(test.tail()->next->prev == test.tail());
+			Assert::IsTrue(test.tail()->prev->next == test.tail());
+			Assert::AreEqual(3, test.pop_back());
+			Assert::IsTrue(test.tail()->next->prev == test.tail());
+			Assert::IsTrue(test.tail()->prev->next == test.tail());
+			Assert::AreEqual(1, test.pop_back());
+			Assert::IsTrue(test.tail()->next->prev == test.tail());
+			Assert::IsTrue(test.tail()->prev->next == test.tail());
+			Assert::AreEqual(4, test.pop_back());
+			Assert::IsTrue(test.tail()->next->prev == test.tail());
+			Assert::IsTrue(test.tail()->prev->next == test.tail());
+			Assert::AreEqual(2, test.pop_back());
+			Assert::IsTrue(test.head() == nullptr);
+			Assert::IsTrue(test.tail() == nullptr);
+		}
 	};
 }


fwk147: #i112578# Remove Sleep command used for debugging

--- desktop/source/app/app.cxx
+++ desktop/source/app/app.cxx
@@ -474,8 +474,6 @@
     RTL_LOGFILE_CONTEXT( aLog, "desktop (cd100003) ::Desktop::Init" );
     SetBootstrapStatus(BS_OK);

-    Sleep(10000);
-
     // create service factory...
     Reference < XMultiServiceFactory > rSMgr = CreateApplicationServiceManager();
     if( rSMgr.is() )


FIX: compile error

FIX: compile error

--- Qmitk/QmitkRenderWindow.cpp
+++ Qmitk/QmitkRenderWindow.cpp
@@ -157,7 +157,7 @@
   QGLWidget::mousePressEvent(me);
   if (m_Renderer.IsNotNull())
   {
-    Point2D p; p[0]=me->x(); p[1]=me->y();
+    mitk::Point2D p; p[0]=me->x(); p[1]=me->y();
     mitk::MouseEvent event(m_Renderer, me->type(), me->button(), me->state(), Qt::Key_unknown, p);
     m_Renderer->MousePressEvent(&event);
   }
@@ -169,7 +169,7 @@
   QGLWidget::mouseReleaseEvent(me);
   if (m_Renderer.IsNotNull())
   {
-    Point2D p; p[0]=me->x(); p[1]=me->y();
+    mitk::Point2D p; p[0]=me->x(); p[1]=me->y();
     mitk::MouseEvent event(m_Renderer, me->type(), me->button(), me->state(), Qt::Key_unknown, p);
     m_Renderer->MouseReleaseEvent(&event);
   }
@@ -180,7 +180,7 @@
 {
   QGLWidget::mouseMoveEvent(me);
   if (m_Renderer.IsNotNull()) {
-    Point2D p; p[0]=me->x(); p[1]=me->y();
+    mitk::Point2D p; p[0]=me->x(); p[1]=me->y();
     mitk::MouseEvent event(m_Renderer, me->type(), me->button(), me->state(), Qt::Key_unknown, p);
     m_Renderer->MouseMoveEvent(&event);
   }


Plausible-looking fix for trunk llvm.

Plausible-looking fix for trunk llvm.

However it segfaults inside the enginer builder.
Further investigation required.

--- src/JITCompiledModule.cpp
+++ src/JITCompiledModule.cpp
@@ -141,7 +141,10 @@
     engine_builder.setErrorStr(&error_string);
     engine_builder.setEngineKind(EngineKind::JIT);
     #ifdef USE_MCJIT
+    #if LLVM_VERSION < 36
+    // >= 3.6 there is only mcjit
     engine_builder.setUseMCJIT(true);
+    #endif
     JITMemoryManager *memory_manager = JITMemoryManager::CreateDefaultMemManager();
     engine_builder.setJITMemoryManager(memory_manager);
     #else


llvmrd: block mapping fixes + function pointers

Signed-off-by: Tomas Jasek <a36b4b6684030202c63b2f0239a51fa8d4eaac8c@gmail.com>

--- src/llvm/analysis/ReachingDefinitions/ReachingDefinitions.cpp
+++ src/llvm/analysis/ReachingDefinitions/ReachingDefinitions.cpp
@@ -512,11 +512,17 @@

                     if (subg.first->successorsNum() > 0) {
                         RDBlock *succBB = (*subg.first->getSuccessors().begin())->getBBlock();
-                        if (succBB)
+                        if (succBB != nullptr) {
                             rb->addSuccessor(succBB);
-                        else
-                            rb->addSuccessor(rb);
-
+                        } else {
+                            fprintf(stderr, "Node without succBB: %d %p\nsuccBB: %x\n", (*subg.first->getSuccessors().begin())->getType(), *subg.first->getSuccessors().begin(), succBB );
+                        }
+                    }
+
+
+                    // if the function consists of single node(intrinsics, undefined etc)
+                    // do not add more nodes for this function
+                    if (subg.first != subg.second) {
                         // successors for blocks with return will be added later
                         new_block = new RDBlock();
                         addBlock(const_cast<llvm::BasicBlock *>(&block), new_block);
@@ -524,11 +530,19 @@
                         new_block->append(subg.second);
                         rb = new_block;

-                        RDBlock *predBB = (*subg.second->getPredecessors().begin())->getBBlock();
-                        if (predBB)
-                            predBB->addSuccessor(new_block);
-                        else
-                            rb->addSuccessor(new_block);
+                        for (RDNode *pred : subg.second->getPredecessors()) {
+                            RDBlock *predBB = pred->getBBlock();
+                            if (pred != subg.second && predBB) {
+                                predBB->addSuccessor(rb);
+                            } else if (!predBB) {
+                                for (RDNode *p2 : pred->getPredecessors()) {
+                                    if (p2->getBBlock() != predBB) {
+                                        p2->getBBlock()->addSuccessor(rb);
+                                        p2->getBBlock()->append(pred);
+                                    }
+                                }
+                            }
+                        }
                     }

                     // new nodes will connect to the return node
@@ -658,6 +672,7 @@
         if (!first) {
             first = blocks[0]->getFirstNode();
             fstblock = blocks[0];
+            fstblock->prepend(root);
         }

         built_blocks[&block] = std::move(blocks);
@@ -696,6 +711,7 @@
     last_function_block->append(ret);
     for (RDNode *r : rets) {
         makeEdge(r, ret);
+        assert( r->getBBlock() );
         if (r->getBBlock() != last_function_block)
             r->getBBlock()->addSuccessor(last_function_block);
     }
@@ -939,6 +955,7 @@
                 }

                 makeEdge(call_funcptr, cf.first);
+                rb->addSuccessor((*cf.first->getSuccessors().begin())->getBBlock());
                 makeEdge(cf.second, ret_call);
             }
         } else {


Remove also argument -t in the metadata command line

--- src/Launcher/Launcher.cpp
+++ src/Launcher/Launcher.cpp
@@ -130,21 +130,23 @@
 	this->stream << rang::tag::comment << std::endl;
 }

-std::string remove_sim_meta(const std::string& cmd)
+std::string remove_argument(const std::string& cmd, std::string arg)
 {
 #if !defined(__clang__) && !defined(__llvm__) && defined(__GNUC__) && defined(__cplusplus) && __GNUC__ < 5
-	const std::string simmeta = " --sim-meta ";
-	auto pos_arg = cmd.find(simmeta);
+
+	if (arg.front() != ' ')
+		arg = " " + arg;
+	auto pos_arg = cmd.find(arg);

 	if (pos_arg == std::string::npos)
 		return cmd;

-	auto pos_start = cmd.find("\"", pos_arg + simmeta.size());
+	auto pos_start = cmd.find("\"", pos_arg + arg.size());
 	auto pos_end   = cmd.find("\"", pos_start + 1);

 	return cmd.substr(0, pos_arg) + cmd.substr(pos_end + 1);
 #else
-	return std::regex_replace(cmd, std::regex("( --sim-meta \"[^\"]*\")"), "");
+	return std::regex_replace(cmd, std::regex("( " + arg + " \"[^\"]*\")"), "");
 #endif
 }

@@ -179,7 +181,7 @@
 	if (!this->params_common.meta.empty())
 	{
 		stream << "[metadata]" << std::endl;
-		stream << "command=" << remove_sim_meta(cmd_line) << std::endl;
+		stream << "command=" << remove_argument(remove_argument(cmd_line, "--sim-meta"), "-t") << std::endl;
 		stream << "title=" << this->params_common.meta << std::endl;
 		stream << std::endl << "[trace]" << std::endl;
 	}


Fix the identify timer logic on the esp32 all-clusters-app (#3917)

* Fix the identify timer logic on the esp32 all-clusters-app

* review suggestion

Co-authored-by: Boris Zbarsky <a129bf763f99531def15560dcd67a8ee94032ae1@apple.com>

Co-authored-by: Boris Zbarsky <a129bf763f99531def15560dcd67a8ee94032ae1@apple.com>

--- examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp
+++ examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp
@@ -36,7 +36,7 @@
 #include <lib/mdns/DiscoveryManager.h>
 #include <support/CodeUtils.h>

-static const char * TAG = "echo-devicecallbacks";
+static const char * TAG = "app-devicecallbacks";

 using namespace ::chip;
 using namespace ::chip::Inet;
@@ -134,12 +134,11 @@
 {
     statusLED1.Animate();

-    // Decrement the timer count.
-    identifyTimerCount--;
-
     if (identifyTimerCount)
     {
         SystemLayer.StartTimer(kIdentifyTimerDelayMS, IdentifyTimerHandler, appState);
+        // Decrement the timer count.
+        identifyTimerCount--;
     }
 }

@@ -150,7 +149,7 @@

     statusLED1.Blink(kIdentifyTimerDelayMS * 2);

-    // timerCount represents the number of callback execution before the we stopped the timer.
+    // timerCount represents the number of callback executions before we stop the timer.
     // value is expressed in seconds and the timer is fired every 250ms, so just multiply value by 4.
     // Also, we want timerCount to be odd number, so the ligth state ends in the same state it starts.
     identifyTimerCount = (*value) * 4;


Misc ex7 bugfix for --disable-second

Misc ex7 bugfix for --disable-second

--- examples/miscellaneous/miscellaneous_ex7/biharmonic_jr.C
+++ examples/miscellaneous/miscellaneous_ex7/biharmonic_jr.C
@@ -23,7 +23,7 @@
 {
   // Check that we can actually compute second derivatives
 #ifndef LIBMESH_ENABLE_SECOND_DERIVATIVES
-  ERROR("Must have second derivatives enabled");
+  libmesh_error_msg("Must have second derivatives enabled");
 #endif

 #ifdef LIBMESH_ENABLE_PERIODIC


Fixed bug in code that selected which state to use.

--- WidgetSets/Falagard/src/FalFrameWindow.cpp
+++ WidgetSets/Falagard/src/FalFrameWindow.cpp
@@ -49,7 +49,7 @@
             return;

         // build state name
-        String stateName(d_enabled ? ((d_parent && d_parent->isActive()) ? "Active" : "Inactive") : "Disabled");
+        String stateName(d_enabled ? (isActive() ? "Active" : "Inactive") : "Disabled");
         stateName += d_titlebar->isVisible() ? "WithTitle" : "NoTitle";
         stateName += d_frameEnabled ? "WithFrame" : "NoFrame";


BUG: Deal with overconstrained cases. (A point placer + constrained axis aligned motion).       Tried to fix this thrice already. Its not even funny anymore.

--- Widgets/vtkPointHandleRepresentation3D.cxx
+++ Widgets/vtkPointHandleRepresentation3D.cxx
@@ -28,7 +28,7 @@
 #include "vtkRenderWindow.h"
 #include "vtkFocalPlanePointPlacer.h"

-vtkCxxRevisionMacro(vtkPointHandleRepresentation3D, "1.14");
+vtkCxxRevisionMacro(vtkPointHandleRepresentation3D, "1.15");
 vtkStandardNewMacro(vtkPointHandleRepresentation3D);

 vtkCxxSetObjectMacro(vtkPointHandleRepresentation3D,Property,vtkProperty);
@@ -68,7 +68,7 @@

   // The size of the hot spot
   this->HotSpotSize = 0.05;
-  this->WaitingForMotion = 1;
+  this->WaitingForMotion = 0;
   this->ConstraintAxis = -1;

   // Current handle size
@@ -216,7 +216,7 @@

   // Okay, figure out constraint. First see if the choice is
   // outside the hot spot
-  if ( ! this->WaitingForMotion )
+  if ( ! x )
     {
     double p[3], d2, tol;
     this->CursorPicker->GetPickPosition(p);
@@ -234,8 +234,9 @@
       return -1;
       }
     }
-  else if ( this->WaitingForMotion && x)
-    {
+  else if ( x)
+    {
+    this->WaitingForMotion = 0;
     double v[3];
     v[0] = fabs(x[0] - startPickPoint[0]);
     v[1] = fabs(x[1] - startPickPoint[1]);
@@ -274,6 +275,7 @@
     this->ConstraintAxis = -1;
     }
   this->Cursor3D->SetTranslationMode(this->TranslationMode);
+  this->WaitCount = 0;
 }

@@ -307,7 +309,9 @@
   if ( this->InteractionState == vtkHandleRepresentation::Selecting ||
        this->InteractionState == vtkHandleRepresentation::Translating )
     {
-    if ( !this->WaitingForMotion || this->WaitCount++ > 3 )
+    this->WaitCount++;
+
+    if ( this->WaitCount > 3 || !this->Constrained )
       {
       vtkInteractorObserver::ComputeDisplayToWorld(
           this->Renderer,
@@ -323,7 +327,7 @@
         // If we are doing axis constrained motion, igonore the placer.
         // Can't have both the placer and an axis constraint dictating
         // handle placement.
-        if (this->ConstraintAxis >= 0)
+        if (this->ConstraintAxis >= 0 || this->Constrained)
           {
           this->MoveFocus( prevPickPoint, pickPoint );
           }
@@ -352,7 +356,7 @@
         // If we are doing axis constrained motion, igonore the placer.
         // Can't have both the placer and the axis constraint dictating
         // handle placement.
-        if (this->ConstraintAxis >= 0)
+        if (this->ConstraintAxis >= 0 || this->Constrained)
           {
           this->Translate(prevPickPoint, pickPoint);
           }


Fix uninitialized variables

Fix uninitialized variables

--- setsm_code.cpp
+++ setsm_code.cpp
@@ -1523,7 +1523,7 @@
     total_ST = time(0);

-    ProInfo *proinfo = (ProInfo*)malloc(sizeof(ProInfo));
+    ProInfo *proinfo = (ProInfo*)calloc(sizeof(ProInfo), 1);
     proinfo->number_of_images = args.number_of_images;
     proinfo->sensor_type = args.sensor_type;
     proinfo->System_memory = args.System_memory;


changed formatting.

changed formatting.

--- src/OuterTotalisticCA.cpp
+++ src/OuterTotalisticCA.cpp
@@ -75,7 +75,7 @@
 		0xfcfcfcfcfcfcfcfcULL,
 		0xfefefefefefefefeULL
 	};
-	for(std::size_t i=1; i<m_BitboardSizeY; i++)
+	for ( std::size_t i = 1 ; i < m_BitboardSizeY ; i ++)
 		new_large_bitboard.SetBitboard(
 				new_large_bitboard.GetBitboard(i * m_BitboardSizeX - 2) & MASK_X[m_SizeX % 8],
 				i * m_BitboardSizeX - 2);
@@ -91,7 +91,7 @@
 		0xffffffffffff0000ULL,
 		0xffffffffffffff00ULL
 	};
-	for(std::size_t i=1; i<m_BitboardSizeX; i++)
+	for ( std::size_t i = 1 ; i < m_BitboardSizeX ; i ++)
 		new_large_bitboard.SetBitboard(
 				new_large_bitboard.GetBitboard(i + m_BitboardSizeX * (m_BitboardSizeY - 2)) & MASK_Y[m_SizeY % 8],
 				i + m_BitboardSizeX * (m_BitboardSizeY - 2));


BUG: On WIN32, since we are using subkey, set it

--- Utilities/kwsys/Registry.cxx
+++ Utilities/kwsys/Registry.cxx
@@ -389,6 +389,10 @@
       res = ( RegCreateKeyEx(scope, str.str().c_str(),
           0, "", REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE,
           NULL, &this->HKey, &dwDummy) == ERROR_SUCCESS );
+      }
+    if ( res != 0 )
+      {
+      this->SetSubKey( subkey );
       }
     return (res != 0);
     }
@@ -553,8 +557,8 @@
     int res = 1;
     DWORD dwType, dwSize;
     dwType = REG_SZ;
-    dwSize = Registry_BUFFER_SIZE;
     char buffer[1024]; // Replace with RegQueryInfoKey
+    dwSize = sizeof(buffer);
     res = ( RegQueryValueEx(this->HKey, skey, NULL, &dwType,
         (BYTE *)buffer, &dwSize) == ERROR_SUCCESS );
     if ( !res )


Fix bug with physical address translation

--- arch/alpha/alpha_memory.cc
+++ arch/alpha/alpha_memory.cc
@@ -455,7 +455,7 @@
     }

     // verify that this is a good virtual address
-    if (!validVirtualAddress(req->vaddr)) {
+    if (!(req->flags & PHYSICAL) && !validVirtualAddress(req->vaddr)) {
         fault(req->vaddr,
               ((write ? MM_STAT_WR_MASK : 0) | MM_STAT_BAD_VA_MASK |
                MM_STAT_ACV_MASK),


revise SingletonRelaxedCounter check functions

Summary: Rename, mark as kept, add a version taking an argument

Differential Revision: D27383132

fbshipit-source-id: 214af5b09e42159756e97b3b829ac9ecb237c17b

--- folly/experimental/test/SingletonRelaxedCounterBench.cpp
+++ folly/experimental/test/SingletonRelaxedCounterBench.cpp
@@ -23,23 +23,27 @@

 #include <folly/Benchmark.h>
 #include <folly/init/Init.h>
+#include <folly/lang/Keep.h>
 #include <folly/portability/GFlags.h>

 DEFINE_int32(num_threads, 4, "No. of threads allocting the objects");
-
-namespace folly {

 namespace {
 struct PrivateTag {};
 } // namespace

-using Counter = SingletonRelaxedCounter<size_t, PrivateTag>;
+using Counter = folly::SingletonRelaxedCounter<size_t, PrivateTag>;

 // small wrappers around the functions being benchmarked
 // useful for looking at the inlined native code of the fast path
-extern "C" void check() noexcept {
+extern "C" FOLLY_KEEP void check_singleton_relaxed_counter_add_1() {
   Counter::add(1);
 }
+extern "C" FOLLY_KEEP void check_singleton_relaxed_counter_add(size_t i) {
+  Counter::add(i);
+}
+
+namespace folly {

 // a noop which the compiler cannot see through
 // used to prevent some compiler optimizations which could skew benchmarks


PPCSignature needed some trivial member functions added, such as isPromoted()

--- db/signature.cpp
+++ db/signature.cpp
@@ -189,7 +189,9 @@
 			virtual	bool		isPreserved(Exp* e);		// Return whether e is preserved by this proc
 			virtual void		setLibraryDefines(StatementList* defs);	// Set list of locations def'd by library calls
             virtual bool		isLocalOffsetPositive() {return true;}
-            //virtual	bool	isAddrOfStackLocal(Prog* prog, Exp* e);
+			virtual bool		isPromoted() { return true; }
+			virtual platform	getPlatform() { return PLAT_PPC; }
+			virtual callconv	getConvention() { return CONV_C; }
 		};
 		class ST20Signature : public Signature {
 		public:


INTEGRATION: CWS changefileheader (1.6.226); FILE MERGED 2008/04/01 15:18:30 thb 1.6.226.3: #i85898# Stripping all external header guards 2008/04/01 10:57:59 thb 1.6.226.2: #i85898# Stripping all external header guards 2008/03/28 15:34:59 rt 1.6.226.1: #i87441# Change license header to LPGL v3.

--- framework/inc/uifactory/toolbarcontrollerfactory.hxx
+++ framework/inc/uifactory/toolbarcontrollerfactory.hxx
@@ -1,35 +1,30 @@
 /*************************************************************************
  *
- *  OpenOffice.org - a multi-platform office productivity suite
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- *  $RCSfile: toolbarcontrollerfactory.hxx,v $
+ * Copyright 2008 by Sun Microsystems, Inc.
  *
- *  $Revision: 1.6 $
+ * OpenOffice.org - a multi-platform office productivity suite
  *
- *  last change: $Author: vg $ $Date: 2006-11-22 10:42:05 $
+ * $RCSfile: toolbarcontrollerfactory.hxx,v $
+ * $Revision: 1.7 $
  *
- *  The Contents of this file are made available subject to
- *  the terms of GNU Lesser General Public License Version 2.1.
+ * This file is part of OpenOffice.org.
  *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
  *
- *    GNU Lesser General Public License Version 2.1
- *    =============================================
- *    Copyright 2005 by Sun Microsystems, Inc.
- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
  *
- *    This library is free software; you can redistribute it and/or
- *    modify it under the terms of the GNU Lesser General Public
- *    License version 2.1, as published by the Free Software Foundation.
- *
- *    This library is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *    Lesser General Public License for more details.
- *
- *    You should have received a copy of the GNU Lesser General Public
- *    License along with this library; if not, write to the Free Software
- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *    MA  02111-1307  USA
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
  *
  ************************************************************************/

@@ -40,61 +35,26 @@
 //  my own includes
 //_________________________________________________________________________________________________________________

-#ifndef __FRAMEWORK_THREADHELP_THREADHELPBASE_HXX_
 #include <threadhelp/threadhelpbase.hxx>
-#endif
-
-#ifndef __FRAMEWORK_MACROS_GENERIC_HXX_
 #include <macros/generic.hxx>
-#endif
-
-#ifndef __FRAMEWORK_MACROS_XINTERFACE_HXX_
 #include <macros/xinterface.hxx>
-#endif
-
-#ifndef __FRAMEWORK_MACROS_XTYPEPROVIDER_HXX_
 #include <macros/xtypeprovider.hxx>
-#endif
-
-#ifndef __FRAMEWORK_MACROS_XSERVICEINFO_HXX_
 #include <macros/xserviceinfo.hxx>
-#endif
-
-#ifndef __FRAMEWORK_STDTYPES_H_
 #include <stdtypes.h>
-#endif

 //_________________________________________________________________________________________________________________
 //  interface includes
 //_________________________________________________________________________________________________________________
-
-#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
 #include <com/sun/star/lang/XServiceInfo.hpp>
-#endif
-
-#ifndef _COM_SUN_STAR_LANG_XTYPEPROVIDER_HPP_
 #include <com/sun/star/lang/XTypeProvider.hpp>
-#endif
-
-#ifndef _COM_SUN_STAR_LANG_XMULTICOMPONENTFACTORY_HPP_
 #include <com/sun/star/lang/XMultiComponentFactory.hpp>
-#endif
-
-#ifndef _COM_SUN_STAR_FRAME_XUICONTROLLERREGISTRATION_HPP_
 #include <com/sun/star/frame/XUIControllerRegistration.hpp>
-#endif

 //_________________________________________________________________________________________________________________
 //  other includes
 //_________________________________________________________________________________________________________________
-
-#ifndef _CPPUHELPER_WEAK_HXX_
 #include <cppuhelper/weak.hxx>
-#endif
-
-#ifndef _RTL_USTRING_HXX_
 #include <rtl/ustring.hxx>
-#endif

 namespace framework
 {


[lib/client]Use different default timeouts for binding and closing assets.

--- lib/client.cpp
+++ lib/client.cpp
@@ -11,7 +11,8 @@

 #include "random.h"

-const static boost::posix_time::millisec DEFAULT_ASSET_TIMEOUT(500);
+const static boost::posix_time::millisec DEFAULT_ASSET_TIMEOUT(1500);
+const static boost::posix_time::millisec CLOSE_TIMEOUT(300);

 using namespace std;
 namespace asio = boost::asio;
@@ -39,7 +40,7 @@
 void AssetBinding::close()
 {
 	_asset = NULL;
-	setTimer(DEFAULT_ASSET_TIMEOUT);
+	setTimer(CLOSE_TIMEOUT);
 }

 void AssetBinding::setTimer(const boost::posix_time::time_duration& timeout)
@@ -70,8 +71,8 @@
 		msg.set_status(bithorde::Status::TIMEOUT);
 		_asset->handleMessage(msg);
 	} else if (_client) {
-		_client->informBound(*this, rand64(), DEFAULT_ASSET_TIMEOUT.total_milliseconds());
-		setTimer(DEFAULT_ASSET_TIMEOUT);
+		_client->informBound(*this, rand64(), CLOSE_TIMEOUT.total_milliseconds());
+		setTimer(CLOSE_TIMEOUT);
 	}
 }


Digitizer: 31bit is enough ADC resolution, let's not waste memory

--- src/modules/DefaultDigitizer/DefaultDigitizerModule.cpp
+++ src/modules/DefaultDigitizer/DefaultDigitizerModule.cpp
@@ -56,12 +56,12 @@
     }

     // Conversion to ADC units requested:
-    if(config_.get<int>("adc_resolution") > 63) {
-        throw InvalidValueError(config_, "adc_resolution", "precision higher than 64bit is not possible");
+    if(config_.get<int>("adc_resolution") > 31) {
+        throw InvalidValueError(config_, "adc_resolution", "precision higher than 31bit is not possible");
     }
     if(config_.get<int>("adc_resolution") > 0) {
         LOG(INFO) << "Converting charge to ADC units, ADC resolution: " << config_.get<int>("adc_resolution")
-                  << "bit, max. value " << ((1ll << config_.get<int>("adc_resolution")) - 1);
+                  << "bit, max. value " << ((1 << config_.get<int>("adc_resolution")) - 1);
     }
 }

@@ -120,10 +120,10 @@
             LOG(DEBUG) << "Smeared for simulating limited ADC sensitivity: " << Units::display(charge, "e");

             // Convert to ADC units and precision:
-            charge = static_cast<double>(std::max(std::min(static_cast<long long>(config_.get<double>("adc_offset") +
-                                                                                charge / config_.get<double>("adc_slope")),
-                                                           (1ll << config_.get<int>("adc_resolution")) - 1),
-                                                  0ll));
+            charge = static_cast<double>(std::max(
+                std::min(static_cast<int>(config_.get<double>("adc_offset") + charge / config_.get<double>("adc_slope")),
+                         (1 << config_.get<int>("adc_resolution")) - 1),
+                0));
             LOG(DEBUG) << "Charge converted to ADC units: " << charge;
         }


gltrim: Add a few more buffer calls

gltrim: Add a few more buffer calls

Signed-off-by: Gert Wollny <a4abb7b2c48b4038af2f307a789969b4cce91ae7@collabora.com>

--- frametrim/ft_frametrimmer.cpp
+++ frametrim/ft_frametrimmer.cpp
@@ -575,7 +575,9 @@
     MAP_OBJ(glNamedBufferData, m_buffers, BufferObjectMap::namedData);
     MAP_OBJ(glNamedBufferStorage, m_buffers, BufferObjectMap::namedData);
     MAP_OBJ(glBufferSubData, m_buffers, BufferObjectMap::callOnBoundObject);
+    MAP_OBJ(glGetBufferSubData, m_buffers, BufferObjectMap::callOnBoundObject);
     MAP_OBJ(glNamedBufferSubData, m_buffers, BufferObjectMap::callOnNamedObject);
+    MAP_OBJ(glGetNamedBufferSubData, m_buffers, BufferObjectMap::callOnNamedObject);
     MAP_OBJ(glCopyBufferSubData, m_buffers, BufferObjectMap::copyBufferSubData);
     MAP_OBJ(glCopyNamedBufferSubData, m_buffers, BufferObjectMap::copyNamedBufferSubData);


property addition to the file

property addition to the file

git-svn-id: e7ea667a1d39a4453c4efcc4ba7bca3d620c3f19@5866 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- examples/keypoints/example_sift_keypoint_estimation.cpp
+++ examples/keypoints/example_sift_keypoint_estimation.cpp
@@ -33,7 +33,7 @@
  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  *
- * $Id: example_rift_estimation.cpp 5172 2012-03-18 10:43:15Z desinghkar $
+ * $Id$
  *
  *
  */


U = 3.0 beta = 3.5

U = 3.0 beta = 3.5

--- 7_Anders/anders.cpp
+++ 7_Anders/anders.cpp
@@ -1271,14 +1271,14 @@
 }
 void test_increasing_mu(){
     /* initialise everything */
-    int lattice_size = 5, time_size, iterations = 10000;
-    double U = 1.5, beta = 3.5, lambda, delta_tau, mu;
+    int lattice_size = 5, time_size, iterations = 2000;
+    double U = 3.5, beta = 3.5, lambda, delta_tau, mu;
     string asf = "average_spin";
     /* generate initial conditions */
     initial_parameter_calculation(U, beta, lambda, delta_tau, time_size);
     print_initial_parameters(U, beta, lambda, delta_tau, mu, time_size, lattice_size, iterations);
     /* plot mu */
-    for(double i = 0; i < 10; i++){
+    for(double i = 0; i < 16; i++){
         LaGenMatComplex lattice = LaGenMatComplex::zeros(lattice_size, time_size);
         generate_lattice(lattice_size, time_size, lattice);
         mu = i * U / 8;


Make FTurnRight SSE2-compatible

Make FTurnRight SSE2-compatible

--- fturn/fturn.cpp
+++ fturn/fturn.cpp
@@ -89,7 +89,7 @@
     src8 = _mm_unpackhi_epi64(a67b67c67d67, e67f67g67h67);
 }

-
+template<InstructionSet level>
 void turnPlaneRight(BYTE* pDst, const BYTE* pSrc, BYTE* buffer, int srcWidth, int srcHeight, int dstPitch, int srcPitch) {
     bool useBuffer = true;
     if (dstPitch == srcHeight) {
@@ -99,7 +99,16 @@

     auto pDst2 = pDst;
     auto pSrc2 = pSrc;
-    auto mask = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 6, 8, 10, 12, 14);
+
+    __m128i pandMask, zero, pshufbMask;
+
+    if (level == InstructionSet::SSE2) {
+        pandMask = _mm_set_epi8(0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF, 0, 0xFF);
+        zero = _mm_setzero_si128();
+    } else {
+        pshufbMask = _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 6, 8, 10, 12, 14);
+    }
+
     int srcWidthMod8 = (srcWidth / 8) * 8;
     int srcHeightMod8 = (srcHeight / 8) * 8;
     for(int y=0; y<srcHeightMod8; y+=8)
@@ -117,15 +126,62 @@
             auto src8 = _mm_loadl_epi64(reinterpret_cast<const __m128i*>(pSrc+x+srcPitch*7));

             fTranspose(src1, src2, src3, src4, src5, src6, src7, src8);
-
-            src1 = _mm_shuffle_epi8(src1, mask);
-            src2 = _mm_shuffle_epi8(src2, mask);
-            src3 = _mm_shuffle_epi8(src3, mask);
-            src4 = _mm_shuffle_epi8(src4, mask);
-            src5 = _mm_shuffle_epi8(src5, mask);
-            src6 = _mm_shuffle_epi8(src6, mask);
-            src7 = _mm_shuffle_epi8(src7, mask);
-            src8 = _mm_shuffle_epi8(src8, mask);
+
+            if (level == InstructionSet::SSE2) {
+                src1 = _mm_shuffle_epi32(src1, _MM_SHUFFLE(1, 0, 3, 2));
+                src2 = _mm_shuffle_epi32(src2, _MM_SHUFFLE(1, 0, 3, 2));
+                src3 = _mm_shuffle_epi32(src3, _MM_SHUFFLE(1, 0, 3, 2));
+                src4 = _mm_shuffle_epi32(src4, _MM_SHUFFLE(1, 0, 3, 2));
+                src5 = _mm_shuffle_epi32(src5, _MM_SHUFFLE(1, 0, 3, 2));
+                src6 = _mm_shuffle_epi32(src6, _MM_SHUFFLE(1, 0, 3, 2));
+                src7 = _mm_shuffle_epi32(src7, _MM_SHUFFLE(1, 0, 3, 2));
+                src8 = _mm_shuffle_epi32(src8, _MM_SHUFFLE(1, 0, 3, 2));
+
+                src1 = _mm_shufflelo_epi16(src1, _MM_SHUFFLE(0, 1, 2, 3));
+                src2 = _mm_shufflelo_epi16(src2, _MM_SHUFFLE(0, 1, 2, 3));
+                src3 = _mm_shufflelo_epi16(src3, _MM_SHUFFLE(0, 1, 2, 3));
+                src4 = _mm_shufflelo_epi16(src4, _MM_SHUFFLE(0, 1, 2, 3));
+                src5 = _mm_shufflelo_epi16(src5, _MM_SHUFFLE(0, 1, 2, 3));
+                src6 = _mm_shufflelo_epi16(src6, _MM_SHUFFLE(0, 1, 2, 3));
+                src7 = _mm_shufflelo_epi16(src7, _MM_SHUFFLE(0, 1, 2, 3));
+                src8 = _mm_shufflelo_epi16(src8, _MM_SHUFFLE(0, 1, 2, 3));
+
+                src1 = _mm_shufflehi_epi16(src1, _MM_SHUFFLE(0, 1, 2, 3));
+                src2 = _mm_shufflehi_epi16(src2, _MM_SHUFFLE(0, 1, 2, 3));
+                src3 = _mm_shufflehi_epi16(src3, _MM_SHUFFLE(0, 1, 2, 3));
+                src4 = _mm_shufflehi_epi16(src4, _MM_SHUFFLE(0, 1, 2, 3));
+                src5 = _mm_shufflehi_epi16(src5, _MM_SHUFFLE(0, 1, 2, 3));
+                src6 = _mm_shufflehi_epi16(src6, _MM_SHUFFLE(0, 1, 2, 3));
+                src7 = _mm_shufflehi_epi16(src7, _MM_SHUFFLE(0, 1, 2, 3));
+                src8 = _mm_shufflehi_epi16(src8, _MM_SHUFFLE(0, 1, 2, 3));
+
+                src1 = _mm_and_si128(src1, pandMask);
+                src2 = _mm_and_si128(src2, pandMask);
+                src3 = _mm_and_si128(src3, pandMask);
+                src4 = _mm_and_si128(src4, pandMask);
+                src5 = _mm_and_si128(src5, pandMask);
+                src6 = _mm_and_si128(src6, pandMask);
+                src7 = _mm_and_si128(src7, pandMask);
+                src8 = _mm_and_si128(src8, pandMask);
+
+                src1 = _mm_packus_epi16(src1, zero);
+                src2 = _mm_packus_epi16(src2, zero);
+                src3 = _mm_packus_epi16(src3, zero);
+                src4 = _mm_packus_epi16(src4, zero);
+                src5 = _mm_packus_epi16(src5, zero);
+                src6 = _mm_packus_epi16(src6, zero);
+                src7 = _mm_packus_epi16(src7, zero);
+                src8 = _mm_packus_epi16(src8, zero);
+            } else {
+                src1 = _mm_shuffle_epi8(src1, pshufbMask);
+                src2 = _mm_shuffle_epi8(src2, pshufbMask);
+                src3 = _mm_shuffle_epi8(src3, pshufbMask);
+                src4 = _mm_shuffle_epi8(src4, pshufbMask);
+                src5 = _mm_shuffle_epi8(src5, pshufbMask);
+                src6 = _mm_shuffle_epi8(src6, pshufbMask);
+                src7 = _mm_shuffle_epi8(src7, pshufbMask);
+                src8 = _mm_shuffle_epi8(src8, pshufbMask);
+            }

             _mm_storel_epi64(reinterpret_cast<__m128i*>(buffer+offset+srcHeight*0), src1);
             _mm_storel_epi64(reinterpret_cast<__m128i*>(buffer+offset+srcHeight*1), src2);
@@ -348,6 +404,8 @@

 auto turnPlaneLeftSSE2 = &turnPlaneLeft<InstructionSet::SSE2>;
 auto turnPlaneLeftSSSE3 = &turnPlaneLeft<InstructionSet::SSSE3>;
+auto turnPlaneRightSSE2 = &turnPlaneRight<InstructionSet::SSE2>;
+auto turnPlaneRightSSSE3 = &turnPlaneRight<InstructionSet::SSSE3>;

 class FTurn : public GenericVideoFilter {
 public:
@@ -388,7 +446,7 @@
         if (direction == TurnDirection::LEFT) {
             turnFunction_ = sse3 ? turnPlaneLeftSSSE3 : turnPlaneLeftSSE2;
         } else {
-            turnFunction_ = turnPlaneRight;
+            turnFunction_ = sse3 ? turnPlaneRightSSSE3 : turnPlaneRightSSE2;
         }

         buffer = new BYTE[vi.width*vi.height];


converge check, change default interval and tolerance

--- readTimeControlsExplicit.H
+++ readTimeControlsExplicit.H
@@ -46,10 +46,10 @@
     runTime.controlDict().lookupOrDefault<scalar>("maxDeltaT", GREAT);

 scalar convergeTol =
-    runTime.controlDict().lookupOrDefault<scalar>("convergeTol", 1.0e-6);
+    runTime.controlDict().lookupOrDefault<scalar>("convergeTol", 1.0e-12);

 label convergeCheckSteps =
-    runTime.controlDict().lookupOrDefault("convergeCheckSteps", 100);
+    runTime.controlDict().lookupOrDefault("convergeCheckSteps", 1);

 scalar TemperatureChange = 1.0;
 // ************************************************************************* //


Fixed compilation of linux

Fixed compilation of linux

--- TIGLViewer/src/TIGLViewerContext.cpp
+++ TIGLViewer/src/TIGLViewerContext.cpp
@@ -20,6 +20,8 @@
 */
 #include "tigl_config.h"

+
+#include <QApplication>
 #include <QTextStream>
 #include <QFile>
 #include <qnamespace.h>
@@ -41,8 +43,6 @@
   #include <Graphic3d_AspectFillArea3d.hxx>
   #include <Graphic3d_ShaderObject.hxx>
 #endif
-
-#include <QApplication>

 /// Loads a shader file from the resource system
 QString getShaderFile(const QString& filename)


SWDEV-294669 - Avoid stall when the new signal was created

Stall in the host thread could occur earlier than the app expects.
Make sure rutnime can grow the signals to the queue size without
any stall. Also adding a new signal to the end of the pool could
break the dependency chain on signal reuse. The new logic will
insert the new signal after current to keep the chain intact.

Change-Id: I9c90b98515907db8b677528263c3e88cd9581a14

--- device/rocm/rocvirtual.cpp
+++ device/rocm/rocvirtual.cpp
@@ -347,6 +347,7 @@
 // ================================================================================================
 hsa_signal_t VirtualGPU::HwQueueTracker::ActiveSignal(
     hsa_signal_value_t init_val, Timestamp* ts, uint32_t queue_size) {
+  bool new_signal = false;
   // If queue size grows, then add more signals to avoid more frequent stalls
   if (queue_size > signal_list_.size()) {
     std::unique_ptr<ProfilingSignal> signal(new ProfilingSignal());
@@ -357,19 +358,28 @@
       uint32_t num_agents = (settings.system_scope_signal_) ? 0 : 1;

       if (HSA_STATUS_SUCCESS == hsa_signal_create(0, num_agents, agents, &signal->signal_)) {
-        signal_list_.push_back(signal.release());
-      }
-    }
-  }
-  // Find valid index
-  ++current_id_ %= signal_list_.size();
-
-  // Make sure the previous operation on the current signal is done
-  WaitCurrent();
-
-  // Have to wait the next signal in the queue to avoid a race condition between
-  // a GPU waiter(which may be not triggered yet) and CPU signal reset below
-  WaitNext();
+        // Find valid new index
+        ++current_id_ %= signal_list_.size();
+        // Insert the new signal into the current slot and ignore any wait
+        signal_list_.insert(signal_list_.begin() + current_id_, signal.release());
+        new_signal = true;
+      }
+    }
+  }
+
+  // If it's the new signal, then the wait can be avoided.
+  // That will allow to grow the list of signals without stalls
+  if (!new_signal) {
+    // Find valid index
+    ++current_id_ %= signal_list_.size();
+
+    // Make sure the previous operation on the current signal is done
+    WaitCurrent();
+
+    // Have to wait the next signal in the queue to avoid a race condition between
+    // a GPU waiter(which may be not triggered yet) and CPU signal reset below
+    WaitNext();
+  }

   if (signal_list_[current_id_]->referenceCount() > 1) {
     // The signal was assigned to the global marker's event, hence runtime can't reuse it


INTEGRATION: CWS sdwarningsbegone (1.6.38); FILE MERGED 2006/11/22 12:42:11 cl 1.6.38.1: #i69285# warning free code changes for unxlngi6.pro

--- sd/source/ui/slidesorter/controller/SlsHideSlideFunction.cxx
+++ sd/source/ui/slidesorter/controller/SlsHideSlideFunction.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: SlsHideSlideFunction.cxx,v $
  *
- *  $Revision: 1.7 $
+ *  $Revision: 1.8 $
  *
- *  last change: $Author: kz $ $Date: 2006-12-12 16:07:27 $
+ *  last change: $Author: kz $ $Date: 2006-12-14 10:45:50 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -118,16 +118,16 @@
         {
             model::SharedPageDescriptor pDescriptor (aSelectedPages.GetNextElement());
             pDescriptor->GetPage()->SetExcluded (eState==EXCLUDED);
-            static_cast<view::SlideSorterView*>(pView)->RequestRepaint(pDescriptor);
+            static_cast<view::SlideSorterView*>(mpView)->RequestRepaint(pDescriptor);
         }
     }

-    SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings();
+    SfxBindings& rBindings = mpViewShell->GetViewFrame()->GetBindings();
     rBindings.Invalidate (SID_PRESENTATION);
     rBindings.Invalidate (SID_REHEARSE_TIMINGS);
     rBindings.Invalidate (SID_HIDE_SLIDE);
     rBindings.Invalidate (SID_SHOW_SLIDE);
-    pDoc->SetChanged();
+    mpDoc->SetChanged();
 }

@@ -174,5 +174,4 @@
     return eState;
 }

-
 } } } // end of namespace ::sd::slidesorter::controller


PendingVariantMap: Update docs.

PendingVariantMap: Update docs.

--- TelepathyQt4/pending-variant-map.cpp
+++ TelepathyQt4/pending-variant-map.cpp
@@ -44,6 +44,8 @@
  *
  * \brief The PendingVariantMap class is a generic subclass of PendingOperation
  * representing a pending D-Bus method call that returns a variant map.
+ *
+ * See \ref async_model
  */

 PendingVariantMap::PendingVariantMap(QDBusPendingCall call, const SharedPtr<RefCounted> &object)


Stop being silly.

Stop being silly.

Change-Id: Icf0b45e0b7032d7cc5b17ffe92be5ab8c6cda729

--- framework/platform/android/tcuAndroidInternals.hpp
+++ framework/platform/android/tcuAndroidInternals.hpp
@@ -63,7 +63,6 @@
 	ALREADY_EXISTS		= -EEXIST,
 	DEAD_OBJECT			= -EPIPE,
 	FAILED_TRANSACTION	= (UNKNOWN_ERROR + 2),
-	JPARKS_BROKE_IT		= -EPIPE,
 	BAD_INDEX			= -E2BIG,
 	NOT_ENOUGH_DATA		= (UNKNOWN_ERROR + 3),
 	WOULD_BLOCK			= (UNKNOWN_ERROR + 4),


coverity#705854 Dereference before null check

Change-Id: I8bdedf38a29587bb504ccf310371dea756efd47d

--- sd/source/filter/eppt/epptso.cxx
+++ sd/source/filter/eppt/epptso.cxx
@@ -693,7 +693,7 @@
             }
             else
             {
-                if ( !pPara->mbFixedLineSpacing && pPortion && pPortion->mnCharHeight > (sal_uInt16)( ((double)-nLineSpacing) * 0.001 * 72.0 / 2.54 ) ) // 1/100mm to point
+                if ( !pPara->mbFixedLineSpacing && pPortion->mnCharHeight > (sal_uInt16)( ((double)-nLineSpacing) * 0.001 * 72.0 / 2.54 ) ) // 1/100mm to point
                     nLineSpacing = nNormalSpacing;
                 else
                     nLineSpacing = (sal_Int16)( (double)nLineSpacing / 4.40972 );


updated chorth to have randomization

updated chorth to have randomization

--- chorth/sporth.cpp
+++ chorth/sporth.cpp
@@ -63,7 +63,7 @@
     sporthData * data = new sporthData;
     data->parsed = 0;
     sp_create(&data->sp);
-    sp_srand(data->sp, time(NULL));
+    sp_srand(data->sp, rand());
     data->sp->sr = API->vm->get_srate();
     plumber_register(&data->pd);
     plumber_init(&data->pd);


fix deadlcok when sync and push register at same time

--- ext/rhoconnect-client/ext/shared/sync/ClientRegister.cpp
+++ ext/rhoconnect-client/ext/shared/sync/ClientRegister.cpp
@@ -282,19 +282,21 @@
         LOG(WARNING)+"Sync client_id is empty, do register later";
 		return false;
 	}
-
-    IDBResult res = CDBAdapter::getUserDB().executeSQL("SELECT token,token_sent from client_info");
-    if ( !res.isEnd() ) {
-		String token = res.getStringByIdx(0);
-		int token_sent = res.getIntByIdx(1) && !RHOCONF().getBool("register_push_at_startup");
+    {
+        // IDBResult hold mutex of DB - we should free it ASAP
+        IDBResult res = CDBAdapter::getUserDB().executeSQL("SELECT token,token_sent from client_info");
+        if ( !res.isEnd() ) {
+            String token = res.getStringByIdx(0);
+            int token_sent = res.getIntByIdx(1) && !RHOCONF().getBool("register_push_at_startup");
+
+            if ( m_strDevicePin.compare(token) == 0 && token_sent > 0 )
+            {
+                //token in db same as new one and it was already send to the server
+                //so we do nothing

-		if ( m_strDevicePin.compare(token) == 0 && token_sent > 0 )
-		{
-			//token in db same as new one and it was already send to the server
-			//so we do nothing
-
-			return true;
-		}
+                return true;
+            }
+        }
     }

 	String strBody = getRegisterBody(client_id);


Fixed warning message with vc++.

Fixed warning message with vc++.

--- language/interpreter.cc
+++ language/interpreter.cc
@@ -143,7 +143,7 @@
         const auto& a = eval(*ast.nodes[0], env).to_array();
         const auto& i = eval(*ast.nodes[1], env).to_long();

-        if (0 <= i && i < a.values.size()) {
+        if (0 <= i && i < static_cast<long>(a.values.size())) {
             return a.values[i];
         }


Add TwoMaterialPropertyInterface params to InterfaceKernelBase

--- framework/src/interfacekernels/InterfaceKernelBase.C
+++ framework/src/interfacekernels/InterfaceKernelBase.C
@@ -23,6 +23,7 @@
 {
   InputParameters params = NeighborResidualObject::validParams();
   params += BoundaryRestrictable::validParams();
+  params += TwoMaterialPropertyInterface::validParams();

   params.addParam<bool>("use_displaced_mesh",
                         false,


Accelerate FillTool

Accelerate FillTool

--- src/Painting/FillTool.cpp
+++ src/Painting/FillTool.cpp
@@ -5,10 +5,13 @@

 void Painting::FillTool::begin(const QPoint &point, QPainter &painter, const QPixmap &pixmap)
 {
-    QRgb oldColor = pixmap.toImage().pixel(point);
-    QRect pixmapRect = pixmap.rect();
+    QImage image = pixmap.toImage();
+    const QRect pixmapRect = pixmap.rect();

-    if (QColor(oldColor) == painter.pen().color())
+    const QRgb oldColor = image.pixel(point);
+    const QRgb newColor = painter.pen().color().rgb();
+
+    if (oldColor == newColor)
     {
         return;
     }
@@ -18,13 +21,13 @@

     while(!neighbours.isEmpty())
     {
-        QPoint currentPoint = neighbours.dequeue();
+        const QPoint currentPoint = neighbours.dequeue();
         if (pixmapRect.contains(currentPoint))
         {
-            QRgb currentColor = pixmap.toImage().pixel(currentPoint);
+            const QRgb currentColor = image.pixel(currentPoint);
             if (currentColor == oldColor)
             {
-                painter.drawPoint(currentPoint);
+                image.setPixel(currentPoint, newColor);

                 neighbours.enqueue(QPoint(currentPoint.x() - 1, currentPoint.y()));
                 neighbours.enqueue(QPoint(currentPoint.x() + 1, currentPoint.y()));
@@ -33,6 +36,7 @@
             }
         }
     }
+    painter.drawImage(QPoint(), image);
 }

 void Painting::FillTool::move(const QPoint &point, QPainter &painter, const QPixmap &pixmap)


replaced typedef I with its actual type (was defined in base class and therefore inaccessible here)

--- hw/dlchain.cpp
+++ hw/dlchain.cpp
@@ -133,7 +133,7 @@
         return true;
     }

-    bool attachAtBegin(DoubleLinkedList<T>& l, I& it)
+    bool attachAtBegin(DoubleLinkedList<T>& l, DoubleLinkedListIterator<T>& it)
     {
         if (it)
         {
@@ -163,7 +163,7 @@
             return false;
     }

-    bool attachAtEnd(DoubleLinkedList<T>& l, I& it)
+    bool attachAtEnd(DoubleLinkedList<T>& l, DoubleLinkedListIterator<T>& it)
     {
         if (it)
         {
@@ -193,7 +193,7 @@
             return false;
     }

-    bool attachListAtFront(DoubleLinkedList<T>& l, I& it)
+    bool attachListAtFront(DoubleLinkedList<T>& l, DoubleLinkedListIterator<T>& it)
     {
         if (it && l.front && !l.front->prev)
         {
@@ -215,7 +215,8 @@
             return false;
     }

-    bool attachListAtBack(DoubleLinkedList<T>& l, I& it)
+    bool attachListAtBack(DoubleLinkedList<T>& l,
+            DoubleLinkedListIterator<T>& it)
     {
         if (it && l.back && !l.back->next)
         {
@@ -237,7 +238,8 @@
             return false;
     }

-    bool join_at(DoubleLinkedList<T>& L1, DoubleLinkedList<T>& L2, I& M1, I& M2)
+    bool join_at(DoubleLinkedList<T>& L1, DoubleLinkedList<T>& L2,
+            DoubleLinkedListIterator<T>& M1, DoubleLinkedListIterator<T>& M2)
     {
         return adoptList(L1) && attachListAtFront(L2, M1) &&
                                 attachAtEnd(L2, M2);
@@ -245,7 +247,7 @@

     bool join(DoubleLinkedList<T>& L1, DoubleLinkedList<T>& L2)
     {
-        I itL1 = L1.begin(), itL2 = L2.end(), M1, M2;
+        DoubleLinkedListIterator<T> itL1 = L1.begin(), itL2 = L2.end(), M1, M2;

         while (itL1 && itL2)
         {


- Stop maintenance jobs prior to reconfiguring. - Always create new LidSpaceCompactionHandlers.

--- searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
+++ searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
@@ -216,10 +216,6 @@
     // Forward changes of cluster state to bucket handler
     _clusterStateHandler.addClusterStateChangedHandler(&_bucketHandler);

-    _lidSpaceCompactionHandlers.push_back(std::make_unique<LidSpaceCompactionHandler>(_maintenanceController.getReadySubDB(), _docTypeName.getName()));
-    _lidSpaceCompactionHandlers.push_back(std::make_unique<LidSpaceCompactionHandler>(_maintenanceController.getRemSubDB(), _docTypeName.getName()));
-    _lidSpaceCompactionHandlers.push_back(std::make_unique<LidSpaceCompactionHandler>(_maintenanceController.getNotReadySubDB(), _docTypeName.getName()));
-
     _writeFilter.setConfig(loaded_config->getMaintenanceConfigSP()->getAttributeUsageFilterConfig());
 }

@@ -415,6 +411,7 @@
         LOG(error, "Applying config to closed document db");
         return;
     }
+    _maintenanceController.killJobs();
     ConfigComparisonResult cmpres;
     Schema::SP oldSchema;
     int64_t generation = configSnapshot->getGeneration();
@@ -482,9 +479,7 @@
         _state.clearDelayedConfig();
     }
     setActiveConfig(configSnapshot, generation);
-    if (params.shouldMaintenanceControllerChange()) {
-        forwardMaintenanceConfig();
-    }
+    forwardMaintenanceConfig();
     _writeFilter.setConfig(configSnapshot->getMaintenanceConfigSP()->getAttributeUsageFilterConfig());
     if (_subDBs.getReprocessingRunner().empty()) {
         _subDBs.pruneRemovedFields(serialNum);
@@ -698,9 +693,7 @@
 void
 DocumentDB::start()
 {
-    LOG(debug,
-        "DocumentDB(%s): Database starting.",
-        _docTypeName.toString().c_str());
+    LOG(debug, "DocumentDB(%s): Database starting.", _docTypeName.toString().c_str());

     internalInit();
 }
@@ -933,6 +926,10 @@
 {
     // Called by executor thread
     _maintenanceController.killJobs();
+    _lidSpaceCompactionHandlers.clear();
+    _lidSpaceCompactionHandlers.push_back(std::make_unique<LidSpaceCompactionHandler>(_maintenanceController.getReadySubDB(), _docTypeName.getName()));
+    _lidSpaceCompactionHandlers.push_back(std::make_unique<LidSpaceCompactionHandler>(_maintenanceController.getRemSubDB(), _docTypeName.getName()));
+    _lidSpaceCompactionHandlers.push_back(std::make_unique<LidSpaceCompactionHandler>(_maintenanceController.getNotReadySubDB(), _docTypeName.getName()));
     MaintenanceJobsInjector::injectJobs(_maintenanceController,
             config,
             _bucketExecutor,
@@ -996,13 +993,11 @@
     // Called by executor thread
     DocumentDBConfig::SP activeConfig = getActiveConfig();
     assert(activeConfig);
-    DocumentDBMaintenanceConfig::SP
-        maintenanceConfig(activeConfig->getMaintenanceConfigSP());
+    auto maintenanceConfig(activeConfig->getMaintenanceConfigSP());
     const auto &attributes_config = activeConfig->getAttributesConfig();
     auto attribute_config_inspector = std::make_unique<AttributeConfigInspector>(attributes_config);
     if (!_state.getClosed()) {
-        if (_maintenanceController.getStarted() &&
-            !_maintenanceController.getStopping()) {
+        if (_maintenanceController.getStarted() && !_maintenanceController.getStopping()) {
             injectMaintenanceJobs(*maintenanceConfig, std::move(attribute_config_inspector));
         }
         _maintenanceController.newConfig(maintenanceConfig);


[C++] Reproducer test for provider reregistration call issue

Change-Id: I2b2cfbf4c4296530755a7f700e8c00e9bf5de5bc

--- cpp/tests/systemintegration-tests/ProviderReregistrationControllerTest.cpp
+++ cpp/tests/systemintegration-tests/ProviderReregistrationControllerTest.cpp
@@ -19,11 +19,13 @@

 #include <gtest/gtest.h>
 #include <gmock/gmock.h>
+#include <chrono>

 #include "joynr/JoynrClusterControllerRuntime.h"
 #include "joynr/Settings.h"
 #include "joynr/SystemServicesSettings.h"
 #include "joynr/system/ProviderReregistrationControllerProxy.h"
+#include "utils/TestLibJoynrWebSocketRuntime.h"

 using namespace ::testing;
 using namespace joynr;
@@ -48,3 +50,29 @@
     runtime->stop();
     runtime = nullptr;
 }
+
+TEST(ProviderReregistrationControllerTest, queryProviderReregistrationControllerSucceedsOnWsRuntime)
+{
+    auto integrationSettings = std::make_unique<Settings>("test-resources/MqttSystemIntegrationTest1.settings");
+    joynr::SystemServicesSettings systemServiceSettings(*integrationSettings);
+    const std::string domain(systemServiceSettings.getDomain());
+
+    auto ccRuntime = std::make_shared<JoynrClusterControllerRuntime>(std::move(integrationSettings));
+    ccRuntime->init();
+    ccRuntime->start();
+
+    auto wsRuntimeSettings = std::make_unique<Settings>("test-resources/libjoynrSystemIntegration1.settings");
+    auto wsRuntime = std::make_shared<TestLibJoynrWebSocketRuntime>(std::move(wsRuntimeSettings), nullptr);
+    wsRuntime->connect(std::chrono::seconds(2));
+
+    auto providerReregistrationControllerProxyBuilder = wsRuntime->createProxyBuilder<joynr::system::ProviderReregistrationControllerProxy>(domain);
+    auto providerReregistrationControllerProxy = providerReregistrationControllerProxyBuilder->build();
+
+    Semaphore finishedSemaphore;
+    providerReregistrationControllerProxy->triggerGlobalProviderReregistrationAsync([&finishedSemaphore]() { finishedSemaphore.notify(); }, [](const joynr::exceptions::JoynrRuntimeException&) { FAIL(); });
+    finishedSemaphore.waitFor(std::chrono::seconds(2));
+
+    wsRuntime = nullptr;
+    ccRuntime->stop();
+    ccRuntime = nullptr;
+}