Fix crash while editing tools under 64 bits arch.

This commit fixes count computation on tools strings array (ie. tool_types).

--- src/CToolDlg.cpp
+++ src/CToolDlg.cpp
@@ -35,7 +35,7 @@
 	wxString materials[] = {_("High Speed Steel"),_("Carbide") };
 	leftControls.push_back(MakeLabelAndControl(_("Tool Material"), m_cmbMaterial = new wxComboBox(this, ID_MATERIAL, _T(""), wxDefaultPosition, wxDefaultSize, 2, materials)));
 	wxString tool_types[] = {_("Drill Bit"), _("Centre Drill Bit"), _("End Mill"), _("Slot Cutter"), _("Ball End Mill"), _("Chamfer"), _("Engraving Bit")};
-	leftControls.push_back(MakeLabelAndControl(_("Tool Type"), m_cmbToolType = new wxComboBox(this, ID_TOOL_TYPE, _T(""), wxDefaultPosition, wxDefaultSize, sizeof(tool_types)/sizeof(CToolParams::eToolType), tool_types)));
+	leftControls.push_back(MakeLabelAndControl(_("Tool Type"), m_cmbToolType = new wxComboBox(this, ID_TOOL_TYPE, _T(""), wxDefaultPosition, wxDefaultSize, sizeof(tool_types)/sizeof(wxString), tool_types)));
 	leftControls.push_back(MakeLabelAndControl(_("Diameter"), m_dblDiameter = new CLengthCtrl(this)));
 	leftControls.push_back(MakeLabelAndControl(_("Tool Length Offset"), m_dblToolLengthOffset = new CLengthCtrl(this)));
 	leftControls.push_back(MakeLabelAndControl(_("Flat Radius"), m_dblFlatRadius = new CLengthCtrl(this)));


Fix reliability_tests after my chrome/test changes.

BUG=93353

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

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

--- chrome/test/reliability/page_load_test.cc
+++ chrome/test/reliability/page_load_test.cc
@@ -67,6 +67,7 @@
 #include "chrome/test/automation/window_proxy.h"
 #include "chrome/test/reliability/page_load_test.h"
 #include "chrome/test/ui/ui_test.h"
+#include "content/common/notification_service.h"
 #include "net/base/net_util.h"
 #include "ui/base/keycodes/keyboard_codes.h"
 #include "v8/include/v8-testing.h"
@@ -670,6 +671,8 @@
     return test_dir;
   }

+  NotificationService notification_service_;
+
   // The pathname of Chrome's crash dumps directory.
   FilePath crash_dumps_dir_path_;


INTEGRATION: CWS components1 (1.11.14); FILE MERGED 2007/01/25 15:24:19 af 1.11.14.2: RESYNC: (1.11-1.12); FILE MERGED 2007/01/24 17:51:21 af 1.11.14.1: #i68075# The click handler can now be supplied along with a control.

--- sd/source/ui/toolpanel/TitledControl.cxx
+++ sd/source/ui/toolpanel/TitledControl.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: TitledControl.cxx,v $
  *
- *  $Revision: 1.12 $
- *
- *  last change: $Author: kz $ $Date: 2006-12-12 18:44:50 $
+ *  $Revision: 1.13 $
+ *
+ *  last change: $Author: rt $ $Date: 2007-04-03 16:21:29 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -58,6 +58,7 @@
     TreeNode* pParent,
     ::std::auto_ptr<TreeNode> pControl,
     const String& rTitle,
+    const ClickHandler& rClickHandler,
     TitleBar::TitleBarType eType)
     : ::Window (pParent->GetWindow(), WB_TABSTOP),
       TreeNode(pParent),
@@ -65,6 +66,7 @@
       mbVisible(true),
       mpUserData(NULL),
       mpControlFactory(NULL),
+      mpClickHandler(new ClickHandler(rClickHandler)),
       mbExpansionModeIsToggle(eType!=TitleBar::TBT_CONTROL_TITLE)
 {
     if (pControl.get() != NULL)
@@ -94,6 +96,7 @@
     TreeNode* pParent,
     ::std::auto_ptr<ControlFactory> pControlFactory,
     const String& rTitle,
+    const ClickHandler& rClickHandler,
     TitleBar::TitleBarType eType)
     : ::Window (pParent->GetWindow(), WB_TABSTOP),
       TreeNode(pParent),
@@ -101,6 +104,7 @@
       mbVisible (true),
       mpUserData (NULL),
       mpControlFactory(pControlFactory),
+      mpClickHandler(new ClickHandler(rClickHandler)),
       mbExpansionModeIsToggle(eType!=TitleBar::TBT_CONTROL_TITLE)
 {
     mpControlContainer->AddControl (::std::auto_ptr<TreeNode> (
@@ -410,11 +414,7 @@
         switch (pWindowEvent->GetId())
         {
             case VCLEVENT_WINDOW_MOUSEBUTTONUP:
-                // Toggle expansion.
-                GetParentNode()->GetControlContainer().SetExpansionState (
-                    this,
-                    mbExpansionModeIsToggle ? ControlContainer::ES_TOGGLE
-                                            : ControlContainer::ES_EXPAND);
+                (*mpClickHandler)(*this);
                 break;
         }
     }
@@ -478,4 +478,24 @@

+
+//===== TitledControlStandardClickHandler =====================================
+
+TitledControlStandardClickHandler::TitledControlStandardClickHandler (
+    ControlContainer& rControlContainer,
+    ControlContainer::ExpansionState eExpansionState)
+    : mrControlContainer(rControlContainer),
+      meExpansionState(eExpansionState)
+{
+}
+
+
+
+
+void TitledControlStandardClickHandler::operator () (TitledControl& rTitledControl)
+{
+    // Toggle expansion.
+    mrControlContainer.SetExpansionState (&rTitledControl, meExpansionState);
+}
+
 } } // end of namespace ::sd::toolpanel


Rename 'proto' to 'proto_'

Rename 'proto' to 'proto_'

Renamed to 'proto_' to follow style guide.

PiperOrigin-RevId: 263851785
Change-Id: Ieba30635369a48b5d8df720f9540415031d62b90

--- asylo/platform/core/trusted_application.cc
+++ asylo/platform/core/trusted_application.cc
@@ -100,8 +100,8 @@
   // StatusSerializer does not take ownership of any of the input pointers.
   // Input pointers must remain valid for the lifetime of the StatusSerializer.
   StatusSerializer(char **output, size_t *output_len)
-      : output_proto_{&proto},
-        status_proto_{&proto},
+      : output_proto_{&proto_},
+        status_proto_{&proto_},
         output_{output},
         output_len_{output_len},
         custom_allocator_{nullptr} {}
@@ -151,7 +151,7 @@
   }

  private:
-  OutputProto proto;
+  OutputProto proto_;
   const OutputProto *output_proto_;
   StatusProto *status_proto_;
   char **output_;


Bugfix where crashed sprites were not disaplayed on low HP.

--- src/CVehicle.cpp
+++ src/CVehicle.cpp
@@ -85,7 +85,7 @@

 ///////////////////////////////////////////////////////////////////////
 // Name: Release()
-// Desc: osvobodi sprite-ovete
+// Desc: Release allocated objects
 ///////////////////////////////////////////////////////////////////////
 void CVehicle::Release()
 {
@@ -126,7 +126,7 @@

 ///////////////////////////////////////////////////////////////////////
 // Name: Initialize()
-// Desc: create vehicle from module
+// Desc: Create vehicle from data module
 ///////////////////////////////////////////////////////////////////////
 int CVehicle::Initialize( CGame *game, const SWV_HEADER *swv, Uint16 carIndex )
 {
@@ -365,7 +365,7 @@
 	// point the current animations to the array of non-crashed vehicle animations
 	sprite = sprite_norm;
 	mask = mask_norm;
-	hit_points_crash = false;
+	crashed_look = false;

 	// reset vars
 	x = pos_warp[warpPos].x;
@@ -459,11 +459,10 @@
 	motion_frame = display_frame;
 }

-

 ///////////////////////////////////////////////////////////////////////
 // Name: DoMotion()
-// Desc: do vehicle motion
+// Desc: Do vehicle motion and collisions tests
 ///////////////////////////////////////////////////////////////////////
 void CVehicle::DoMotion()
 {
@@ -473,9 +472,7 @@
 	float tmp_maxvel 	= (float) max_vel;
 	float tmp_vel 		= vel;
 	float abs_vel 		= fabsf(vel);
-
-	float rot_m     = 1.0f;
-
+	float rot_m			= 1.0f;

 	/*
 	 * AI steering
@@ -715,7 +712,7 @@
 					anger = anger > 110 ? 110 : anger;

 					float speed_damage = (float)damage + 0.10f * (float)tmp_vel;
-					float armour_absorb = (0.20f * (float)ptr_veh->GetHitPoints());
+					float armour_absorb = (0.12f * (float)ptr_veh->GetHitPoints());
 					DBG( "[DODAMAGE] speed_damage=" << speed_damage << " armour_absorb=" << armour_absorb);
 					int fulldmg = speed_damage - armour_absorb + tmp_anger;
 					fulldmg = fulldmg < 0 ? 0 : fulldmg;
@@ -923,11 +920,11 @@

 					hit_points += _game->Dtoys.GetToyValue( i );

-					if ( hit_points >= hit_points_crash && hit_points_crash )
+					if ( hit_points >= hit_points_crash && crashed_look )
 					{
 						sprite = sprite_norm;
 						mask = mask_norm;
-						hit_points_crash = false;
+						crashed_look = false;
 					}
 					if ( hit_points > max_hitpoints )
 						hit_points = max_hitpoints;
@@ -1127,12 +1124,12 @@
 			has_the_goal = false;
 		}
 	}
-	else if ( hit_points <= hit_points_crash && !hit_points_crash )
+	else if ( hit_points <= hit_points_crash && !crashed_look )
 	{
 		// show smashed vehicle sprites
 		sprite = sprite_crash;
 		mask = mask_crash;
-		hit_points_crash = true;
+		crashed_look = true;

 		// PLAYSOUND
 		_game->Snd.Play( SND_CRASHBRAKE, (int)x );
@@ -1451,7 +1448,7 @@

 ///////////////////////////////////////////////////////////////////////
 // Name: AI_Update()
-// Desc: obnovi informaciqta za waypointa i cqloto AI
+// Desc: Update waypoints and general AI decision taking process
 ///////////////////////////////////////////////////////////////////////
 void CVehicle::AI_Update()
 {
@@ -1531,7 +1528,6 @@
 	Uint32	  distance		= 0L,
 			  tmp_dist		= 0L;
 	bool	  bonus_found	= false;
-	SDL_Rect  rtoy;
 	Uint32	  bonus_list_index[DT_MAX_CHILDS];
 	Uint32	  bonus_list[DT_MAX_DEADTOYS];
 	Uint32	  bonus_list_warrior[DT_MAX_DEADTOYS]	= { 30, 25, 15, 10, 20 };
@@ -1551,7 +1547,7 @@
 		{
 			action = ACTION_TAKEBONUS;

-			// proveri za bonusi i systavi spisyk
+			// check for available bonuses on map and create a list
 			for( i = 0; i < DT_MAX_CHILDS; i++ )
 			{
 				if ( _game->Dtoys.GetToyVisible( i ) )
@@ -1562,8 +1558,9 @@
 				}
 			}

-			// v sluchai che nqma vidimi bonusi
-			if ( !bonus_found ) action = ACTION_ATTACK;
+			// in case no bonuses are available
+			if ( !bonus_found )
+				action = ACTION_ATTACK;
 		}

@@ -1593,6 +1590,8 @@
 		}
 	}

+
+	SDL_Rect  rBonus;

 	switch( action )
 	{
@@ -1651,10 +1650,10 @@
 		// take random bonus from the list
 		bonus_index = bonus_list_index[AI_doFSM( bonus_list, DT_MAX_DEADTOYS )];

-		_game->Dtoys.GetToyRect( bonus_index, &rtoy );
+		_game->Dtoys.GetToyRect( bonus_index, &rBonus );

-		waypoint.x = rtoy.x;
-		waypoint.y = rtoy.y;
+		waypoint.x = rBonus.x;
+		waypoint.y = rBonus.y;
 		waypoint.reached = false;
 		waypoint.static_pos = true;
 		waypoint.index = bonus_index;
@@ -1671,16 +1670,14 @@

 	}

-	// vzemi koordinatite kym tochkata
+	// Adjust waypoint coordinates
 	AI_ProcessWaypoint();
-
-}
-
+}

 ///////////////////////////////////////////////////////////////////////
 // Name: AI_ProcessWaypoint()
-// Desc: vzemi ygyla kym waypoint-a i sloji pravilniq motion_frame
+// Desc: Get angle to waypoint destination and adjust turning
 ///////////////////////////////////////////////////////////////////////
 void CVehicle::AI_ProcessWaypoint()
 {
@@ -1724,7 +1721,6 @@
 		ai_turning = VR_LEFT;
 	}

-
 	/*// calculate radial speed
 	distance = fGetDistance( (float)GetX(), (float)GetY(), waypoint.x, waypoint.y );
 	ai_maxvel = sqrt( acc * distance );  // a = (v*v)/R
@@ -1744,7 +1740,6 @@

 	//display_frame = la/10;
 	//motion_frame = display_frame;*/
-
 }


Fix for uuid functions

Fix for uuid functions

--- c_src/nif_cass_uuid.cc
+++ c_src/nif_cass_uuid.cc
@@ -101,7 +101,7 @@
 {
     unsigned long timestamp;

-    if(!enif_get_uint64(env, argv[1], &timestamp))
+    if(!enif_get_uint64(env, argv[0], &timestamp))
         return enif_make_badarg(env);

     CassUuid obj;
@@ -113,7 +113,7 @@
 {
     unsigned long timestamp;

-    if(!enif_get_uint64(env, argv[1], &timestamp))
+    if(!enif_get_uint64(env, argv[0], &timestamp))
         return enif_make_badarg(env);

     CassUuid obj;
@@ -125,7 +125,7 @@
 {
     std::string str_value;

-    if(!get_string(env, argv[1], str_value))
+    if(!get_string(env, argv[0], str_value))
         return enif_make_badarg(env);

     CassUuid uuid;
@@ -139,7 +139,7 @@
 {
     std::string str_value;

-    if(!get_string(env, argv[1], str_value))
+    if(!get_string(env, argv[0], str_value))
         return enif_make_badarg(env);

     CassUuid uuid;


Remove extra trace from multicast workaround code

Removing an overly verbose message inside the new workaround
that was added.

Change-Id: Ibe9d691c0781ff34e901dec3f27138a44c9e537b
Backport: op910
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48692
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Tested-by: Jenkins OP Build CI <e610bd72261d3c0a48f1e8ae36832ab00774d426@us.ibm.com>
Tested-by: Jenkins OP HW <0eb0fff262f74a65a832afbcc7b153e391c9a3fd@us.ibm.com>
Tested-by: FSP CI Jenkins <aa9e4d9ac7cd25905e9c0dd36d4150516e73dd86@us.ibm.com>
Reviewed-by: Daniel M. Crowell <912029ca9254ac7b5854e56910561d682e1fa2d0@us.ibm.com>

--- src/usr/scom/scom.C
+++ src/usr/scom/scom.C
@@ -1180,7 +1180,6 @@
         uint64_t l_addr = (i_addr & ~CHIPLET_BYTE);
         uint64_t l_unit = l_chiplet->getAttr<TARGETING::ATTR_CHIP_UNIT>();
         l_addr |= (l_unit << 24);
-        TRACFCOMP( g_trac_scom, "doMulticastWorkaround> scom to %.8X", l_addr );
         io_buflen = sizeof(uint64_t);
         l_err = deviceOp(i_opType,
                          i_target,


enforce aspect ratios

enforce aspect ratios

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

--- src/util/events.cpp
+++ src/util/events.cpp
@@ -22,7 +22,17 @@
                 break;
             }
             case SDL_VIDEORESIZE : {
-                dispatch(ResizeScreen, event.resize.w, event.resize.h);
+                int width = event.resize.w;
+                int height = event.resize.h;
+                /* to keep the perspective correct
+                 * 640/480 = 1.33333
+                 */
+                if (width > height){
+                    height = (int)((double) width / 1.3333333333);
+                } else {
+                    width = (int)((double) height * 1.3333333333);
+                }
+                dispatch(ResizeScreen, width, height);
                 break;
             }
             default : {


#i10000# removed extra qualification

#i10000# removed extra qualification

--- reportdesign/source/ui/inc/statusbarcontroller.hxx
+++ reportdesign/source/ui/inc/statusbarcontroller.hxx
@@ -57,7 +57,7 @@
             create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);

     private:
-        void SAL_CALL OStatusbarController::dispose() throw (::com::sun::star::uno::RuntimeException);
+        void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
         // XInterface
         DECLARE_XINTERFACE( )
         // XServiceInfo


Fix redundant transpose removal related failures.

--- tensorflow/core/graph/mkl_layout_pass_test.cc
+++ tensorflow/core/graph/mkl_layout_pass_test.cc
@@ -1028,16 +1028,15 @@
       " input: ['Transpose1'] }");
   EXPECT_EQ(
       DoMklLayoutOptimizationPass(),
-      "Const0(Const);Const1(Const);"
-      "Conv2D(_MklConv2D);DMT/_0(Const);DMT/_1(Const);DMT/_2(Const);"
-      "Input0(Input);Input1(Input);Relu(_MklRelu);"
-      "Transpose0(Transpose);Transpose1(Transpose)|Const0->Transpose0:1;Const1-"
-      ">Transpose1:1;"
-      "Conv2D->Transpose1;DMT/_0->Conv2D:2;DMT/_1->Conv2D:3;DMT/"
-      "_2->Relu:1;Input0->Transpose0;"
+      "Const0(Const);Const1(Const);Conv2D(_MklConv2D);"
+      "DMT/_0(Const);DMT/_1(Const);DMT/_2(Const);Input0(Input);"
+      "Input1(Input);Relu(_MklRelu);Transpose0(_MklTranspose);"
+      "Transpose1(_MklTranspose)|Const0->Transpose0:1;"
+      "Const1->Transpose1:1;Conv2D->Transpose1;DMT/_0->Conv2D:2;"
+      "DMT/_1->Conv2D:3;DMT/_2->Relu:1;Input0->Transpose0;"
       "Input1->Conv2D:1;Transpose0->Conv2D;Transpose0:control->DMT/_0:control;"
-      "Transpose0:control->DMT/"
-      "_1:control;Transpose1->Relu;Transpose1:control->DMT/_2:control");
+      "Transpose0:control->DMT/_1:control;Transpose1->Relu;"
+      "Transpose1:control->DMT/_2:control");
 }

 TEST_F(MklLayoutPassTest, NodeMerge_TransposeConv3DTranspose_Positive) {
@@ -1057,8 +1056,8 @@
                  }                                                            \
                }                                                              \
                tensor_content:                                                \
-       '\\000\\000\\000\\000\\002\\000\\000\\000\\003\\000\\000\\000\\004     \
-        \\000\\000\\000\\001\\000\\000\\000'                                  \
+       '\\000\\000\\000\\000\\002\\000\\000\\000\\003\\000\\000\\000\\004'    \
+       '\\000\\000\\000\\001\\000\\000\\000'                                  \
              }                                                                \
            }                                                                  \
          }                                                                    \
@@ -1076,8 +1075,8 @@
                  }                                                            \
                }                                                              \
                tensor_content:                                                \
-       '\\000\\000\\000\\000\\004\\000\\000\\000\\001\\000\\000\\000\\002     \
-        \\000\\000\\000\\003\\000\\000\\000'                                  \
+       '\\000\\000\\000\\000\\004\\000\\000\\000\\001\\000\\000\\000\\002'    \
+       '\\000\\000\\000\\003\\000\\000\\000'                                  \
              }                                                                \
            }                                                                  \
          }                                                                    \
@@ -1206,8 +1205,8 @@
                  }                                                            \
                }                                                              \
                tensor_content:                                                \
-       '\\000\\000\\000\\000\\002\\000\\000\\000\\003\\000\\000\\000\\004     \
-        \\000\\000\\000\\001\\000\\000\\000'                                  \
+       '\\000\\000\\000\\000\\002\\000\\000\\000\\003\\000\\000\\000\\004'    \
+       '\\000\\000\\000\\001\\000\\000\\000'                                  \
              }                                                                \
            }                                                                  \
          }                                                                    \
@@ -1230,8 +1229,8 @@
                  }                                                            \
                }                                                              \
                tensor_content:                                                \
-       '\\000\\000\\000\\000\\002\\000\\000\\000\\003\\000\\000\\000\\004     \
-        \\000\\000\\000\\001\\000\\000\\000'                                  \
+       '\\000\\000\\000\\000\\002\\000\\000\\000\\003\\000\\000\\000\\004'    \
+       '\\000\\000\\000\\001\\000\\000\\000'                                  \
              }                                                                \
            }                                                                  \
          }                                                                    \
@@ -1331,15 +1330,16 @@
       " input: ['Transpose1'] }");
   EXPECT_EQ(
       DoMklLayoutOptimizationPass(),
-      "Const0(Const);Const1(Const);Conv3D(_MklConv3D);DMT/_0(Const);"
-      "DMT/_1(Const);DMT/_2(Const);Input0(Input);Input1(Input);"
-      "Relu(_MklRelu);Transpose0(Transpose);"
-      "Transpose1(Transpose)|Const0->Transpose0:1;"
-      "Const1->Transpose1:1;Conv3D->Transpose1;"
-      "DMT/_0->Conv3D:2;DMT/_1->Conv3D:3;DMT/_2->Relu:1;"
-      "Input0->Transpose0;Input1->Conv3D:1;Transpose0->Conv3D;"
-      "Transpose0:control->DMT/_0:control;Transpose0:control->DMT/_1:control;"
-      "Transpose1->Relu;Transpose1:control->DMT/_2:control");
+      "Const0(Const);Const1(Const);Conv3D(_MklConv3D);"
+      "DMT/_0(Const);DMT/_1(Const);DMT/_2(Const);"
+      "Input0(Input);Input1(Input);Relu(_MklRelu);"
+      "Transpose0(_MklTranspose);Transpose1(_MklTranspose)"
+      "|Const0->Transpose0:1;Const1->Transpose1:1;"
+      "Conv3D->Transpose1;DMT/_0->Conv3D:2;DMT/_1->Conv3D:3;"
+      "DMT/_2->Relu:1;Input0->Transpose0;Input1->Conv3D:1;"
+      "Transpose0->Conv3D;Transpose0:control->DMT/_0:control;"
+      "Transpose0:control->DMT/_1:control;Transpose1->Relu;"
+      "Transpose1:control->DMT/_2:control");
 }

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


use sane default for router configuration

git-svn-id: c9a369146f666b9deda0c4af3838c8001dc825a8@2520 ce7aba0d-9f81-40a6-a495-cecae84b0515

--- src/booksim_config.cpp
+++ src/booksim_config.cpp
@@ -139,11 +139,11 @@
   _int_map["input_speedup"]     = 1;  // expansion of input ports into crossbar
   _int_map["output_speedup"]    = 1;  // expansion of output ports into crossbar

-  _int_map["routing_delay"]    = 0;
-  _int_map["vc_alloc_delay"]   = 0;
-  _int_map["sw_alloc_delay"]   = 0;
+  _int_map["routing_delay"]    = 1;
+  _int_map["vc_alloc_delay"]   = 1;
+  _int_map["sw_alloc_delay"]   = 1;
   _int_map["st_prepare_delay"] = 0;
-  _int_map["st_final_delay"]   = 0;
+  _int_map["st_final_delay"]   = 1;

   //==== Event-driven =====================================


imgproc(perf): add GaussianBlur cases for SIFT

--- modules/imgproc/perf/opencl/perf_filters.cpp
+++ modules/imgproc/perf/opencl/perf_filters.cpp
@@ -238,15 +238,13 @@

 ///////////// GaussianBlur ////////////////////////

-typedef FilterFixture GaussianBlurFixture;
-
-OCL_PERF_TEST_P(GaussianBlurFixture, GaussianBlur,
-            ::testing::Combine(OCL_TEST_SIZES, OCL_TEST_TYPES, OCL_PERF_ENUM(3, 5, 7)))
-{
-    const FilterParams params = GetParam();
-    const Size srcSize = get<0>(params);
-    const int type = get<1>(params), ksize = get<2>(params);
-    const double eps = CV_MAT_DEPTH(type) <= CV_32S ? 2 + DBL_EPSILON : 3e-4;
+typedef FilterFixture OCL_GaussianBlurFixture;
+
+PERF_TEST_P_(OCL_GaussianBlurFixture, GaussianBlur)
+{
+    const FilterParams& params = GetParam();
+    const Size srcSize = get<0>(params);
+    const int type = get<1>(params), ksize = get<2>(params);

     checkDeviceMaxMemoryAllocSize(srcSize, type);

@@ -255,8 +253,41 @@

     OCL_TEST_CYCLE() cv::GaussianBlur(src, dst, Size(ksize, ksize), 1, 1, cv::BORDER_CONSTANT);

-    SANITY_CHECK(dst, eps);
-}
+    SANITY_CHECK_NOTHING();
+}
+
+INSTANTIATE_TEST_CASE_P(/*nothing*/, OCL_GaussianBlurFixture,
+    ::testing::Combine(
+        OCL_TEST_SIZES,
+        OCL_TEST_TYPES,
+        OCL_PERF_ENUM(3, 5, 7)
+    )
+);
+
+INSTANTIATE_TEST_CASE_P(SIFT, OCL_GaussianBlurFixture,
+    ::testing::Combine(
+        ::testing::Values(sz1080p),
+        ::testing::Values(CV_32FC1),
+        OCL_PERF_ENUM(11, 13, 17, 21, 27)
+    )
+);
+
+INSTANTIATE_TEST_CASE_P(DISABLED_FULL, OCL_GaussianBlurFixture,
+    ::testing::Combine(
+        ::testing::Values(sz1080p),
+        ::testing::Values(
+            CV_8UC1, CV_8UC2, CV_8UC3, CV_8UC4,
+            CV_8SC1, CV_8SC2, CV_8SC3, CV_8SC4,
+            CV_16UC1, CV_16UC2, CV_16UC3, CV_16UC4,
+            CV_16SC1, CV_16SC2, CV_16SC3, CV_16SC4,
+            CV_32SC1, CV_32SC2, CV_32SC3, CV_32SC4,
+            CV_32FC1, CV_32FC2, CV_32FC3, CV_32FC4,
+            CV_64FC1, CV_64FC2, CV_64FC3, CV_64FC4
+        ),
+        OCL_PERF_ENUM(3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29)
+    )
+);
+

 ///////////// Filter2D ////////////////////////


Patch from Serge to exit after telling the other SciTE to open a file.

--- win32/SciTEWin.cxx
+++ win32/SciTEWin.cxx
@@ -900,6 +900,7 @@
 				const_cast<char *>(cmdLine));
 			::SendMessage(hAnother, WM_COPYDATA, 0,
 				reinterpret_cast<LPARAM>(&cds));
+			exit(0);
 		}
 	}


Actual buffer overflow bug found because of these fixes

--- Engine/source/console/fileSystemFunctions.cpp
+++ Engine/source/console/fileSystemFunctions.cpp
@@ -643,8 +643,8 @@
       name = szPathCopy;
    else
       name++;
-   char *ret = Con::getReturnBuffer(dStrlen(name));
-   dStrcpy(ret, name, dStrlen(name));
+   char *ret = Con::getReturnBuffer(dStrlen(name) + 1);
+   dStrcpy(ret, name, dStrlen(name) + 1);
    return ret;
 }


slightly shorter

slightly shorter

--- selfdestructing/crash_on_copy.hpp
+++ selfdestructing/crash_on_copy.hpp
@@ -163,15 +163,15 @@
 	struct on_total : public detail::when<MaxN,on_feedback,detail::total_count<T,detail::should_decrement_on_destruction>>
 	{
 		// instead typedef  copies instance - for gcc/standard complience
-		typedef typename crashes::detail::when<MaxN, std::function<void(int)>, crashes::detail::total_count<T, crashes::detail::should_decrement_on_destruction> >::copies instances;
-		typedef typename crashes::detail::when<MaxN, std::function<void(int)>, crashes::detail::total_count<T, crashes::detail::should_decrement_on_destruction> >::copies instance;
+		typedef typename detail::when<MaxN, std::function<void(int)>, crashes::detail::total_count<T, crashes::detail::should_decrement_on_destruction> >::copies instances;
+		typedef typename detail::when<MaxN, std::function<void(int)>, crashes::detail::total_count<T, crashes::detail::should_decrement_on_destruction> >::copies instance;
 	};

 	/// crashes on MaxN total instances of T
 	template <size_t MaxN,typename T>
 	struct after_total : public detail::when<MaxN,on_feedback,detail::total_count<T,detail::shouldnt_decrement_on_destruction>>
 	{
-		typedef typename crashes::detail::when<MaxN, std::function<void(int)>, crashes::detail::total_count<T, crashes::detail::shouldnt_decrement_on_destruction> >::copies instances;
-		typedef typename crashes::detail::when<MaxN, std::function<void(int)>, crashes::detail::total_count<T, crashes::detail::shouldnt_decrement_on_destruction> >::copies instance;
+		typedef typename detail::when<MaxN, std::function<void(int)>, crashes::detail::total_count<T, crashes::detail::shouldnt_decrement_on_destruction> >::copies instances;
+		typedef typename detail::when<MaxN, std::function<void(int)>, crashes::detail::total_count<T, crashes::detail::shouldnt_decrement_on_destruction> >::copies instance;
 	};
 }


Update k-th-smallest-in-lexicographical-order.cpp

--- C++/k-th-smallest-in-lexicographical-order.cpp
+++ C++/k-th-smallest-in-lexicographical-order.cpp
@@ -7,7 +7,7 @@
         int result = 0;

         vector<int> cnts(10);
-        for (int i = 1; i < 10; i++) {
+        for (int i = 1; i <= 9; ++i) {
             cnts[i] = cnts[i - 1] * 10 + 1;
         }

@@ -20,7 +20,7 @@
         for (int i = nums.size() - 1; i >= 0 && k; --i) {
             target = target * 10 + nums[i];
             const auto start = i == nums.size() - 1 ? 1 : 0;
-            for (int j = start; j < 10; ++j) {
+            for (int j = start; j <= 9; ++j) {
                 int candidate = result * 10 + j;
                 int num;
                 if (candidate < target) {


LMRの探索後の条件分岐を代入にした

LMRの探索後の条件分岐を代入にした

--- src/chess_engine_search.cpp
+++ src/chess_engine_search.cpp
@@ -533,7 +533,7 @@
           depth - cache.lmr_search_reduction_ - 1, level + 1,
           -(temp_alpha + 1), -temp_alpha, next_material);

-          if (score > temp_alpha) do_normal_search = true;
+          do_normal_search = score > temp_alpha;
         } else {
           do_normal_search = true;
         }
@@ -1034,7 +1034,7 @@
           job.depth_ - cache.lmr_search_reduction_ - 1, job.level_ + 1,
           -(temp_alpha + 1), -temp_alpha, next_material);

-          if (score > temp_alpha) do_normal_search = true;
+          do_normal_search = score > temp_alpha;
         } else {
           do_normal_search = true;
         }
@@ -1256,7 +1256,7 @@
             job.depth_ - cache.lmr_search_reduction_ - 1, job.level_ + 1,
             -(temp_alpha + 1), -temp_alpha, next_material);

-            if (score > temp_alpha) do_normal_search = true;
+            do_normal_search = score > temp_alpha;
           } else {
             do_normal_search = true;
           }


check whether sema issues a redefinition error

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

--- test/SemaTemplate/inject-templated-friend.cpp
+++ test/SemaTemplate/inject-templated-friend.cpp
@@ -1,4 +1,5 @@
 // RUN: %clang %s -S -emit-llvm -o - | grep -e "define linkonce_odr.*_ZlsR11std_ostreamRK8StreamerI3FooE"
+// RUN: %clang -cc1 %s -DREDEFINE -verify
 // PR8007: friend function not instantiated.

 struct std_ostream
@@ -11,7 +12,7 @@
 template <typename STRUCT_TYPE>
 struct Streamer
 {
-    friend std_ostream& operator << (std_ostream& o, const Streamer& f)
+    friend std_ostream& operator << (std_ostream& o, const Streamer& f) // expected-error{{redefinition of 'operator<<'}}
         {
             Streamer s(f);
             s(o);
@@ -26,14 +27,17 @@

 typedef struct Foo {} Foo;

-std_ostream& operator << (std_ostream& o, const Streamer<Foo>& f);
-/*std_ostream& operator << (std_ostream& o, const Streamer<Foo>& f)
+std_ostream& operator << (std_ostream&, const Streamer<Foo>&);
+#ifdef REDEFINE
+std_ostream& operator << (std_ostream& o, const Streamer<Foo>&) // expected-note{{is here}}
 {
   // Sema should flag this as a redefinition
-}*/
+  return o;
+}
+#endif

 template <>
-void Streamer<Foo>::operator () (std_ostream& o) const
+void Streamer<Foo>::operator () (std_ostream& o) const // expected-note{{requested here}}
 {
 }


Implements sending 'sliderPosition' to app on respose TIMED_OUT

SDL must transfer Slider("resultCode": TIMED_OUT, success:false,
"sliderPosition":<position>) on TIMED_OUT response.

Implements: APPLINK-16995

--- src/components/application_manager/src/commands/mobile/slider_request.cc
+++ src/components/application_manager/src/commands/mobile/slider_request.cc
@@ -74,8 +74,8 @@
     return;
   }

-  if ((*message_)[strings::msg_params][strings::num_ticks].asInt()
-      < (*message_)[strings::msg_params][strings::position].asInt()) {
+  if ((*message_)[strings::msg_params][strings::num_ticks].asInt() <
+      (*message_)[strings::msg_params][strings::position].asInt()) {
     LOG4CXX_ERROR(logger_, "INVALID_DATA");
     SendResponse(false, mobile_apis::Result::INVALID_DATA);
     return;
@@ -114,40 +114,56 @@
 void SliderRequest::on_event(const event_engine::Event& event) {
   LOG4CXX_AUTO_TRACE(logger_);
   using namespace helpers;
-  const smart_objects::SmartObject& message = event.smart_object();
+  using namespace smart_objects;
+  using namespace hmi_apis;
+
+  const SmartObject& message = event.smart_object();

   const event_engine::Event::EventID event_id = event.id();
-  if (event_id == hmi_apis::FunctionID::UI_OnResetTimeout) {
+  if (event_id == FunctionID::UI_OnResetTimeout) {
     LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event");
     ApplicationManagerImpl::instance()->updateRequestTimeout(connection_key(),
       correlation_id(),
       default_timeout());
     return;
   }
-  if (event_id != hmi_apis::FunctionID::UI_Slider) {
+
+  if (event_id != FunctionID::UI_Slider) {
     LOG4CXX_ERROR(logger_, "Received unknown event" << event.id());
     return;
   }

-  LOG4CXX_INFO(logger_, "Received UI_Slider event");
-
-  const hmi_apis::Common_Result::eType response_code =
-      static_cast<hmi_apis::Common_Result::eType>(
+  LOG4CXX_DEBUG(logger_, "Received UI_Slider event");
+
+  const Common_Result::eType response_code = static_cast<Common_Result::eType>(
       message[strings::params][hmi_response::code].asInt());

-  smart_objects::SmartObject response_msg_params = message[strings::msg_params];
-  if (response_code == hmi_apis::Common_Result::ABORTED &&
-      response_msg_params[strings::data].keyExists(strings::slider_position)) {
-    //Copy slider_position info to msg_params section
-        response_msg_params[strings::slider_position] =
-        message[strings::params][strings::data][strings::slider_position];
+  SmartObject response_msg_params = message[strings::msg_params];
+
+  const bool is_timeout_aborted =
+      Compare<Common_Result::eType, EQ, ONE>(
+        response_code,
+        Common_Result::TIMED_OUT,
+        Common_Result::ABORTED);
+
+  if (is_timeout_aborted) {
+    if (message[strings::params][strings::data]
+        .keyExists(strings::slider_position)) {
+      //Copy slider_position info to msg_params section
+      response_msg_params[strings::slider_position] =
+          message[strings::params][strings::data][strings::slider_position];
+    } else {
+      LOG4CXX_ERROR(logger_, strings::slider_position << " field is absent"
+                    " in response.");
+      response_msg_params[strings::slider_position] = 0;
+    }
   }

   const bool is_response_success =
-      Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
+      Compare<Common_Result::eType, EQ, ONE>(
         response_code,
-        hmi_apis::Common_Result::SUCCESS,
-        hmi_apis::Common_Result::WARNINGS);
+        Common_Result::SUCCESS,
+        Common_Result::WARNINGS);

   SendResponse(is_response_success,
                MessageHelper::HMIToMobileResult(response_code),


Correct resource paths.

Correct resource paths.

--- test/engine/rendering/renderable_sprite.t.cpp
+++ test/engine/rendering/renderable_sprite.t.cpp
@@ -13,7 +13,7 @@
     Renderer renderer;

     // can't continue if can't find the texture
-    ASSERT_TRUE( renderer.loadTexture( "test", "res/texture/block.png" ) );
+    ASSERT_TRUE( renderer.loadTexture( "test", "res/texture/actor/block/block.png" ) );

     RenderableSprite texture( renderer.getTexture( "test" ) );
     RenderableSprite sprite( sf::Sprite( renderer.getTexture( "test" ) ) );
@@ -28,7 +28,7 @@
     Renderer renderer;

     // can't continue if can't find the texture
-    ASSERT_TRUE( renderer.loadTexture( "test", "res/texture/block.png" ) );
+    ASSERT_TRUE( renderer.loadTexture( "test", "res/texture/actor/block/block.png" ) );

     RenderableSprite sprite( renderer.getTexture( "test" ) );

@@ -50,7 +50,7 @@
     Renderer renderer;

     // can't continue if can't find the texture
-    ASSERT_TRUE( renderer.loadTexture( "test", "res/texture/block.png" ) );
+    ASSERT_TRUE( renderer.loadTexture( "test", "res/texture/actor/block/block.png" ) );

     RenderableSprite sprite( renderer.getTexture( "test" ) );
     sprite.setPosition( 0.0f, 0.0f );


Frees disk_vols when volume create failed

--- iocore/cache/Cache.cc
+++ iocore/cache/Cache.cc
@@ -2865,6 +2865,8 @@
         new_cp->disk_vols = (DiskVol **)ats_malloc(gndisks * sizeof(DiskVol *));
         memset(new_cp->disk_vols, 0, gndisks * sizeof(DiskVol *));
         if (create_volume(config_vol->number, size_in_blocks, config_vol->scheme, new_cp)) {
+          ats_free(new_cp->disk_vols);
+          new_cp->disk_vols = nullptr;
           delete new_cp;
           return -1;
         }


Allow printing only tac or ast

Allow printing only tac or ast

--- src/Compiler.cpp
+++ src/Compiler.cpp
@@ -115,6 +115,7 @@

         TIMER_END(parsing)

+        //If the parsing was sucessfully
         if(parsing){
             //Symbol tables
             FunctionTable functionTable;
@@ -125,10 +126,10 @@

             //Apply some cleaning transformations
             clean(program);
-
+
             //Annotate the AST with more informations
             defineDefaultValues(program);
-
+
             //Fill the string pool
             checkStrings(program, pool);

@@ -148,53 +149,71 @@

             //Check that there is a main in the program
             checkForMain(functionTable);
-
+
             //Optimize the AST
             optimize(program, functionTable, pool);
-
-            tac::Program tacProgram;
-
-            //Generate Three-Address-Code language
-            tac::Compiler compiler;
-            compiler.compile(program, pool, tacProgram);
-
-            //Separate into basic blocks
-            tac::BasicBlockExtractor extractor;
-            extractor.extract(tacProgram);
-
-            //Allocate storage for the temporaries that need to be stored
-            tac::TemporaryAllocator allocator;
-            allocator.allocate(tacProgram);
-
-            tac::Optimizer optimizer;
-            optimizer.optimize(tacProgram, pool);
-
-            //Compute liveness of variables
-            tac::LivenessAnalyzer liveness;
-            liveness.compute(tacProgram);
-
-            //Generate assembly from TAC
-            AssemblyFileWriter writer("output.asm");
-
-            as::CodeGeneratorFactory factory;
-            auto generator = factory.get(platform, writer);
-            generator->generate(tacProgram, pool, functionTable);
-            writer.write();
-
-            //If it's necessary, assemble and link the assembly
-            if(!options.count("assembly")){
-                if(options.count("debug")){
-                    assembleWithDebug(platform, output);
-                } else {
-                    assemble(platform, output);
+
+            //If the user asked for it, print the Abstract Syntax Tree
+            if(options.count("ast") || options.count("ast-only")){
+                ast::DebugVisitor()(program);
+            }
+
+            //If necessary, continue the compilation process
+            if(!options.count("ast-only")){
+
+                tac::Program tacProgram;
+
+                //Generate Three-Address-Code language
+                tac::Compiler compiler;
+                compiler.compile(program, pool, tacProgram);
+
+                //Separate into basic blocks
+                tac::BasicBlockExtractor extractor;
+                extractor.extract(tacProgram);
+
+                //Allocate storage for the temporaries that need to be stored
+                tac::TemporaryAllocator allocator;
+                allocator.allocate(tacProgram);
+
+                tac::Optimizer optimizer;
+                optimizer.optimize(tacProgram, pool);
+
+                //If asked by the user, print the Three Address code representation
+                if(options.count("tac") || options.count("tac-only")){
+                    tac::Printer printer;
+                    printer.print(tacProgram);
                 }

-                //Remove temporary files
-                if(!options.count("keep")){
-                    remove("output.asm");
+                //If necessary, continue the compilation process
+                if(!options.count("tac-only")){
+                    //Compute liveness of variables
+                    tac::LivenessAnalyzer liveness;
+                    liveness.compute(tacProgram);
+
+                    //Generate assembly from TAC
+                    AssemblyFileWriter writer("output.asm");
+
+                    as::CodeGeneratorFactory factory;
+                    auto generator = factory.get(platform, writer);
+                    generator->generate(tacProgram, pool, functionTable);
+                    writer.write();
+
+                    //If it's necessary, assemble and link the assembly
+                    if(!options.count("assembly")){
+                        if(options.count("debug")){
+                            assembleWithDebug(platform, output);
+                        } else {
+                            assemble(platform, output);
+                        }
+
+                        //Remove temporary files
+                        if(!options.count("keep")){
+                            remove("output.asm");
+                        }
+
+                        remove("output.o");
+                    }
                 }
-
-                remove("output.o");
             }
         }
     } catch (const SemanticalException& e) {


GroupBy: applying fix that @sebalamm only applied to GroupByIndex, one week ago, fixes #101.

--- thrill/api/groupby.hpp
+++ thrill/api/groupby.hpp
@@ -149,9 +149,9 @@
     void Dispose() override { }

 private:
-    const KeyExtractor& key_extractor_;
-    const GroupFunction& groupby_function_;
-    const HashFunction& hash_function_;
+    KeyExtractor key_extractor_;
+    GroupFunction groupby_function_;
+    HashFunction hash_function_;

     data::CatStreamPtr stream_ { context_.GetNewCatStream() };
     std::vector<data::Stream::Writer> emitter_ { stream_->OpenWriters() };


#26: Rename column headers in the "My Addresses" screen

--- ion/AddressesPage.cpp
+++ ion/AddressesPage.cpp
@@ -56,15 +56,15 @@
     output << "
";
     output << "
";
     output << "
";
-    output << "            MAC	";
-    output << "            IP	";
-    output << "            Last	";
+    output << "            MAC Address	";
+    output << "            IP Address	";
+    output << "            Last Seen	";
     output << "            Type	";
     output << "            Name	";
     output << "            Vendor	";
-    output << "            OS	";
+    output << "            Operating System	";
     output << "            Description	";
-    output << "            HW	";
+    output << "            Hardware Family	";
     output << "            Authorized	";
     output << "
";
     output << "
";


Remove old check for 3-byte shifted IP addresses from pre-0.2.9 node messages

Summary:
The change removes an old check for IPv6 addresses in range ::ff:ff00:0:0:0/72 that were created due to a bug in size field of addr messages for 0.2.8 nodes and before.

This check is no longer needed as they are no more pre 0.2.9 nodes on the network (as per bitnodes network snapshot).

Credits for discovering this go to sipa.

This is a backport of [[https://github.com/bitcoin/bitcoin/pull/19797 | core#19797]]

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10134

--- src/netaddress.cpp
+++ src/netaddress.cpp
@@ -436,17 +436,6 @@
  * @see CNetAddr::IsRoutable()
  */
 bool CNetAddr::IsValid() const {
-    // Cleanup 3-byte shifted addresses caused by garbage in size field of addr
-    // messages from versions before 0.2.9 checksum.
-    // Two consecutive addr messages look like this:
-    // header20 vectorlen3 addr26 addr26 addr26 header20 vectorlen3 addr26
-    // addr26 addr26... so if the first length field is garbled, it reads the
-    // second batch of addr misaligned by 3 bytes.
-    if (IsIPv6() && memcmp(m_addr.data(), IPV4_IN_IPV6_PREFIX.data() + 3,
-                           sizeof(IPV4_IN_IPV6_PREFIX) - 3) == 0) {
-        return false;
-    }
-
     // unspecified IPv6 address (::/128)
     uint8_t ipNone6[16] = {};
     if (IsIPv6() && memcmp(m_addr.data(), ipNone6, sizeof(ipNone6)) == 0) {


Fix subscript[0] in netaddress.cpp

Fix subscript[0] in netaddress.cpp

--- src/netaddress.cpp
+++ src/netaddress.cpp
@@ -573,7 +573,7 @@
 {
      std::vector<unsigned char> vKey;
      vKey.resize(18);
-     memcpy(&vKey[0], ip, 16);
+     memcpy(vKey.data(), ip, 16);
      vKey[16] = port / 0x100;
      vKey[17] = port & 0x0FF;
      return vKey;


Update compare-strings.cpp

Update compare-strings.cpp

--- C++/compare-strings.cpp
+++ C++/compare-strings.cpp
@@ -2,6 +2,32 @@
 // Space: O(c)

 class Solution {
+public:
+    /**
+     * @param A: A string includes Upper Case letters
+     * @param B: A string includes Upper Case letter
+     * @return:  if string A contains all of the characters in B return true
+     *           else return false
+     */
+    bool compareStrings(string A, string B) {
+        unordered_map<char, int> h;
+        for (auto& c: A) {
+            ++h[c];
+        }
+
+        for (auto& c: B) {
+            if (--h[c] < 0) {
+                return false;
+            }
+        }
+
+        return true;
+    }
+};
+
+
+
+class Solution2 {
 public:
     /**
      * @param A: A string includes Upper Case letters
@@ -11,7 +37,7 @@
      */
     bool compareStrings(string A, string B) {
         // write your code here
-        unordered_map<char, size_t> h;
+        unordered_map<char, int> h;
         for (auto& c: B) {
             ++h[c];
         }


Update permutations-ii.cpp

Update permutations-ii.cpp

--- C++/permutations-ii.cpp
+++ C++/permutations-ii.cpp
@@ -18,7 +18,7 @@
     }

     void permuteUniqueRecu(const vector<int> &A, deque<bool> *used,
-                                    vector<int> *ans, vector<vector<int>> *result) {
+                           vector<int> *ans, vector<vector<int>> *result) {
         if (ans->size() == A.size()) {
             result->emplace_back(*ans);
             return;


Changes: fix ut_mcalendar

Changes: fix ut_mcalendar

RevBy: Holger Schröder

Details:

Broken because of

    commit 85b605d84f5b0725a8b8c3786b48d10fefe62532
    Author: Mike FABIAN <mike.fabian@basyskom.de>
    Date:   Fri Sep 16 16:26:33 2011 +0200

        Fixes: NB#281175 - Settings; Regional format: Unexpected behavior in changing dates after selecting a different region form

I missed to places which needed changes.

--- tests/ut_mcalendar/ut_mcalendar.cpp
+++ tests/ut_mcalendar/ut_mcalendar.cpp
@@ -5163,7 +5163,7 @@
         << "cs_CZ"
         << "cs_CZ"
         << "ccc d"
-        << "pá 16";
+        << "Pá 16";
     QTest::newRow("fi_FI")
         << MLocale::GregorianCalendar
         << QDateTime(QDate(2011,12,16),QTime(18,42,5))
@@ -5305,7 +5305,7 @@
         << "cs_CZ"
         << "cs_CZ"
         << "cccc d"
-        << "pátek 16";
+        << "Pátek 16";
     QTest::newRow("fi_FI")
         << MLocale::GregorianCalendar
         << QDateTime(QDate(2011,12,16),QTime(18,42,5))


Augh.  My databases had their paths baked in them.

--- src/Database.cpp
+++ src/Database.cpp
@@ -66,7 +66,7 @@
 	if (!checkError("mdb_env_open", result)) {
 		result = mdb_txn_begin(_environment, 0, 0, &_transaction);
 		if (!checkError("mdb_txn_begin", result)) {
-			result = mdb_dbi_open(_transaction, path, MDB_CREATE, &_database);
+			result = mdb_dbi_open(_transaction, NULL, MDB_CREATE, &_database);
 			if (!checkError("mdb_dbi_open", result)) {
 				result = mdb_txn_commit(_transaction);
 				checkError("mdb_txn_commit", result);


INTEGRATION: CWS warnings01 (1.24.10); FILE MERGED 2005/12/22 14:40:50 ab 1.24.10.1: #i53898# Removed warnings for unxlngi6, unxlngi6.pro

--- scripting/source/protocolhandler/scripthandler.cxx
+++ scripting/source/protocolhandler/scripthandler.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: scripthandler.cxx,v $
  *
- *  $Revision: 1.24 $
- *
- *  last change: $Author: hr $ $Date: 2005-09-27 12:55:36 $
+ *  $Revision: 1.25 $
+ *
+ *  last change: $Author: hr $ $Date: 2006-06-19 10:19:43 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -106,6 +106,9 @@
     const URL& aURL, const ::rtl::OUString& sTargetFrameName, sal_Int32 nSearchFlags )
     throw( ::com::sun::star::uno::RuntimeException )
 {
+    (void)sTargetFrameName;
+    (void)nSearchFlags;
+
     Reference< XDispatch > xDispatcher;
     // get scheme of url

@@ -353,18 +356,26 @@
 const Reference< XStatusListener >& xControl, const URL& aURL )
 throw ( RuntimeException )
 {
+    (void)xControl;
+    (void)aURL;
+
     // implement if status is supported
 }

 void SAL_CALL ScriptProtocolHandler::removeStatusListener(
 const Reference< XStatusListener >& xControl, const URL& aURL )
 throw ( RuntimeException )
-{}
+{
+    (void)xControl;
+    (void)aURL;
+}

 void
 ScriptProtocolHandler::createScriptProvider( const ::rtl::OUString& url )
 throw ( RuntimeException )
 {
+    (void)url;
+
     if ( m_xScriptProvider.is() )
     {
         return;
@@ -521,12 +532,16 @@
     void SAL_CALL component_getImplementationEnvironment(
         const sal_Char** ppEnvironmentTypeName, uno_Environment** ppEnvironment )
     {
+        (void)ppEnvironment;
+
         *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
     }

     sal_Bool SAL_CALL component_writeInfo( void * pServiceManager ,
                                            void * pRegistryKey )
     {
+        (void)pServiceManager;
+
         Reference< css::registry::XRegistryKey > xKey(
             reinterpret_cast< css::registry::XRegistryKey* >( pRegistryKey ) ) ;

@@ -547,6 +562,8 @@
                                          void * pServiceManager ,
                                          void * pRegistryKey )
     {
+        (void)pRegistryKey;
+
         // Set default return value for this operation - if it failed.
         void * pReturn = NULL ;


Only recreate IndexReader when needed

Only recreate IndexReader when needed

Don't constantly call reopen(); this was done due to misunderstanding
the documentation, it actually _always_ returned a new instanced.
Instead use isCurrent() to check if it is necessary at all.

--- src/tm/transmem.cpp
+++ src/tm/transmem.cpp
@@ -149,9 +149,9 @@
 {
     std::lock_guard<std::mutex> guard(m_readerMutex);

-    auto newReader = m_reader->reopen();
-    if (m_reader != newReader)
-    {
+    if (!m_reader->isCurrent())
+    {
+        auto newReader = m_reader->reopen();
         m_reader->close();
         m_reader = newReader;
     }


Fix DateTime for android

Fix DateTime for android

--- src/DateTime.cpp
+++ src/DateTime.cpp
@@ -320,6 +320,39 @@
   }
 }

+#ifdef __ANDROID__
+static time_t my_timegm(struct tm * t)
+/* struct tm to seconds since Unix epoch */
+{
+    long year;
+    time_t result;
+#define MONTHSPERYEAR   12      /* months per calendar year */
+    static const int cumdays[MONTHSPERYEAR] =
+        { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
+
+    /*@ +matchanyintegral @*/
+    year = 1900 + t->tm_year + t->tm_mon / MONTHSPERYEAR;
+    result = (year - 1970) * 365 + cumdays[t->tm_mon % MONTHSPERYEAR];
+    result += (year - 1968) / 4;
+    result -= (year - 1900) / 100;
+    result += (year - 1600) / 400;
+    if ((year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0) &&
+        (t->tm_mon % MONTHSPERYEAR) < 2)
+        result--;
+    result += t->tm_mday - 1;
+    result *= 24;
+    result += t->tm_hour;
+    result *= 60;
+    result += t->tm_min;
+    result *= 60;
+    result += t->tm_sec;
+    if (t->tm_isdst == 1)
+        result -= 3600;
+    /*@ -matchanyintegral @*/
+    return (result);
+}
+#endif
+
 time_t
 DateTime::getTimeUTC() const {
   tm tt;
@@ -335,8 +368,7 @@
 #if defined WIN32
   return _mkgmtime(&tt);
 #elif defined __ANDROID__
-  // this needs to be changed
-  return mktime(&tt) - timezone; // or _timezone
+  return my_timegm(&tt);
 #else
   return timegm(&tt);
 #endif


Changed some tests for non-ASCII characters from "> 0x80" to ">= 0x80".

--- src/Document.cxx
+++ src/Document.cxx
@@ -688,7 +688,7 @@
 }

 Document::charClassification Document::WordCharClass(unsigned char ch) {
-	if ((SC_CP_UTF8 == dbcsCodePage) && (ch > 0x80))
+	if ((SC_CP_UTF8 == dbcsCodePage) && (ch >= 0x80))
 		return ccWord;
 	return charClass[ch];
 }
@@ -1032,7 +1032,7 @@
 		}
 	} else {
 		for (ch = 0; ch < 256; ch++) {
-			if (ch > 0x80 || isalnum(ch) || ch == '_')
+			if (ch >= 0x80 || isalnum(ch) || ch == '_')
 				charClass[ch] = ccWord;
 		}
 	}


BUG: Need to handle empty input properly.

--- Graphics/vtkRectilinearGridGeometryFilter.cxx
+++ Graphics/vtkRectilinearGridGeometryFilter.cxx
@@ -69,6 +69,12 @@

   vtkDebugMacro(<< "Extracting rectilinear points geometry");

+  if (input->GetNumberOfPoints() == 0)
+    {
+    vtkDebugMacro("Empty input");
+    return 1;
+    }
+
   pd = input->GetPointData();
   outPD = output->GetPointData();
   outPD->CopyNormalsOff();


thcrap_update UI: add a "Update other games and patches" checkbox. [V]

--- thcrap_update/src/loader_update.cpp
+++ thcrap_update/src/loader_update.cpp
@@ -24,6 +24,7 @@
 	HWND_STATIC_UPDATES_INTERVAL,
 	HWND_EDIT_UPDATES_INTERVAL,
 	HWND_UPDOWN,
+	HWND_CHECKBOX_UPDATE_OTHERS,
 	HWND_BUTTON_UPDATE,
 	HWND_BUTTON_RUN,
 	HWND_BUTTON_EXPAND_LOGS,
@@ -51,6 +52,7 @@
 	bool game_started;
 	bool update_at_exit;
 	bool background_updates;
+	bool update_others;
 	int time_between_updates;
 	bool cancel_update;

@@ -125,6 +127,17 @@
 				}
 				else {
 					state->update_at_exit = false;
+				}
+			}
+			break;
+
+		case HWND_CHECKBOX_UPDATE_OTHERS:
+			if (HIWORD(wParam) == BN_CLICKED) {
+				if (SendMessage(state->hwnd[HWND_CHECKBOX_UPDATE_OTHERS], BM_GETCHECK, 0, 0) == BST_CHECKED) {
+					state->update_others = true;
+				}
+				else {
+					state->update_others = false;
 				}
 			}
 			break;
@@ -166,7 +179,7 @@
 				}
 				else {
 					// Show log window
-					SetWindowPos(state->hwnd[HWND_MAIN], 0, 0, 0, 500, 410, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOZORDER);
+					SetWindowPos(state->hwnd[HWND_MAIN], 0, 0, 0, 500, 435, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOZORDER);
 					state->settings_visible = true;
 				}
 			}
@@ -178,6 +191,7 @@
 		if ((HWND)lParam == state->hwnd[HWND_LABEL_STATUS] ||
 			(HWND)lParam == state->hwnd[HWND_CHECKBOX_UPDATE_AT_EXIT] ||
 			(HWND)lParam == state->hwnd[HWND_CHECKBOX_KEEP_UPDATER] ||
+			(HWND)lParam == state->hwnd[HWND_CHECKBOX_UPDATE_OTHERS] ||
 			(HWND)lParam == state->hwnd[HWND_STATIC_UPDATES_INTERVAL] ||
 			(HWND)lParam == state->hwnd[HWND_STATIC_UPDATE_AT_EXIT]) {
 			HDC hdc = (HDC)wParam;
@@ -359,10 +373,15 @@
 	SendMessage(state->hwnd[HWND_UPDOWN], UDM_SETBUDDY, (WPARAM)state->hwnd[HWND_EDIT_UPDATES_INTERVAL], 0);
 	SendMessage(state->hwnd[HWND_UPDOWN], UDM_SETPOS, 0, state->time_between_updates);
 	SendMessage(state->hwnd[HWND_UPDOWN], UDM_SETRANGE, 0, MAKELPARAM(UD_MAXVAL, 0));
+	state->hwnd[HWND_CHECKBOX_UPDATE_OTHERS] = CreateWindowW(L"Button", L"Update other games and patches", WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
+		5, 245, 480, 18, state->hwnd[HWND_MAIN], (HMENU)HWND_CHECKBOX_UPDATE_OTHERS, hMod, NULL);
+	if (state->update_others) {
+		CheckDlgButton(state->hwnd[HWND_MAIN], HWND_CHECKBOX_UPDATE_OTHERS, BST_CHECKED);
+	}
 	state->hwnd[HWND_BUTTON_DISABLE_UPDATES] = CreateWindowW(L"Button", L"Completely disable updates (not recommended)", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
-		5, 245, 480, 23, state->hwnd[HWND_MAIN], (HMENU)HWND_BUTTON_DISABLE_UPDATES, hMod, NULL);
+		5, 270, 480, 23, state->hwnd[HWND_MAIN], (HMENU)HWND_BUTTON_DISABLE_UPDATES, hMod, NULL);
 	state->hwnd[HWND_EDIT_LOGS] = CreateWindowW(L"Edit", L"", WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY,
-		5, 275, 480, 100, state->hwnd[HWND_MAIN], (HMENU)HWND_EDIT_LOGS, hMod, NULL);
+		5, 300, 480, 100, state->hwnd[HWND_MAIN], (HMENU)HWND_EDIT_LOGS, hMod, NULL);
 	SendMessageW(state->hwnd[HWND_EDIT_LOGS], EM_LIMITTEXT, -1, 0);

 	// Font
@@ -500,6 +519,13 @@
 	state.time_between_updates = (int)json_integer_value(json_object_get(config, "time_between_updates"));
 	if (state.time_between_updates == 0) {
 		state.time_between_updates = 5;
+	}
+	json_t *update_others_object = json_object_get(config, "update_others");
+	if (update_others_object) {
+		state.update_others = json_boolean_value(update_others_object);
+	}
+	else {
+		state.update_others = true;
 	}

 	SetLastError(0);
@@ -588,9 +614,20 @@
 		DWORD wait_ret;
 		do {
 			progress_bars_set_marquee(&state, true, true);
-			SetWindowTextW(state.hwnd[HWND_LABEL_STATUS], L"Updating other patches and games...");
 			EnableWindow(state.hwnd[HWND_BUTTON_UPDATE], FALSE);
-			global_update(loader_update_progress_callback, &state);
+			if (state.update_others) {
+				SetWindowTextW(state.hwnd[HWND_LABEL_STATUS], L"Updating other patches and games...");
+				state.state = STATE_GLOBAL_UPDATE;
+				global_update(loader_update_progress_callback, &state);
+			}
+			else {
+				json_t *game = json_object_get(runconfig_get(), "game");
+				if (game) {
+					SetWindowTextW(state.hwnd[HWND_LABEL_STATUS], L"Updating patch files...");
+					state.state = STATE_PATCHES_UPDATE;
+					stack_update(update_filter_games, game, loader_update_progress_callback, &state);
+				}
+			}
 			EnterCriticalSection(&state.cs);
 			time_between_updates = state.time_between_updates;
 			LeaveCriticalSection(&state.cs);
@@ -598,6 +635,7 @@
 			// Display the "Update finished" message
 			EnableWindow(state.hwnd[HWND_BUTTON_UPDATE], TRUE);
 			SetWindowTextW(state.hwnd[HWND_LABEL_STATUS], L"Update finished");
+			state.state = STATE_WAITING;
 			progress_bars_set_marquee(&state, false, true);
 			SendMessage(state.hwnd[HWND_PROGRESS1], PBM_SETPOS, 100, 0);
 			SendMessage(state.hwnd[HWND_PROGRESS2], PBM_SETPOS, 100, 0);
@@ -615,6 +653,7 @@
 	json_object_set_new(config, "update_at_exit", json_boolean(state.update_at_exit));
 	json_object_set_new(config, "background_updates", json_boolean(state.background_updates));
 	json_object_set_new(config, "time_between_updates", json_integer(state.time_between_updates));
+	json_object_set_new(config, "update_others", json_boolean(state.update_others));
 	json_dump_file(config, "config.js", JSON_INDENT(2) | JSON_SORT_KEYS);
 	json_decref(config);


Change `thrust::system_error` in the CUDA backend to print out its `cudaError_t`
enumerator in addition to the diagnostic message.

Bug 2455943
Bug 2017697

--- thrust/system/cuda/detail/error.inl
+++ thrust/system/cuda/detail/error.inl
@@ -59,9 +59,12 @@

     inline virtual std::string message(int ev) const
     {
-      static const std::string unknown_err("Unknown error");
-      const char *c_str = ::cudaGetErrorString(static_cast<cudaError_t>(ev));
-      return c_str ? std::string(c_str) : unknown_err;
+      char const* const unknown_str  = "unknown error";
+      char const* const unknown_name = "cudaErrorUnknown";
+      char const* c_str  = ::cudaGetErrorString(static_cast<cudaError_t>(ev));
+      char const* c_name = ::cudaGetErrorName(static_cast<cudaError_t>(ev));
+      return std::string(c_name ? c_name : unknown_name)
+           + ": " + (c_str ? c_str : unknown_str);
     }

     inline virtual error_condition default_error_condition(int ev) const


Use ASSERT_TRUE(p != nullptr) to check pointer nullness.

Also add argument comments to literals.

PiperOrigin-RevId: 487251986
Change-Id: I3fc14099f73047a7f73b5cc6440f9bba3438e6b6

--- tools/cpp/runfiles/runfiles_test.cc
+++ tools/cpp/runfiles/runfiles_test.cc
@@ -161,13 +161,14 @@
 TEST_F(RunfilesTest, CreatesManifestBasedRunfilesFromManifestNextToBinary) {
   unique_ptr<MockFile> mf(MockFile::Create(
       "foo" LINE_AS_STRING() ".runfiles_manifest", {"a/b c/d"}));
-  EXPECT_TRUE(mf != nullptr);
+  ASSERT_TRUE(mf != nullptr);
   string argv0(mf->Path().substr(
       0, mf->Path().size() - string(".runfiles_manifest").size()));

   string error;
-  unique_ptr<Runfiles> r(Runfiles::Create(argv0, "", "", &error));
-  ASSERT_NE(r, nullptr);
+  unique_ptr<Runfiles> r(Runfiles::Create(argv0, /*runfiles_manifest_file=*/"",
+                                          /*runfiles_dir=*/"", &error));
+  ASSERT_TRUE(r != nullptr);
   EXPECT_TRUE(error.empty());
   EXPECT_EQ(r->Rlocation("a/b"), "c/d");
   // We know it's manifest-based because it returns empty string for unknown
@@ -180,13 +181,14 @@
        CreatesManifestBasedRunfilesFromManifestInRunfilesDirectory) {
   unique_ptr<MockFile> mf(MockFile::Create(
       "foo" LINE_AS_STRING() ".runfiles/MANIFEST", {"a/b c/d"}));
-  EXPECT_TRUE(mf != nullptr);
+  ASSERT_TRUE(mf != nullptr);
   string argv0(mf->Path().substr(
       0, mf->Path().size() - string(".runfiles/MANIFEST").size()));

   string error;
-  unique_ptr<Runfiles> r(Runfiles::Create(argv0, "", "", &error));
-  ASSERT_NE(r, nullptr);
+  unique_ptr<Runfiles> r(Runfiles::Create(argv0, /*runfiles_manifest_file=*/"",
+                                          /*runfiles_dir=*/"", &error));
+  ASSERT_TRUE(r != nullptr);
   EXPECT_TRUE(error.empty());
   EXPECT_EQ(r->Rlocation("a/b"), "c/d");
   EXPECT_EQ(r->Rlocation("foo"), argv0 + ".runfiles/foo");
@@ -196,12 +198,12 @@
 TEST_F(RunfilesTest, CreatesManifestBasedRunfilesFromEnvvar) {
   unique_ptr<MockFile> mf(MockFile::Create(
       "foo" LINE_AS_STRING() ".runfiles_manifest", {"a/b c/d"}));
-  EXPECT_TRUE(mf != nullptr);
+  ASSERT_TRUE(mf != nullptr);

   string error;
   unique_ptr<Runfiles> r(Runfiles::Create("ignore-argv0", mf->Path(),
                                           "non-existent-runfiles_dir", &error));
-  ASSERT_NE(r, nullptr);
+  ASSERT_TRUE(r != nullptr);
   EXPECT_TRUE(error.empty());
   EXPECT_EQ(r->Rlocation("a/b"), "c/d");
   // We know it's manifest-based because it returns empty string for unknown
@@ -213,12 +215,12 @@
 TEST_F(RunfilesTest, CannotCreateManifestBasedRunfilesDueToBadManifest) {
   unique_ptr<MockFile> mf(MockFile::Create(
       "foo" LINE_AS_STRING() ".runfiles_manifest", {"a b", "nospace"}));
-  EXPECT_TRUE(mf != nullptr);
+  ASSERT_TRUE(mf != nullptr);

   string error;
   unique_ptr<Runfiles> r(
       Runfiles::Create("ignore-argv0", mf->Path(), "", &error));
-  ASSERT_EQ(r, nullptr);
+  EXPECT_EQ(r, nullptr);
   EXPECT_NE(error.find("bad runfiles manifest entry"), string::npos);
   EXPECT_NE(error.find("line #2: \"nospace\""), string::npos);
 }
@@ -226,13 +228,13 @@
 TEST_F(RunfilesTest, ManifestBasedRunfilesRlocationAndEnvVars) {
   unique_ptr<MockFile> mf(MockFile::Create(
       "foo" LINE_AS_STRING() ".runfiles_manifest", {"a/b c/d"}));
-  EXPECT_TRUE(mf != nullptr);
+  ASSERT_TRUE(mf != nullptr);

   string error;
   unique_ptr<Runfiles> r(
       Runfiles::Create("ignore-argv0", mf->Path(), "", &error));

-  ASSERT_NE(r, nullptr);
+  ASSERT_TRUE(r != nullptr);
   EXPECT_TRUE(error.empty());
   EXPECT_EQ(r->Rlocation("a/b"), "c/d");
   EXPECT_EQ(r->Rlocation("c/d"), "");
@@ -259,12 +261,12 @@
 TEST_F(RunfilesTest, DirectoryBasedRunfilesRlocationAndEnvVars) {
   unique_ptr<MockFile> dummy(
       MockFile::Create("foo" LINE_AS_STRING() ".runfiles/dummy", {"a/b c/d"}));
-  EXPECT_TRUE(dummy != nullptr);
+  ASSERT_TRUE(dummy != nullptr);
   string dir = dummy->DirName();

   string error;
   unique_ptr<Runfiles> r(Runfiles::Create("ignore-argv0", "", dir, &error));
-  ASSERT_NE(r, nullptr);
+  ASSERT_TRUE(r != nullptr);
   EXPECT_TRUE(error.empty());

   EXPECT_EQ(r->Rlocation("a/b"), dir + "/a/b");
@@ -291,14 +293,14 @@
 TEST_F(RunfilesTest, ManifestAndDirectoryBasedRunfilesRlocationAndEnvVars) {
   unique_ptr<MockFile> mf(MockFile::Create(
       "foo" LINE_AS_STRING() ".runfiles/MANIFEST", {"a/b c/d"}));
-  EXPECT_TRUE(mf != nullptr);
+  ASSERT_TRUE(mf != nullptr);
   string dir = mf->DirName();

   string error;
   unique_ptr<Runfiles> r(
       Runfiles::Create("ignore-argv0", mf->Path(), "", &error));

-  ASSERT_NE(r, nullptr);
+  ASSERT_TRUE(r != nullptr);
   EXPECT_TRUE(error.empty());
   EXPECT_EQ(r->Rlocation("a/b"), "c/d");
   EXPECT_EQ(r->Rlocation("c/d"), dir + "/c/d");
@@ -326,12 +328,12 @@
 TEST_F(RunfilesTest, ManifestBasedRunfilesEnvVars) {
   unique_ptr<MockFile> mf(
       MockFile::Create(string("foo" LINE_AS_STRING() ".runfiles_manifest")));
-  EXPECT_TRUE(mf != nullptr);
+  ASSERT_TRUE(mf != nullptr);

   string error;
   unique_ptr<Runfiles> r(
       Runfiles::Create("ignore-argv0", mf->Path(), "", &error));
-  ASSERT_NE(r, nullptr);
+  ASSERT_TRUE(r != nullptr);
   EXPECT_TRUE(error.empty());

   AssertEnvvars(*r, mf->Path(), "");
@@ -345,8 +347,9 @@
       0, mf->Path().size() - string(".runfiles/dummy").size()));

   string error;
-  unique_ptr<Runfiles> r(Runfiles::Create(argv0, "", "", &error));
-  ASSERT_NE(r, nullptr);
+  unique_ptr<Runfiles> r(Runfiles::Create(argv0, /*runfiles_manifest_file=*/"",
+                                          /*runfiles_dir=*/"", &error));
+  ASSERT_TRUE(r != nullptr);
   EXPECT_TRUE(error.empty());

   EXPECT_EQ(r->Rlocation("a/b"), argv0 + ".runfiles/a/b");
@@ -364,7 +367,7 @@

   string error;
   unique_ptr<Runfiles> r(Runfiles::Create("ignore-argv0", "", dir, &error));
-  ASSERT_NE(r, nullptr);
+  ASSERT_TRUE(r != nullptr);
   EXPECT_TRUE(error.empty());

   EXPECT_EQ(r->Rlocation("a/b"), dir + "/a/b");
@@ -378,22 +381,23 @@
 TEST_F(RunfilesTest, FailsToCreateAnyRunfilesBecauseEnvvarsAreNotDefined) {
   unique_ptr<MockFile> mf(
       MockFile::Create(string("foo" LINE_AS_STRING() ".runfiles/MANIFEST")));
-  EXPECT_TRUE(mf != nullptr);
+  ASSERT_TRUE(mf != nullptr);

   string error;
   unique_ptr<Runfiles> r(
       Runfiles::Create("ignore-argv0", mf->Path(), "whatever", &error));
-  ASSERT_NE(r, nullptr);
+  ASSERT_TRUE(r != nullptr);
   EXPECT_TRUE(error.empty());

   // We create a directory as a side-effect of creating a mock file.
   mf.reset(MockFile::Create(string("foo" LINE_AS_STRING() ".runfiles/dummy")));
   r.reset(Runfiles::Create("ignore-argv0", "", mf->DirName(), &error));
-  ASSERT_NE(r, nullptr);
-  EXPECT_TRUE(error.empty());
-
-  r.reset(Runfiles::Create("ignore-argv0", "", "", &error));
-  ASSERT_EQ(r, nullptr);
+  ASSERT_TRUE(r != nullptr);
+  EXPECT_TRUE(error.empty());
+
+  r.reset(Runfiles::Create("ignore-argv0", /*runfiles_manifest_file=*/"",
+                           /*runfiles_dir=*/"", &error));
+  EXPECT_EQ(r, nullptr);
   EXPECT_NE(error.find("cannot find runfiles"), string::npos);
 }

@@ -419,7 +423,7 @@
   {
     unique_ptr<MockFile> mf(
         MockFile::Create(string("foo" LINE_AS_STRING() "/bar1/qux")));
-    EXPECT_TRUE(mf != nullptr);
+    ASSERT_TRUE(mf != nullptr);
     path = mf->Path();

     std::ifstream stm(path);
@@ -436,7 +440,7 @@
   {
     unique_ptr<MockFile> mf(MockFile::Create(
         string("foo" LINE_AS_STRING() "/bar2/qux"), vector<string>()));
-    EXPECT_TRUE(mf != nullptr);
+    ASSERT_TRUE(mf != nullptr);
     path = mf->Path();

     std::ifstream stm(path);
@@ -454,7 +458,7 @@
     unique_ptr<MockFile> mf(
         MockFile::Create(string("foo" LINE_AS_STRING() "/bar3/qux"),
                          {"hello world", "you are beautiful"}));
-    EXPECT_TRUE(mf != nullptr);
+    ASSERT_TRUE(mf != nullptr);
     path = mf->Path();

     std::ifstream stm(path);
@@ -617,18 +621,20 @@
        "protobuf~3.19.2/foo/runfile C:/Actual Path\\protobuf\\runfile",
        "_main/bar/runfile /the/path/./to/other//other runfile.txt",
        "protobuf~3.19.2/bar/dir E:\\Actual Path\\Directory"}));
-  EXPECT_TRUE(mf != nullptr);
+  ASSERT_TRUE(mf != nullptr);
   unique_ptr<MockFile> rm(MockFile::Create(
       "foo" + uid + ".repo_mapping",
       {",my_module,_main", ",my_protobuf,protobuf~3.19.2",
        ",my_workspace,_main", "protobuf~3.19.2,protobuf,protobuf~3.19.2"}));
-  EXPECT_TRUE(rm != nullptr);
+  ASSERT_TRUE(rm != nullptr);
   string argv0(mf->Path().substr(
       0, mf->Path().size() - string(".runfiles_manifest").size()));

   string error;
-  unique_ptr<Runfiles> r(Runfiles::Create(argv0, "", "", "", &error));
-  ASSERT_NE(r, nullptr);
+  unique_ptr<Runfiles> r(Runfiles::Create(argv0, /*runfiles_manifest_file=*/"",
+                                          /*runfiles_dir=*/"",
+                                          /*source_repository=*/"", &error));
+  ASSERT_TRUE(r != nullptr);
   EXPECT_TRUE(error.empty());

   EXPECT_EQ(r->Rlocation("my_module/bar/runfile"),
@@ -673,19 +679,20 @@
        "protobuf~3.19.2/foo/runfile C:/Actual Path\\protobuf\\runfile",
        "_main/bar/runfile /the/path/./to/other//other runfile.txt",
        "protobuf~3.19.2/bar/dir E:\\Actual Path\\Directory"}));
-  EXPECT_TRUE(mf != nullptr);
+  ASSERT_TRUE(mf != nullptr);
   unique_ptr<MockFile> rm(MockFile::Create(
       "foo" + uid + ".repo_mapping",
       {",my_module,_main", ",my_protobuf,protobuf~3.19.2",
        ",my_workspace,_main", "protobuf~3.19.2,protobuf,protobuf~3.19.2"}));
-  EXPECT_TRUE(rm != nullptr);
+  ASSERT_TRUE(rm != nullptr);
   string argv0(mf->Path().substr(
       0, mf->Path().size() - string(".runfiles_manifest").size()));

   string error;
-  unique_ptr<Runfiles> r(
-      Runfiles::Create(argv0, "", "", "protobuf~3.19.2", &error));
-  ASSERT_NE(r, nullptr);
+  unique_ptr<Runfiles> r(Runfiles::Create(argv0, /*runfiles_manifest_file=*/"",
+                                          /*runfiles_dir=*/"",
+                                          "protobuf~3.19.2", &error));
+  ASSERT_TRUE(r != nullptr);
   EXPECT_TRUE(error.empty());

   EXPECT_EQ(r->Rlocation("protobuf/foo/runfile"),
@@ -723,19 +730,21 @@
   string uid = LINE_AS_STRING();
   unique_ptr<MockFile> dir_marker(
       MockFile::Create("foo" + uid + ".runfiles/marker"), {});
-  EXPECT_TRUE(dir_marker != nullptr);
+  ASSERT_TRUE(dir_marker != nullptr);
   string dir = dir_marker->DirName();
   unique_ptr<MockFile> rm(MockFile::Create(
       "foo" + uid + ".repo_mapping",
       {",my_module,_main", ",my_protobuf,protobuf~3.19.2",
        ",my_workspace,_main", "protobuf~3.19.2,protobuf,protobuf~3.19.2"}));
-  EXPECT_TRUE(rm != nullptr);
+  ASSERT_TRUE(rm != nullptr);
   string argv0(
       rm->Path().substr(0, rm->Path().size() - string(".repo_mapping").size()));

   string error;
-  unique_ptr<Runfiles> r(Runfiles::Create(argv0, "", "", "", &error));
-  ASSERT_NE(r, nullptr);
+  unique_ptr<Runfiles> r(Runfiles::Create(argv0, /*runfiles_manifest_file=*/"",
+                                          /*runfiles_dir=*/"",
+                                          /*source_repository=*/"", &error));
+  ASSERT_TRUE(r != nullptr);
   EXPECT_TRUE(error.empty());

   EXPECT_EQ(r->Rlocation("my_module/bar/runfile"), dir + "/_main/bar/runfile");
@@ -772,20 +781,21 @@
   string uid = LINE_AS_STRING();
   unique_ptr<MockFile> dir_marker(
       MockFile::Create("foo" + uid + ".runfiles/marker"), {});
-  EXPECT_TRUE(dir_marker != nullptr);
+  ASSERT_TRUE(dir_marker != nullptr);
   string dir = dir_marker->DirName();
   unique_ptr<MockFile> rm(MockFile::Create(
       "foo" + uid + ".repo_mapping",
       {",my_module,_main", ",my_protobuf,protobuf~3.19.2",
        ",my_workspace,_main", "protobuf~3.19.2,protobuf,protobuf~3.19.2"}));
-  EXPECT_TRUE(rm != nullptr);
+  ASSERT_TRUE(rm != nullptr);
   string argv0(
       rm->Path().substr(0, rm->Path().size() - string(".repo_mapping").size()));

   string error;
-  unique_ptr<Runfiles> r(
-      Runfiles::Create(argv0, "", "", "protobuf~3.19.2", &error));
-  ASSERT_NE(r, nullptr);
+  unique_ptr<Runfiles> r(Runfiles::Create(argv0, /*runfiles_manifest_file=*/"",
+                                          /*runfiles_dir=*/"",
+                                          "protobuf~3.19.2", &error));
+  ASSERT_TRUE(r != nullptr);
   EXPECT_TRUE(error.empty());

   EXPECT_EQ(r->Rlocation("protobuf/foo/runfile"),
@@ -819,20 +829,22 @@
   string uid = LINE_AS_STRING();
   unique_ptr<MockFile> dir_marker(
       MockFile::Create("foo" + uid + ".runfiles/marker"), {});
-  EXPECT_TRUE(dir_marker != nullptr);
+  ASSERT_TRUE(dir_marker != nullptr);
   string dir = dir_marker->DirName();
   unique_ptr<MockFile> rm(MockFile::Create(
       "foo" + uid + ".repo_mapping",
       {",my_module,_main", ",my_protobuf,protobuf~3.19.2",
        ",my_workspace,_main", "protobuf~3.19.2,protobuf,protobuf~3.19.2"}));
-  EXPECT_TRUE(rm != nullptr);
+  ASSERT_TRUE(rm != nullptr);
   string argv0(
       rm->Path().substr(0, rm->Path().size() - string(".repo_mapping").size()));

   string error;
-  unique_ptr<Runfiles> r(Runfiles::Create(argv0, "", "", "", &error));
+  unique_ptr<Runfiles> r(Runfiles::Create(argv0, /*runfiles_manifest_file=*/"",
+                                          /*runfiles_dir=*/"",
+                                          /*source_repository=*/"", &error));
   r = r->WithSourceRepository("protobuf~3.19.2");
-  ASSERT_NE(r, nullptr);
+  ASSERT_TRUE(r != nullptr);
   EXPECT_TRUE(error.empty());

   EXPECT_EQ(r->Rlocation("protobuf/foo/runfile"),
@@ -865,17 +877,19 @@
   string uid = LINE_AS_STRING();
   unique_ptr<MockFile> dir_marker(
       MockFile::Create("foo" + uid + ".runfiles/marker"), {});
-  EXPECT_TRUE(dir_marker != nullptr);
+  ASSERT_TRUE(dir_marker != nullptr);
   string dir = dir_marker->DirName();
   unique_ptr<MockFile> rm(
       MockFile::Create("foo" + uid + ".repo_mapping", {"a,b"}));
-  EXPECT_TRUE(rm != nullptr);
+  ASSERT_TRUE(rm != nullptr);
   string argv0(
       rm->Path().substr(0, rm->Path().size() - string(".repo_mapping").size()));

   string error;
-  unique_ptr<Runfiles> r(Runfiles::Create(argv0, "", "", "", &error));
-  ASSERT_EQ(r, nullptr);
+  unique_ptr<Runfiles> r(Runfiles::Create(argv0, /*runfiles_manifest_file=*/"",
+                                          /*runfiles_dir=*/"",
+                                          /*source_repository=*/"", &error));
+  EXPECT_EQ(r, nullptr);
   EXPECT_TRUE(error.find("bad repository mapping") != string::npos);
 }


fixed another problem in choosing a function with volatile-side-effect

--- src/Function.cpp
+++ src/Function.cpp
@@ -250,10 +250,10 @@
 	vector<Function *>::iterator i;

 	for (i = funcs.begin(); i != funcs.end(); ++i) {
-        // skip any function which has incompatible return type
-        // if type = 0, we don't care
-        if (type && !type->is_convertable((*i)->return_type))
-            continue;
+		// skip any function which has incompatible return type
+		// if type = 0, we don't care
+		if (type && !type->is_convertable((*i)->return_type))
+			continue;
 		if (qfer && (*i)->rv && !qfer->match((*i)->rv->qfer))
 			continue;
 		// We cannot call a function that has an as-yet unknown effect.
@@ -262,8 +262,16 @@
 			continue;
 		}
 		// We cannot call a function with a side-effect that is in conflict with the current context
-		if (cg_context.in_conflict((*i)->get_feffect())) {
-			continue;
+		if (CGOptions::strict_volatile_rule()) {
+			if (!((*i)->get_feffect().is_side_effect_free())
+			    && !cg_context.get_effect_context().is_side_effect_free()) {
+				continue;
+			}
+		}
+		else {
+			if (cg_context.in_conflict((*i)->get_feffect())) {
+				continue;
+			}
 		}
 		//// TODO: is this too strong for what we want?
 		//if (!((*i)->get_feffect().is_side_effect_free())


mavsdk_tests: increase time for manual tests

--- test/mavsdk_tests/test_multicopter_manual.cpp
+++ test/mavsdk_tests/test_multicopter_manual.cpp
@@ -42,7 +42,7 @@
 	tester.store_home();
 	tester.arm();
 	tester.fly_forward_in_posctl();
-	std::chrono::seconds until_disarmed_timeout = std::chrono::seconds(60);
+	std::chrono::seconds until_disarmed_timeout = std::chrono::seconds(90);
 	tester.wait_until_disarmed(until_disarmed_timeout);
 	tester.check_home_not_within(5.f);
 }
@@ -55,7 +55,7 @@
 	tester.store_home();
 	tester.arm();
 	tester.fly_forward_in_altctl();
-	std::chrono::seconds until_disarmed_timeout = std::chrono::seconds(60);
+	std::chrono::seconds until_disarmed_timeout = std::chrono::seconds(90);
 	tester.wait_until_disarmed(until_disarmed_timeout);
 	tester.check_home_not_within(5.f);
 }


Include header for numeric_limits directly

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

--- src/utils/xdr_cxx.C
+++ src/utils/xdr_cxx.C
@@ -20,6 +20,7 @@

 // C/C++ includes
 #include <cstring>
+#include <limits>

 // Local includes
 #include "xdr_cxx.h"


Remove iterator boilerplate in Xdr.

Remove iterator boilerplate in Xdr.

--- src/utils/xdr_cxx.C
+++ src/utils/xdr_cxx.C
@@ -534,9 +534,8 @@
   unsigned int length = cast_int<unsigned int>(a.size());
   bool b = xdr_u_int(x, &length);
   a.resize(length);
-  typename std::vector<std::complex<T>>::iterator iter = a.begin();
-  for (; iter != a.end(); ++iter)
-    if (!xdr_translate(x, *iter))
+  for (auto & val : a)
+    if (!xdr_translate(x, val))
       b = false;
   return b;
 }
@@ -547,9 +546,8 @@
   unsigned int length = cast_int<unsigned int>(s.size());
   bool b = xdr_u_int(x, &length);
   s.resize(length);
-  std::vector<std::string>::iterator iter = s.begin();
-  for (; iter != s.end(); ++iter)
-    if (!xdr_translate(x, *iter))
+  for (auto & val : s)
+    if (!xdr_translate(x, val))
       b = false;
   return b;
 }


Refactor log messages using stringstream

--- src/GameProc.cpp
+++ src/GameProc.cpp
@@ -143,13 +143,12 @@

     LOG("Initializing SDL_mixer ..." );

-    string strLog;
+    stringstream ss;

     if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0)
     {
-        strLog = string("SDL Error: ...failed to open SDL_INIT_AUDIO:  ");
-        strLog.append(SDL_GetError());
-        LOG(strLog);
+        ss << "SDL Error: ...failed to open SDL_INIT_AUDIO:  " << SDL_GetError();
+        LOG(ss.str());
         // XXX Should we continue?
     }

@@ -157,11 +156,10 @@
     int flags_supported = Mix_Init(flags_required);

     if(flags_supported & flags_required != flags_required) {
-        strLog.clear();
-        strLog.append("SDL_mixer failed to initialize! Game will start without sound.");
-        strLog.append("SDL_mixer error: ");
-        strLog.append(SDL_GetError());
-        LOG(strLog);
+        ss.str("");
+        ss << "SDL_mixer failed to initialize! Game will start without sound."
+            << "SDL_mixer error: " << SDL_GetError();
+        LOG(ss.str());
     }
     else
     {
@@ -170,11 +168,10 @@

         /* initialize sdl mixer, open up the audio device */
         if (Mix_OpenAudio(mixrate, MIX_DEFAULT_FORMAT, 2, 4096) < 0) {
-            strLog.clear();
-            strLog.append("SDL_mixer failed to initialize!.");
-            strLog.append("SDL_mixer error: ");
-            strLog.append(SDL_GetError());
-            LOG(strLog);
+            ss.str("");
+            ss << "SDL_mixer failed to initialize!."
+                << "SDL_mixer error: " << SDL_GetError();
+            LOG(ss.str());
         }
         else
         {
@@ -188,7 +185,7 @@
                 int sample_size = bits / 8 + audio_channels;
                 int rate = audio_rate;

-                stringstream ss;
+                ss.str("");
                 ss << "SDL_mixer: Opened audio at " << audio_rate << " Hz " << bits << " bit "
                     << (audio_channels > 1 ? "stereo" : "mono");
                 LOG(ss.str());


fixing cavityRetetrahedralization for LCC representation

--- cdtGen.cpp
+++ cdtGen.cpp
@@ -1114,7 +1114,7 @@

 }

-bool isStronglyDelaunay(DartHandle facetHandle, unordered_set<unsigned int> cavityVerticesSet)
+bool isStronglyDelaunay(DartHandle facetHandle, vector<DartHandle> cavityVerticesSet, LCC cavityLCC)
 {
 	// tests whether facet/triangle pointed to by facetHandle is strongly Delaunay wrt. vertices in cavityVerticesSet

@@ -1126,10 +1126,10 @@
 		// If no, then it is not even Delaunay, return false

 	Delaunay tempDT;
-	vector<Point> cavityVertices;
-
-	for (unordered_set<unsigned int>::iterator vertexIter = cavityVerticesSet.begin(); vertexIter != cavityVerticesSet.end(); vertexIter++)
-		cavityVertices.push_back(plcVertices[*vertexIter].first);
+	vector<CGALPoint> cavityVertices;
+
+	for (vector<DartHandle>::iterator vertexIter = cavityVerticesSet.begin(), vertexIter = cavityVerticesSet.end(); vertexIter != vertexIterEnd; vertexIter++)
+		cavityVertices.push_back(cavityLCC.point(vertexIter));

 	// Compute DT
@@ -1138,15 +1138,15 @@
 	// test strong Delaunay criteria
 	VertexHandle vh[3];
 	int i, j, k, h = 0;
-	Delaunay::Cell_handle ch;
-
-	for (lcc::One_dart_per_incident_cell_range<0, 2>::iterator iter = cdtMesh.one_dart_per_incident_cell<0, 2>(facetHandle).begin(); iter != cdtMesh.one_dart_per_incident_cell<0, 2>(facetHandle).end(); iter++)
-		tempDT.is_vertex(plcVertices[cdtMesh.info<0>(iter)].first, vh[h++]);
+	CellHandle ch;
+
+	for (LCC::One_dart_per_incident_cell_range<0, 2>::iterator iter = cavityLCC.one_dart_per_incident_cell<0, 2>(facetHandle).begin(), iterEnd != cdtMesh.one_dart_per_incident_cell<0, 2>(facetHandle).end(); iter != iterEnd; iter++)
+		tempDT.is_vertex(cavityLCC.point(iter), vh[h++]);

 	if (tempDT.is_facet(vh[0], vh[1], vh[2], ch, i, j, k))
 	{
-		Sphere s(vh[0]->point(), vh[1]->point(), vh[2]->point(), ((*ch).vertex(6 - i - j - k))->point());
+		CGALSphere s(vh[0]->point(), vh[1]->point(), vh[2]->point(), ((*ch).vertex(6 - i - j - k))->point());

 		for (vector<Point>::iterator vIter = cavityVertices.begin(); vIter != cavityVertices.end(); vIter++)
 		{
@@ -1258,14 +1258,12 @@
 }

-
-
 void cavityRetetrahedralization(vector <DartHandle>& cavity, vector<DartHandle>& lcc3CellsToBeRemoved)
 {

 	// cavity verification/expansion
 		// for all faces 'f' in upper(or lower) cavity,
-			// Form a queue Q of all non-strongly Delunay faces in cavity C
+			// Form a queue Q of all non-strongly Delaunay faces in cavity C
 			// If f is not strongly Deluanay,
 				// Remove f from cavity list
 				// For all tetrahedra t sharing f
@@ -1274,139 +1272,115 @@
 							// add it to cavity
 						// Else
 							// remove it from cavity
-						// Cavity C and set of vertices of cavity V
+						// Modify C and set of vertices V of cavity
 			// repeat untill all faces of cavity are strongly Delaunay
+
+
+	LCC cavityLCC;
+	createLCCRepresentationForCavity(cavity, cavityLCC, cavityLCCTocdtMeshDartMap);
+
+
+
 	vector<DartHandle> nonStronglyDelaunayFacesInCavity;
-	unordered_set<unsigned int> cavityVerticesSet;
+	vector<DartHandle> cavityVerticesSet; // V

 	// compute set of non-strongly Delunay faces in cavity
-
-
-
-		do
-		{
-			for (unsigned int k = 0; k < cavity.size(); k++)
-			{
-				// get set of all vertices of cavity
-					// create set of vertex ids from the vertexAttribute of all vertices of each facet in cavity
-					// add vertex ids to cavityVertices array
-				for (lcc::One_dart_per_incident_cell_range<0,2>::iterator vertexIter = cdtMesh.one_dart_per_incident_cell<0,2>(cavity[k]).begin(); vertexIter != cdtMesh.one_dart_per_incident_cell<0,2>(cavity[k]).end(); vertexIter++)
-		         		cavityVerticesSet.insert(cdtMesh.info<0>(vertexIter));
+	do
+	{
+		for (LCC::One_dart_per_cell_range<0>::iterator vertexIter = cavityLCC.one_dart_per_cell<0>().begin(), vertexIterEnd = cavityLCC.one_dart_per_cell<0>().end(); vertextIter != vertexIterEnd; vertexIter++)
+			cavityVerticesSet.push_back(vertexIter);
+
+		for (LCC::One_dart_per_cell_range<2>::iterator facetIter = cavityLCC.one_dart_per_cell<2>().begin(), facetIterEnd = cavityLCC.one_dart_per_cell<2>().end(); facetIter != facetIterEnd; facetIter++)
+		{
+			if (isStronglyDelaunay(facetIter, cavityVerticesSet, cavityLCC))
+		        	continue;
+			else
+				nonStronglyDelaunayFacesInCavity.push_back(facetIter);
+		}
+
+		// For each non strongly Delunay face
+		// remove face from cavity[i]
+		// find tets from cdtMesh sharing it:
+		// for each such tet t:
+			// for all facets F of t, F != f
+			// if F is in cavity[i]
+				// remove F from cavity[i]
+			// else,
+				// add F to cavity[i]
+
+		for (unsigned int h = 0; h < nonStronglyDelaunayFacesInCavity.size(); h++)
+		{
+			DartHandle tempNonStronglyDelaunayFacet = nonStronglyDelaunayFacesInCavity.back();
+			nonStronglyDelaunayFacesInCavity.pop_back();
+
+			// find tet from cdtMesh sharing it:
+			DartHandle cellToBeRemovedHandle = cavityLCCTocdtMeshDartMap[tempNonStronglyDelaunayFacet];
+			lcc3CellsToBeRemoved.push_back(cellToBeRemovedHandle);
+
+			for (LCC::One_dart_per_incident_cell_range<2, 3>::iterator faceIter = cdtMesh.one_dart_per_incident_cell<2, 3>(cellToBeRemovedHandle).begin(), faceIterEnd != cdtMesh.one_dart_per_incident_cell<2, 3>(cellToBeRemovedHandle).end(); facetIter != facetIterEnd; faceIter++)
+			{
+				if ((facetPosition2 = locateFacetInCavity(faceIter, cavity)) != -1)
+					cavityLCC.erase(cavity.begin(), cavity.begin() + facetPosition2);
+				else // add facet to the cavity
+					cavityLCC.push_back(faceIter);
+			}
+			// remove facet from cavity
+			cavityLCC.remove_cell<2>(tempNonStronglyDelaunayFacet);
+		}
+	}while(nonStronglyDelaunayFacesInCavity.size() != 0);
+
+
+	// Remove cells from cdtMesh(creates space for retetrahedralization)
+	for (vector<DartHandle>::iterator cIter = lcc3CellsToBeRemoved.begin(); cIter != lcc3CellsToBeRemoved.end(); cIter++)
+		remove_cell<lcc, 3>(cdtMesh, *cIter);
+
+
+
+	// Cavity retetrahedralization:
+		// Compute DT of vertices of input cavity
+		// import it to lcc

-			}
-
-			for (vector<DartHandle>::iterator iter = cavity.begin(); iter != cavity.end(); iter++)
-			{
-				if (isStronglyDelaunay(*iter, cavityVerticesSet))
-			        	continue;
-				else
-					nonStronglyDelaunayFacesInCavity.push_back(*iter);
-			}
-
-
-		// For each non strongly Delunay face
-			// remove face from cavity[i]
-			// find tets from cdtMesh sharing it:
-			// for each such tet t:
-				// for all facets F of t, F != f
-				// if F is in cavity[i]
-					// remove F from cavity[i]
-				// else,
-					// add F to cavity[i]
-
-			for (unsigned int h = 0; h < nonStronglyDelaunayFacesInCavity.size(); h++)
-			{
-				DartHandle tempNonStronglyDelaunayFacet = nonStronglyDelaunayFacesInCavity.back();
-				nonStronglyDelaunayFacesInCavity.pop_back();
-
-				unsigned int facetPosition1, facetPosition2;
-				if ((facetPosition1 = locateFacetInCavity(tempNonStronglyDelaunayFacet, cavity)) != -1) // found,
-				{
+			// create an unordered set of vertex info
+			// insert all vertices of set to DT
+	cavityVerticesSet.clear();
+
+	for (vector<DartHandle>::iterator facetIter = cavity.begin(); facetIter != cavity.end(); facetIter++)
+		for (lcc::One_dart_per_incident_cell_range<0, 2>::iterator vertexIter = cdtMesh.one_dart_per_incident_cell<0, 2>(*facetIter).begin(); vertexIter != cdtMesh.one_dart_per_incident_cell<0, 2>(*facetIter).end(); vertexIter++)
+			cavityVerticesSet.insert(cdtMesh.info<0>(vertexIter));
+
+
+	// create a vector of vertices of cavity
+	vector <pair<Point, unsigned int> > cavityVertices;
+	for (unordered_set<unsigned int>::iterator pointIdIter = cavityVerticesSet.begin(); pointIdIter != cavityVerticesSet.end(); pointIdIter++)
+		cavityVertices.push_back(plcVertices[*pointIdIter]);
+
+
+	//create cavity vertices
+	Delaunay cavityDT;
+	lcc cavityLCC;
+
+	cavityDT.insert(cavityVertices.begin(), cavityVertices.end());
+
+	map<Delaunay::Cell_handle, lcc::Dart_handle> *dtCellToLCCCellMap;
+	import_from_triangulation_3(cavityLCC, cavityDT, dtCellToLCCCellMap);
+	copyInfoFromDTToLCC(cavityDT, cavityLCC, dtCellToLCCCellMap);
+
+	// Sew retetrahedralized cavity back to original cdtMesh
+	// Add cavityLCC to cdtMesh
+	Point_3<K> tempPt[4];
+	unsigned int x;
+
+	for (lcc::One_dart_per_cell_range<3>::iterator cIter = cavityLCC.one_dart_per_cell<3>().begin(); cIter != cavityLCC.one_dart_per_cell<3>().end(); cIter++)
+	{
+		x = 0;
+
+		for (lcc::One_dart_per_incident_cell_range<0, 3>::iterator vIter = cavityLCC.one_dart_per_incident_cell<0, 3>(cIter).begin(); vIter != cavityLCC.one_dart_per_incident_cell<0, 3>(cIter).end(); vIter++)
+			tempPt[x++] = cdtMesh.point(vIter);

-					// find tet from cdtMesh sharing it:
-					for (lcc::One_dart_per_incident_cell_range<2, 3>::iterator cellIter = cdtMesh.one_dart_per_incident_cell<2, 3>(tempNonStronglyDelaunayFacet).begin(); cellIter != cdtMesh.one_dart_per_incident_cell<2, 3>(tempNonStronglyDelaunayFacet).end(); cellIter++)
-					{
-						if (isCellOutsideCavity(cellIter, cavity))
-						{
-
-							lcc3CellsToBeRemoved.push_back(cellIter);
-
-							for (lcc::One_dart_per_incident_cell_range<2, 3>::iterator faceIter = cdtMesh.one_dart_per_incident_cell<2, 3>(cellIter).begin(); faceIter != cdtMesh.one_dart_per_incident_cell<2, 3>(cellIter).end(); faceIter++)
-							{
-								if ((facetPosition2 = locateFacetInCavity(faceIter, cavity)) != -1)
-									cavity.erase(cavity.begin(), cavity.begin() + facetPosition2);
-								else // add facet to the cavity
-									cavity.push_back(faceIter);
-							}
-						}
-
-						else
-							continue; // skip and check next neighbor cell
-
-					}
-					// remove facet from cavity
-					cavity.erase(cavity.begin(), cavity.begin() + facetPosition1);
-
-				}
-
-			}
-		}while(nonStronglyDelaunayFacesInCavity.size() != 0);
-
-
-
-
-
-		// Remove cells from cdtMesh(creates space for retetrahedralization)
-		for (vector<DartHandle>::iterator cIter = lcc3CellsToBeRemoved.begin(); cIter != lcc3CellsToBeRemoved.end(); cIter++)
-			remove_cell<lcc, 3>(cdtMesh, *cIter);
-
-
-
-		// Cavity retetrahedralization:
-			// Compute DT of vertices of input cavity
-			// import it to lcc
-
-				// create an unordered set of vertex info
-				// insert all vertices of set to DT
-		cavityVerticesSet.clear();
-
-		for (vector<DartHandle>::iterator facetIter = cavity.begin(); facetIter != cavity.end(); facetIter++)
-			for (lcc::One_dart_per_incident_cell_range<0, 2>::iterator vertexIter = cdtMesh.one_dart_per_incident_cell<0, 2>(*facetIter).begin(); vertexIter != cdtMesh.one_dart_per_incident_cell<0, 2>(*facetIter).end(); vertexIter++)
-				cavityVerticesSet.insert(cdtMesh.info<0>(vertexIter));
-
-
-		// create a vector of vertices of cavity
-		vector <pair<Point, unsigned int> > cavityVertices;
-		for (unordered_set<unsigned int>::iterator pointIdIter = cavityVerticesSet.begin(); pointIdIter != cavityVerticesSet.end(); pointIdIter++)
-			cavityVertices.push_back(plcVertices[*pointIdIter]);
-
-
-		//create cavity vertices
-		Delaunay cavityDT;
-		lcc cavityLCC;
-
-		cavityDT.insert(cavityVertices.begin(), cavityVertices.end());
-
-		map<Delaunay::Cell_handle, lcc::Dart_handle> *dtCellToLCCCellMap;
-		import_from_triangulation_3(cavityLCC, cavityDT, dtCellToLCCCellMap);
-		copyInfoFromDTToLCC(cavityDT, cavityLCC, dtCellToLCCCellMap);
-
-		// Sew retetrahedralized cavity back to original cdtMesh
-		// Add cavityLCC to cdtMesh
-		Point_3<K> tempPt[4];
-		unsigned int x;
-
-		for (lcc::One_dart_per_cell_range<3>::iterator cIter = cavityLCC.one_dart_per_cell<3>().begin(); cIter != cavityLCC.one_dart_per_cell<3>().end(); cIter++)
-		{
-			x = 0;
-
-			for (lcc::One_dart_per_incident_cell_range<0, 3>::iterator vIter = cavityLCC.one_dart_per_incident_cell<0, 3>(cIter).begin(); vIter != cavityLCC.one_dart_per_incident_cell<0, 3>(cIter).end(); vIter++)
-				tempPt[x++] = cdtMesh.point(vIter);
-
-			cdtMesh.make_tetrahedron(tempPt[0], tempPt[1], tempPt[2], tempPt[3]);
-		}
-
-		cdtMesh.sew3_same_facets();
+		cdtMesh.make_tetrahedron(tempPt[0], tempPt[1], tempPt[2], tempPt[3]);
+	}
+
+	cdtMesh.sew3_same_facets();

 }


works upto initial Delaunay tetrahedralization

--- cdtGen.cpp
+++ cdtGen.cpp
@@ -1,6 +1,6 @@
 #include <string.h>
 #include <iostream>
-#include <unordered_set>
+//#include <unordered_set>
 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
 #include <CGAL/Point_3.h>
 #include <CGAL/Delaunay_triangulation_3.h>
@@ -13,8 +13,8 @@

 typedef Exact_predicates_inexact_constructions_kernel K;
-typedef Point_3<K> Point;
 typedef Delaunay_triangulation_3<K> Delaunay;
+typedef Delaunay::Point Point;
 typedef Delaunay::Vertex_handle Vertex_handle;

 /*
@@ -25,19 +25,22 @@
 class Segment
 {
 	public:
-		unsigned int vertexIds[2]; // index into the plcVertices vector
+		unsigned int pointIds[2]; // index into the plcVertices vector
+
 };

 class Triangle
 {
 	public:
-		unsigned int vertexIds[3];
+		unsigned int pointIds[3];
+
 };

 class Tetrahedron
 {
 	public:
-		unsigned int vertexIds[4];
+		unsigned int pointIds[4];
+
 };

@@ -52,7 +55,8 @@
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

-static unsigned int tempPoint[3];
+static float tempPoint[3];
+
 unsigned int dimensionId = 0;
 static unsigned pointId = 0;

@@ -66,16 +70,19 @@
 	// insert the vertex into plcVertex
 	if (eol)
 	{
-		plcVertices.insert(Point(tempPoint[0],tempPoint[1],tempPoint[2]));
+
+		plcVertices.push_back(Point(tempPoint[0],tempPoint[1],tempPoint[2]));
 		dimensionId = 0;

 	}
+
+	return 1;
 }

 static int face_cb(p_ply_argument argument)
 {
 	long length, value_index;
-        static TriangleFace tempFace;
+        static Triangle tempFace;

 	ply_get_argument_property(argument, NULL, &length, &value_index);

@@ -83,37 +90,37 @@
 	{
         	case 0:
 	        case 1:
-        		tempFace.vertexIds[pointId++] = ply_get_argument_value(argument);
+        		tempFace.pointIds[pointId++] = ply_get_argument_value(argument);
+
 	                break;
         	case 2:
-			tempFace.vertexIds[pointId] = ply_get_argument_value(argument);
+			tempFace.pointIds[pointId] = ply_get_argument_value(argument);
 			pointId = 0;
-			plcFaces.push(tempFace);
+			plcFaces.push_back(tempFace);

 			// extract corresponding segments as well
 			Segment tempSegments[3]; // each face will give 3 segments

-			tempSegments[0].vertexIds[0] = tempFace.pointIds[0];
-			tempSegments[0].vertexIds[1] = tempFace.pointIds[1];
+			tempSegments[0].pointIds[0] = tempFace.pointIds[0];
+			tempSegments[0].pointIds[1] = tempFace.pointIds[1];

-			tempSegments[1].vertexIds[0] = tempFace.pointIds[1];
-			tempSegments[1].vertexIds[1] = tempFace.pointIds[2];
-
-
-			tempSegments[2].vertexIds[0] = tempFace.pointIds[2]
-			tempSegments[2].vertexIds[1] = tempFace.pointIds[3];
-
-
-			plcSegments.push(tempSegments[0]);
-			plcSegments.push(tempSegments[1]);
-			plcSegments.push(tempSegments[2]);
+			tempSegments[1].pointIds[0] = tempFace.pointIds[1];
+			tempSegments[1].pointIds[1] = tempFace.pointIds[2];
+
+			tempSegments[2].pointIds[0] = tempFace.pointIds[2];
+			tempSegments[2].pointIds[1] = tempFace.pointIds[3];
+
+
+			plcSegments.push_back(tempSegments[0]);
+			plcSegments.push_back(tempSegments[1]);
+			plcSegments.push_back(tempSegments[2]);

 			break;
         	default:
-                	cout << "Invalid number of points in a face specified :(";
-			break;
+                	break;
         }

+	return 1;
 }

 // reads input PLC
@@ -130,12 +137,6 @@
 	if (!inputPLY) exit(0);

         if (!ply_read_header(inputPLY)) exit(0);
-
-	if (!ply_read(inputPLY))
-	{
-		cout << "Cannot read the PLY file :(";
-		exit(0);
-	}

 	// Initialize plcVertex and plcFaces
   	ply_set_read_cb(inputPLY, "vertex", "x", vertex_cb, NULL, 0);
@@ -143,8 +144,20 @@
 	ply_set_read_cb(inputPLY, "vertex", "z", vertex_cb, NULL, 1);

 	ply_set_read_cb(inputPLY, "face", "vertex_indices", face_cb, NULL, 0);
+	if (!ply_read(inputPLY))
+	{
+		cout << "Cannot read the PLY file :(";
+		exit(0);
+	}
+

 	ply_close(inputPLY);
+
+	cout << "Number of vertices:" << plcVertices.size() << "\n";
+	cout << "Number of faces:" << plcFaces.size() << "\n";
+	cout << "Number of segments:" << plcSegments.size();
+
+

 }
 //////////////////////////////////////////////////// Done with reading input PLC ////////////////////////////////////////////////
@@ -152,15 +165,21 @@
 void computeDelaunayTetrahedralization()
 {

-	list <Point> tempPointList;
+/*	vector<Point> tempPointList;
 	unsigned int i = 0;

 	for (map<unsigned, Point>::iterator pit = plcVertices.begin(); pit != plcVertices.end(); pit++, i++)
-		tempPointList.push(plcVertices.find(i)->second);
+		tempPointList.push_back(plcVertices.find(i)->second);

     	DT.insert(tempPointList.begin(), tempPointList.end());
-
-	cout << "\nInitial Delaunay tetrahedralization computed!!";
+*/
+	DT.insert(plcVertices.begin(), plcVertices.end());
+
+	cout << "\nDelaunay tetrahedralization computed!!\n";
+
+	cout << "Number of vertices in Delaunay tetrahedralization" << DT.number_of_vertices() << "\n";
+	cout << "Number of tetrahedrons in Delaunay tetrahedralization" << DT.number_of_cells() << "\n";
+
 }

@@ -213,7 +232,7 @@
 	float circumradiusMap[plcVertices.size() - 2]; // stores the circumradius value for all vertices for the triangle formed by missingsegment and vertex.
 	for (unsigned int n = 0; n < plcVertices.size(); n++)
 	{
-		if (n != missingSegment->verexIds[0] && n != missingSegment->vertexIds[1])
+		if (n != missingSegment->verexIds[0] && n != missingSegment->pointIds[1])
 			if (encroachingCandidateDistance <= smallestCircumsphere.radius) // encroaching vertex
 				circumradiusMap[n] = computeCircumradius(A, B, plcVertices[n]);
 			else // not encroaching
@@ -248,11 +267,11 @@
 	Vertex segment1Vertex[2];
 	Vertex segment2Vertex[2];

-	segment1Vertex[0] = getVertexbyId(segment1.vertexIds[0]);
-	segment1Vertex[1] = getVertexbyId(segment1.vertexIds[1]);
-
-	segment2Vertex[0] = getVertexbyId(segment2.vertexIds[0]);
-	segment2Vertex[1] = getVertexbyId(segment2.vertexIds[1]);
+	segment1Vertex[0] = getVertexbyId(segment1.pointIds[0]);
+	segment1Vertex[1] = getVertexbyId(segment1.pointIds[1]);
+
+	segment2Vertex[0] = getVertexbyId(segment2.pointIds[0]);
+	segment2Vertex[1] = getVertexbyId(segment2.pointIds[1]);

 	Vector vector1 = (segment1Vertex[0].x - segment1Vertex[1].x, segment1Vertex[0].y - segment1Vertex[1].y, segment1Vertex[0].z - segment1Vertex[1].z);
 	Vector vector2 = (segment2Vertex[0].x - segment2Vertex[1].x, segment2Vertex[0].y - segment2Vertex[1].y, segment2Vertex[0].z - segment2Vertex[1].z);
@@ -268,8 +287,8 @@
 float vectorMagnitude(Segment inputSegment)
 {
 	Vertex segmentVertices[2];
-	segmentVertices[0] = getVertexbyId(inputSegment.vertexIds[0]);
-	segmentVertices[1] = getVertexbyId(inputSegment.vertexIds[1]);
+	segmentVertices[0] = getVertexbyId(inputSegment.pointIds[0]);
+	segmentVertices[1] = getVertexbyId(inputSegment.pointIds[1]);

 	Vector vector = (segmentVertices[0].x - segmentVertices[1].x, segmentVertices[0].y - segmentVertices[1].y, segmentVertices[0].z - segmentVertices[1].z);

@@ -291,7 +310,7 @@

 	for (unsigned int n = 0; n < plcSegments.size(); n++)
 	{
-		if (plcSegments[n].vertexIds[0] == A.id || plcSegments[n].vertexIds[1] == A.id)
+		if (plcSegments[n].pointIds[0] == A.id || plcSegments[n].pointIds[1] == A.id)
 			incidentOnA.push(plcSegments[n]);
 	}

@@ -310,8 +329,8 @@

 	// if both endpoints of the segment are acute, type 1
 	// if only one endpoint acute, type 2
-	Vertex A = getVertexbyId(missingSegment->vertexIds[0]);
-	Vertex B = getVertexbyId(missingSegment->vertexIds[1]);
+	Vertex A = getVertexbyId(missingSegment->pointIds[0]);
+	Vertex B = getVertexbyId(missingSegment->pointIds[1]);

 	bool vertexAIsAcute = isVertexAcute(A);
 	bool vertexBIsAcute = isVertexAcute(B);
@@ -347,8 +366,8 @@
 	computeReferencePoint(refPoint);
 	segmentType = determineSegmentType(missingSegment);

-	Vertex A = getVertexbyId(missingSegment->vertexIds[0]);
-	Vertex B = getVertexbyId(missingSegment->vertexIds[1]);
+	Vertex A = getVertexbyId(missingSegment->pointIds[0]);
+	Vertex B = getVertexbyId(missingSegment->pointIds[1]);

 	float AP, PB, AB;

@@ -391,27 +410,27 @@

 		if (isVertexAcute(A))
-			acuteParentId = missingSegment->vertexIds[0];
+			acuteParentId = missingSegment->pointIds[0];
 	        else if (isVertexAcute(B))
-	       		acuteParentId = missingSegment->vertexIds[1];
+	       		acuteParentId = missingSegment->pointIds[1];
        		else
 	        {
 	        	if (A.acuteParentId != NULL)
 		       	{
 				acuteParentId = A.acuteParentId;
-				ApB.vertexIds[1] = missingSegment->vertexIds[1]; // ie. vertex B taken as the other endpoint
+				ApB.pointIds[1] = missingSegment->pointIds[1]; // ie. vertex B taken as the other endpoint
 		 		vbLength = computerSegmentLength(v, B);
 		       	}

 		       	else if (B.acuteParentId != NULL)
 			{
 				acuteParentId = B.acuteParentId;
-				ApB.vertexIds[1] = missingSegment->vertexIds[0]; // vertex A taken as the other endpoint
+				ApB.pointIds[1] = missingSegment->pointIds[0]; // vertex A taken as the other endpoint
        	        		vbLength = computerSegmentLength(v, A);
 			}
 		}

-		ApB.vertexIds[0] = acuteParentId;
+		ApB.pointIds[0] = acuteParentId;

 		Vertex *acuteParent = getVertexbyId(acuteParentId);


Add exponent to GlobeTranslation altitude slider

--- modules/globebrowsing/src/globetranslation.cpp
+++ modules/globebrowsing/src/globetranslation.cpp
@@ -125,6 +125,7 @@
     addProperty(_latitude);

     _altitude = p.altitude.value_or(_altitude);
+    _altitude.setExponent(10.f);
     _altitude.onChange([this]() { _positionIsDirty = true; });
     addProperty(_altitude);