Small fix for i386 extended backtraces; wasn't skipping a
4-byte reserved area when reading the libBacktraceRecording API results.
Also, add a little logging about queues being created.
<rdar://problem/16127752>

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

--- source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
+++ source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
@@ -621,6 +621,7 @@
 {
     Error error;
     DataBufferHeap data (queues_buffer_size, 0);
+    Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_SYSTEM_RUNTIME));
     if (m_process->ReadMemory (queues_buffer, data.GetBytes(), queues_buffer_size, error) == queues_buffer_size && error.Success())
     {
         // We've read the information out of inferior memory; free it on the next call we make
@@ -648,11 +649,8 @@
             offset_t    start_of_this_item = offset;

             uint32_t    offset_to_next = extractor.GetU32 (&offset);
-            /* on 64-bit architectures, the pointer will be 8-byte aligned so there's 4 bytes of
-             * padding between these fields.
-             */
-            if (m_process->GetAddressByteSize() == 8)
-                offset += 4;
+
+            offset += 4; // Skip over the 4 bytes of reserved space
             addr_t      queue = extractor.GetPointer (&offset);
             uint64_t    serialnum = extractor.GetU64 (&offset);
             uint32_t    running_work_items_count = extractor.GetU32 (&offset);
@@ -666,6 +664,9 @@

             offset_t    start_of_next_item = start_of_this_item + offset_to_next;
             offset = start_of_next_item;
+
+            if (log)
+                log->Printf ("SystemRuntimeMacOSX::PopulateQueuesUsingLibBTR added queue with dispatch_queue_t 0x%" PRIx64 ", serial number 0x%" PRIx64 ", running items %d, pending items %d, name '%s'", queue, serialnum, running_work_items_count, pending_work_items_count, queue_label);

             QueueSP queue_sp (new Queue (m_process->shared_from_this(), serialnum, queue_label));
             queue_sp->SetNumRunningWorkItems (running_work_items_count);


DEFERRED_SHADING_DEMO: Move the backbuffer RenderTarget clear down to after it's bound to the pipeline

It just makes more sense to have it there for code flow reasons. No change in code semantics

--- source/deferred_shading_demo/deferred_shading_demo_draw.cpp
+++ source/deferred_shading_demo/deferred_shading_demo_draw.cpp
@@ -30,7 +30,6 @@
 	m_immediateContext->OMSetRenderTargets(2, &m_gBufferRTVs[0], m_depthStencilBuffer->GetDepthStencil());

 	// Clear the Render Targets and DepthStencil
-	m_immediateContext->ClearRenderTargetView(m_renderTargetView, DirectX::Colors::LightGray);
 	for (auto gbufferRTV : m_gBufferRTVs) {
 		m_immediateContext->ClearRenderTargetView(gbufferRTV, DirectX::Colors::Black);
 	}
@@ -78,6 +77,7 @@

 	// Final gather pass
 	m_immediateContext->OMSetRenderTargets(1, &m_renderTargetView, nullptr);
+	m_immediateContext->ClearRenderTargetView(m_renderTargetView, DirectX::Colors::LightGray);

 	// Full screen triangle setup
 	m_immediateContext->IASetInputLayout(m_fullscreenTriangleInputLayout);


Fix up the logic which leads to the bug where unselected nodes are not shown with show unselected mode is on. Tracker item 2747, https://tracker.physiomeproject.org/show_bug.cgi?id=2747

git-svn-id: 4705079bc6b8aadf675e3696f5c015a6aa4916e3@8123 3c1deb5b-d424-0410-962d-aba41a686d42

--- source/finite_element/finite_element_to_graphics_object.cpp
+++ source/finite_element/finite_element_to_graphics_object.cpp
@@ -272,7 +272,13 @@
 			actual size after adding each node, thereby only visiting and
 			checking each node once. */
 		current_field_address=computed_fields_of_node->required_fields;
-		if (computed_fields_of_node->select_mode == GRAPHICS_DRAW_SELECTED ||
+
+		if ((computed_fields_of_node->select_mode == GRAPHICS_DRAW_UNSELECTED) &&
+			!computed_fields_of_node->group_field)
+		{
+			visibility = 1;
+		}
+		else if (computed_fields_of_node->select_mode == GRAPHICS_DRAW_SELECTED ||
 			computed_fields_of_node->select_mode == GRAPHICS_DRAW_UNSELECTED)
 		{
 			if (computed_fields_of_node->group_field &&
@@ -382,7 +388,12 @@
 	number_of_variable_scale_components = 0;
 	node_to_glyph_set_data =
 		(struct Node_to_glyph_set_data *)node_to_glyph_set_data_void;
-	if (node_to_glyph_set_data->select_mode == GRAPHICS_DRAW_SELECTED ||
+	if ((node_to_glyph_set_data->select_mode == GRAPHICS_DRAW_UNSELECTED) &&
+			!node_to_glyph_set_data->group_field)
+	{
+		visibility_value = 1;
+	}
+	else if (node_to_glyph_set_data->select_mode == GRAPHICS_DRAW_SELECTED ||
 		node_to_glyph_set_data->select_mode == GRAPHICS_DRAW_UNSELECTED)
 	{
 		if (node_to_glyph_set_data->group_field &&
@@ -1385,8 +1396,7 @@
 		((!label_density_field) ||
 			(3 >=	Computed_field_get_number_of_components(label_density_field))))
 	{
-		if (((GRAPHICS_DRAW_SELECTED!=select_mode)&&
-				(GRAPHICS_DRAW_UNSELECTED!=select_mode))||group_field)
+		if ((GRAPHICS_DRAW_SELECTED!=select_mode) || group_field)
 		{
 			if (computed_fields_of_node=CREATE(Computed_fields_of_node)())
 			{


Remove relative path includes in JsonMessageBuilder.cpp

--- src/BusinessLayer/JsonMessageBuilder/JsonMessageBuilder.cpp
+++ src/BusinessLayer/JsonMessageBuilder/JsonMessageBuilder.cpp
@@ -1,6 +1,7 @@
 #include "JsonMessageBuilder.h"
 #include "JsonForwarder/JsonDefines.h"
-#include "../CommunicationLayer/PacketDecoder/PacketDecoder.h"
+#include "CommunicationLayer/PacketDecoder/PacketDecoder.h"
+#include "CommunicationLayer/PacketChecksumChecker/I_PacketChecksumChecker.h"
 #include "DataLayer/KeyMotorData/I_KeyMotorData.h"
 #include "DataLayer/MotorDetailsData/I_MotorDetailsData.h"
 #include "DataLayer/MotorDetailsData/I_MotorDetailsUnit.h"
@@ -13,7 +14,6 @@
 #include "DataLayer/AuxBmsData/I_AuxBmsData.h"
 #include "DataLayer/CcsData/I_CcsData.h"
 #include "DataLayer/CcsData/CcsData.h"
-#include "../CommunicationLayer/PacketChecksumChecker/I_PacketChecksumChecker.h"

 JsonMessageBuilder::JsonMessageBuilder()
 {


Fixed cooling of ignition area.

Fixed cooling of ignition area.

--- wled00/FX.cpp
+++ wled00/FX.cpp
@@ -1982,9 +1982,14 @@

         // Step 1.  Cool down every cell a little
         for (int i = 0; i < SEGLEN; i++) {
-          uint8_t cool = (((20 + SEGMENT.speed/3) * 16) / SEGLEN);
-          uint8_t temp = qsub8(heat[i], random8(0, cool + 2));
-          heat[i] = (temp==0 && i<ignition) ? random8(1,16) : temp; // prevent ignition area from becoming black
+          uint8_t cool = random8((((20 + SEGMENT.speed/3) * 16) / SEGLEN)+2);
+          uint8_t minTemp = 0;
+          if (i<ignition) {
+            cool /= (ignition-i); // ignition area cools slower
+            minTemp = 4*(ignition-i) + 8; // and should not become black
+          }
+          uint8_t temp = qsub8(heat[i], cool);
+          heat[i] = i<ignition && temp<minTemp ? minTemp : temp; // prevent ignition area from becoming black
         }

         // Step 2.  Heat from each cell drifts 'up' and diffuses a little
@@ -2001,7 +2006,7 @@

       // Step 4.  Map from heat cells to LED colors
       for (int j = 0; j < SEGLEN; j++) {
-        SEGMENT.setPixelColor(indexToVStrip(j, stripNr), ColorFromPalette(SEGPALETTE, heat[j], 255, NOBLEND));
+        SEGMENT.setPixelColor(indexToVStrip(j, stripNr), ColorFromPalette(SEGPALETTE, MIN(heat[j],240), 255, NOBLEND));
       }
     }
   };


CC1101 Test: can configure Gdo0 as high impedance.

--- cc1101/stm32f3/main.cpp
+++ cc1101/stm32f3/main.cpp
@@ -60,6 +60,11 @@
 		} else {
 			XPCC_LOG_DEBUG << XPCC_FILE_INFO << "Initialized cc1101." << xpcc::endl;
 		}
+		// Configure Gdo0 as high impedance
+		PT_CALL(radio.configureGdo(this,
+			Radio::Gdo::Gdo0,
+			Radio::GdoInverted::No,
+			Radio::GdoSignalSelection::HighImpedance));

 		// main loop
 		while(true){
@@ -74,8 +79,8 @@
 		typedef SpiSimpleMaster3 SpiMaster;
 		typedef GpioOutputA15    Cs;
 		typedef GpioInputB4      Miso;
-		typedef GpioD6           Gdo0;
-		typedef GpioD4           Gdo2;
+		typedef GpioInputD6      Gdo0;
+		typedef GpioInputD4      Gdo2;
 	};

 private:
@@ -115,6 +120,10 @@
 	SpiSimpleMaster3::initialize<defaultSystemClock, 1125 * kHz1>();
 	//SpiSimpleMaster3::initialize<defaultSystemClock, 140625>();

+	// Initialize Gdos
+	MainThread::CC1101Config::Gdo0::setInput();
+	MainThread::CC1101Config::Gdo2::setInput();
+
 	while (1)
 	{
 		mainThread.run();


BUG: Mantis-940: add a check on inverse output enabled state

--- Applications/FeatureExtraction/otbDimensionalityReduction.cxx
+++ Applications/FeatureExtraction/otbDimensionalityReduction.cxx
@@ -234,7 +234,7 @@
     bool normalize = IsParameterEnabled("normalize");
     bool rescale = IsParameterEnabled("rescale");

-    bool invTransform = HasValue("outinv");
+    bool invTransform = HasValue("outinv") && IsParameterEnabled("outinv");
     switch (GetParameterInt("method"))
       {
       // PCA Algorithm


adding linux replace logic

adding linux replace logic

--- ArcGISRuntimeSDKQt_QMLSamples/Layers/RasterLayerFile/main.cpp
+++ ArcGISRuntimeSDKQt_QMLSamples/Layers/RasterLayerFile/main.cpp
@@ -34,12 +34,21 @@
   QQuickView view;
   view.setResizeMode(QQuickView::SizeRootObjectToView);

-  // Add the import Path
-  view.engine()->addImportPath(QDir(QCoreApplication::applicationDirPath()).filePath("qml"));
+  QString arcGISRuntimeImportPath = QUOTE(ARCGIS_RUNTIME_IMPORT_PATH);
+  QString arcGISToolkitImportPath = QUOTE(ARCGIS_TOOLKIT_IMPORT_PATH);
+
+#if defined(LINUX_PLATFORM_REPLACEMENT)
+  // on some linux platforms the string 'linux' is replaced with 1
+  // fix the replacement paths which were created
+  QString replaceString = QUOTE(LINUX_PLATFORM_REPLACEMENT);
+  arcGISRuntimeImportPath = arcGISRuntimeImportPath.replace(replaceString, "linux", Qt::CaseSensitive);
+  arcGISToolkitImportPath = arcGISToolkitImportPath.replace(replaceString, "linux", Qt::CaseSensitive);
+#endif
+
   // Add the Runtime and Extras path
-  view.engine()->addImportPath(QUOTE(ARCGIS_RUNTIME_IMPORT_PATH));
+  view.engine()->addImportPath(arcGISRuntimeImportPath);
   // Add the Toolkit path
-  view.engine()->addImportPath(QUOTE(ARCGIS_TOOLKIT_IMPORT_PATH));
+  view.engine()->addImportPath(arcGISToolkitImportPath);

   // Set the source
   view.setSource(QUrl("qrc:/Samples/Layers/RasterLayerFile/RasterLayerFile.qml"));


Tweaks here, tweaks there.

Tweaks here, tweaks there.

--- Outputs/CRT/Internals/Shaders/IntermediateShader.cpp
+++ Outputs/CRT/Internals/Shaders/IntermediateShader.cpp
@@ -213,8 +213,9 @@
 				"), vec3(1.0));"

 			"float chrominance = 0.5 * (samples[1].y - luminance) / phaseAndAmplitudeVarying.y;"
+			"luminance /= (1.0 - phaseAndAmplitudeVarying.y);"
+
 			"vec2 quadrature = vec2(cos(phaseAndAmplitudeVarying.x), -sin(phaseAndAmplitudeVarying.x));"
-
 			"fragColour = vec3(luminance, vec2(0.5) + (chrominance * quadrature));"
 		"}",false, false);
 }
@@ -272,7 +273,7 @@
 				"), vec3(1.0))"
 			");"

-			"vec3 lumaChromaColourInRange = (lumaChromaColour - vec3(0.0, 0.5, 0.5)) * vec3(1.0, 3.0, 3.0);"
+			"vec3 lumaChromaColourInRange = (lumaChromaColour - vec3(0.0, 0.5, 0.5)) * vec3(1.0, 4.0, 4.0);"
 			"fragColour = lumaChromaToRGB * lumaChromaColourInRange;"
 		"}", false, false);
 }


fix number of bins mismatch

fix number of bins mismatch

--- PWG2/RESONANCES/macros/train/AddAnalysisTaskRsnEff.C
+++ PWG2/RESONANCES/macros/train/AddAnalysisTaskRsnEff.C
@@ -56,7 +56,7 @@
   //  0) transverse momentum
   //  1) pseudo-rapidity
   //  2) multiplicity (estimated with SPD tracklets - uncorrected)
-  AliRsnFunctionAxis *axisPt   = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairPt,       40,  0.0,  10.0);
+  AliRsnFunctionAxis *axisPt   = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairPt,       50,  0.0,  10.0);
   AliRsnFunctionAxis *axisEta  = new AliRsnFunctionAxis(AliRsnFunctionAxis::kPairEta,      20, -1.5,   1.5);
   AliRsnFunctionAxis *axisMult = new AliRsnFunctionAxis(AliRsnFunctionAxis::kEventMult,     8,  0.0, 200.0);
   for (Int_t i = 0; i < 2; i++)


[robust_estimator] partial fix for acransac  (ce0850d)

poparteu/openMVG#77

--- src/openMVG/robust_estimation/robust_estimator_ACRansac.hpp
+++ src/openMVG/robust_estimation/robust_estimator_ACRansac.hpp
@@ -97,7 +97,7 @@
   const size_t n = e.size();
   for(size_t k = startIndex + 1; k <= n && e[k - 1].first <= maxThreshold; ++k)
   {
-    double logalpha = logalpha0 + multError * log10(e[k - 1].first + std::numeric_limits<float>::min());
+    const double logalpha = logalpha0 + multError * log10(e[k - 1].first + std::numeric_limits<float>::epsilon());
     ErrorIndex index(loge0 +
                      logalpha * (double) (k - startIndex) +
                      logc_n[k] +


Added comment

Added comment

--- tests/SimpleStringTest.cpp
+++ tests/SimpleStringTest.cpp
@@ -550,9 +550,14 @@
 #ifdef CPPUTEST_64BIT
 #ifdef CPPUTEST_64BIT_32BIT_LONGS

+/*
+ * Right now, the 64 bit pointers are casted to 32bit as the %p is causing different formats on
+ * different platforms. However, this will need to be fixed in the future and then this test ought
+ * to be deleted.
+ */
 TEST(SimpleString, _64BitAddressPrintsCorrectly)
 {
-    char* p = (char*) 0xffffffffu; // LLP64 long is only 32 bit
+    char* p = (char*) 0xffffffffu;
     SimpleString expected("0x23456789");
     SimpleString actual = StringFrom((void*)&p[0x2345678A]);
     STRCMP_EQUAL(expected.asCharString(), actual.asCharString());


[tests.elliptic-testcases] updated SPE10 description


texturec: Fixed PTC14 encoder. Issue #699.

--- tools/texturec/texturec.cpp
+++ tools/texturec/texturec.cpp
@@ -117,7 +117,7 @@
 		case TextureFormat::PTC14:
 			{
 				using namespace Javelin;
-				RgbBitmap bmp;
+				RgbaBitmap bmp;
 				bmp.width  = _width;
 				bmp.height = _height;
 				bmp.data   = (uint8_t*)const_cast<void*>(_src);


Fixed floating base poser when zero pose of base is not at origin

--- Cpp/View/RobotPoseWidget.cpp
+++ Cpp/View/RobotPoseWidget.cpp
@@ -77,9 +77,22 @@

 void SetFloatingBase(Robot& robot,const RigidTransform& T)
 {
-  T.t.get(robot.q(0),robot.q(1),robot.q(2));
+  RigidTransform Tp,Tchain;
+  if(robot.joints[0].type == RobotJoint::Floating || robot.joints[0].type == RobotJoint::FloatingPlanar) {
+    Tp.mulInverseB(T,robot.links[robot.joints[0].linkIndex].T0_Parent);
+    Tchain.mulInverseA(robot.links[robot.joints[0].baseIndex+1].T0_Parent,Tp);
+    if(robot.joints[0].baseIndex >= 0) {
+      Tp.mulInverseA(robot.links[robot.parents[robot.joints[0].baseIndex]].T_World,Tchain);
+      Tchain = Tp;
+    }
+  }
+  else {
+    Tp.mulInverseB(T,robot.links[5].T0_Parent);
+    Tchain.mulInverseA(robot.links[0].T0_Parent,Tp);
+  }
+  Tchain.t.get(robot.q(0),robot.q(1),robot.q(2));
   EulerAngleRotation e;
-  e.setMatrixZYX(T.R);
+  e.setMatrixZYX(Tchain.R);
   e.get(robot.q(3),robot.q(4),robot.q(5));
 }


rename con.png to  cones.png in test gpu

rename con.png to  cones.png in test gpu

--- tests/gpu/src/meanshift.cpp
+++ tests/gpu/src/meanshift.cpp
@@ -61,7 +61,7 @@
         int spatialRad = 30;
         int colorRad = 30;

-        cv::Mat img = cv::imread(std::string(ts->get_data_path()) + "meanshift/con.png");
+        cv::Mat img = cv::imread(std::string(ts->get_data_path()) + "meanshift/cones.png");
         cv::Mat img_template = cv::imread(std::string(ts->get_data_path()) + "meanshift/con_result.png");

         cv::Mat rgba;


[yaml2obj] - Simplify. NFC.

[yaml2obj] - Simplify. NFC.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@355832 91177308-0d34-0410-b5e6-96231b3b80d8

--- tools/yaml2obj/yaml2elf.cpp
+++ tools/yaml2obj/yaml2elf.cpp
@@ -133,8 +133,7 @@
   const ELFYAML::Object &Doc;

   bool buildSectionIndex();
-  bool buildSymbolIndex(std::size_t &StartIndex,
-                        const std::vector<ELFYAML::Symbol> &Symbols);
+  bool buildSymbolIndex(const ELFYAML::LocalGlobalWeakSymbols &);
   void initELFHeader(Elf_Ehdr &Header);
   void initProgramHeaders(std::vector<Elf_Phdr> &PHeaders);
   bool initSectionHeaders(std::vector<Elf_Shdr> &SHeaders,
@@ -779,16 +778,19 @@
 }

 template <class ELFT>
-bool
-ELFState<ELFT>::buildSymbolIndex(std::size_t &StartIndex,
-                                 const std::vector<ELFYAML::Symbol> &Symbols) {
-  for (const auto &Sym : Symbols) {
-    ++StartIndex;
-    if (Sym.Name.empty())
-      continue;
-    if (SymN2I.addName(Sym.Name, StartIndex)) {
-      WithColor::error() << "Repeated symbol name: '" << Sym.Name << "'.\n";
-      return false;
+bool ELFState<ELFT>::buildSymbolIndex(
+    const ELFYAML::LocalGlobalWeakSymbols &Symbols) {
+  std::size_t I = 0;
+  for (const std::vector<ELFYAML::Symbol> &V :
+       {Symbols.Local, Symbols.Global, Symbols.Weak}) {
+    for (const auto &Sym : V) {
+      ++I;
+      if (Sym.Name.empty())
+        continue;
+      if (SymN2I.addName(Sym.Name, I)) {
+        WithColor::error() << "Repeated symbol name: '" << Sym.Name << "'.\n";
+        return false;
+      }
     }
   }
   return true;
@@ -846,10 +848,7 @@
   if (!State.buildSectionIndex())
     return 1;

-  std::size_t StartSymIndex = 0;
-  if (!State.buildSymbolIndex(StartSymIndex, Doc.Symbols.Local) ||
-      !State.buildSymbolIndex(StartSymIndex, Doc.Symbols.Global) ||
-      !State.buildSymbolIndex(StartSymIndex, Doc.Symbols.Weak))
+  if (!State.buildSymbolIndex(Doc.Symbols))
     return 1;

   Elf_Ehdr Header;


Fix handling multi-dimensional arrays in SPIR-V disassembly & reflection

--- renderdoc/driver/shaders/spirv/spirv_disassemble.cpp
+++ renderdoc/driver/shaders/spirv/spirv_disassemble.cpp
@@ -486,11 +486,21 @@
     }
     else if(type == eArray)
     {
+      std::string arraySuffix;
+
+      SPVTypeData *eltype = baseType;
+      while(eltype->type == eArray)
+      {
+        arraySuffix += StringFormat::Fmt("[%u]", eltype->arraySize);
+        eltype = eltype->baseType;
+      }
+
       if(arraySize != ~0U)
-        ret +=
-            StringFormat::Fmt("%s %s[%u]", baseType->GetName().c_str(), varName.c_str(), arraySize);
+        ret += StringFormat::Fmt("%s %s[%u]%s", eltype->GetName().c_str(), varName.c_str(),
+                                 arraySize, arraySuffix.c_str());
       else
-        ret += StringFormat::Fmt("%s %s[]", baseType->GetName().c_str(), varName.c_str());
+        ret += StringFormat::Fmt("%s %s[]%s", eltype->GetName().c_str(), varName.c_str(),
+                                 arraySuffix.c_str());
     }
     else
     {
@@ -3461,7 +3471,8 @@
   return retDisasm;
 }

-void MakeConstantBlockVariables(SPVTypeData *structType, rdcarray<ShaderConstant> &cblock);
+void MakeConstantBlockVariables(SPVTypeData *structType, uint32_t arraySize,
+                                uint32_t arrayByteStride, rdcarray<ShaderConstant> &cblock);

 void MakeConstantBlockVariable(ShaderConstant &outConst, SPVTypeData *type, const std::string &name,
                                const std::vector<SPVDecoration> &decorations)
@@ -3582,12 +3593,46 @@

     outConst.type.descriptor.name = type->GetName();

-    MakeConstantBlockVariables(type, outConst.type.members);
+    MakeConstantBlockVariables(type, outConst.type.descriptor.elements,
+                               outConst.type.descriptor.arrayByteStride, outConst.type.members);
+
+    if(type->type == SPVTypeData::eArray)
+    {
+      // if the inner type is an array, it will be expanded in our members list. So don't also
+      // redundantly keep the element count
+      outConst.type.descriptor.elements = 1;
+    }
   }
 }

-void MakeConstantBlockVariables(SPVTypeData *structType, rdcarray<ShaderConstant> &cblock)
+void MakeConstantBlockVariables(SPVTypeData *structType, uint32_t arraySize,
+                                uint32_t arrayByteStride, rdcarray<ShaderConstant> &cblock)
 {
+  // we get here for multi-dimensional arrays
+  if(structType->type == SPVTypeData::eArray)
+  {
+    std::vector<SPVDecoration> empty;
+
+    uint32_t relativeOffset = 0;
+
+    cblock.resize(arraySize);
+    for(uint32_t i = 0; i < arraySize; i++)
+    {
+      MakeConstantBlockVariable(cblock[i], structType, StringFormat::Fmt("[%u]", i),
+                                structType->decorations ? *structType->decorations : empty);
+
+      uint32_t byteOffset = relativeOffset;
+      RDCASSERT(byteOffset % 4 == 0);    // assume uint32_t aligned
+      byteOffset /= 4;
+      cblock[i].reg.vec = byteOffset / 4;
+      cblock[i].reg.comp = byteOffset % 4;
+
+      relativeOffset += arrayByteStride;
+    }
+
+    return;
+  }
+
   if(structType->children.empty())
     return;

@@ -4225,11 +4270,11 @@
           res.variableType.descriptor.type = VarType::Float;
           res.variableType.descriptor.name = type->GetName();

-          MakeConstantBlockVariables(type, res.variableType.members);
+          MakeConstantBlockVariables(type, 0, 0, res.variableType.members);
         }
         else
         {
-          MakeConstantBlockVariables(type, cblock.variables);
+          MakeConstantBlockVariables(type, 0, 0, cblock.variables);

           if(!type->children.empty())
             cblock.byteSize = CalculateMinimumByteSize(cblock.variables);


Format sampled image types correctly

Format sampled image types correctly

--- renderdoc/driver/shaders/spirv/spirv_disassemble.cpp
+++ renderdoc/driver/shaders/spirv/spirv_disassemble.cpp
@@ -286,6 +286,19 @@
 					arrayed ? "Array" : "",
 					ToStr::Get(texdim).c_str(),
 					typestring.c_str());
+			}
+			else if(type == eSampledImage)
+			{
+				name = "Sampled" + baseType->GetName();
+			}
+			else if(type == eSampler)
+			{
+				name = "Sampler";
+			}
+			else
+			{
+				RDCERR("Unexpected type!");
+				name = StringFormat::Fmt("Unhandled_%u_Type", type);
 			}
 		}


simplify iterator in for-loop #187

simplify iterator in for-loop #187

--- src/openMVG/sfm/pipelines/sequential/sequential_SfM.cpp
+++ src/openMVG/sfm/pipelines/sequential/sequential_SfM.cpp
@@ -371,12 +371,9 @@

     // Add observations histogram
     std::vector<int> obs_histogram;
-    for (Landmarks::const_iterator iterTracks = _sfm_data.GetLandmarks().begin();
-      iterTracks != _sfm_data.GetLandmarks().end();
-      ++iterTracks
-    )
-    {
-      const Observations & obs = iterTracks->second.obs;
+    for (const auto & iterTracks : _sfm_data.GetLandmarks())
+    {
+      const Observations & obs = iterTracks.second.obs;
       if(obs_histogram.size() < obs.size() + 1)
         obs_histogram.resize(obs.size() + 1, 0);
       obs_histogram[obs.size()]++;


Handle implicitly-enabled promoted extensions. Refs #2695

--- renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp
+++ renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp
@@ -3250,6 +3250,15 @@
         VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHR,
     };

+    if(RDCMIN(m_EnabledExtensions.vulkanVersion, physProps.apiVersion) >= VK_MAKE_VERSION(1, 3, 0))
+    {
+      // VK_EXT_extended_dynamic_state and VK_EXT_extended_dynamic_state2 were unconditionally
+      // promoted and considered implicitly enabled in vulkan 1.3
+      m_ExtendedDynState = true;
+      m_ExtendedDynState2 = true;
+      // logic and patch CPs were not
+    }
+
     if(RDCMIN(m_EnabledExtensions.vulkanVersion, physProps.apiVersion) >= VK_MAKE_VERSION(1, 2, 0))
     {
       VkPhysicalDeviceVulkan12Features avail12Features = {


D3D9: Fixed a bug where RenderWindow and Viewport sizes would not be in sync during a windowResized event.

--- RenderSystems/Direct3D9/src/OgreD3D9RenderWindow.cpp
+++ RenderSystems/Direct3D9/src/OgreD3D9RenderWindow.cpp
@@ -351,7 +351,7 @@
 			if (fullScreen != mIsFullScreen)
 				mSwitchingFullscreen = true;

-			DWORD dwStyle = WS_VISIBLE | WS_CLIPCHILDREN;
+			mStyle = WS_VISIBLE | WS_CLIPCHILDREN;

 			bool oldFullscreen = mIsFullScreen;
 			mIsFullScreen = fullScreen;
@@ -360,7 +360,7 @@

 			if (fullScreen)
 			{
-				dwStyle |= WS_POPUP;
+				mStyle |= WS_POPUP;

 				// Get the nearest monitor to this window.
 				HMONITOR hMonitor = MonitorFromWindow(mHWnd, MONITOR_DEFAULTTONEAREST);
@@ -386,25 +386,24 @@
 				{
 					SetWindowPos(mHWnd, HWND_TOPMOST, mLeft, mTop, width, height, SWP_NOACTIVATE);
 					//MoveWindow(mHWnd, mLeft, mTop, mWidth, mHeight, FALSE);
-					SetWindowLong(mHWnd, GWL_STYLE, dwStyle);
+					SetWindowLong(mHWnd, GWL_STYLE, mStyle);
 					SetWindowPos(mHWnd, 0, 0,0, 0,0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
 				}
 			}
 			else
 			{
-				dwStyle |= WS_OVERLAPPEDWINDOW;
+				mStyle |= WS_OVERLAPPEDWINDOW;
 				// Calculate window dimensions required
 				// to get the requested client area
 				unsigned int winWidth, winHeight;
-				adjustWindow(mWidth, mHeight, dwStyle, &winWidth, &winHeight);
-
-				SetWindowLong(mHWnd, GWL_STYLE, dwStyle);
+				adjustWindow(mWidth, mHeight, mStyle, &winWidth, &winHeight);
+
+				SetWindowLong(mHWnd, GWL_STYLE, mStyle);
 				SetWindowPos(mHWnd, HWND_NOTOPMOST, 0, 0, winWidth, winHeight,
 					SWP_DRAWFRAME | SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOACTIVATE);
 				// Note that we also set the position in the restoreLostDevice method
 				// via _finishSwitchingFullScreen
 			}
-			mStyle = dwStyle;

 			// Have to release & trigger device reset
 			// NB don't use windowMovedOrResized since Win32 doesn't know
@@ -457,20 +456,11 @@
 		}
 		else
 		{
-			bool updateRect = false;
-
 			// When switching back to windowed mode, need to reset window size
 			// after device has been restored
 			// We may have had a resize event which polluted our desired sizes
-			if (mWidth != mDesiredWidth ||
-				mHeight != mDesiredHeight)
-			{
-				mWidth = mDesiredWidth;
-				mHeight = mDesiredHeight;
-				updateRect = true;
-			}
 			unsigned int winWidth, winHeight;
-			adjustWindow(mWidth, mHeight, mStyle, &winWidth, &winHeight);
+			adjustWindow(mDesiredWidth, mDesiredHeight, mStyle, &winWidth, &winHeight);

 			// deal with centreing when switching down to smaller resolution

@@ -489,8 +479,11 @@
 			SetWindowPos(mHWnd, HWND_NOTOPMOST, left, top, winWidth, winHeight,
 				SWP_DRAWFRAME | SWP_FRAMECHANGED | SWP_NOACTIVATE);

-			if (updateRect)
-			{
+			if (mWidth != mDesiredWidth ||
+				mHeight != mDesiredHeight)
+			{
+				mWidth = mDesiredWidth;
+				mHeight = mDesiredHeight;
 				// Notify viewports of resize
 				ViewportList::iterator it = mViewportList.begin();
 				while( it != mViewportList.end() )


Don't specify cache as derived resource if it's non-existant

--- renderdoc/driver/vulkan/wrappers/vk_shader_funcs.cpp
+++ renderdoc/driver/vulkan/wrappers/vk_shader_funcs.cpp
@@ -629,7 +629,8 @@

     AddResource(Pipeline, ResourceType::PipelineState, "Graphics Pipeline");
     DerivedResource(device, Pipeline);
-    DerivedResource(origCache, Pipeline);
+    if(origCache != VK_NULL_HANDLE)
+      DerivedResource(origCache, Pipeline);
     if(CreateInfo.basePipelineHandle != VK_NULL_HANDLE)
       DerivedResource(CreateInfo.basePipelineHandle, Pipeline);
     DerivedResource(CreateInfo.layout, Pipeline);


Correcting conversion between Cartesian and spherical coordinates

--- implementations/MaxMSP/jcom.dbapBformat/jcom.dbapBformat.cpp
+++ implementations/MaxMSP/jcom.dbapBformat/jcom.dbapBformat.cpp
@@ -715,8 +715,12 @@
 	scalingCoefficientSquareInverse = 0;
 	for (i=0; i<x->attrNumberOfDestinations; i++) {

-		dx = x->destinationPosition[i].x - x->sourcePosition[n].x;
-		dy = x->destinationPosition[i].y - x->sourcePosition[n].y;
+		//dx = x->destinationPosition[i].x - x->sourcePosition[n].x;
+		//dy = x->destinationPosition[i].y - x->sourcePosition[n].y;
+		// Clculations of dx and dy might seem strange, but are due to the rotation
+		// of spherical vs. Cartesian coordinate systems in SpatDIF
+		dx = x->destinationPosition[i].y - x->sourcePosition[n].y;
+		dy = x->sourcePosition[n].x		 - x->destinationPosition[i].x;

 		// Calculations required for ambisonics decoding
 		distance = sqrt(dx*dx + dy*dy);


Added more debugging info to rewriterview

Reviewed-by: erikv

--- src/plugins/qmldesigner/designercore/model/rewriterview.cpp
+++ src/plugins/qmldesigner/designercore/model/rewriterview.cpp
@@ -404,8 +404,10 @@
     clearErrors();

     if (inErrorState()) {
+        const QString content = textModifierContent();
         qDebug() << "RewriterView::applyChanges() got called while in error state. Will do a quick-exit now.";
-        throw RewritingException(__LINE__, __FUNCTION__, __FILE__, "RewriterView::applyChanges() already in error state", textModifierContent());
+        qDebug() << "Content:" << content;
+        throw RewritingException(__LINE__, __FUNCTION__, __FILE__, "RewriterView::applyChanges() already in error state", content);
     }

     try {
@@ -414,11 +416,17 @@
             enterErrorState(errors().first().description());
         }
     } catch (Exception &e) {
+        const QString content = textModifierContent();
+        qDebug() << "RewriterException:" << m_rewritingErrorMessage;
+        qDebug() << "Content:" << content;
         enterErrorState(e.description());
     }

     if (inErrorState()) {
-        throw RewritingException(__LINE__, __FUNCTION__, __FILE__, m_rewritingErrorMessage, textModifierContent());
+        const QString content = textModifierContent();
+        qDebug() << "RewriterException:" << m_rewritingErrorMessage;
+        qDebug() << "Content:" << content;
+        throw RewritingException(__LINE__, __FUNCTION__, __FILE__, m_rewritingErrorMessage, content);
     }
 }


INTEGRATION: CWS pchfix02 (1.7.122); FILE MERGED 2006/09/01 17:37:17 kaib 1.7.122.1: #i68856# Added header markers and pch files

--- sd/source/ui/slidesorter/controller/SlsPageSelector.cxx
+++ sd/source/ui/slidesorter/controller/SlsPageSelector.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: SlsPageSelector.cxx,v $
  *
- *  $Revision: 1.7 $
- *
- *  last change: $Author: vg $ $Date: 2006-04-06 16:20:07 $
+ *  $Revision: 1.8 $
+ *
+ *  last change: $Author: obo $ $Date: 2006-09-16 19:06:44 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -32,6 +32,9 @@
  *    MA  02111-1307  USA
  *
  ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sd.hxx"

 #include "controller/SlsPageSelector.hxx"


Fixed FE framer resync message drop corner case.

This is a rare and subtle corner case that is triggered only if there is
non-message content before a valid message that:
1. Starts with a preamble, but isn't a valid message
2. Has a _second_ BYTE0 in the middle but _not_ a BYTE1
3. Has exactly enough bogus bytes (21 B) that the preamble and first byte
   of the valid message header end up right at the end of the resync buffer
   (24 B)

--- src/point_one/fusion_engine/parsers/fusion_engine_framer.cc
+++ src/point_one/fusion_engine/parsers/fusion_engine_framer.cc
@@ -390,7 +390,6 @@
             << (available_bytes - message_size - 1)
             << " candidate bytes remaining]";
       } else {
-        --available_bytes;
         size_t prev_offset = offset;
         offset = 0;
         VLOG(1) << "Candidate message rejected after " << prev_offset


Windows: Removed manual use of `O_BINARY`.

This is now superfluous as it is added in stout.

Review: https://reviews.apache.org/r/64690

--- src/status_update_manager/status_update_manager_process.hpp
+++ src/status_update_manager/status_update_manager_process.hpp
@@ -634,9 +634,6 @@
         // Open the updates file.
         Try<int_fd> result = os::open(
             path.get(),
-#ifdef __WINDOWS__
-            O_BINARY |
-#endif // __WINDOWS__
             O_CREAT | O_SYNC | O_WRONLY | O_CLOEXEC,
             S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);


HARMONY-3700 :  LOS adaptation bug

HARMONY-3700 :  LOS adaptation bug

svn path=/harmony/; revision=531039

--- enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_slide_compact.cpp
+++ enhanced/drlvm/trunk/vm/gc_gen/src/mark_compact/mspace_slide_compact.cpp
@@ -423,13 +423,14 @@
     lspace_fix_repointed_refs(collector, lspace);
     gc_fix_rootset(collector);
     gc_init_block_for_sliding_compact(gc, mspace);
-    num_fixing_collectors++;
     /*LOS_Shrink: Fixme: This operation moves objects in LOS, and should be part of Pass 4*/
     if(lspace->move_object)  lspace_sliding_compact(collector, lspace);
     mspace_settle_fake_blocks_for_los_shrink(mspace);
     /*Fixme: LOS_Shrink: set dest block for sliding compact*/
     if(gc->tuner->kind == TRANS_FROM_LOS_TO_MOS)
       mspace->block_iterator = (Block_Header*)((POINTER_SIZE_INT)mspace->blocks - (mspace->gc)->tuner->tuning_size);
+
+    num_fixing_collectors++;
   }
   while(num_fixing_collectors != num_active_collectors + 1);


Use SG_CALLOC instead of calloc Just to fix some of the static analyzer reports

--- src/shogun/kernel/string/LocalAlignmentStringKernel.cpp
+++ src/shogun/kernel/string/LocalAlignmentStringKernel.cpp
@@ -188,14 +188,12 @@
 	register int32_t i;

 	/* Initialization of the array which gives the position of each amino-acid in the set of amino-acid */
-	if ((aaIndex=(int32_t *)calloc(NLET,sizeof(int32_t)))==NULL)
-		SG_ERROR("run out o memory");
+	aaIndex = SG_CALLOC(int32_t, NLET);
 	for (i=0;i<NAA;i++)
 		aaIndex[aaList[i]-'A']=i;

 	/* Initialization of the array which indicates whether a char is an amino-acid */
-	if ((isAA=(int32_t *)calloc(256,sizeof(int32_t)))==NULL)
-		SG_ERROR("run out of memory");
+	isAA = SG_CALLOC(int32_t, 256);
 	for (i=0;i<NAA;i++)
 		isAA[(int32_t)aaList[i]]=1;

@@ -379,10 +377,8 @@

 	/* Create aax and aay */

-	if ((aax=(int32_t *)calloc(lx,sizeof(int32_t)))==NULL)
-		SG_ERROR("run out of memory");
-	if ((aay=(int32_t *)calloc(ly,sizeof(int32_t)))==NULL)
-		SG_ERROR("run out of memory");
+	aax = SG_CALLOC(int32_t, lx);
+	aay = SG_CALLOC(int32_t, ly);

 	/* Extract the characters corresponding to aminoacids and keep their indexes */


Changed the MIN_CPU_SHARES to match the kernel constant.

Review: https://reviews.apache.org/r/36410

--- src/slave/containerizer/isolators/cgroups/constants.hpp
+++ src/slave/containerizer/isolators/cgroups/constants.hpp
@@ -28,7 +28,7 @@

 // CPU subsystem constants.
 const uint64_t CPU_SHARES_PER_CPU = 1024;
-const uint64_t MIN_CPU_SHARES = 10;
+const uint64_t MIN_CPU_SHARES = 2; // Linux constant.
 const Duration CPU_CFS_PERIOD = Milliseconds(100); // Linux default.
 const Duration MIN_CPU_CFS_QUOTA = Milliseconds(1);


Update CombatTaskTests - Add Default Test Case of exclusive one exhaust

--- Tests/UnitTests/Tasks/BasicTasks/CombatTaskTests.cpp
+++ Tests/UnitTests/Tasks/BasicTasks/CombatTaskTests.cpp
@@ -55,6 +55,23 @@
     attack(1, 1);
     EXPECT_EQ(gen.player1.field.size(), static_cast<size_t>(0));
     EXPECT_EQ(gen.player2.field.size(), static_cast<size_t>(0));
+
+    card1->attack = 5;
+    Character minion3(card1.get());
+
+    gen.player1.field.emplace_back(&minion3);
+    gen.player2.field.emplace_back(&minion2);
+
+    attack(1, 1);
+    EXPECT_EQ(gen.player1.field[0]->health, static_cast<size_t>(1));
+    EXPECT_EQ(gen.player2.field.size(), static_cast<size_t>(0));
+
+    gen.player1.field[0]->attack = 1;
+    gen.player2.field.emplace_back(&minion2);
+
+    attack(1, 1);
+    EXPECT_EQ(gen.player1.field.size(), static_cast<size_t>(0));
+    EXPECT_EQ(gen.player2.field[0]->health, static_cast<size_t>(3));
 }

 TEST(CombatTask, CombatTaunt)


Fixed crash (I still don't understand why new imap folders don't get assigned
an account right away, but only when syncing... Sounds like a bug, so this commit
is more of a workaround...)

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

--- kmail/folderdiaacltab.cpp
+++ kmail/folderdiaacltab.cpp
@@ -717,7 +717,7 @@
     imapAccount = static_cast<KMFolderImap*>( refFolder->storage() )->account();
   else
     imapAccount = static_cast<KMFolderCachedImap*>( refFolder->storage() )->account();
-  return imapAccount->hasACLSupport(); // support for ACLs (or not tried connecting yet)
+  return imapAccount && imapAccount->hasACLSupport(); // support for ACLs (or not tried connecting yet)
 }

 #include "folderdiaacltab.moc"


Remove now redundant else clause as discussed here:
http://lists.kde.org/?t=108471306900002&r=1&w=2

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

--- kmail/kmsearchpattern.cpp
+++ kmail/kmsearchpattern.cpp
@@ -274,8 +274,6 @@
                matches( aStr, msg, &cc, 2 ) &&
                matches( aStr, msg, &bcc, 3 ) );
     }
-  } else {
-    return KMSearchRule::matches( aStr, msg, aHeaderField, aHeaderLen );
   }
 }


Avoid a string copy when sending mails.

Avoid a string copy when sending mails.

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

--- kmail/messagecomposer.cpp
+++ kmail/messagecomposer.cpp
@@ -1527,7 +1527,10 @@
       if ( !encryptThisNow && !signThisNow ) {
         msg->addBodyPart( it->part );
         // I DON'T KNOW WHY, BUT THIS FIXES THE VANISHING BOUNDARY PARAMTER
-        (void)msg->asString();
+        //(void)msg->asString();
+        /* I assume the above was needed for the side effect of assembling the
+         * message. The below does that as well without copying the string. - Till */
+        (void)msg->asDwMessage();
         continue;
       }


use previous index test

use previous index test

--- tests/index/index_test.cpp
+++ tests/index/index_test.cpp
@@ -10,34 +10,14 @@
 //
 //===----------------------------------------------------------------------===//

-#include "gtest/gtest.h"
 #include "harness.h"

 #include "backend/common/logger.h"
 #include "backend/index/index_factory.h"
 #include "backend/storage/tuple.h"

-//#define BWTREE_DEBUG
-#include <random>
-
 namespace peloton {
 namespace test {
-
-
-template <typename Fn, typename... Args>
-void LaunchParallelTestID(uint64_t num_threads, Fn&& fn, Args &&... args) {
-  std::vector<std::thread> thread_group;
-
-  // Launch a group of threads
-  for (uint64_t thread_itr = 0; thread_itr < num_threads; ++thread_itr) {
-    thread_group.push_back(std::thread(fn, thread_itr, args...));
-  }
-
-  // Join the threads with the main thread
-  for (uint64_t thread_itr = 0; thread_itr < num_threads; ++thread_itr) {
-    thread_group[thread_itr].join();
-  }
-}

 //===--------------------------------------------------------------------===//
 // Index Tests
@@ -50,19 +30,17 @@
 ItemPointer item1(120, 7);
 ItemPointer item2(123, 19);

-/*
- * BuildIndex() - Set up environment to test index implementation
- *
- * Argument unique_keys specifies whether the index should accept
- * duplicated key or not, which by default is set to false
- */
-index::Index *BuildIndex(bool unique_keys = false) {
+class IndexTests : public PelotonTest {};
+
+index::Index *BuildIndex() {
   // Build tuple and key schema
   std::vector<std::vector<std::string>> column_names;
   std::vector<catalog::Column> columns;
   std::vector<catalog::Schema *> schemas;
-  // IndexType index_type = INDEX_TYPE_BTREE;
-  IndexType index_type = INDEX_TYPE_BWTREE;
+  IndexType index_type = INDEX_TYPE_BTREE;
+  index_type = INDEX_TYPE_HASH;
+  // TODO: Uncomment the line below
+  //index_type = INDEX_TYPE_BWTREE;

   catalog::Column column1(VALUE_TYPE_INTEGER, GetTypeSize(VALUE_TYPE_INTEGER),
                           "A", true);
@@ -86,6 +64,8 @@
   tuple_schema = new catalog::Schema(columns);

   // Build index metadata
+  const bool unique_keys = false;
+
   index::IndexMetadata *index_metadata = new index::IndexMetadata(
       "test_index", 125, index_type, INDEX_CONSTRAINT_TYPE_DEFAULT,
       tuple_schema, key_schema, unique_keys);
@@ -97,145 +77,8 @@
   return index;
 }

-/*
- * UniqueKeyTest() - Test unique key support for index
- *
- * We test insert/remove of unique key under several different
- * conditions
- */
-TEST(IndexTests, UniqueKeyTest) {
-  // It sets up an index schema with 4 columns
-  // A B C D and set the indexed column to be jointly A and B
-  // which is an integer and a varchar
-  auto pool = TestingHarness::GetInstance().GetTestingPool();
-
-  // We explicitly require the index to enforce unqiue key
-  std::unique_ptr<index::Index> index(BuildIndex(true));
-  std::unique_ptr<storage::Tuple> key0(new storage::Tuple(key_schema, true));
-  key0->SetValue(0, ValueFactory::GetIntegerValue(100), pool);
-  key0->SetValue(1, ValueFactory::GetStringValue("a"), pool);
-
-  // Boolean return value
-  bool ret;
-  // Vector of item return value
-  std::vector<ItemPointer> item_list;
-
-  /*
-   * Single key test for unique key
-   */
-
-  // First make sure there is no such key in the index and
-  // then delete returns false (trivial)
-  ret = index->DeleteEntry(key0.get(), item0);
-  EXPECT_EQ(ret, false);
-
-  // Insert single key-value pair
-  ret = index->InsertEntry(key0.get(), item0);
-  EXPECT_EQ(ret, true);
-
-  // Make sure it has been inserted
-  item_list = index->ScanKey(key0.get());
-  EXPECT_EQ(item_list.size(), 1);
-
-  // Do the same insertion again, this time it should
-  // fail with false since we are expecting unique key
-  ret = index->InsertEntry(key0.get(), item0);
-  EXPECT_EQ(ret, false);
-
-  // Make sure it has not been inserted
-  item_list = index->ScanKey(key0.get());
-  EXPECT_EQ(item_list.size(), 1);
-
-  /*
-   * End of previous test
-   */
-
-  delete tuple_schema;
-
-  /*
-   * Many key test for unique key
-   */
-
-  // Use another index object to avoid previous result pollute this test
-  std::unique_ptr<index::Index> index2(BuildIndex(true));
-  // We test the index with this many different keys
-  const int key_list_size = 2000;
-
-  storage::Tuple **key_list = new storage::Tuple *[key_list_size];
-  for (int i = 0; i < key_list_size; i++) {
-    key_list[i] = new storage::Tuple(key_schema, true);
-
-    // All the key has a unique value
-    key_list[i]->SetValue(0, ValueFactory::GetIntegerValue(i), pool);
-    key_list[i]->SetValue(1, ValueFactory::GetStringValue("many-key-test!"),
-                          pool);
-  }
-
-  // Test whether many key insertion under unique key mode is successful
-  for (int i = 0; i < key_list_size; i++) {
-    ret = index2->InsertEntry(key_list[i], item0);
-    EXPECT_EQ(ret, true);
-
-    // Make sure it has been deleted (no search result)
-    item_list = index2->ScanKey(key_list[i]);
-    EXPECT_EQ(item_list.size(), 1);
-  }
-
-  // Check whether that many keys have been inserted
-  // NOTE: CURRENT WE FAIL THE FOLLOWING STATEMENT
-  item_list = index2->ScanAllKeys();
-  EXPECT_EQ(item_list.size(), key_list_size);
-
-  // Delete most of the keys (whose index is a multiple of 2 or 3 or 5)
-  int counter = 0;
-  for (int i = 0; i < key_list_size; i++) {
-    if (((i % 2) == 0) || ((i % 3) == 0) || ((i % 5) == 0)) {
-      // Check if the values are actually present
-      item_list = index2->ScanKey(key_list[i]);
-      EXPECT_EQ(item_list.size(), 1);
-
-      // Make sure delete succeeds
-      ret = index2->DeleteEntry(key_list[i], item0);
-      EXPECT_EQ(ret, true);
-
-      // We use this to validate ScanKey() result
-      counter++;
-
-      // Make sure it has been deleted (no search result)
-      item_list = index2->ScanKey(key_list[i]);
-      EXPECT_EQ(item_list.size(), 0);
-
-      // Try to delete a key that does not exist in the
-      // index - should always return false
-      ret = index2->DeleteEntry(key0.get(), item0);
-      EXPECT_EQ(ret, false);
-    }
-  }
-
-  // There should be remaining (key_list_size - counter) keys
-  item_list = index2->ScanAllKeys();
-  EXPECT_EQ(item_list.size(), key_list_size - counter);
-
-  // Clean up - Avoid memory leak
-  for (int i = 0; i < key_list_size; i++) {
-    delete key_list[i];
-  }
-
-  delete[] key_list;
-
-  /*
-   * End of previous test
-   */
-
-  /*
-   * End of all tests
-   */
-
-  // This should be the last line
-  delete tuple_schema;
-}
-
-TEST(IndexTests, BasicTest) {
+
+TEST_F(IndexTests, BasicTest) {
   auto pool = TestingHarness::GetInstance().GetTestingPool();
   std::vector<ItemPointer> locations;

@@ -243,26 +86,13 @@
   std::unique_ptr<index::Index> index(BuildIndex());

   std::unique_ptr<storage::Tuple> key0(new storage::Tuple(key_schema, true));
-  std::unique_ptr<storage::Tuple> key1(new storage::Tuple(key_schema, true));
-  std::unique_ptr<storage::Tuple> key2(new storage::Tuple(key_schema, true));

   key0->SetValue(0, ValueFactory::GetIntegerValue(100), pool);
+
   key0->SetValue(1, ValueFactory::GetStringValue("a"), pool);
-
-  key1->SetValue(0, ValueFactory::GetIntegerValue(101), pool);
-  key1->SetValue(1, ValueFactory::GetStringValue("b"), pool);
-
-  key2->SetValue(0, ValueFactory::GetIntegerValue(102), pool);
-  key2->SetValue(1, ValueFactory::GetStringValue("c"), pool);
-
-  // DELETE BEFORE INSERT
-  bool res = index->DeleteEntry(key0.get(), item0);
-  EXPECT_EQ(res, false);

   // INSERT
   index->InsertEntry(key0.get(), item0);
-  index->InsertEntry(key1.get(), item1);
-  index->InsertEntry(key2.get(), item2);

   locations = index->ScanKey(key0.get());
   EXPECT_EQ(locations.size(), 1);
@@ -274,153 +104,21 @@
   locations = index->ScanKey(key0.get());
   EXPECT_EQ(locations.size(), 0);

-  // INSERT SAME KEY VALUE
-  for (int i = 0; i < 100; i++) {
-    index->InsertEntry(key0.get(), item0);
-  }
-
-  locations = index->ScanKey(key0.get());
-
-  EXPECT_EQ(locations.size(), 100);
-
-  // DELETE SAME KEY VALUE
-  index->DeleteEntry(key0.get(), item0);
-
-  locations = index->ScanKey(key0.get());
-  EXPECT_EQ(locations.size(), 0);
-
-  locations = index->ScanKey(key1.get());
-  EXPECT_EQ(locations.size(), 1);
-
-  locations = index->ScanKey(key2.get());
-  EXPECT_EQ(locations.size(), 1);
-
   delete tuple_schema;
 }

-#ifdef BWTREE_DEBUG
-int thread_counter = 0;
-std::mutex thread_counter_mutex;
-#endif
-
 // INSERT HELPER FUNCTION
-void InsertTest(index::Index *index, VarlenPool *pool, size_t scale_factor) {
-
-#ifdef BWTREE_DEBUG
-  // Allocate a unique thread ID for each thread
-  // NOTE: This might change the scheduling since we
-  // now introduce lock and unlock
-  thread_counter_mutex.lock();
-  int thread_id = thread_counter++;
-  thread_counter_mutex.unlock();
-#endif
-
-#ifdef BWTREE_DEBUG
-  int counter = 1;
-#endif
+void InsertTest(index::Index *index, VarlenPool *pool, size_t scale_factor){
+
   // Loop based on scale factor
-  for (size_t scale_itr = 1; scale_itr <= scale_factor; scale_itr++) {
+  for(size_t scale_itr = 1; scale_itr <= scale_factor; scale_itr++) {
     // Insert a bunch of keys based on scale itr
     std::unique_ptr<storage::Tuple> key0(new storage::Tuple(key_schema, true));
     std::unique_ptr<storage::Tuple> key1(new storage::Tuple(key_schema, true));
     std::unique_ptr<storage::Tuple> key2(new storage::Tuple(key_schema, true));
     std::unique_ptr<storage::Tuple> key3(new storage::Tuple(key_schema, true));
     std::unique_ptr<storage::Tuple> key4(new storage::Tuple(key_schema, true));
-    std::unique_ptr<storage::Tuple> keynonce(
-        new storage::Tuple(key_schema, true));
-
-    key0->SetValue(0, ValueFactory::GetIntegerValue(100 * scale_itr), pool);
-    key0->SetValue(1, ValueFactory::GetStringValue("a"), pool);
-
-    key1->SetValue(0, ValueFactory::GetIntegerValue(100 * scale_itr), pool);
-    key1->SetValue(1, ValueFactory::GetStringValue("b"), pool);
-
-    key2->SetValue(0, ValueFactory::GetIntegerValue(100 * scale_itr), pool);
-    key2->SetValue(1, ValueFactory::GetStringValue("c"), pool);
-
-    key3->SetValue(0, ValueFactory::GetIntegerValue(400 * scale_itr), pool);
-    key3->SetValue(1, ValueFactory::GetStringValue("d"), pool);
-
-    key4->SetValue(0, ValueFactory::GetIntegerValue(500 * scale_itr), pool);
-    key4->SetValue(1, ValueFactory::GetStringValue(
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"),
-                   pool);
-
-    keynonce->SetValue(0, ValueFactory::GetIntegerValue(1000 * scale_itr),
-                       pool);
-    keynonce->SetValue(1, ValueFactory::GetStringValue("f"), pool);
-
-    // INSERT
-    index->InsertEntry(key0.get(), item0);
-#ifdef BWTREE_DEBUG
-    printf("Insert test (thread %d) %d\n", thread_id, counter++);
-#endif
-    index->InsertEntry(key1.get(), item1);
-#ifdef BWTREE_DEBUG
-    printf("Insert test (thread %d) %d\n", thread_id, counter++);
-#endif
-    index->InsertEntry(key1.get(), item2);
-#ifdef BWTREE_DEBUG
-    printf("Insert test (thread %d) %d\n", thread_id, counter++);
-#endif
-    index->InsertEntry(key1.get(), item1);
-#ifdef BWTREE_DEBUG
-    printf("Insert test (thread %d) %d\n", thread_id, counter++);
-#endif
-    index->InsertEntry(key1.get(), item1);
-#ifdef BWTREE_DEBUG
-    printf("Insert test (thread %d) %d\n", thread_id, counter++);
-#endif
-    index->InsertEntry(key1.get(), item0);
-#ifdef BWTREE_DEBUG
-    printf("Insert test (thread %d) %d\n", thread_id, counter++);
-#endif
-    index->InsertEntry(key2.get(), item1);
-#ifdef BWTREE_DEBUG
-    printf("Insert test (thread %d) %d\n", thread_id, counter++);
-#endif
-    index->InsertEntry(key3.get(), item1);
-#ifdef BWTREE_DEBUG
-    printf("Insert test (thread %d) %d\n", thread_id, counter++);
-#endif
-    index->InsertEntry(key4.get(), item1);
-#ifdef BWTREE_DEBUG
-    printf("Insert test (thread %d) %d\n", thread_id, counter++);
-#endif
-  }
-
-  return;
-}
-
-// DELETE HELPER FUNCTION
-void DeleteTest(index::Index *index, VarlenPool *pool, size_t scale_factor) {
-  // Loop based on scale factor
-  for (size_t scale_itr = 1; scale_itr <= scale_factor; scale_itr++) {
-    // Delete a bunch of keys based on scale itr
-    std::unique_ptr<storage::Tuple> key0(new storage::Tuple(key_schema, true));
-    std::unique_ptr<storage::Tuple> key1(new storage::Tuple(key_schema, true));
-    std::unique_ptr<storage::Tuple> key2(new storage::Tuple(key_schema, true));
-    std::unique_ptr<storage::Tuple> key3(new storage::Tuple(key_schema, true));
-    std::unique_ptr<storage::Tuple> key4(new storage::Tuple(key_schema, true));
+    std::unique_ptr<storage::Tuple> keynonce(new storage::Tuple(key_schema, true));

     key0->SetValue(0, ValueFactory::GetIntegerValue(100 * scale_itr), pool);
     key0->SetValue(1, ValueFactory::GetStringValue("a"), pool);
@@ -432,27 +130,86 @@
     key3->SetValue(1, ValueFactory::GetStringValue("d"), pool);
     key4->SetValue(0, ValueFactory::GetIntegerValue(500 * scale_itr), pool);
     key4->SetValue(1, ValueFactory::GetStringValue(
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
-                          "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"),
-                   pool);
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"), pool);
+    keynonce->SetValue(0, ValueFactory::GetIntegerValue(1000 * scale_itr), pool);
+    keynonce->SetValue(1, ValueFactory::GetStringValue("f"), pool);
+
+    // INSERT
+    index->InsertEntry(key0.get(), item0);
+    index->InsertEntry(key1.get(), item1);
+    index->InsertEntry(key1.get(), item2);
+    index->InsertEntry(key1.get(), item1);
+    index->InsertEntry(key1.get(), item1);
+    index->InsertEntry(key1.get(), item0);
+
+    index->InsertEntry(key2.get(), item1);
+    index->InsertEntry(key3.get(), item1);
+    index->InsertEntry(key4.get(), item1);
+  }
+
+}
+
+// DELETE HELPER FUNCTION
+void DeleteTest(index::Index *index, VarlenPool *pool, size_t scale_factor){
+
+  // Loop based on scale factor
+  for(size_t scale_itr = 1; scale_itr <= scale_factor; scale_itr++) {
+    // Delete a bunch of keys based on scale itr
+    std::unique_ptr<storage::Tuple> key0(new storage::Tuple(key_schema, true));
+    std::unique_ptr<storage::Tuple> key1(new storage::Tuple(key_schema, true));
+    std::unique_ptr<storage::Tuple> key2(new storage::Tuple(key_schema, true));
+    std::unique_ptr<storage::Tuple> key3(new storage::Tuple(key_schema, true));
+    std::unique_ptr<storage::Tuple> key4(new storage::Tuple(key_schema, true));
+
+    key0->SetValue(0, ValueFactory::GetIntegerValue(100 * scale_itr), pool);
+    key0->SetValue(1, ValueFactory::GetStringValue("a"), pool);
+    key1->SetValue(0, ValueFactory::GetIntegerValue(100 * scale_itr), pool);
+    key1->SetValue(1, ValueFactory::GetStringValue("b"), pool);
+    key2->SetValue(0, ValueFactory::GetIntegerValue(100 * scale_itr), pool);
+    key2->SetValue(1, ValueFactory::GetStringValue("c"), pool);
+    key3->SetValue(0, ValueFactory::GetIntegerValue(400 * scale_itr), pool);
+    key3->SetValue(1, ValueFactory::GetStringValue("d"), pool);
+    key4->SetValue(0, ValueFactory::GetIntegerValue(500 * scale_itr), pool);
+    key4->SetValue(1, ValueFactory::GetStringValue(
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
+        "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"), pool);

     // DELETE
     index->DeleteEntry(key0.get(), item0);
@@ -461,9 +218,10 @@
     index->DeleteEntry(key3.get(), item1);
     index->DeleteEntry(key4.get(), item1);
   }
-}
-
-TEST(IndexTests, DeleteTest) {
+
+}
+
+TEST_F(IndexTests, InsertTest) {
   auto pool = TestingHarness::GetInstance().GetTestingPool();
   std::vector<ItemPointer> locations;

@@ -471,11 +229,11 @@
   std::unique_ptr<index::Index> index(BuildIndex());

   // Single threaded test
-  size_t scale_factor = 100;
-
-  // These two are executed sequentially
+  size_t scale_factor = 1;
   LaunchParallelTest(1, InsertTest, index.get(), pool, scale_factor);
-  LaunchParallelTest(1, DeleteTest, index.get(), pool, scale_factor);
+
+  locations = index->ScanAllKeys();
+  EXPECT_EQ(locations.size(), 9);

   // Checks
   std::unique_ptr<storage::Tuple> key0(new storage::Tuple(key_schema, true));
@@ -490,10 +248,10 @@
   key2->SetValue(1, ValueFactory::GetStringValue("c"), pool);

   locations = index->ScanKey(key0.get());
-  EXPECT_EQ(locations.size(), 0);
+  EXPECT_EQ(locations.size(), 1);

   locations = index->ScanKey(key1.get());
-  EXPECT_EQ(locations.size(), 2);
+  EXPECT_EQ(locations.size(), 5);

   locations = index->ScanKey(key2.get());
   EXPECT_EQ(locations.size(), 1);
@@ -502,26 +260,60 @@
   delete tuple_schema;
 }

-TEST(IndexTests, MultiThreadedInsertTest) {
+TEST_F(IndexTests, DeleteTest) {
   auto pool = TestingHarness::GetInstance().GetTestingPool();
   std::vector<ItemPointer> locations;

   // INDEX
   std::unique_ptr<index::Index> index(BuildIndex());

+  // Single threaded test
+  size_t scale_factor = 1;
+  LaunchParallelTest(1, InsertTest, index.get(), pool, scale_factor);
+  LaunchParallelTest(1, DeleteTest, index.get(), pool, scale_factor);
+
+  // Checks
+  std::unique_ptr<storage::Tuple> key0(new storage::Tuple(key_schema, true));
+  std::unique_ptr<storage::Tuple> key1(new storage::Tuple(key_schema, true));
+  std::unique_ptr<storage::Tuple> key2(new storage::Tuple(key_schema, true));
+
+  key0->SetValue(0, ValueFactory::GetIntegerValue(100), pool);
+  key0->SetValue(1, ValueFactory::GetStringValue("a"), pool);
+  key1->SetValue(0, ValueFactory::GetIntegerValue(100), pool);
+  key1->SetValue(1, ValueFactory::GetStringValue("b"), pool);
+  key2->SetValue(0, ValueFactory::GetIntegerValue(100), pool);
+  key2->SetValue(1, ValueFactory::GetStringValue("c"), pool);
+
+  locations = index->ScanKey(key0.get());
+  EXPECT_EQ(locations.size(), 0);
+
+  locations = index->ScanKey(key1.get());
+  EXPECT_EQ(locations.size(), 2);
+
+  locations = index->ScanKey(key2.get());
+  EXPECT_EQ(locations.size(), 1);
+  EXPECT_EQ(locations[0].block, item1.block);
+
+  delete tuple_schema;
+}
+
+TEST_F(IndexTests, MultiThreadedInsertTest) {
+  auto pool = TestingHarness::GetInstance().GetTestingPool();
+  std::vector<ItemPointer> locations;
+
+  // INDEX
+  std::unique_ptr<index::Index> index(BuildIndex());
+
   // Parallel Test
-  size_t num_threads = 60;
-  size_t scale_factor = 100;
+  size_t num_threads = 4;
+  size_t scale_factor = 1;
   LaunchParallelTest(num_threads, InsertTest, index.get(), pool, scale_factor);

   locations = index->ScanAllKeys();
-  // We enable duplicated-key support, so each insert should exactly
-  // increase key count by 1
-  EXPECT_EQ(locations.size(), 9 * num_threads * scale_factor);
+  EXPECT_EQ(locations.size(), 9 * num_threads);

   std::unique_ptr<storage::Tuple> key0(new storage::Tuple(key_schema, true));
-  std::unique_ptr<storage::Tuple> keynonce(
-      new storage::Tuple(key_schema, true));
+  std::unique_ptr<storage::Tuple> keynonce(new storage::Tuple(key_schema, true));

   keynonce->SetValue(0, ValueFactory::GetIntegerValue(1000), pool);
   keynonce->SetValue(1, ValueFactory::GetStringValue("f"), pool);
@@ -539,74 +331,5 @@
   delete tuple_schema;
 }

-void InsertClear(uint64_t thread_id, index::Index *index, VarlenPool *pool,
-                 std::vector<std::vector<int>> all_keys) {
-  // Loop based on scale factor
-  std::vector<int>& keys = all_keys[thread_id];
-  printf("entering thread %lu\n", thread_id);
-  for (size_t i = 0; i < keys.size(); ++i) {
-    std::unique_ptr<storage::Tuple> key0(new storage::Tuple(key_schema, true));
-    key0->SetValue(0, ValueFactory::GetIntegerValue(keys[i]), pool);
-    key0->SetValue(1, ValueFactory::GetStringValue("a"), pool);
-
-    index->InsertEntry(key0.get(), item0);
-  }
-
-  for (size_t i = 0; i < keys.size(); ++i) {
-    std::unique_ptr<storage::Tuple> key0(new storage::Tuple(key_schema, true));
-    key0->SetValue(0, ValueFactory::GetIntegerValue(keys[keys.size() - i - 1]),
-                   pool);
-    key0->SetValue(1, ValueFactory::GetStringValue("a"), pool);
-
-    index->DeleteEntry(key0.get(), item0);
-  }
-
-  return;
-}
-
-TEST(IndexTestsClear, MultiThreadedClear) {
-  auto pool = TestingHarness::GetInstance().GetTestingPool();
-  std::vector<ItemPointer> locations;
-
-  // INDEX
-  std::unique_ptr<index::Index> index(BuildIndex());
-
-  // Parallel Test
-  int num_threads = 10;
-  int scale_factor = 50;
-
-  std::random_device rd;
-  std::mt19937 gen(rd());
-  std::uniform_int_distribution<> dis(0, num_threads * scale_factor * 10);
-
-  std::vector<std::vector<int>> all_keys;
-  for (int i = 0; i < num_threads; ++i) {
-    std::vector<int> keys;
-    for (int j = 0; j < scale_factor * 10; ++j) {
-      keys.push_back(dis(gen));
-    }
-    all_keys.push_back(keys);
-  }
-
-  LaunchParallelTestID(num_threads, InsertClear, index.get(), pool,
-                       all_keys);
-
-  locations = index->ScanAllKeys();
-  // We enable duplicated-key support, so each insert should exactly
-  // increase key count by 1
-  EXPECT_EQ(locations.size(), 0);
-
-  LaunchParallelTestID(num_threads, InsertClear, index.get(), pool,
-                       all_keys);
-
-  locations = index->ScanAllKeys();
-  // We enable duplicated-key support, so each insert should exactly
-  // increase key count by 1
-  EXPECT_EQ(locations.size(), 0);
-
-
-  delete tuple_schema;
-}
-
 }  // End test namespace
-}  // End peloton namespace
+}  // End peloton namespace


KOTodoView: Popups fixed, everything is at the right column now.

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

--- korganizer/kotodoview.cpp
+++ korganizer/kotodoview.cpp
@@ -382,6 +382,7 @@
   mTodoListView->setColumnWidthMode( 3, QListView::Manual );
   mTodoListView->setColumnWidthMode( 4, QListView::Manual );
   mTodoListView->setColumnWidthMode( 5, QListView::Manual );
+  mTodoListView->setColumnWidthMode( 6, QListView::Manual );
 #if 0
   mTodoListView->setColumnWidthMode( 6, QListView::Manual );
 #endif
@@ -665,16 +666,16 @@
         dtDue().date() );
     }
     switch ( column ) {
-      case 1:
+      case 2:
         mPriorityPopupMenu->popup( QCursor::pos () );
         break;
-      case 2:
+      case 3:
         mPercentageCompletedPopupMenu->popup( QCursor::pos () );
         break;
-      case 3:
+      case 4:
           mDatePickerPopupMenu->popup( QCursor::pos () );
         break;
-      case 5:
+      case 6:
         getCategoryPopupMenu(
             static_cast<KOTodoViewItem *>( item ) )->popup( QCursor::pos () );
         break;


Fix signal/slot (now we can change status)

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

--- korganizer/kotodoview.cpp
+++ korganizer/kotodoview.cpp
@@ -495,7 +495,7 @@
     QString label = QString ("%1 %").arg (i);
     mPercentage[ mPercentageCompletedPopupMenu->addAction(label) ] = i;
   }
-  connect( mPercentageCompletedPopupMenu, SIGNAL( activated( QAction* ) ),
+  connect( mPercentageCompletedPopupMenu, SIGNAL(triggered( QAction* ) ),
            SLOT( setNewPercentage( QAction* ) ) );

   mMovePopupMenu = new KDatePickerPopup(
@@ -1324,8 +1324,8 @@
       action->setChecked( true );
   }

-  connect ( tempMenu, SIGNAL( activated( QAction* ) ),
-            SLOT( changedCategories( QAction* ) ) );
+  connect ( tempMenu, SIGNAL(triggered(QAction*) ),
+            SLOT( changedCategories(QAction*) ) );
   return tempMenu;
 }


Filled bc_flag related to EqnMHDCONT in mhdopt

--- applications/OptControlApps/mhdopt/OptQuantities.cpp
+++ applications/OptControlApps/mhdopt/OptQuantities.cpp
@@ -1329,11 +1329,77 @@
   _qtymap._mesh._domain->TransformPointToRef(xp,&x_rotshift[0]);

-
-
-
-
-
+#if (DIMENSION==2)
+  if ( (x_rotshift[0]) > -bdry_toll && ( x_rotshift[0]) < bdry_toll ) { //left
+     bc_flag[0]=0;
+     bc_flag[1]=0;
+  }
+
+  if ( (le[0]-lb[0])  -(x_rotshift[0]) > -bdry_toll && (le[0]-lb[0])  -(x_rotshift[0]) < bdry_toll){  //right
+    bc_flag[0]=0;
+    bc_flag[1]=0;
+  }
+
+   if (( x_rotshift[1]) > -bdry_toll && ( x_rotshift[1]) < bdry_toll)  { //bottom  of the RefBox
+     bc_flag[0]=0;
+     bc_flag[1]=0;  //here when you control you must fix it,even if the corresponding b is let free, otherwise the control may use this as well
+                      //well,wait,it depends: if you are using the Laplacian for MHD state, then Becont bc's must be consistent with the Laplacian
+		      // given there.
+		      //if you are using curlxcurl, then Becont should be consistent with curl-curl
+		      //on the other hand, Be has a gamma*Laplacian FOR HERSELF... !
+		      //so the Becont BC's should be consistent BOTH WITH MHD EQUATION and with MHDCONT EQUATION!
+
+
+// wait, if you fix all dirichlet, then things go into Becontp pressure
+//instead if you fix one Dir and one Neu then nothing goes into pressure
+
+  }
+
+  if ((le[1]-lb[1]) -(x_rotshift[1]) > -bdry_toll &&  (le[1]-lb[1]) -(x_rotshift[1]) < bdry_toll)  {//top of the  of the RefBox
+
+     bc_flag[0] = _qtymap._physmap->get("UseControl");
+     bc_flag[1] = _qtymap._physmap->get("UseControl");
+ }
+
+#else
+
+  if ( x_rotshift[0] > -bdry_toll &&  x_rotshift[0] < bdry_toll ) {  //left of the RefBox
+    bc_flag[0]=0;
+    bc_flag[1]=0;
+    bc_flag[2]=0;
+  }
+
+ if ( (le[0]-lb[0])  - x_rotshift[0] > -bdry_toll && (le[0]-lb[0]) - x_rotshift[0] < bdry_toll){  //right of the RefBox
+    bc_flag[0]=0;
+    bc_flag[1]=0;
+    bc_flag[2]=0;
+  }
+
+   if ( x_rotshift[1] > -bdry_toll &&  x_rotshift[1] < bdry_toll)  {  //bottom  of the RefBox
+    bc_flag[0]=0;
+    bc_flag[1]=0;
+    bc_flag[2]=0;
+  }
+
+  if ((le[1]-lb[1]) -(x_rotshift[1]) > -bdry_toll &&  (le[1]-lb[1]) -(x_rotshift[1]) < bdry_toll)  {  //top of the RefBox
+    bc_flag[0] = _qtymap._physmap->get("UseControl");
+    bc_flag[1] = _qtymap._physmap->get("UseControl");
+
+    bc_flag[2]=0;
+  }
+   if ( (x_rotshift[2]) > -bdry_toll && ( x_rotshift[2]) < bdry_toll ) {
+    bc_flag[0]=0;
+    bc_flag[1]=0;
+    bc_flag[2]=0;
+  }
+  if ((le[2]-lb[2]) -(x_rotshift[2]) > -bdry_toll &&  (le[2]-lb[2]) -(x_rotshift[2]) < bdry_toll)  {
+    bc_flag[0]=0;
+    bc_flag[1]=0;
+    bc_flag[2]=0;
+  }
+
+#endif //DIMENSION
+

   return;
@@ -1362,12 +1428,52 @@
   std::vector<double> x_rotshift(_qtymap._mesh.get_dim());
   _qtymap._mesh._domain->TransformPointToRef(xp,&x_rotshift[0]);

-
-
-
-
-
-
+
+
+#if (DIMENSION==2)
+  if ( (x_rotshift[0]) > -bdry_toll && ( x_rotshift[0]) < bdry_toll ) { //left
+//   bc_flag[0]=0;
+  }
+
+  if ( (le[0]-lb[0])  -(x_rotshift[0]) > -bdry_toll && (le[0]-lb[0])  -(x_rotshift[0]) < bdry_toll){  //right
+//  bc_flag[0]=0;
+  }
+
+   if (( x_rotshift[1]) > -bdry_toll && ( x_rotshift[1]) < bdry_toll)  { //bottom  of the RefBox
+//   bc_flag[0]=0;     //comment it, don't do the integral
+  }
+
+  if ((le[1]-lb[1]) -(x_rotshift[1]) > -bdry_toll &&  (le[1]-lb[1]) -(x_rotshift[1]) < bdry_toll)  {//top of the  of the RefBox
+//   bc_flag[0]=0;       //comment it, don't do the integral
+
+ }
+
+#else
+
+  if ( x_rotshift[0] > -bdry_toll &&  x_rotshift[0] < bdry_toll ) {  //left of the RefBox
+//     bc_flag[0]=0;
+  }
+
+ if ( (le[0]-lb[0])  - x_rotshift[0] > -bdry_toll && (le[0]-lb[0]) - x_rotshift[0] < bdry_toll){  //right of the RefBox
+//     bc_flag[0]=0;
+  }
+
+   if ( x_rotshift[1] > -bdry_toll &&  x_rotshift[1] < bdry_toll)  {  //bottom  of the RefBox
+//     bc_flag[0]=0;
+  }
+
+  if ((le[1]-lb[1]) -(x_rotshift[1]) > -bdry_toll &&  (le[1]-lb[1]) -(x_rotshift[1]) < bdry_toll)  {  //top of the RefBox
+//     bc_flag[0]=0;
+
+  }
+   if ( (x_rotshift[2]) > -bdry_toll && ( x_rotshift[2]) < bdry_toll ) {
+//     bc_flag[0]=0;
+  }
+  if ((le[2]-lb[2]) -(x_rotshift[2]) > -bdry_toll &&  (le[2]-lb[2]) -(x_rotshift[2]) < bdry_toll)  {
+//     bc_flag[0]=0;
+  }
+
+#endif //DIMENSION

   return;


changed adjustments icon

changed adjustments icon

--- applications/mne_x/plugins/covariance/covariance.cpp
+++ applications/mne_x/plugins/covariance/covariance.cpp
@@ -75,7 +75,7 @@
 , m_pCovarianceBuffer(CircularMatrixBuffer<double>::SPtr())
 , m_iEstimationSamples(5000)
 {
-    m_pActionShowAdjustment = new QAction(QIcon(":/images/covariance.png"), tr("Covariance Adjustments"),this);
+    m_pActionShowAdjustment = new QAction(QIcon(":/images/covadjustments.png"), tr("Covariance Adjustments"),this);
 //    m_pActionSetupProject->setShortcut(tr("F12"));
     m_pActionShowAdjustment->setStatusTip(tr("Covariance Adjustments"));
     connect(m_pActionShowAdjustment, &QAction::triggered, this, &Covariance::showCovarianceWidget);


replace files option to prevent reloading LM each time

--- training/augment_grammar.cc
+++ training/augment_grammar.cc
@@ -35,24 +35,29 @@
   opts.add_options()
         ("source_lm,l",po::value<string>(),"Source language LM (KLM)")
         ("collapse_weights,w",po::value<string>(), "Collapse weights into a single feature X using the coefficients from this weights file")
-        ("add_shape_types,s", "Add rule shape types");
+        ("add_shape_types,s", "Add rule shape types")
+        ("replace_files,r", "Replace files with transformed variants (requires loading full grammar into memory)")
+        ("grammar,g", po::value<vector<string> >(), "Input (also output) grammar file(s)");
   po::options_description clo("Command line options");
   clo.add_options()
         ("config", po::value<string>(), "Configuration file")
         ("help,h", "Print this help message and exit");
   po::options_description dconfig_options, dcmdline_options;
+  po::positional_options_description p;
+  p.add("grammar", -1);
+
   dconfig_options.add(opts);
   dcmdline_options.add(opts).add(clo);
-
-  po::store(parse_command_line(argc, argv, dcmdline_options), *conf);
+
+  po::store(po::command_line_parser(argc, argv).options(dcmdline_options).positional(p).run(), *conf);
   if (conf->count("config")) {
     ifstream config((*conf)["config"].as<string>().c_str());
     po::store(po::parse_config_file(config, dconfig_options), *conf);
   }
   po::notify(*conf);

-  if (conf->count("help")) {
-    cerr << "Usage " << argv[0] << " [OPTIONS]\n";
+  if (conf->count("help") || conf->count("grammar")==0) {
+    cerr << "Usage " << argv[0] << " [OPTIONS] file.scfg [file2.scfg...]\n";
     cerr << dcmdline_options << endl;
     return false;
   }
@@ -82,20 +87,26 @@

 int kSrcLM;
 vector<double> col_weights;
+bool gather_rules;
+vector<TRulePtr> rules;

 static void RuleHelper(const TRulePtr& new_rule, const unsigned int ctf_level, const TRulePtr& coarse_rule, void* extra) {
   static const int kSrcLM = FD::Convert("SrcLM");
   static const int kPC = FD::Convert("PC");
   static const int kX = FD::Convert("X");
-  TRule r(*new_rule);
-  if (ngram) r.scores_.set_value(kSrcLM, Score(r.f_, *ngram));
-  r.scores_.set_value(kPC, 1.0);
+  TRulePtr r; r.reset(new TRule(*new_rule));
+  if (ngram) r->scores_.set_value(kSrcLM, Score(r->f_, *ngram));
+  r->scores_.set_value(kPC, 1.0);
   if (col_weights.size()) {
-    double score = r.scores_.dot(col_weights);
-    r.scores_.clear();
-    r.scores_.set_value(kX, score);
+    double score = r->scores_.dot(col_weights);
+    r->scores_.clear();
+    r->scores_.set_value(kX, score);
   }
-  cout << r << endl;
+  if (gather_rules) {
+    rules.push_back(r);
+  } else {
+    cout << *r << endl;
+  }
 }

@@ -116,7 +127,22 @@
     w.InitFromFile(conf["collapse_weights"].as<string>());
     w.InitVector(&col_weights);
   }
-  RuleLexer::ReadRules(&cin, &RuleHelper, NULL);
+  gather_rules = false;
+  bool replace_files = conf.count("replace_files");
+  if (replace_files) gather_rules = true;
+  vector<string> files = conf["grammar"].as<vector<string> >();
+  for (int i=0; i < files.size(); ++i) {
+    cerr << "Processing " << files[i] << " ..." << endl;
+    if (true) {
+      ReadFile rf(files[i]);
+      rules.clear();
+      RuleLexer::ReadRules(rf.stream(), &RuleHelper, NULL);
+    }
+    if (replace_files) {
+      WriteFile wf(files[i]);
+      for (int i = 0; i < rules.size(); ++i) { (*wf.stream()) << *rules[i] << endl; }
+    }
+  }
   return 0;
 }


INTEGRATION: CWS help2 (1.23.12); FILE MERGED 2004/07/13 16:49:11 ihi 1.23.12.4: #104752# Forced Language switch 2004/07/07 17:21:51 ihi 1.23.12.3: RESYNC: (1.23-1.24); FILE MERGED 2004/06/01 11:28:58 ihi 1.23.12.2: #i27675# '\n' removed from GetTimeStamp method 2004/05/18 16:32:32 ihi 1.23.12.1: Assertion log fix / mergebuild join


INTEGRATION: CWS l10ntooling11 (1.9.20); FILE MERGED 2008/02/11 16:52:29 ihi 1.9.20.1: #i85733# skip all sub dirs if the file no_localization is found

--- transex3/source/srciter.cxx
+++ transex3/source/srciter.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: srciter.cxx,v $
  *
- *  $Revision: 1.9 $
+ *  $Revision: 1.10 $
  *
- *  last change: $Author: obo $ $Date: 2007-10-30 12:29:49 $
+ *  last change: $Author: rt $ $Date: 2008-02-18 15:10:58 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -38,6 +38,7 @@

 #include "srciter.hxx"
 #include <stdio.h>
+#include <tools/fsys.hxx>

 //
 // class SourceTreeIterator
@@ -94,6 +95,24 @@
             sDirName.indexOf( WCARD10 , 0 ) > -1
            )    return;
         //printf("**** %s \n", OUStringToOString( sDirName , RTL_TEXTENCODING_UTF8 , sDirName.getLength() ).getStr() );
+
+        rtl::OUString sDirNameTmp = aDirectory.getFullName();
+        ByteString sDirNameTmpB( OUStringToOString( sDirNameTmp , RTL_TEXTENCODING_UTF8 , sDirName.getLength() ).getStr() );
+
+#ifdef WNT
+        sDirNameTmpB.Append( ByteString("\\no_localization") );
+#else
+        sDirNameTmpB.Append( ByteString("/no_localization") );
+#endif
+        //printf("**** %s \n", OUStringToOString( sDirNameTmp , RTL_TEXTENCODING_UTF8 , sDirName.getLength() ).getStr() );
+
+        DirEntry aDE( sDirNameTmpB.GetBuffer() );
+        if( aDE.Exists() )
+        {
+            //printf("#### no_localization file found ... skipping");
+            return;
+        }
+
         aDirectory.setSkipLinks( bSkipLinks );
         aDirectory.readDirectory();
         OnExecuteDirectory( aDirectory.getFullName() );


use mega::m_gmtime for thread safety

use mega::m_gmtime for thread safety

--- tests/integration/main.cpp
+++ tests/integration/main.cpp
@@ -26,7 +26,9 @@
         {
             auto t = std::time(NULL);
             char ts[50];
-            if (!std::strftime(ts, sizeof(ts), "%H:%M:%S", std::gmtime(&t)))
+            struct tm dt;
+            mega::m_gmtime(t, &dt);
+            if (!std::strftime(ts, sizeof(ts), "%H:%M:%S", &dt))
             {
                 ts[0] = '\0';
             }


null pointer crash

null pointer crash

svn path=/trunk/KDE/kdepim/ktimetracker/; revision=654279

--- ktimetracker/taskview.cpp
+++ ktimetracker/taskview.cpp
@@ -320,12 +320,15 @@
 is stored in the _preferences object. */
 {
   kDebug(5970) << "Entering TaskView::restoreItemState" << endl;
-  QTreeWidgetItemIterator item(first_child());
-  while( *item )
-  {
-    Task *t = (Task *) *item;
-    t->setExpanded( _preferences->readBoolEntry( t->uid() ) );
-    ++item;
+
+  if (first_child()) {
+    QTreeWidgetItemIterator item(first_child());
+    while( *item )
+    {
+      Task *t = (Task *) *item;
+      t->setExpanded( _preferences->readBoolEntry( t->uid() ) );
+      ++item;
+    }
   }
   kDebug(5970) << "Entering TaskView::restoreItemState" << endl;
 }


simplified OnFile

simplified OnFile

git-svn-id: e171abefef93db0a74257c7d87d5b6400fe00c1f@1239 f22100f3-aa73-48fe-a4fb-fd497bb32605

--- trunk/extension/src/dir.cpp
+++ trunk/extension/src/dir.cpp
@@ -53,9 +53,7 @@
       return wxDIR_STOP;
     }

-    wxFileName file(filename);
-
-    if (wxExMatchesOneOf(file, m_Dir.GetFileSpec()))
+    if (wxExMatchesOneOf(filename, m_Dir.GetFileSpec()))
     {
       m_Dir.OnFile(filename);
     }


added change marker to UpperCase and LowerCase

git-svn-id: e171abefef93db0a74257c7d87d5b6400fe00c1f@4877 f22100f3-aa73-48fe-a4fb-fd497bb32605

--- trunk/extension/src/stc.cpp
+++ trunk/extension/src/stc.cpp
@@ -1733,8 +1733,16 @@
     HexDecCalltip(GetCurrentPos());
   break;

-  case ID_EDIT_LOWERCASE: LowerCase(); break;
-  case ID_EDIT_UPPERCASE: UpperCase(); break;
+  case ID_EDIT_LOWERCASE:
+    LowerCase();
+    TargetFromSelection();
+    MarkTargetChange();
+    break;
+  case ID_EDIT_UPPERCASE:
+    UpperCase();
+    TargetFromSelection();
+    MarkTargetChange();
+    break;

   case ID_EDIT_MARKER_NEXT:
     {


add assert on the parent

add assert on the parent

git-svn-id: e171abefef93db0a74257c7d87d5b6400fe00c1f@2067 f22100f3-aa73-48fe-a4fb-fd497bb32605

--- trunk/extension/src/svn.cpp
+++ trunk/extension/src/svn.cpp
@@ -188,6 +188,9 @@

 wxStandardID wxExSVN::ExecuteAndShowOutput(wxWindow* parent)
 {
+  // We must have a parent.
+  wxASSERT(parent != NULL);
+
   // If an error occurred, already shown by wxExecute itself.
   if (Execute(parent) == wxID_OK)
   {


Adding chrome start-up parameters to information passed back in breakpad crash
- we collect the first two params : switch-1 and switch-2
- up to 64 chars, then it truncates

BUG=b/1910452

TEST=starting chrome should work as usual, otherwise see the bug

Review URL: http://codereview.chromium.org/149034

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@19376 0039d316-1c4b-4281-b951-d872f2087c98

--- chrome/app/breakpad_win.cc
+++ chrome/app/breakpad_win.cc
@@ -5,6 +5,7 @@
 #include "chrome/app/breakpad_win.h"

 #include <windows.h>
+#include <shellapi.h>
 #include <tchar.h>
 #include <vector>

@@ -33,12 +34,21 @@

 google_breakpad::ExceptionHandler* g_breakpad = NULL;

-std::vector<wchar_t*>* url_chunks = NULL;
+std::vector<wchar_t*>* g_url_chunks = NULL;

 // Dumps the current process memory.
 extern "C" void __declspec(dllexport) __cdecl DumpProcess() {
   if (g_breakpad)
     g_breakpad->WriteMinidump();
+}
+
+// Reduces the size of the string |str| to a max of 64 chars. Required because
+// breakpad's CustomInfoEntry raises an invalid_parameter error if the string
+// we want to set is longer.
+std::wstring TrimToBreakpadMax(const std::wstring& str) {
+  std::wstring shorter(str);
+  return shorter.substr(0,
+      google_breakpad::CustomInfoEntry::kValueMaxLength - 1);
 }

 // Returns the custom info structure based on the dll in parameter and the
@@ -62,6 +72,7 @@
      version = L"0.0.0.0-devel";
   }

+  // Common entries.
   google_breakpad::CustomInfoEntry ver_entry(L"ver", version.c_str());
   google_breakpad::CustomInfoEntry prod_entry(L"prod", product.c_str());
   google_breakpad::CustomInfoEntry plat_entry(L"plat", L"Win32");
@@ -81,28 +92,39 @@
     google_breakpad::CustomInfoEntry url8(L"url-chunk-8", L"");

     static google_breakpad::CustomInfoEntry entries[] =
-        { ver_entry, prod_entry, plat_entry, type_entry, url1, url2, url3,
-          url4, url5, url6, url7, url8 };
+        { ver_entry, prod_entry, plat_entry, type_entry,
+          url1, url2, url3, url4, url5, url6, url7, url8 };

     std::vector<wchar_t*>* tmp_url_chunks = new std::vector<wchar_t*>(8);
     for (size_t i = 0; i < 8; ++i)
       (*tmp_url_chunks)[i] = entries[4 + i].value;
-    url_chunks = tmp_url_chunks;
-
-    static google_breakpad::CustomClientInfo custom_info = {entries,
-                                                            arraysize(entries)};
-
-    return &custom_info;
-  }
-  static google_breakpad::CustomInfoEntry entries[] = {ver_entry,
-                                                       prod_entry,
-                                                       plat_entry,
-                                                       type_entry};
-
-  static google_breakpad::CustomClientInfo custom_info = {entries,
-                                                          arraysize(entries)};
-
-  return &custom_info;
+    g_url_chunks = tmp_url_chunks;
+
+    static google_breakpad::CustomClientInfo custom_info_renderer
+        = {entries, arraysize(entries)};
+    return &custom_info_renderer;
+  }
+
+  // Browser-specific entries.
+  google_breakpad::CustomInfoEntry switch1(L"switch-1", L"");
+  google_breakpad::CustomInfoEntry switch2(L"switch-2", L"");
+
+  // Get the first two command line switches if they exist. The CommandLine
+  // class does not allow to enumerate the switches so we do it by hand.
+  int num_args = 0;
+  wchar_t** args = ::CommandLineToArgvW(::GetCommandLineW(), &num_args);
+  if (args) {
+    if (num_args > 1)
+      switch1.set_value(TrimToBreakpadMax(args[1]).c_str());
+    if (num_args > 2)
+      switch2.set_value(TrimToBreakpadMax(args[2]).c_str());
+  }
+
+  static google_breakpad::CustomInfoEntry entries[] =
+      {ver_entry, prod_entry, plat_entry, type_entry, switch1, switch2};
+  static google_breakpad::CustomClientInfo custom_info_browser =
+      {entries, arraysize(entries)};
+  return &custom_info_browser;
 }

 // Contains the information needed by the worker thread.
@@ -162,11 +184,11 @@
 extern "C" void __declspec(dllexport) __cdecl SetActiveRendererURL(
     const wchar_t* url_cstring) {
   DCHECK(url_cstring);
-  if (!url_chunks)
+  if (!g_url_chunks)
     return;

   std::wstring url(url_cstring);
-  size_t num_chunks = url_chunks->size();
+  size_t num_chunks = g_url_chunks->size();
   size_t chunk_index = 0;
   size_t url_size = url.size();

@@ -176,16 +198,16 @@
     size_t current_chunk_size = std::min(url_size - url_offset,
         static_cast<size_t>(
             google_breakpad::CustomInfoEntry::kValueMaxLength - 1));
-    url._Copy_s((*url_chunks)[chunk_index],
+    url._Copy_s((*g_url_chunks)[chunk_index],
                 google_breakpad::CustomInfoEntry::kValueMaxLength,
                 current_chunk_size, url_offset);
-    (*url_chunks)[chunk_index][current_chunk_size] = L'\0';
+    (*g_url_chunks)[chunk_index][current_chunk_size] = L'\0';
     url_offset += current_chunk_size;
   }

   // And null terminate any unneeded chunks.
   for (; chunk_index < num_chunks; ++chunk_index)
-    (*url_chunks)[chunk_index][0] = L'\0';
+    (*g_url_chunks)[chunk_index][0] = L'\0';
 }

 }  // namespace


if help flag is specified do not add file argument

git-svn-id: e171abefef93db0a74257c7d87d5b6400fe00c1f@3889 f22100f3-aa73-48fe-a4fb-fd497bb32605

--- trunk/extension/src/vcs.cpp
+++ trunk/extension/src/vcs.cpp
@@ -170,6 +170,12 @@
     if (!flags.empty())
     {
       flags = " " + flags;
+
+      // If we specified help flags, we do not need a file argument.
+      if (flags.Contains("help"))
+      {
+        file.clear();
+      }
     }
   }

@@ -201,6 +207,8 @@
   wxArrayString errors;
   long retValue;

+  // Call wxExcute to execute the cvs command and
+  // collect the output and the errors.
   if ((retValue = wxExecute(
     commandline,
     output,


Expand force compositing mode trial to the dev channel

BUG=none
TEST=none

Review URL: https://chromiumcodereview.appspot.com/10786034

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@147110 0039d316-1c4b-4281-b951-d872f2087c98

--- chrome/browser/gpu_util.cc
+++ chrome/browser/gpu_util.cc
@@ -179,8 +179,9 @@
   return;
 #endif
   chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
-  // Only run the trial on the Canary channel.
-  if (channel != chrome::VersionInfo::CHANNEL_CANARY)
+  // Only run the trial on the Canary and Dev channels.
+  if (channel != chrome::VersionInfo::CHANNEL_CANARY &&
+      channel != chrome::VersionInfo::CHANNEL_DEV)
     return;
 #if defined(OS_WIN)
   // Don't run the trial on Windows XP.


VCS_NO_COMMAND no longer necessary

VCS_NO_COMMAND no longer necessary

git-svn-id: e171abefef93db0a74257c7d87d5b6400fe00c1f@4127 f22100f3-aa73-48fe-a4fb-fd497bb32605

--- trunk/extension/src/vcs.cpp
+++ trunk/extension/src/vcs.cpp
@@ -24,14 +24,6 @@
 #include <wx/extension/stcdlg.h>
 #include <wx/extension/util.h>

-// The VCS commands are read in from vcss.xml.
-// See also defs.h, and do not exceed VCS_MAX_COMMANDS in vcss.xml.
-// This command indicates an error in the command being handled.
-enum
-{
-  VCS_NO_COMMAND = -1,
-};
-
 // The VCS systems are read in from vcss.xml.
 // The ones here can be set in the config dialog, and are not
 // present in the vcss.xml.
@@ -181,7 +173,7 @@

 long wxExVCS::Execute()
 {
-  wxASSERT(m_Command.GetNo() != VCS_NO_COMMAND);
+  wxASSERT(m_Command.GetType() != wxExVCSCommand::VCS_COMMAND_IS_UNKNOWN);

   wxString cwd;
   wxString file;


Core side cancel repeater request on squash.

--- ZPIPE-exec/exec-IO-DPM.cpp
+++ ZPIPE-exec/exec-IO-DPM.cpp
@@ -1967,6 +1967,9 @@
   struct core_knobs_t * knobs = core->knobs;
   zesto_assert((dead_uop->alloc.LDQ_index >= 0) && (dead_uop->alloc.LDQ_index < knobs->exec.LDQ_size),(void)0);
   zesto_assert(LDQ[dead_uop->alloc.LDQ_index].uop == dead_uop,(void)0);
+  if (dead_uop->oracle.is_repeated)
+    repeater_cancel_request(core->memory.mem_repeater, core->id,
+                            dead_uop->oracle.virt_addr, dead_uop);
   //memset(&LDQ[dead_uop->alloc.LDQ_index],0,sizeof(LDQ[0]));
   memzero(&LDQ[dead_uop->alloc.LDQ_index],sizeof(LDQ[0]));
   LDQ_num --;


#539 Fixed

#539 Fixed

git-svn-id: 20a2189a131a7440b063264d90d14bc443096647@10379 1ed66053-1c2d-0410-8867-f7571e6e31d3

--- l7vsd/src/tcp_session.cpp
+++ l7vsd/src/tcp_session.cpp
@@ -1082,7 +1082,7 @@
         //----Debug log----------------------------------------------------------------------
         {
                 boost::mutex::scoped_lock lock(upthread_status_mutex);
-                if (upthread_status != UPTHREAD_ACTIVE) {
+                while (upthread_status < UPTHREAD_ACTIVE) {
                         to_time(LOCKTIMEOUT, xt);
                         upthread_status_cond.timed_wait(upthread_status_mutex, xt);
                 }
@@ -1125,7 +1125,7 @@
                         socket_element push_rs_socket = down_thread_connect_socket_list.get_socket();
                         down_thread_receive_realserver_socket_list.push_back(push_rs_socket);
                         down_thread_current_receive_realserver_socket = down_thread_receive_realserver_socket_list.begin();
-                        boost::mutex::scoped_lock lokc(upthread_status_mutex);
+                        boost::mutex::scoped_lock lock(upthread_status_mutex);
                         if (upthread_status < UPTHREAD_ALIVE)
                                 break;
                 }
@@ -1417,7 +1417,6 @@
                 add_flag = true;
         }

-//XXX
         if (is_epoll_edge_trigger && (!add_flag)) {
                 if (epoll_ctl(up_client_epollfd, EPOLL_CTL_MOD, event.data.fd, &event) < 0) {
                         std::stringstream buf;
@@ -1681,7 +1680,6 @@
                 }
         }

-//XXX
         if (is_epoll_edge_trigger && (!add_flag)) {
                 if (epoll_ctl(up_realserver_epollfd, EPOLL_CTL_MOD, event.data.fd, &event) < 0) {
                         std::stringstream buf;
@@ -1785,19 +1783,6 @@

         std::map<protocol_module_base::EVENT_TAG, UP_THREAD_FUNC_TYPE_TAG>::iterator func_type = up_thread_module_event_map.find(module_event);
         up_thread_function_pair func = up_thread_function_array[func_type->second];
-/*
-        if (module_event == protocol_module_base::SORRYSERVER_SELECT) {
-                // protocol module sorry mode change
-                tcp_thread_message *down_msg = new tcp_thread_message;
-
-                std::map<DOWN_THREAD_FUNC_TYPE_TAG, tcp_session_func>::iterator
-                down_func = up_thread_message_down_thread_function_map.find(DOWN_FUNC_SORRY_ENABLE_EVENT);
-
-                down_msg->message = down_func->second;
-                while (!down_thread_message_que.push(down_msg)) {}
-        }
-*/
-
         up_thread_next_call_function = func;

         if (unlikely(LOG_LV_DEBUG == Logger::getLogLevel(LOG_CAT_L7VSD_SESSION))) {
@@ -3209,6 +3194,16 @@
                 Logger::putLogDebug(LOG_CAT_L7VSD_SESSION, 999, formatter.str(), __FILE__, __LINE__);
         }

+        if (unlikely(!sorryserver_socket.second->get_socket().lowest_layer().is_open())) {
+                if (unlikely(LOG_LV_DEBUG == Logger::getLogLevel(LOG_CAT_L7VSD_SESSION))) {
+                        boost::format formatter("Thread ID[%d] FUNC OUT down_thread_sorryserver_receive");
+                        formatter % boost::this_thread::get_id();
+                        Logger::putLogDebug(LOG_CAT_L7VSD_SESSION, 999, formatter.str(), __FILE__, __LINE__);
+                }
+                down_thread_next_call_function = down_thread_function_array[DOWN_FUNC_SORRYSERVER_RECEIVE];
+                return;
+        }
+
         down_thread_data_dest_side.initialize();
         boost::array<char, MAX_BUFFER_SIZE>& data_buff = down_thread_data_dest_side.get_data();
         boost::system::error_code ec;


Missing member initialization (G__ifile's pos); strcpy (Coverity)

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@32150 27541ba8-7e3a-0410-8455-c3a389f83636

--- cint/cint/src/bc_debug.cxx
+++ cint/cint/src/bc_debug.cxx
@@ -22,7 +22,7 @@
 struct G__input_file G__bc_funccall::getifile() const {
   struct G__input_file ifile;
   ifile.str = 0;
-  // ifile.pos = 0;
+  ifile.pos = 0;
   ifile.vindex = 0;

   if(!m_bytecode) {
@@ -34,7 +34,7 @@
     ifile.filenum = ifunc->pentry[ifn]->filenum;
     ifile.fp = G__srcfile[ifile.filenum].fp;
     ifile.line_number = m_line_number;
-    strcpy(ifile.name,G__srcfile[ifile.filenum].filename);
+    strncpy(ifile.name,G__srcfile[ifile.filenum].filename, sizeof(ifile.name) - 1);
   }

   return(ifile);


Add missing include TMath.h

Add missing include TMath.h

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@19159 27541ba8-7e3a-0410-8455-c3a389f83636

--- tutorials/tree/JetEvent.cxx
+++ tutorials/tree/JetEvent.cxx
@@ -7,6 +7,7 @@
 // see $ROOTSYS/tutorials/jets.C for an example creating a Tree
 // with JetEvents.

+#include "TMath.h"
 #include "TRandom.h"
 #include "JetEvent.h"