Fix windows build

Fix windows build

--- src/main/main_windows.cpp
+++ src/main/main_windows.cpp
@@ -328,10 +328,10 @@
 		_hwnd = CreateWindowA("crown"
 			, "Crown"
 			, WS_OVERLAPPEDWINDOW | WS_VISIBLE
-			, opts->window_x()
-			, opts->window_y()
-			, opts->window_width()
-			, opts->window_height()
+			, opts->_window_x
+			, opts->_window_y
+			, opts->_window_width
+			, opts->_window_height
 			, 0
 			, NULL
 			, instance


Update mls-mpm88-explained.cpp

Update mls-mpm88-explained.cpp

fixed normalization

--- mls-mpm88-explained.cpp
+++ mls-mpm88-explained.cpp
@@ -122,7 +122,7 @@
     for(int j = 0; j <= n; j++) {
       auto &g = grid[i][j];
       // No need for epsilon here
-      if (g[2] <= 0) {
+      if (g[2] > 0) {
         // Normalize by mass
         g /= g[2];
         // Gravity
@@ -254,24 +254,24 @@
 Step 2: Compile and run

 * Linux:
-    g++ mls-mpm88.cpp -std=c++14 -g -lX11 -lpthread -O3 -o mls-mpm
+    g++ mls-mpm88-explained.cpp -std=c++14 -g -lX11 -lpthread -O3 -o mls-mpm
     ./mls-mpm

 * Windows (MinGW):
-    g++ mls-mpm88.cpp -std=c++14 -lgdi32 -lpthread -O3 -o mls-mpm
+    g++ mls-mpm88-explained.cpp -std=c++14 -lgdi32 -lpthread -O3 -o mls-mpm
     .\mls-mpm.exe

 * Windows (Visual Studio 2017+):
   - Create an "Empty Project"
-  - Use taichi.h as the only header, and mls-mpm88.cpp as the only source
+  - Use taichi.h as the only header, and mls-mpm88-explained.cpp as the only source
   - Change configuration to "Release" and "x64"
   - Press F5 to compile and run

 * OS X:
-    g++ mls-mpm88.cpp -std=c++14 -framework Cocoa -lpthread -O3 -o mls-mpm
+    g++ mls-mpm88-explained.cpp -std=c++14 -framework Cocoa -lpthread -O3 -o mls-mpm
     ./mls-mpm


Do not close the input if it hasn't been opened

--- src/gfx/qt.cpp
+++ src/gfx/qt.cpp
@@ -613,7 +613,6 @@
     if (avformat_open_input(&formatContext, imagePath.toUtf8().constData(), NULL, NULL))
     {
         LOG_warn << "Error opening video: " << imagePath;
-        avformat_close_input(&formatContext);
         return NULL;
     }


[OGRE-300] Apply GL state cache crash fix to GLES2 state cache.

--- RenderSystems/GLES2/src/StateCacheManager/OgreGLES2StateCacheManagerImp.cpp
+++ RenderSystems/GLES2/src/StateCacheManager/OgreGLES2StateCacheManagerImp.cpp
@@ -180,8 +180,7 @@

     void GLES2StateCacheManagerImp::invalidateStateForTexture(GLuint texture)
     {
-        TexUnitsMap::iterator it = mTexUnitsMap.find(texture);
-        mTexUnitsMap.erase(it);
+        mTexUnitsMap.erase(texture);
     }

     // TODO: Store as high/low bits of a GLuint, use vector instead of map for TexParameteriMap


Refactored function HTML_RESPONSE

Refactored function HTML_RESPONSE

--- examples/dualnic/service.cpp
+++ examples/dualnic/service.cpp
@@ -98,35 +98,39 @@

 std::string HTML_RESPONSE() {
-  int color = rand();
-  std::stringstream stream;
+  const int color = rand();

   /* HTML Fonts */
-  std::string ubuntu_medium  = "font-family: \'Ubuntu\', sans-serif; font-weight: 500; ";
-  std::string ubuntu_normal  = "font-family: \'Ubuntu\', sans-serif; font-weight: 400; ";
-  std::string ubuntu_light  = "font-family: \'Ubuntu\', sans-serif; font-weight: 300; ";
+  const std::string ubuntu_medium = "font-family: \'Ubuntu\', sans-serif; font-weight: 500; ";
+  const std::string ubuntu_normal = "font-family: \'Ubuntu\', sans-serif; font-weight: 400; ";
+  const std::string ubuntu_light  = "font-family: \'Ubuntu\', sans-serif; font-weight: 300; ";

   /* HTML */
-  stream << ""
+  std::stringstream stream;
+  stream << "<!DOCTYPE html>"
          << "<link href='https://fonts.googleapis.com/css?family=Ubuntu:500,300' rel='stylesheet' type='text/css'>"
          << ""
-         << "<h1 style= \"color: " << "#" << std::hex << (color >> 8) << "\">"
-         <<  "IncludeOS
"
+         << "<h1 style='color: #" << std::hex << (color >> 8) << "'>"
+         <<  "IncludeOS
"
          <<  "
Now speaks TCP!
"
-    // .... generate more dynamic content
+         // .... generate more dynamic content
          << "
  ...and can improvise http. With limitations of course, but it's been easier than expected so far
"
-         << "
 © 2015, Oslo and Akershus University College of Applied Sciences "
-         << "\n";
+         << "
 © 2015, Oslo and Akershus University College of Applied Sciences "
+         << "";

-  std::string html = stream.str();
+  const std::string html = stream.str();

-  std::string header="HTTP/1.1 200 OK \n "        \
-    "Date: Mon, 01 Jan 1970 00:00:01 GMT \n"      \
-    "Server: IncludeOS prototype 4.0 \n"        \
-    "Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT \n"   \
-    "Content-Type: text/html; charset=UTF-8 \n"     \
-    "Content-Length: "+std::to_string(html.size())+"\n"   \
-    "Accept-Ranges: bytes\n"          \
-    "Connection: close\n\n";
+  std::string header
+  {
+    "HTTP/1.1 200 OK\n"
+    "Date: Mon, 01 Jan 1970 00:00:01 GMT\n"
+    "Server: IncludeOS prototype 4.0\n"
+    "Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT\n"
+    "Content-Type: text/html; charset=UTF-8\n"
+    "Content-Length: "+std::to_string(html.size())+"\n"
+    "Accept-Ranges: bytes\n"
+    "Connection: close\n\n"
+  };
+
   return header + html;
 }


Planning: Bug fix on side-pass.

Planning: Bug fix on side-pass.

--- modules/planning/scenarios/side_pass/stage_approach_obstacle.cc
+++ modules/planning/scenarios/side_pass/stage_approach_obstacle.cc
@@ -146,6 +146,8 @@
         GetContext()->scenario_config_.min_l_nudge_buffer()) {
       continue;
     }
+    has_blocking_obstacle = true;
+    break;
   }

   if (!has_blocking_obstacle) {


Add on to the basic framework of answer to question 3.4

For more info, refer to issue #11 Update 3


comilation fix for gcc

comilation fix for gcc

--- include/universal/internal/blocktriple/blocktriple.hpp
+++ include/universal/internal/blocktriple/blocktriple.hpp
@@ -354,7 +354,6 @@

 	template<size_t targetBits>
 	blockbinary<targetBits, bt> alignSignificant(int alignmentShift) const {
-		constexpr bool signExtend = false; // do not sign-extend the number as significants lead with the hidden bit, which is not a sign bit
 		blockbinary<targetBits, bt> v;
 		v.assignWithoutSignExtend(_significant);
 		if (fhbits + static_cast<size_t>(alignmentShift) >= targetBits) {
@@ -588,8 +587,8 @@

 	// align the significants and add a leading 0 bit so that we can
 	// transform to a 2's complement encoding for negative numbers
-	blockbinary<sumbits, bt> r1 = lhs.alignSignificant<sumbits>(lhs_scale - scale_of_result + 3);
-	blockbinary<sumbits, bt> r2 = rhs.alignSignificant<sumbits>(rhs_scale - scale_of_result + 3);
+	blockbinary<sumbits, bt> r1 = lhs.template alignSignificant<sumbits>(lhs_scale - scale_of_result + 3);
+	blockbinary<sumbits, bt> r2 = rhs.template alignSignificant<sumbits>(rhs_scale - scale_of_result + 3);

 	if (lhs.isneg()) r1 = twosComplement(r1);
 	if (rhs.isneg()) r2 = twosComplement(r2);


TRD update

TRD update

--- PWG1/CalibMacros/Pass0/AddTaskTRDCalib.C
+++ PWG1/CalibMacros/Pass0/AddTaskTRDCalib.C
@@ -41,11 +41,11 @@
   // Disabling TRD CPAss0 as per https://savannah.cern.ch/bugs/?88813
   //calibTask->SetMaxEvent(-1);

-  calibTask->SetMaxNbTracks(600);
+  calibTask->SetMaxNbTracks(1600);
   calibTask->SetHisto2d(kTRUE);
   calibTask->SetVector2d(kFALSE);
   calibTask->SetVdriftLinear(kTRUE);
-  calibTask->SetExbAlt(kTRUE);
+  calibTask->SetExbAlt(kFALSE);
   calibTask->SetNz(0,0);
   calibTask->SetNrphi(0,0);
   calibTask->SetNz(0,1);
@@ -112,4 +112,3 @@
   return calibTask;

 }
-


Reset URuntimeMesh::bQueuedForMeshUpdate in Reset()

bQueuedForMeshUpdate is normally cleared in URuntimeMeshComponentEngineSubsystem::Tick or FRuntimeMeshUpdateTask::DoWork, but if the GCAnchor has changed state, those functions will not have access to the meshref to clear bQueuedForMeshUpdate.

--- Source/RuntimeMeshComponent/Private/RuntimeMesh.cpp
+++ Source/RuntimeMeshComponent/Private/RuntimeMesh.cpp
@@ -156,6 +156,7 @@
 {
 	RMC_LOG_VERBOSE("Reset called.");
 	GCAnchor.BeginNewState();
+	bQueuedForMeshUpdate.AtomicSet(false);

 	{
 		FWriteScopeLock Lock(MeshProviderLock);
@@ -1193,4 +1194,4 @@

-#undef RMC_LOG_VERBOSE+#undef RMC_LOG_VERBOSE


Added bunch crossing number to ntuple

Added bunch crossing number to ntuple

--- PWG1/global/AliAnalysisTaskVertexESD.cxx
+++ PWG1/global/AliAnalysisTaskVertexESD.cxx
@@ -114,7 +114,7 @@
   fOutput = new TList;
   fOutput->SetOwner();

-  fNtupleVertexESD = new TNtuple("fNtupleVertexESD","vertices","run:tstamp:triggered:dndygen:xtrue:ytrue:ztrue:xSPD:xerrSPD:ySPD:yerrSPD:zSPD:zerrSPD:ntrksSPD:SPD3D:dphiSPD:xTPC:xerrTPC:yTPC:yerrTPC:zTPC:zerrTPC:ntrksTPC:constrTPC:xTRK:xerrTRK:yTRK:yerrTRK:zTRK:zerrTRK:ntrksTRK:constrTRK:ntrklets:nESDtracks:nITSrefit5or6:nTPCin:nTPCinEta09:SPD0cls:xTPCnc:xerrTPCnc:yTPCnc:yerrTPCnc:zTPCnc:zerrTPCnc:ntrksTPCnc:xTRKnc:xerrTRKnc:yTRKnc:yerrTRKnc:zTRKnc:zerrTRKnc:ntrksTRKnc:xTPCc:xerrTPCc:yTPCc:yerrTPCc:zTPCc:zerrTPCc:ntrksTPCc:xTRKc:xerrTRKc:yTRKc:yerrTRKc:zTRKc:zerrTRKc:ntrksTRKc");
+  fNtupleVertexESD = new TNtuple("fNtupleVertexESD","vertices","run:tstamp:bunchcross:triggered:dndygen:xtrue:ytrue:ztrue:xSPD:xerrSPD:ySPD:yerrSPD:zSPD:zerrSPD:ntrksSPD:SPD3D:dphiSPD:xTPC:xerrTPC:yTPC:yerrTPC:zTPC:zerrTPC:ntrksTPC:constrTPC:xTRK:xerrTRK:yTRK:yerrTRK:zTRK:zerrTRK:ntrksTRK:constrTRK:ntrklets:nESDtracks:nITSrefit5or6:nTPCin:nTPCinEta09:SPD0cls:xTPCnc:xerrTPCnc:yTPCnc:yerrTPCnc:zTPCnc:zerrTPCnc:ntrksTPCnc:xTRKnc:xerrTRKnc:yTRKnc:yerrTRKnc:zTRKnc:zerrTRKnc:ntrksTRKnc:xTPCc:xerrTPCc:yTPCc:yerrTPCc:zTPCc:zerrTPCc:ntrksTPCc:xTRKc:xerrTRKc:yTRKc:yerrTRKc:zTRKc:zerrTRKc:ntrksTRKc");

   fOutput->Add(fNtupleVertexESD);

@@ -301,13 +301,14 @@

   // fill ntuple
-  Int_t isize=66;
-  Float_t xnt[66]; for(Int_t iii=0;iii<isize;iii++) xnt[iii]=0.;
+  Int_t isize=67;
+  Float_t xnt[67]; for(Int_t iii=0;iii<isize;iii++) xnt[iii]=0.;

   Int_t index=0;

   xnt[index++]=(Float_t)esdE->GetRunNumber();
   xnt[index++]=(Float_t)esdE->GetTimeStamp();
+  xnt[index++]=(Float_t)esdE->GetBunchCrossNumber();
   xnt[index++]=(eventTriggered ? 1. : 0.);

   xnt[index++]=(Float_t)dNchdy;


check to see that k is in right petal in new_replace

--- src/global.cpp
+++ src/global.cpp
@@ -327,9 +327,9 @@
             Plist tfs=M[g].av_tfs;//all tiles and fibers that reach g
             int done=0;//quit after we've used this SS
             for(int i=0;i<tfs.size() && done==0;++i){
-                if(tfs[i].f==j){//a combination on this plate
+                if(tfs[i].f==j&&pp.spectrom[tfs[i].s]==p){//a combination on this plate
                     int k=tfs[i].s;//we know g can be reached by this petal of plate j and fiber k
-                    int g_old=A.TF[j][k];//what is now at (j,k)
+                    int g_old=A.TF[j][k];//what is now at (j,k)  g_old can't be -1 or we would have used it already in assign_sf
                     if (M[g_old].priority_class==c&&A.is_assigned_jg(j,g,M,F)==-1&& ok_for_limit_SS_SF(g,j,k,M,P,pp,F)){
                         //right priority; this SS not already assigned on this plate
                         A.unassign(j,k,g_old,M,P,pp);
@@ -351,7 +351,7 @@
             Plist tfs=M[g].av_tfs;
             int done=0;
             for(int i=0;i<tfs.size() && done==0;++i){
-                if(tfs[i].f==j){
+                if(tfs[i].f==j&&pp.spectrom[tfs[i].s]==p){
                     int k=tfs[i].s;//we know g can be reached by this petal of plate j and fiber k
                     int g_old=A.TF[j][k];//what is now at (j,k)
                    if (M[g_old].priority_class==c&&A.is_assigned_jg(j,g,M,F)==-1 && ok_for_limit_SS_SF(g,j,k,M,P,pp,F)){
@@ -443,7 +443,7 @@
             }
 			// If not enough SS and SF, replace galaxies with lowest priority
         //printf("begin new replace\n");
-        //new_replace(j,p,M,P,pp,F,A);
+        new_replace(j,p,M,P,pp,F,A);
     }
 }


Added protection against invalid objects for AOD analysis

--- PWGLF/RESONANCES/AliRsnValueDaughter.cxx
+++ PWGLF/RESONANCES/AliRsnValueDaughter.cxx
@@ -154,9 +154,17 @@
    AliAODv0       *v0aod = fDaughter->Ref2AODv0();
    AliESDEvent    *lESDEvent = fEvent->GetRefESD();

-   Double_t xPrimaryVertex = lESDEvent->GetPrimaryVertex()->GetX();
-   Double_t yPrimaryVertex = lESDEvent->GetPrimaryVertex()->GetY();
-   Double_t zPrimaryVertex = lESDEvent->GetPrimaryVertex()->GetZ();
+   Double_t xPrimaryVertex = -999.9;
+   Double_t yPrimaryVertex = -999.9;
+   Double_t zPrimaryVertex = -999.9;
+
+   if(lESDEvent){
+
+   xPrimaryVertex = lESDEvent->GetPrimaryVertex()->GetX();
+   yPrimaryVertex = lESDEvent->GetPrimaryVertex()->GetY();
+   zPrimaryVertex = lESDEvent->GetPrimaryVertex()->GetZ();
+
+   }

    if (fUseMCInfo && !refMC) {
       AliError("No MC");
@@ -460,7 +468,7 @@
 	  return kFALSE;
 	 }
       case kLambdaProtonPIDCut:
-         if(v0esd) {
+         if(v0esd && lESDEvent) {
 	   AliESDv0 *v0ESD = dynamic_cast<AliESDv0 *>(v0esd);
 	   // retrieve the V0 daughters
    	   UInt_t lIdxPos      = (UInt_t) TMath::Abs(v0ESD->GetPindex());
@@ -481,7 +489,7 @@
 	  return kFALSE;
 	 }
        case kAntiLambdaAntiProtonPIDCut:
-         if(v0esd) {
+         if(v0esd && lESDEvent) {
 	   AliESDv0 *v0ESD = dynamic_cast<AliESDv0 *>(v0esd);
 	   // retrieve the V0 daughters
    	   UInt_t lIdxNeg      = (UInt_t) TMath::Abs(v0ESD->GetNindex());
@@ -502,7 +510,7 @@
 	  return kFALSE;
 	 }
       case kLambdaPionPIDCut:
-         if(v0esd) {
+         if(v0esd && lESDEvent) {
 	   AliESDv0 *v0ESD = dynamic_cast<AliESDv0 *>(v0esd);
 	   // retrieve the V0 daughters
    	   UInt_t lIdxNeg      = (UInt_t) TMath::Abs(v0ESD->GetNindex());
@@ -523,7 +531,7 @@
 	  return kFALSE;
 	 }
        case kAntiLambdaAntiPionPIDCut:
-         if(v0esd) {
+         if(v0esd && lESDEvent) {
 	   AliESDv0 *v0ESD = dynamic_cast<AliESDv0 *>(v0esd);
 	   // retrieve the V0 daughters
    	   UInt_t lIdxPos      = (UInt_t) TMath::Abs(v0ESD->GetPindex());


Show full thread / process name in Graph Row Info dialog

--- src/gpuvis.cpp
+++ src/gpuvis.cpp
@@ -2479,23 +2479,16 @@
             if ( ImGui::CollapsingHeader( "Graph Row Info" ) )
             {
                 if ( imgui_begin_columns( "row_info", { "Name", "Events" } ) )
-                    ImGui::SetColumnWidth( 0, imgui_scale( 200.0f ) );
+                    ImGui::SetColumnWidth( 0, imgui_scale( 250.0f ) );

                 for ( const GraphRows::graph_rows_info_t &info : m_graph.rows.m_graph_rows_list )
                 {
-                    ImU32 col = ImGui::GetColorU32( ImGuiCol_Text );
+                    const char *row_name = info.row_name.c_str();

                     if ( info.type == TraceEvents::LOC_TYPE_Comm )
-                    {
-                        const tgid_info_t *tgid_info = m_trace_events.tgid_from_commstr( info.row_name.c_str() );
-
-                        if ( tgid_info )
-                            col = tgid_info->color;
-                    }
-
-                    ImGui::PushStyleColor( ImGuiCol_Text, ( ImColor )col );
-                    ImGui::Text( "%s", info.row_name.c_str() );
-                    ImGui::PopStyleColor();
+                        row_name = m_trace_events.tgidcomm_from_commstr( row_name );
+
+                    ImGui::Text( "%s", row_name );

                     ImGui::NextColumn();
                     ImGui::Text( "%lu", info.event_count );


Show either focal distance or autofocus target in Thin Lens camera

--- src/appleseed/renderer/modeling/camera/thinlenscamera.cpp
+++ src/appleseed/renderer/modeling/camera/thinlenscamera.cpp
@@ -743,7 +743,8 @@
             .insert("label", "Enable autofocus")
             .insert("type", "boolean")
             .insert("use", "optional")
-            .insert("default", "true"));
+            .insert("default", "true")
+            .insert("on_change", "rebuild_form"));

     metadata.push_back(
         Dictionary()
@@ -751,7 +752,10 @@
             .insert("label", "Focal Distance")
             .insert("type", "text")
             .insert("use", "optional")
-            .insert("default", "1.0"));
+            .insert("default", "1.0")
+            .insert("visible_if",
+                Dictionary()
+                    .insert("autofocus_enabled", "false")));

     metadata.push_back(
         Dictionary()
@@ -759,7 +763,10 @@
             .insert("label", "Autofocus Target")
             .insert("type", "text")
             .insert("use", "optional")
-            .insert("default", "0.5 0.5"));
+            .insert("default", "0.5 0.5")
+            .insert("visible_if",
+                Dictionary()
+                    .insert("autofocus_enabled", "true")));

     metadata.push_back(
         Dictionary()


improve resample area detect

improve resample area detect


Some minor cleaning up.

Some minor cleaning up.

--- src/plugins/misc/CellMLSupport/src/cellmlfileruntime.cpp
+++ src/plugins/misc/CellMLSupport/src/cellmlfileruntime.cpp
@@ -526,7 +526,7 @@
     ObjRef<iface::cellml_services::CodeGeneratorBootstrap> codeGeneratorBootstrap = CreateCodeGeneratorBootstrap();
     ObjRef<iface::cellml_services::CodeGenerator> codeGenerator = codeGeneratorBootstrap->createCodeGenerator();

-    // Generate some code for the model (i.e. 'compile' the model)
+    // Generate some code for the model

     try {
         mOdeCodeInformation = codeGenerator->generateCode(pModel);
@@ -557,7 +557,7 @@
     ObjRef<iface::cellml_services::CodeGeneratorBootstrap> codeGeneratorBootstrap = CreateCodeGeneratorBootstrap();
     ObjRef<iface::cellml_services::IDACodeGenerator> codeGenerator = codeGeneratorBootstrap->createIDACodeGenerator();

-    // Generate some code for the model (i.e. 'compile' the model)
+    // Generate some code for the model

     try {
         mDaeCodeInformation = codeGenerator->generateIDACode(pModel);


Fix context menu popup color when right clicking on vblank events

--- src/gpuvis.cpp
+++ src/gpuvis.cpp
@@ -2696,6 +2696,8 @@
     // If we've got an active popup menu, render it.
     if ( m_eventlist.popup_eventid == i )
     {
+        ImGui::PushStyleColor( ImGuiCol_Text, s_clrs().getv4( col_ImGui_Text ) );
+
         uint32_t eventid = !m_eventlist.filtered_events.empty() ?
                     m_eventlist.filtered_events[ m_eventlist.popup_eventid ] :
                     m_eventlist.popup_eventid;
@@ -2704,6 +2706,8 @@
             m_eventlist.popup_eventid = INVALID_ID;

         popup_shown = true;
+
+        ImGui::PopStyleColor();
     }

     return popup_shown;


ENH: Updated to latest headers

ENH: Updated to latest headers

--- Testing/Code/Algorithms/itkAlgorithmsHeaderTest.cxx
+++ Testing/Code/Algorithms/itkAlgorithmsHeaderTest.cxx
@@ -19,6 +19,7 @@

 #include "itkBalloonForce3DFilter.txx"
 #include "itkBalloonForceFilter.txx"
+#include "itkBinaryMask3DMeshSource.txx"
 #include "itkBinaryMinMaxCurvatureFlowFunction.txx"
 #include "itkBinaryMinMaxCurvatureFlowImageFilter.txx"
 #include "itkClassifier.txx"


all mat functions mapped

all mat functions mapped

--- saurabh_ip.cpp
+++ saurabh_ip.cpp
@@ -94,6 +94,14 @@
     Mat img_flood_fill2=Mat::zeros( img_edge_dilated.rows + 2, img_edge_dilated.cols + 2, CV_8UC1 );
     img_eroded1.convertTo(img_eroded1,CV32S);
     floodFill(img_eroded1,img_flood_fill2,origin,Scalar(255),&rect,Scalar(20),Scalar(20),4);
+
+
+
+    Mat labelImage(img_flood_fill2.size(), CV_8UC1);
+    int nLabels = connectedComponents(img_flood_fill2, labelImage, 8);
+
+    Mat img_color_coded;
+    applyColorMap(labelImage,img_color_coded,COLORMAP_JET);


BUG: Fixing the numbering of argv command line arguments.

--- Testing/Code/Numerics/Statistics/itkKdTreeTest1.cxx
+++ Testing/Code/Numerics/Statistics/itkKdTreeTest1.cxx
@@ -32,7 +32,7 @@
     {
     std::cerr << "Missing parameters" << std::endl;
     std::cerr << "Usage: " << std::endl;
-    std::cerr << argv[0] << "numberOfDataPoints numberOfTestPoints bucketSize graphvizDotOutputFile" << std::endl;
+    std::cerr << argv[0] << " numberOfDataPoints numberOfTestPoints bucketSize graphvizDotOutputFile" << std::endl;
     return EXIT_FAILURE;
     }

@@ -160,7 +160,7 @@
   // Plot out the tree structure to the console in the format used by Graphviz dot
   //
   std::ofstream plotFile;
-  plotFile.open( argv[2] );
+  plotFile.open( argv[4] );
   tree->PlotTree( plotFile );
   plotFile.close();


Refine NeonDepthwiseConv.

Refine NeonDepthwiseConv.

--- paddle/function/neon/NeonDepthwiseConv.cpp
+++ paddle/function/neon/NeonDepthwiseConv.cpp
@@ -17,8 +17,6 @@
 #include "paddle/function/Im2Col.h"

 namespace paddle {
-
-namespace neon {

 #if defined(__ARM_NEON__) || defined(__ARM_NEON)

@@ -45,16 +43,16 @@
     const TensorShape& filter = inputs[1].shape();
     const TensorShape& output = outputs[0].shape();

-    size_t batchSize = input[0];
-    size_t inputChannels = input[1];
-    size_t inputHeight = input[2];
-    size_t inputWidth = input[3];
-    size_t filterHeight = getFilterHeight(filter);
-    size_t filterWidth = getFilterWidth(filter);
-    size_t outputChannels = output[1];
-    size_t outputHeight = output[2];
-    size_t outputWidth = output[3];
-    size_t filterMultiplier = outputChannels / groups_;
+    int batchSize = input[0];
+    int inputChannels = input[1];
+    int inputHeight = input[2];
+    int inputWidth = input[3];
+    int filterHeight = getFilterHeight(filter);
+    int filterWidth = getFilterWidth(filter);
+    int outputChannels = output[1];
+    int outputHeight = output[2];
+    int outputWidth = output[3];
+    int filterMultiplier = outputChannels / groups_;
     CHECK_EQ(inputChannels, groups_);

     // only support strideH() == strideW() and filterHeight == filterWidth.
@@ -90,18 +88,18 @@
         DepthWiseConv;

     if (filterWidth == 3 && strideW() == 1) {
-      DepthWiseConv = DepthwiseConvKernel<3, 1>::run;
+      DepthWiseConv = neon::DepthwiseConvKernel<3, 1>::run;
     } else if (filterWidth == 3 && strideW() == 2) {
-      DepthWiseConv = DepthwiseConvKernel<3, 2>::run;
+      DepthWiseConv = neon::DepthwiseConvKernel<3, 2>::run;
     } else if (filterWidth == 4 && strideW() == 1) {
-      DepthWiseConv = DepthwiseConvKernel<4, 1>::run;
+      DepthWiseConv = neon::DepthwiseConvKernel<4, 1>::run;
     } else if (filterWidth == 4 && strideW() == 2) {
-      DepthWiseConv = DepthwiseConvKernel<4, 2>::run;
+      DepthWiseConv = neon::DepthwiseConvKernel<4, 2>::run;
     } else {
       LOG(FATAL) << "Not supported";
     }

-    for (size_t i = 0; i < batchSize; i++) {
+    for (int i = 0; i < batchSize; i++) {
       DepthWiseConv(inputPadding,
                     filterData,
                     inputHeight,
@@ -117,9 +115,10 @@
   }
 };

+#ifndef PADDLE_TYPE_DOUBLE
 REGISTER_TYPED_FUNC(NeonDepthwiseConv, CPU, NeonDepthwiseConvFunction);
+#endif

 #endif

-}  // namespace neon
 }  // namespace paddle


Added test for LinearAllocator

Added test for LinearAllocator

--- Tests/DiligentCoreTest/src/Common/AllocatorTest.cpp
+++ Tests/DiligentCoreTest/src/Common/AllocatorTest.cpp
@@ -27,6 +27,7 @@

 #include "DefaultRawMemoryAllocator.hpp"
 #include "FixedBlockMemoryAllocator.hpp"
+#include "LinearAllocator.hpp"

 #include "gtest/gtest.h"

@@ -120,4 +121,28 @@
     }
 }

+TEST(Common_LinearAllocator, PointerAlignment)
+{
+    LinearAllocator Allocator{DefaultRawMemoryAllocator::GetAllocator()};
+
+    const std::string SrcStr = "123456789";
+
+    Allocator.AddRequiredSize<char>(SrcStr.length() + 1);
+    Allocator.AddRequiredSize<uint32_t>(5);
+    Allocator.AddRequiredSize<uint64_t>(3);
+    Allocator.AddRequiredSize<float>(6);
+
+    Allocator.Reserve();
+
+    char* DstStr = Allocator.CopyString(SrcStr.c_str());
+    size_t IntPtrUint32 = reinterpret_cast<size_t>(Allocator.Allocate<uint32_t>(5));
+    size_t IntPtrUint64 = reinterpret_cast<size_t>(Allocator.Allocate<uint64_t>(3));
+    size_t IntPtrFloat  = reinterpret_cast<size_t>(Allocator.Allocate<float>(6));
+
+    EXPECT_EQ(SrcStr, DstStr);
+    EXPECT_EQ(IntPtrUint32, Align(IntPtrUint32, alignof(uint32_t)));
+    EXPECT_EQ(IntPtrUint64, Align(IntPtrUint64, alignof(uint64_t)));
+    EXPECT_EQ(IntPtrFloat, Align(IntPtrFloat, alignof(float)));
+}
+
 } // namespace


Delete debug log

Delete debug log

--- paddle/gserver/layers/SwitchOrderLayer.cpp
+++ paddle/gserver/layers/SwitchOrderLayer.cpp
@@ -33,11 +33,9 @@

   auto& reshape_conf = config_.reshape_conf();
   for (size_t i = 0; i < reshape_conf.heightaxis_size(); i++) {
-    LOG(INFO) << "reshape height axis: " << reshape_conf.heightaxis(i);
     heightAxis_.push_back(reshape_conf.heightaxis(i));
   }
   for (size_t i = 0; i < reshape_conf.widthaxis_size(); i++) {
-    LOG(INFO) << "reshape width axis: " << reshape_conf.widthaxis(i);
     widthAxis_.push_back(reshape_conf.widthaxis(i));
   }
   createFunction(nchw2nhwc_, "NCHW2NHWC", FuncConfig());
@@ -60,8 +58,6 @@
     reshapeWidth_ *= outDims_[widthAxis_[i]];
   }
   output_.setFrameWidth(reshapeWidth_);
-  LOG(INFO) << "outDims: " << outDims_[0] << "; " << outDims_[1] << ";"
-            << outDims_[2] << ";" << outDims_[3];
 }

 void SwitchOrderLayer::setInDims() {
@@ -76,8 +72,6 @@
   int totalCount = input->getElementCnt();
   int channels = totalCount / (inDims_[0] * inDims_[2] * inDims_[3]);
   if (channels != 0) inDims_.setDim(1, channels);
-  LOG(INFO) << "inDims: " << inDims_[0] << "; " << inDims_[1] << ";"
-            << inDims_[2] << ";" << inDims_[3];
 }

 void SwitchOrderLayer::forward(PassType passType) {
@@ -95,12 +89,12 @@
   inputs.addArg(*getInputValue(0), inDims_);
   outputs.addArg(*getOutputValue(), outDims_);
   nchw2nhwc_[0]->calc(inputs, outputs);
-  // forwardActivation();
+  forwardActivation();
 }

 void SwitchOrderLayer::backward(const UpdateCallback& callback) {
   (void)callback;
-  // backwardActivation();
+  backwardActivation();

   // switch NHWC to NCHW
   BufferArgs inputs;


Filling out definition of psi()

Filling out definition of psi()

--- svm-sos/svm_struct_api.cpp
+++ svm-sos/svm_struct_api.cpp
@@ -333,11 +333,26 @@
      that ybar!=y that maximizes psi(x,ybar,sm)*sm.w (where * is the
      inner vector product) and the appropriate function of the
      loss + margin/slack rescaling method. See that paper for details. */
-  SVECTOR *fvec=NULL;
-
-  /* insert code for computing the feature vector for x and y here */
-
-  return(fvec);
+    SVECTOR *fvec=NULL;
+
+    /* insert code for computing the feature vector for x and y here */
+
+    std::vector<WORD> words;
+    FNUM fnum = 1;
+    for (auto fgp : data(sm)->m_features) {
+        std::vector<FVAL> values = fgp->Psi(*data(x), *data(y));
+        ASSERT(values.size() == fgp->NumFeatures());
+        for (FVAL v : values) {
+            WORD w;
+            w.wnum = fnum++;
+            w.weight = v;
+            words.push_back(w);
+        }
+    }
+
+    fvec = create_svector(words.data(), nullptr, 1.0);
+
+    return(fvec);
 }

 double      loss(LABEL y, LABEL ybar, STRUCT_LEARN_PARM *sparm)


fix par_merge_sort benchmark for current gc root impl

--- benchmark/parallel_merge_sort/parallel_merge_sort.cpp
+++ benchmark/parallel_merge_sort/parallel_merge_sort.cpp
@@ -46,11 +46,12 @@
 template <typename F, typename... Args>
 std::future<typename std::result_of<F(Args...)>::type> launch_task(F&& f, Args&&... args)
 {
+    using precisegc::details::utils::make_scope_guard;
     typedef typename std::result_of<F(Args...)>::type result_type;

-    std::function<result_type(Args...)> functor(f);
+    std::function<result_type(Args...)> functor(std::forward<F>(f));
     std::packaged_task<result_type(bool, Args...)> task([functor] (bool parallel_flag, Args&&... task_args) {
-        auto guard = precisegc::details::utils::make_scope_guard([parallel_flag, &threads_mutex, &threads_cond, &threads_count] {
+        auto guard = make_scope_guard([parallel_flag, &threads_mutex, &threads_cond, &threads_count] {
             if (parallel_flag) {
                 std::lock_guard<std::mutex> lock(threads_mutex);
                 assert(threads_count != 0);
@@ -150,6 +151,8 @@
     return {.head = res, .length = length};
 }

+void merge_sort_helper(const List& list, List& sorted);
+
 List merge_sort(const List& list)
 {
     if (list.length == 0) {
@@ -167,10 +170,17 @@
     List lpart = {.head = list.head, .length = m};
     List rpart = {.head = mid,       .length = list.length - m};

-    std::future<List> lsorted = launch_task(merge_sort, std::ref(lpart));
+    List lsorted;
+    std::future<void> future = launch_task(merge_sort_helper, std::ref(lpart), std::ref(lsorted));
     List rsorted = merge_sort(rpart);
-
-    return merge(lsorted.get(), rsorted);
+    future.get();
+
+    return merge(lsorted, rsorted);
+}
+
+void merge_sort_helper(const List& list, List& sorted)
+{
+    sorted = merge_sort(list);
 }

 List create_list(size_t n, int mod)


Added singleton filter.

Added singleton filter.

git-svn-id: 357248c53bdac2d7b36f7ee045286eb205fcf757@72 ec762483-ff6d-05da-a07a-a48fb63a330f

--- gi/pyp-topics/src/contexts_corpus.cc
+++ gi/pyp-topics/src/contexts_corpus.cc
@@ -35,7 +35,7 @@
     // filter out singleton contexts
     if (!counts->empty()) {
       map<string,int>::const_iterator find_it = counts->find(context_str);
-      if (find_it == counts->end() || find_it->second == 1)
+      if (find_it == counts->end() || find_it->second < 5)
         continue;
     }


#99089# +GrabFirstControlFocus

#99089# +GrabFirstControlFocus

--- svx/source/form/fmview.cxx
+++ svx/source/form/fmview.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: fmview.cxx,v $
  *
- *  $Revision: 1.19 $
- *
- *  last change: $Author: fs $ $Date: 2002-05-02 16:40:01 $
+ *  $Revision: 1.20 $
+ *
+ *  last change: $Author: fs $ $Date: 2002-05-22 17:16:02 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -400,6 +400,13 @@
     // und mein Undo-Environment wieder an
     if (pModel)
         pModel->GetUndoEnv().UnLock();
+}
+
+//------------------------------------------------------------------------
+void FmFormView::GrabFirstControlFocus( sal_Bool _bForceSync )
+{
+    if ( !IsDesignMode() )
+        pImpl->AutoFocus( _bForceSync );
 }

 //------------------------------------------------------------------------


alert death to death handle func

alert death to death handle func

--- src/master/job_manager.cc
+++ src/master/job_manager.cc
@@ -823,7 +823,7 @@
     fsm_.insert(std::make_pair(BuildHandlerKey(kStageRunning, kStageRunning),
           boost::bind(&JobManager::HandleDoNothing, this, _1, _2)));
     fsm_.insert(std::make_pair(BuildHandlerKey(kStageDeath, kStageDeath),
-          boost::bind(&JobManager::HandleDoNothing, this, _1, _2)));
+          boost::bind(&JobManager::HandleRunningToDeath, this, _1, _2)));
     fsm_.insert(std::make_pair(BuildHandlerKey(kStageDeath, kStagePending),
           boost::bind(&JobManager::HandleDeathToPending, this, _1, _2)));
     fsm_.insert(std::make_pair(BuildHandlerKey(kStageRemoved, kStageDeath),


Added a helper for the array constructor.

--- gjstest/internal/cpp/typed_arrays.cc
+++ gjstest/internal/cpp/typed_arrays.cc
@@ -49,6 +49,7 @@
 #include "base/logging.h"

 using v8::Arguments;
+using v8::Array;
 using v8::ExternalArrayType;
 using v8::FunctionTemplate;
 using v8::Handle;
@@ -319,6 +320,43 @@
   return result;
 }

+// Implement the constructor with this signature:
+//
+//     TypedArray(type[] array)
+//
+template <typename T>
+static Handle<Value> CreateExternalArrayWithArrayArg(
+    ExternalArrayType element_type,
+    const Handle<Array>& array) {
+  CHECK(!array.IsEmpty());
+  TryCatch try_catch;
+
+  const size_t element_size = sizeof(T);
+  const uint32_t num_elements = array->Length();
+
+  // Create the underlying data.
+  T* const data =
+      static_cast<T*>(
+          calloc(num_elements, element_size));
+
+  const size_t offset = 0;
+
+  if (!data) {
+    return ThrowException(String::New("Memory allocation failed."));
+  }
+
+  // Convert each element.
+  for (uint32_t i = 0; i < num_elements; ++i) {
+    data[i] = array->Get(i)->ToInteger()->Value();
+  }
+
+  return CreateExternalArray(
+      data,
+      num_elements,
+      element_size,
+      element_type);
+}
+
 // Common constructor code for all typed arrays. The following signatures are
 // supported:
 //


Reworked the Intel disassembler to support instructions
whose opcodes extend into the ModR/M field using the
Form field of the instruction rather than by special
casing each instruction.  Commented out the special
casing of VMCALL, which is the first instruction to use
this special form.  While I was in the neighborhood,
added a few comments for people modifying the Intel
disassembler.

git-svn-id: a4a6f32337ebd29ad4763b423022f00f68d1c7b7@96043 91177308-0d34-0410-b5e6-96231b3b80d8

--- TableGen/X86RecognizableInstr.cpp
+++ TableGen/X86RecognizableInstr.cpp
@@ -24,6 +24,13 @@

 using namespace llvm;

+#define MRM_MAPPING     \
+  MAP(C1, 33)           \
+  MAP(C8, 34)           \
+  MAP(C9, 35)           \
+  MAP(E8, 36)           \
+  MAP(F0, 37)
+
 // A clone of X86 since we can't depend on something that is generated.
 namespace X86Local {
   enum {
@@ -38,7 +45,12 @@
     MRM4r = 20, MRM5r = 21, MRM6r = 22, MRM7r = 23,
     MRM0m = 24, MRM1m = 25, MRM2m = 26, MRM3m = 27,
     MRM4m = 28, MRM5m = 29, MRM6m = 30, MRM7m = 31,
-    MRMInitReg  = 32
+    MRMInitReg  = 32,
+
+#define MAP(from, to) MRM_##from = to,
+    MRM_MAPPING
+#undef MAP
+    lastMRM
   };

   enum {
@@ -51,7 +63,24 @@
     P_0F_AE = 16, P_0F_01 = 17
   };
 }
-
+
+// If rows are added to the opcode extension tables, then corresponding entries
+// must be added here.
+//
+// If the row corresponds to a single byte (i.e., 8f), then add an entry for
+// that byte to ONE_BYTE_EXTENSION_TABLES.
+//
+// If the row corresponds to two bytes where the first is 0f, add an entry for
+// the second byte to TWO_BYTE_EXTENSION_TABLES.
+//
+// If the row corresponds to some other set of bytes, you will need to modify
+// the code in RecognizableInstr::emitDecodePath() as well, and add new prefixes
+// to the X86 TD files, except in two cases: if the first two bytes of such a
+// new combination are 0f 38 or 0f 3a, you just have to add maps called
+// THREE_BYTE_38_EXTENSION_TABLES and THREE_BYTE_3A_EXTENSION_TABLES and add a
+// switch(Opcode) just below the case X86Local::T8: or case X86Local::TA: line
+// in RecognizableInstr::emitDecodePath().
+
 #define ONE_BYTE_EXTENSION_TABLES \
   EXTENSION_TABLE(80)             \
   EXTENSION_TABLE(81)             \
@@ -82,10 +111,6 @@
   EXTENSION_TABLE(b9)             \
   EXTENSION_TABLE(ba)             \
   EXTENSION_TABLE(c7)
-
-#define TWO_BYTE_FULL_EXTENSION_TABLES \
-  EXTENSION_TABLE(01)
-

 using namespace X86Disassembler;

@@ -550,23 +575,28 @@
 void RecognizableInstr::emitDecodePath(DisassemblerTables &tables) const {
   // Special cases where the LLVM tables are not complete

-#define EXACTCASE(class, name, lastbyte)         \
-  if (Name == name) {                           \
-    tables.setTableFields(class,                 \
-                          insnContext(),         \
-                          Opcode,               \
-                          ExactFilter(lastbyte), \
-                          UID);                 \
-    Spec->modifierBase = Opcode;               \
-    return;                                      \
-  }
+#define MAP(from, to)                     \
+  case X86Local::MRM_##from:              \
+    filter = new ExactFilter(0x##from);   \
+    break;
+
+#define EXACTCASE(class, name, lastbyte)          \
+  if (Name == name) {                             \
+    tables.setTableFields(class,                  \
+                          insnContext(),          \
+                          Opcode,                 \
+                          ExactFilter(lastbyte),  \
+                          UID);                   \
+    Spec->modifierBase = Opcode;                  \
+    return;                                       \
+  }

   EXACTCASE(TWOBYTE, "MONITOR",  0xc8)
   EXACTCASE(TWOBYTE, "MWAIT",    0xc9)
   EXACTCASE(TWOBYTE, "SWPGS",    0xf8)
   EXACTCASE(TWOBYTE, "INVEPT",   0x80)
   EXACTCASE(TWOBYTE, "INVVPID",  0x81)
-  EXACTCASE(TWOBYTE, "VMCALL",   0xc1)
+  //EXACTCASE(TWOBYTE, "VMCALL",   0xc1) - Handled by MRM_ form; safe to remove
   EXACTCASE(TWOBYTE, "VMLAUNCH", 0xc2)
   EXACTCASE(TWOBYTE, "VMRESUME", 0xc3)
   EXACTCASE(TWOBYTE, "VMXOFF",   0xc4)
@@ -620,6 +650,7 @@
       case X86Local::MRM7m:
         filter = new ExtendedFilter(false, Form - X86Local::MRM0m);
         break;
+      MRM_MAPPING
       } // switch (Form)
       break;
     default:
@@ -697,6 +728,7 @@
       case X86Local::MRM7m:
         filter = new ExtendedFilter(false, Form - X86Local::MRM0m);
         break;
+      MRM_MAPPING
       } // switch (Form)
       break;
     case 0xd8:
@@ -761,6 +793,8 @@
   }

   delete filter;
+
+#undef MAP
 }

 #define TYPE(str, type) if (s == str) return type;


fixing broken admin cli 'help' command

fixing broken admin cli 'help' command

--- src/clustering/administration/cli/admin_command_parser.cc
+++ src/clustering/administration/cli/admin_command_parser.cc
@@ -670,6 +670,9 @@
     info = add_command(touch_command, touch_command, touch_usage, &admin_cluster_link_t::do_admin_touch, &commands);

     info = add_command(help_command, help_command, help_usage, NULL, &commands); // Special case, 'help' is not done through the cluster
+    info->add_positional("command", 1, false)->add_options("split", "merge", "set", "unset", "ls", "create", "rm", "resolve", "help", "pin", "touch", NULLPTR);
+    info->add_positional("subcommand", 1, false);
+
     info = add_command(dashed_help_command, dashed_help_command, help_usage, NULL, &commands); // Also allow --help to work for consistency with other rethinkdb subcommands
     info->add_positional("command", 1, false)->add_options("split", "merge", "set", "ls", "create", "rm", "resolve", "help", "pin", "touch", NULLPTR);
     info->add_positional("subcommand", 1, false);
@@ -707,7 +710,7 @@

 admin_command_parser_t::command_info_t *
 admin_command_parser_t::find_command(const std::map<std::string,
-                                     admin_command_parser_t::command_info_t *>& cmd_map,
+                                                    admin_command_parser_t::command_info_t *>& cmd_map,
                                      const std::vector<std::string>& line,
                                      size_t& index) {
     std::map<std::string, command_info_t *>::const_iterator i = cmd_map.find(line[0]);


#89181# SvDataTypeList removed

#89181# SvDataTypeList removed

--- svx/source/inc/filtnav.hxx
+++ svx/source/inc/filtnav.hxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: filtnav.hxx,v $
  *
- *  $Revision: 1.4 $
- *
- *  last change: $Author: fs $ $Date: 2001-04-18 12:29:18 $
+ *  $Revision: 1.5 $
+ *
+ *  last change: $Author: oj $ $Date: 2001-07-05 10:12:39 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -293,7 +293,6 @@
 //========================================================================
 class OFilterItemExchange : public OLocalExchange
 {
-    SvDataTypeList          m_aDataTypeList;
     vector<FmFilterItem*>   m_aDraggedEntries;
     FmFormItem*             m_pFormItem;        // ensure that we drop on the same form


update

update


Replaced std::pair<std::pair< .. > > usage with backfill_queue_entry_t and got rid of a bad typedef.

--- src/clustering/immediate_consistency/branch/backfillee.cc
+++ src/clustering/immediate_consistency/branch/backfillee.cc
@@ -11,25 +11,43 @@

 #define ALLOCATION_CHUNK 50

-template <class backfill_chunk_t>
-void push_chunk_on_queue(fifo_enforcer_queue_t<std::pair<std::pair<bool, backfill_chunk_t>, fifo_enforcer_write_token_t> > *queue, backfill_chunk_t chunk, fifo_enforcer_write_token_t token) {
-    queue->push(token, std::make_pair(std::make_pair(true, chunk), token));
+template <class protocol_t>
+struct backfill_queue_entry_t {
+    // TODO: The fact that fifo_enforcer_queue_t requires a default
+    // constructor (and assignment operator, presumably) is completely asinine.
+    backfill_queue_entry_t() { }
+    backfill_queue_entry_t(bool _is_not_last_backfill_chunk,
+                           const typename protocol_t::backfill_chunk_t &_chunk,
+                           fifo_enforcer_write_token_t _write_token)
+        : is_not_last_backfill_chunk(_is_not_last_backfill_chunk),
+          chunk(_chunk),
+          write_token(_write_token) { }
+
+    bool is_not_last_backfill_chunk;
+    typename protocol_t::backfill_chunk_t chunk;
+    fifo_enforcer_write_token_t write_token;
+};
+
+template <class protocol_t>
+void push_chunk_on_queue(fifo_enforcer_queue_t<backfill_queue_entry_t<protocol_t> > *queue,
+                         typename protocol_t::backfill_chunk_t chunk, fifo_enforcer_write_token_t token) {
+    queue->push(token, backfill_queue_entry_t<protocol_t>(true, chunk, token));
 }

-template <class backfill_chunk_t>
-void push_finish_on_queue(fifo_enforcer_queue_t<std::pair<std::pair<bool, backfill_chunk_t>, fifo_enforcer_write_token_t> > *queue, fifo_enforcer_write_token_t token) {
-    queue->push(token, std::make_pair(std::make_pair(false, backfill_chunk_t()), token));
+template <class protocol_t>
+void push_finish_on_queue(fifo_enforcer_queue_t<backfill_queue_entry_t<protocol_t> > *queue, fifo_enforcer_write_token_t token) {
+    queue->push(token, backfill_queue_entry_t<protocol_t>(false, typename protocol_t::backfill_chunk_t(), token));
 }

 /* Now that the metadata indicates that the backfill is happening, it's
    time to start actually performing backfill chunks */
 template <class protocol_t>
-class chunk_callback_t : public coro_pool_t<std::pair<std::pair<bool, typename protocol_t::backfill_chunk_t>, fifo_enforcer_write_token_t> >::callback_t,
+class chunk_callback_t : public coro_pool_t<backfill_queue_entry_t<protocol_t> >::callback_t,
                          public home_thread_mixin_t {
 public:
     chunk_callback_t(multistore_ptr_t<protocol_t> *_svs,
-                     fifo_enforcer_queue_t<std::pair<std::pair<bool, typename protocol_t::backfill_chunk_t>, fifo_enforcer_write_token_t> > *_chunk_queue, mailbox_manager_t *_mbox_manager,
+                     fifo_enforcer_queue_t<backfill_queue_entry_t<protocol_t> > *_chunk_queue, mailbox_manager_t *_mbox_manager,
                      mailbox_addr_t<void(int)> _allocation_mailbox) :
         svs(_svs), chunk_queue(_chunk_queue), mbox_manager(_mbox_manager),
         allocation_mailbox(_allocation_mailbox), unacked_chunks(0),
@@ -44,11 +62,10 @@
         svs->receive_backfill(chunk, &write_token, interruptor);
     }

-    // TODO: Don't pass a std::pair of std::pair.
-    void coro_pool_callback(std::pair<std::pair<bool, typename protocol_t::backfill_chunk_t>, fifo_enforcer_write_token_t> chunk, signal_t *interruptor) {
+    void coro_pool_callback(backfill_queue_entry_t<protocol_t> chunk, signal_t *interruptor) {
         assert_thread();
         try {
-            if (chunk.first.first) {
+            if (chunk.is_not_last_backfill_chunk) {
                 /* This is an actual backfill chunk */

                 /* Before letting the next thing go, increment
@@ -60,7 +77,7 @@
                 num_outstanding_chunks++;

                 // We acquire the write token in apply_backfill_chunk.
-                apply_backfill_chunk(chunk.second, chunk.first.second, interruptor);
+                apply_backfill_chunk(chunk.write_token, chunk.chunk, interruptor);

                 /* Allow the backfiller to send us more data */
                 int chunks_to_send_out = 0;
@@ -87,7 +104,7 @@
                    that the backfill is over */
                 rassert(!done_message_arrived);
                 done_message_arrived = true;
-                chunk_queue->finish_write(chunk.second);
+                chunk_queue->finish_write(chunk.write_token);
             }

             if (done_message_arrived && num_outstanding_chunks == 0) {
@@ -107,7 +124,7 @@

 private:
     multistore_ptr_t<protocol_t> *svs;
-    fifo_enforcer_queue_t<std::pair<std::pair<bool, typename protocol_t::backfill_chunk_t>, fifo_enforcer_write_token_t> > *chunk_queue;
+    fifo_enforcer_queue_t<backfill_queue_entry_t<protocol_t> > *chunk_queue;
     mailbox_manager_t *mbox_manager;
     mailbox_addr_t<void(int)> allocation_mailbox;
     int unacked_chunks;
@@ -165,20 +182,19 @@
          * pool services these requests and poops them off one at a time to
          * perform them. */

-        typedef fifo_enforcer_queue_t<std::pair<std::pair<bool, backfill_chunk_t>, fifo_enforcer_write_token_t> > chunk_queue_t;
-        chunk_queue_t chunk_queue;
+        fifo_enforcer_queue_t<backfill_queue_entry_t<protocol_t> > chunk_queue;

         /* The backfiller will notify `done_mailbox` when the backfill is all over
         and the version described in `end_point_mailbox` has been achieved. */
         mailbox_t<void(fifo_enforcer_write_token_t)> done_mailbox(
             mailbox_manager,
-            boost::bind(&push_finish_on_queue<backfill_chunk_t>, &chunk_queue, _1),
+            boost::bind(&push_finish_on_queue<protocol_t>, &chunk_queue, _1),
             mailbox_callback_mode_inline);

         /* The backfiller will send individual chunks of the backfill to
         `chunk_mailbox`. */
         mailbox_t<void(backfill_chunk_t, fifo_enforcer_write_token_t)> chunk_mailbox(
-            mailbox_manager, boost::bind(&push_chunk_on_queue<backfill_chunk_t>, &chunk_queue, _1, _2));
+            mailbox_manager, boost::bind(&push_chunk_on_queue<protocol_t>, &chunk_queue, _1, _2));

         /* The backfiller will register for allocations on the allocation
          * registration box. */
@@ -287,7 +303,7 @@

         chunk_callback_t<protocol_t> chunk_callback(svs, &chunk_queue, mailbox_manager, allocation_mailbox);

-        coro_pool_t<std::pair<std::pair<bool, backfill_chunk_t>, fifo_enforcer_write_token_t> > backfill_workers(10, &chunk_queue, &chunk_callback);
+        coro_pool_t<backfill_queue_entry_t<protocol_t> > backfill_workers(10, &chunk_queue, &chunk_callback);

         /* Now wait for the backfill to be over */
         {


CWS-TOOLING: integrate CWS ooo33gsl13

CWS-TOOLING: integrate CWS ooo33gsl13

--- sw/source/core/doc/doc.cxx
+++ sw/source/core/doc/doc.cxx
@@ -1336,12 +1336,14 @@

     // get PageRange value to use
     OUString aPageRange;
-    if (bIsPDFExport)
-    {
-        // ?? rOptions.getValue( C2U("Selection") );
-        aPageRange = rOptions.getStringValue( "PageRange", OUString() );
-    }
-    else
+    // --> PL, OD #i116085# - adjusting fix for i113919
+//    if (bIsPDFExport)
+//    {
+//        aPageRange = rOptions.getStringValue( "PageRange", OUString() );
+//    }
+//    else
+    if ( !bIsPDFExport )
+    // <--
     {
         // PageContent :
         // 0 -> print all pages (default if aPageRange is empty)


INTEGRATION: CWS smarttags (1.64.44); FILE MERGED 2006/12/21 10:43:09 jakob_lechner 1.64.44.1: #i72705#: support for smarttags


Be more strict with detecting Optimus on Linux.

I don't really this is the root cause of r371851, but anyway,
tighten up the logic seems reasonable.

BUG=371851
TEST=
R=kbr@chromium.org

Review URL: https://codereview.chromium.org/283823002

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

--- gpu/config/gpu_info_collector_x11.cc
+++ gpu/config/gpu_info_collector_x11.cc
@@ -237,13 +237,18 @@
     case kVendorIDIntel:
       // In dual-GPU cases, sometimes PCI scan only gives us the
       // integrated GPU (i.e., the Intel one).
-      driver_version = CollectDriverVersionNVidia();
-      if (!driver_version.empty()) {
-        gpu_info->driver_vendor = "NVIDIA";
-        gpu_info->driver_version = driver_version;
-        // Machines with more than two GPUs are not handled.
-        if (gpu_info->secondary_gpus.size() <= 1)
+      if (gpu_info->secondary_gpus.size() == 0) {
+        driver_version = CollectDriverVersionNVidia();
+        if (!driver_version.empty()) {
+          gpu_info->driver_vendor = "NVIDIA";
+          gpu_info->driver_version = driver_version;
           gpu_info->optimus = true;
+          // Put Intel to the secondary GPU list.
+          gpu_info->secondary_gpus.push_back(gpu_info->gpu);
+          // Put NVIDIA as the primary GPU.
+          gpu_info->gpu.vendor_id = kVendorIDNVidia;
+          gpu_info->gpu.device_id = 0;  // Unknown Device.
+        }
       }
       break;
   }


On EntryCtrl, "Split" button now says "Split" instead of "Split...".
The dots were misleading as conventionally this implies a new
dialog window will pop up.

git-svn-id: 0231d2b9506727b8389b50bfeac72ec1f38c13c1@1638 ac3cbfda-f6ac-4daa-b570-d46c5f00fc98

--- graphical_session/wxs/entry_ctrl.cpp
+++ graphical_session/wxs/entry_ctrl.cpp
@@ -86,7 +86,7 @@
 	m_split_button = new wxButton
 	(	this,
 		s_split_button_id,
-		wxString("Split..."),
+		wxString("Split"),
 		wxDefaultPosition,
 		m_text_ctrl_size
 	);


Fixed regression in "Save To Pdf" of Print Preview.
Logical OR was used instead of bitwise OR.

BUG=415437

Review URL: https://codereview.chromium.org/585653003

Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#295588}

--- chrome/browser/ui/webui/print_preview/print_preview_handler.cc
+++ chrome/browser/ui/webui/print_preview/print_preview_handler.cc
@@ -247,7 +247,7 @@
   printing::PdfMetafileSkia metafile;
   metafile.InitFromData(static_cast<const void*>(data->front()), data->size());
   base::File file(path,
-                  base::File::FLAG_CREATE_ALWAYS || base::File::FLAG_WRITE);
+                  base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE);
   metafile.SaveTo(&file);
   if (!pdf_file_saved_closure.is_null())
     pdf_file_saved_closure.Run();


E_Node: Add binding for Node.get/setWorldSRT(...)

--- Core/Nodes/E_Node.cpp
+++ Core/Nodes/E_Node.cpp
@@ -262,6 +262,13 @@

 	//! [ESMF] self MinSG.Node.setSRT(SRT)
 	ES_MFUN(typeObject,Node,"setSRT",1,1,(thisObj->setSRT(parameter[0].to<const Geometry::SRT&>(rt)),thisEObj))
+
+	//! [ESMF] SRT MinSG.Node.getWorldSRT()
+	ES_MFUN(typeObject,const Node,"getWorldSRT",0,0,Transformations::getWorldSRT(thisObj))
+
+	//! [ESMF] slef MinSG.Node.setWorldSRT(SRT)
+	ES_MFUN(typeObject,Node,"setWorldSRT",1,1,(thisObj->setSRT( Transformations::worldSRTToRelSRT(thisObj,parameter[0].to<const Geometry::SRT&>(rt))),thisEObj))
+

 	// -----------------------------------
 	// ---- States


added granularity for ColorDibFromElevation

--- TerrainSDK/vtlib/core/Terrain.cpp
+++ TerrainSDK/vtlib/core/Terrain.cpp
@@ -514,7 +514,7 @@
 	}
 	vtHeightFieldGrid3d *pHFGrid = GetHeightFieldGrid3d();

-	pHFGrid->ColorDibFromElevation(m_pDIB, m_pTextureColors);
+	pHFGrid->ColorDibFromElevation(m_pDIB, m_pTextureColors, 4000);
 }

 /**


formatting update in tests.cpp

formatting update in tests.cpp

--- extras/tests/src/tests.cpp
+++ extras/tests/src/tests.cpp
@@ -128,23 +128,23 @@

 TEST_CASE("Wrapped map must not abandon memory if it had to allocate outside private pool", "[wrapped-map][abandon]")
 {
-    // We will use counting allocator to make sure no allocations fall through to std allocator.
-    allo::strategies::counting_strategy counting_strategy;
+   // We will use counting allocator to make sure no allocations fall through to std allocator.
+   allo::strategies::counting_strategy counting_strategy;

-    {
-        allo::counting_allocator<uint16_t> counting_allocator(counting_strategy);
+   {
+      allo::counting_allocator<uint16_t> counting_allocator(counting_strategy);

-        // Create with empty private pool.
-        // So in the end we must get as many deallocations as allocations.
-        allo::containers::wrapped_map<uint16_t, std::string, allo::counting_allocator> wrapped_map(0, counting_allocator);
-        auto& map = wrapped_map.unwrap();
+      // Create with empty private pool.
+      // So in the end we must get as many deallocations as allocations.
+      allo::containers::wrapped_map<uint16_t, std::string, allo::counting_allocator> wrapped_map(0, counting_allocator);
+      auto& map = wrapped_map.unwrap();

-        map[42] = "hello, world!";
+      map[42] = "hello, world!";

-        REQUIRE(map.size() == 1);
-        REQUIRE(map[42] == "hello, world!");
-    }
+      REQUIRE(map.size() == 1);
+      REQUIRE(map[42] == "hello, world!");
+   }

-    REQUIRE(counting_strategy.number_of_allocations() > 0);
-    REQUIRE(counting_strategy.number_of_deallocations() == counting_strategy.number_of_allocations());
+   REQUIRE(counting_strategy.number_of_allocations() > 0);
+   REQUIRE(counting_strategy.number_of_deallocations() == counting_strategy.number_of_allocations());
 }


fixed bug with deleting trees which had been moved

--- TerrainSDK/vtlib/core/Terrain.cpp
+++ TerrainSDK/vtlib/core/Terrain.cpp
@@ -2418,8 +2418,15 @@
 		if (m_PIA.IsSelected(i))
 		{
 			vtTransform *pTrans = m_PIA.GetPlantNode(i);
-			m_pVegGrid->RemoveFromGrid(pTrans);
-			m_PIA.DeletePlant(i);
+			if (pTrans != NULL)
+			{
+				vtGroup *pParent = pTrans->GetParent();
+				if (pParent)
+				{
+					pParent->RemoveChild(pTrans);
+					m_PIA.DeletePlant(i);
+				}
+			}
 		}
 	}
 }


cleanup and proper indent

cleanup and proper indent

--- enforcer-ng/src/xmlext-pb/xmlext-wr.cpp
+++ enforcer-ng/src/xmlext-pb/xmlext-wr.cpp
@@ -31,6 +31,7 @@

 #include <errno.h>
 #include <set>
+#include <sstream>

 #include "config.h"
 #include "xmlext-wr.h"
@@ -39,95 +40,68 @@
 #include "shared/log.h"
 #include "shared/file.h"

-static const char *module_str = "xmlext_wr";
-
-void
-ods_strcat_printf(std::string &str, const char *format, ...)
-{
-    char buf[ODS_SE_MAXLINE] = "";
-    int nbuf;
-    va_list args;
-    va_start(args, format);
-    nbuf = vsnprintf(buf,ODS_SE_MAXLINE,format,args);
-    if (nbuf<0)
-        ods_log_error("[%s] ods_strcat_printf: encoding error" ,module_str);
-    else
-        if (nbuf>=ODS_SE_MAXLINE)
-            ods_log_error("[%s] ods_strcat_printf: printed string too long",
-                          module_str);
-    str += buf;
-    va_end(args);
-}
-
 using namespace ::google::protobuf;
 using namespace std;

+static const char *module_str = "xmlext_wr";
+
+template <typename T> string tostr(const T& t) {
+	ostringstream os; os<<t; return os.str();
+}
+
 string
 get_value(const Message *msg, const FieldDescriptor *field)
 {
     const Reflection *reflection = msg->GetReflection();
     const xmloption xmlopt = field->options().GetExtension(xml);
-    string a;
+    char tmp[ODS_SE_MAXLINE];

     switch (field->type()) {
-        case FieldDescriptor::TYPE_FLOAT:
-            // float, exactly four bytes on the wire.
-            ods_strcat_printf(a, "%g",reflection->GetFloat(*msg, field));
-            break;
+        case FieldDescriptor::TYPE_FLOAT:    // float, exactly four bytes on the wire.
+            return tostr(reflection->GetFloat(*msg, field));
         case FieldDescriptor::TYPE_MESSAGE:
-            a = "";
-            break;
-        case FieldDescriptor::TYPE_DOUBLE: // double, exactly eight bytes on the wire.
-            ods_strcat_printf(a, "%g", reflection->GetDouble(*msg, field));
-            break;
+            return "";
+        case FieldDescriptor::TYPE_DOUBLE:   // double, exactly eight bytes on the wire.
+            return tostr(reflection->GetDouble(*msg, field));
         case FieldDescriptor::TYPE_INT32:    // int32, varint on the wire.  Negative numbers
         case FieldDescriptor::TYPE_SFIXED32: // int32, exactly four bytes on the wire
         case FieldDescriptor::TYPE_SINT32:   // int32, ZigZag-encoded varint on the wire
-            if (xmlopt.type()==duration)
-                ods_strcat_printf(a, "PT%dS", reflection->GetInt32(*msg, field));
-            else
-                ods_strcat_printf(a, "%d", reflection->GetInt32(*msg, field));
-            break;
+            if (xmlopt.type() != duration)
+                return tostr(reflection->GetInt32(*msg, field));
+            snprintf(tmp, ODS_SE_MAXLINE, "PT%dS", reflection->GetInt32(*msg, field));
+            return tostr(tmp);
         case FieldDescriptor::TYPE_INT64:    // int64, varint on the wire.  Negative numbers
         case FieldDescriptor::TYPE_SFIXED64: // int64, exactly eight bytes on the wire
         case FieldDescriptor::TYPE_SINT64:   // int64, ZigZag-encoded varint on the wire
-            if (xmlopt.type()==duration)
-                ods_strcat_printf(a, "PT%lldS", reflection->GetInt64(*msg, field));
-            else
-                ods_strcat_printf(a, "%lld", reflection->GetInt64(*msg, field));
-            break;
-        case FieldDescriptor::TYPE_UINT32: // uint32, varint on the wire
-        case FieldDescriptor::TYPE_FIXED32: // uint32, exactly four bytes on the wire.
-            if (xmlopt.type()==duration)
-                ods_strcat_printf(a, "PT%uS", reflection->GetUInt32(*msg, field));
-            else
-                ods_strcat_printf(a, "%u", reflection->GetUInt32(*msg, field));
-            break;
-        case FieldDescriptor::TYPE_UINT64: // uint64, varint on the wire.
-        case FieldDescriptor::TYPE_FIXED64: // uint64, exactly eight bytes on the wire.
-            if (xmlopt.type()==duration)
-                ods_strcat_printf(a, "PT%lluS", reflection->GetUInt64(*msg, field));
-            else
-                ods_strcat_printf(a, "%llu", reflection->GetUInt64(*msg, field));
-            break;
-        case FieldDescriptor::TYPE_BOOL: // bool, varint on the wire.
-            ods_strcat_printf(a, "%d", (int)reflection->GetBool(*msg, field)?1:0);
-            break;
-        case FieldDescriptor::TYPE_STRING: // UTF-8 text.
-            ods_strcat_printf(a, "%s", reflection->GetString(*msg, field).c_str());
-            break;
-        case FieldDescriptor::TYPE_BYTES: // Arbitrary byte array.
-            ods_strcat_printf(a, "%s", "ERROR: Bytes don't fit in xml attribute");
+            if (xmlopt.type() != duration)
+                return tostr(reflection->GetInt64(*msg, field));
+            snprintf(tmp, ODS_SE_MAXLINE, "PT%lldS", reflection->GetInt64(*msg, field));
+            return tostr(tmp);
+        case FieldDescriptor::TYPE_UINT32:   // uint32, varint on the wire
+        case FieldDescriptor::TYPE_FIXED32:  // uint32, exactly four bytes on the wire.
+            if (xmlopt.type() != duration)
+                return tostr(reflection->GetUInt32(*msg, field));
+            snprintf(tmp, ODS_SE_MAXLINE, "PT%uS", reflection->GetUInt32(*msg, field));
+            return tostr(tmp);
+        case FieldDescriptor::TYPE_UINT64:   // uint64, varint on the wire.
+        case FieldDescriptor::TYPE_FIXED64:  // uint64, exactly eight bytes on the wire.
+            if (xmlopt.type() != duration)
+                return tostr(reflection->GetUInt64(*msg, field));
+            snprintf(tmp, ODS_SE_MAXLINE, "PT%lluS", reflection->GetUInt64(*msg, field));
+            return tostr(tmp);
+        case FieldDescriptor::TYPE_BOOL:     // bool, varint on the wire.
+            return tostr((int)reflection->GetBool(*msg, field)?1:0);
+        case FieldDescriptor::TYPE_STRING:   // UTF-8 text.
+            return reflection->GetString(*msg, field);
+        case FieldDescriptor::TYPE_BYTES:    // Arbitrary byte array.
             ods_log_error("[%s] Bytes don't fit in xml attribute", module_str);
-            break;
-        case FieldDescriptor::TYPE_ENUM: // Enum, varint on the wire
-            ods_strcat_printf(a, "%s", reflection->GetEnum(*msg,field)->name().c_str());
-            break;
+            return tostr("ERROR: Bytes don't fit in xml attribute");
+        case FieldDescriptor::TYPE_ENUM:     // Enum, varint on the wire
+            return reflection->GetEnum(*msg,field)->name();
         default:
-            ods_strcat_printf(a, "%s", "ERROR: UNKNOWN FIELD TYPE");
             ods_log_error("[%s] Unknow field type", module_str);
-    }
-    return a;
+            return tostr("ERROR: UNKNOWN FIELD TYPE");
+    }
 }

 bool
@@ -207,13 +181,14 @@
 open_element(FILE *fw, const FieldDescriptor *field,
     std::vector<const FieldDescriptor*> elements,
     std::vector<const FieldDescriptor*> attributes,
-    const Message *msg
+    const Message *msg, int lvl
 )
 {
     /* get everything after last '/' */
     string elempath = field->options().GetExtension(xml).path();
     string elemname = strip_path(elempath);

+    for (int i = 0; i<lvl; i++) fprintf(fw, "  ");
     fprintf(fw, "<%s", elemname.c_str());
     //~ printf(" ((attrlen %d)) ", attributes.size());
     vector<const FieldDescriptor*>::const_iterator fld_iter;
@@ -237,13 +212,15 @@
 close_element(FILE *fw, const FieldDescriptor *field,
     std::vector<const FieldDescriptor*> elements,
     std::vector<const FieldDescriptor*> attributes,
-    const Message *msg
+    const Message *msg, int lvl
 )
 {
     string elempath = field->options().GetExtension(xml).path();
     string elemname = strip_path(elempath);
     string val =  get_value(msg, field);
     if (elements.empty() && val.empty()) return;
+    if (!elements.empty())
+        for (int i = 0; i<lvl; i++) fprintf(fw, "  ");
     fprintf(fw, "</%s>\n",  elemname.c_str());
 }

@@ -270,8 +247,10 @@
         string root = get_pathroot((*fld_iter)->options().GetExtension(xml).path());
         getSubForElemStr(root, nonterminal_elements, &sibblings);

+        for (int i = 0; i<lvl; i++) fprintf(fw, "  ");
         fprintf(fw, "<%s>\n",  root.c_str());
         recurse_write(fw, NULL, sibblings, attrs, msg, lvl+1, root);
+        for (int i = 0; i<lvl; i++) fprintf(fw, "  ");
         fprintf(fw, "</%s>\n",  root.c_str());
     }
 }
@@ -326,7 +305,7 @@
     if (parentfield) {
         std::vector<const FieldDescriptor*> parent_attr;
         getSubForElem(parentfield, &attributes, &parent_attr);
-        open_element(fw, parentfield, elements, parent_attr, msg);
+        open_element(fw, parentfield, elements, parent_attr, msg, lvl-1);
     }

     for (fld_iter=elements.begin(); fld_iter != elements.end(); ++fld_iter) {
@@ -364,8 +343,8 @@
                 printf("DUBUG skipping repeated field");
                 continue;
             } else {
-                open_element (fw, *fld_iter, subfields, elem_attr, msg);
-                close_element(fw, *fld_iter, subfields, elem_attr, msg);
+                open_element (fw, *fld_iter, subfields, elem_attr, msg, lvl);
+                close_element(fw, *fld_iter, subfields, elem_attr, msg, lvl);
             }
         }
     }
@@ -373,7 +352,7 @@
     write_nonterminals(fw, msg, &nonterminal_elements, lvl);

     if (parentfield) {
-        close_element(fw, parentfield, elements, attributes, msg);
+        close_element(fw, parentfield, elements, attributes, msg, lvl-1);
     }
 }

@@ -386,8 +365,9 @@
     recurse_write(fw, NULL, fields, attributes, msg, 0, "");
 }

-bool write_pb_message_to_xml_file(const google::protobuf::Message *document,
-                                  const char *xmlfilepath)
+bool
+write_pb_message_to_xml_file(const google::protobuf::Message *document,
+    const char *xmlfilepath)
 {
     FILE *fw = ods_fopen(xmlfilepath,NULL,"w");
     if (!fw) return false;
@@ -396,8 +376,9 @@
     return true;
 }

-bool write_pb_message_to_xml_fd(const google::protobuf::Message *document,
-								int fd)
+bool
+write_pb_message_to_xml_fd(const google::protobuf::Message *document,
+    int fd)
 {
     if (fd<0) {
         ods_log_error("[%s] write_pb_message_to_xml_fd: invalid fd: %d",


fixed delete of fence geometry

fixed delete of fence geometry

--- TerrainSDK/vtlib/core/Terrain.cpp
+++ TerrainSDK/vtlib/core/Terrain.cpp
@@ -1299,7 +1299,10 @@
 		if (str->IsSelected())
 		{
 			vtStructure3d *str3d = structures->GetStructure3d(i);
-			RemoveNodeFromStructGrid(str3d->GetContainer());
+			vtNode *node = str3d->GetContainer();
+			if (!node)
+				node = str3d->GetGeom();
+			RemoveNodeFromStructGrid(node);
 		}
 	}


Fixed scaling on non square displays

Fixed scaling on non square displays

--- CGProj/main.cpp
+++ CGProj/main.cpp
@@ -63,10 +63,15 @@

 //scaling & transform screen function
 void myReshape(int w, int h) {
-    glViewport(0, 0, (GLsizei)w, (GLsizei)h);
+    if(w == h)
+        glViewport(0, 0, (GLsizei)w, (GLsizei)h);
+    else if(w < h)
+        glViewport(0.0, (h - w)/2, (GLsizei)w, (GLsizei)w);
+    else
+        glViewport((w - h)/2, 0.0, (GLsizei)h, (GLsizei)h);
     glMatrixMode(GL_PROJECTION);
     glLoadIdentity();
-	glOrtho(0.0, COLUMNS, 0.0, ROWS, -1.0, 1.0);
+    glOrtho(0.0, COLUMNS, 0.0, ROWS, -1.0, 1.0);
     glMatrixMode(GL_MODELVIEW);
     glLoadIdentity();
 }


attenuation slider

attenuation slider

--- src/saiga/opengl/rendering/lighting/attenuated_light.cpp
+++ src/saiga/opengl/rendering/lighting/attenuated_light.cpp
@@ -13,6 +13,9 @@
 {
 void LightDistanceAttenuation::renderImGui()
 {
+    ImGui::SliderFloat("atten. a", &attenuation[0], 0, 2);
+    ImGui::SliderFloat("atten. b", &attenuation[1], 0, 2);
+    ImGui::SliderFloat("atten. c", &attenuation[2], 0, 2);
     ImGui::InputFloat3("attenuation", &attenuation[0]);
     float c = Evaluate(radius);
     ImGui::Text("Cutoff Intensity: %f", c);


COFF: Remove dead code.

COFF: Remove dead code.

git-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@240682 91177308-0d34-0410-b5e6-96231b3b80d8

--- COFF/Writer.cpp
+++ COFF/Writer.cpp
@@ -124,16 +124,6 @@
       if (SC->isRoot())
         SC->markLive();
 }
-
-struct Hasher {
-  size_t operator()(const SectionChunk *C) const { return C->getHash(); }
-};
-
-struct Equals {
-  bool operator()(const SectionChunk *A, const SectionChunk *B) const {
-    return A->equals(B);
-  }
-};

 // Merge identical COMDAT sections.
 void Writer::dedupCOMDATs() {


Fix memory leak

Fix memory leak

--- src/common/pixelboost/logic/system/physics/2d/physics.cpp
+++ src/common/pixelboost/logic/system/physics/2d/physics.cpp
@@ -18,7 +18,7 @@

 PhysicsSystem2D::~PhysicsSystem2D()
 {
-
+    delete _World;
 }

 pb::Uid PhysicsSystem2D::GetType()


do not paint background if no fade color was set

The condition got lost in commit 2e8b2e6de14d325863d9bc419a461b75c3aaf3d0 .

Change-Id: I8c9a6baf56dfe36d55e02476823e2847d77a7f58

--- slideshow/source/engine/transitions/slidetransitionfactory.cxx
+++ slideshow/source/engine/transitions/slidetransitionfactory.cxx
@@ -420,11 +420,14 @@
     const ViewEntry& rViewEntry,
     const cppcanvas::CanvasSharedPtr& rDestinationCanvas )
 {
-    // clear page to given fade color. 'Leaving' slide is
-    // painted atop of that, but slowly fading out.
-    fillPage( rDestinationCanvas,
-              ::basegfx::B2DSize( getEnteringSlideSizePixel( rViewEntry.mpView ) ),
-              *maFadeColor );
+    if ( maFadeColor )
+    {
+        // clear page to given fade color. 'Leaving' slide is
+        // painted atop of that, but slowly fading out.
+        fillPage( rDestinationCanvas,
+                ::basegfx::B2DSize( getEnteringSlideSizePixel( rViewEntry.mpView ) ),
+                *maFadeColor );
+    }
 }

 void FadingSlideChange::performIn(


Fixed typo.

Fixed typo.

git-svn-id: b36ee6b6e70810a25e81bc801db00a83677983fc@672581 13f79535-47bb-0310-9956-ffa450edef68

--- Tests/Performance/TestHarness.hpp
+++ Tests/Performance/TestHarness.hpp
@@ -242,7 +242,7 @@
             m_logger->error()
                     << "Mode: "
                     << testCase.inputMode.c_str()
-                    << " is inavlid for stylesheet: "
+                    << " is invalid for stylesheet: "
                     << testCase.stylesheet
                     << endl;
         }


Make compile also with MPI enabled.

Make compile also with MPI enabled.

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@23926 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/source/dofs/dof_tools.cc
+++ deal.II/source/dofs/dof_tools.cc
@@ -4649,6 +4649,9 @@
 				     // reduce information from all CPUs
 #ifdef DEAL_II_USE_P4EST
 #ifdef DEAL_II_COMPILER_SUPPORTS_MPI
+    const unsigned int dim = DH::dimension;
+    const unsigned int spacedim = DH::space_dimension;
+
     if (const parallel::distributed::Triangulation<dim,spacedim> * tria
 	= (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
 	   (&dof_handler.get_tria())))


white space

white space

--- src/shogun/features/streaming/StreamingDenseFeatures.cpp
+++ src/shogun/features/streaming/StreamingDenseFeatures.cpp
@@ -224,8 +224,8 @@
 bool CStreamingDenseFeatures<T>::get_next_example()
 {
 	bool ret_value;
-	ret_value=(bool)parser.get_next_example(current_vector.vector, current_vector.vlen,
-			current_label);
+	ret_value=(bool)parser.get_next_example(current_vector.vector,
+			current_vector.vlen, current_label);

 	return ret_value;
 }
@@ -233,8 +233,6 @@
 template<class T>
 SGVector<T> CStreamingDenseFeatures<T>::get_vector()
 {
-	current_vector=SGVector<T>(current_vector.vector, current_vector.vlen, false);
-
 	return current_vector;
 }


preempt: annotate for branch prediction

preempt: annotate for branch prediction

We can predict that need_preempt() will usually return false, helping
the compiler push the prempted path out of the hot path.
Message-Id: <4c7414d1e91c5ee0c8158e181cc06e151b6fcfee@scylladb.com>

--- core/preempt.hh
+++ core/preempt.hh
@@ -30,7 +30,7 @@
 #ifndef SEASTAR_DEBUG
     // prevent compiler from eliminating loads in a loop
     std::atomic_signal_fence(std::memory_order_seq_cst);
-    return g_need_preempt;
+    return __builtin_expect(g_need_preempt, false);
 #else
     return true;
 #endif


Adding "colorscheme" to the supported variables
This is a string,
	kate: colorscheme My Fancy Scheme;
If no color scheme with the given name exist, the default is used.

svn path=/trunk/kdelibs/kate/; revision=272931

--- part/part/katedocument.cpp
+++ part/part/katedocument.cpp
@@ -4621,7 +4621,7 @@
         << "background-color" << "selection-color"
         << "current-line-color" << "bracket-highlight-color"
         << "word-wrap-marker-color"
-        << "font" << "font-size";
+        << "font" << "font-size" << "colorscheme";
     int p( 0 );
     QString s = kvLine.cap(1);
     QString  var, val;
@@ -4772,6 +4772,10 @@

       v->renderer()->config()->setFont( _f );
     }
+    else if ( var == "colorscheme" )
+    {
+      v->renderer()->config()->setSchema( KateFactory::self()->schemaManager()->number( val ) );
+    }
   }
 }


Transceiver52M: Read IP address and port to bind to from a configuration instead of hardcoding them.

Signed-off-by: Thomas Tsou <tom@tsou.cc>

git-svn-id: 504cad4147f1e500be0a169b9f46375eaf875953@4634 19bc5d8c-e614-43d4-8b26-e1612bc8e597

--- Transceiver52M/runTransceiver.cpp
+++ Transceiver52M/runTransceiver.cpp
@@ -96,7 +96,7 @@
   }

   RadioInterface* radio = new RadioInterface(usrp,3,SAMPSPERSYM,mOversamplingRate,false);
-  Transceiver *trx = new Transceiver(5700,"127.0.0.1",SAMPSPERSYM,GSM::Time(3,0),radio);
+  Transceiver *trx = new Transceiver(gConfig.getNum("TRX.Port"),gConfig.getStr("TRX.IP").c_str(),SAMPSPERSYM,GSM::Time(3,0),radio);
   trx->receiveFIFO(radio->receiveFIFO());
 /*
   signalVector *gsmPulse = generateGSMPulse(2,1);


Revert thiago's merge to kdelibs /trunk that broke lotsa stuff for now.

svn path=/trunk/KDE/kdelibs/kate/; revision=556588

--- part/part/katedocument.cpp
+++ part/part/katedocument.cpp
@@ -68,7 +68,7 @@
 #include <ktempfile.h>
 #include <kcodecs.h>

-#include <QtDBus/QtDBus>
+#include <dbus/qdbus.h>
 #include <qtimer.h>
 #include <qfile.h>
 #include <qclipboard.h>


Another crash (Q_ASSERT for others) fixed: when deleting text from a line,
the loop that moves the chars was going too far. In essence:
-    for (int z = pos; z < (int) oldTextLen; z++)
+  for (uint z = pos; z < oldTextLen - delLen; z++)
(but I also got rid of the useless oldTextLen, moving the -= below that loop).
Heavily tested.

svn path=/trunk/kdelibs/kate/; revision=186693

--- part/part/katetextline.cpp
+++ part/part/katetextline.cpp
@@ -1,10 +1,10 @@
 /* This file is part of the KDE libraries
-   Copyright (C) 2001-2002 Christoph Cullmann <cullmann@kde.org>
+   Copyright (C) 2001-2002 Christoph Cullmann <cullmann@kde.org>
    Copyright (C) 2002 Joseph Wenninger <jowenn@kde.org>
-
+
    Based on:
      TextLine : Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
-
+
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License version 2 as published by the Free Software Foundation.
@@ -44,16 +44,16 @@
   // calc new textLen, store old
   uint textLen = m_text.size();
   uint oldTextLen = textLen;
-
+
   if (pos <= textLen)
     textLen += insLen;
   else if (pos > textLen)
     textLen = pos + insLen;
-
+
   // resize the arrays
   m_text.resize (textLen);
   m_attributes.resize (textLen);
-
+
   // HA, insert behind text end, fill with spaces
   if (pos >= oldTextLen)
   {
@@ -65,19 +65,19 @@
   }
   // HA, insert in text, move the old text behind pos
   else if (oldTextLen > 0)
-  {
+  {
     for (int z = oldTextLen -1; z >= (int) pos; z--)
     {
       m_text[z+insLen] = m_text[z];
       m_attributes[z+insLen] = m_attributes[z];
     }
   }
-
+
   // BUH, actually insert the new text
   for (uint z = 0; z < insLen; z++)
   {
     m_text[z+pos] = insText[z];
-
+
     if (insAttribs == 0)
       m_attributes[z+pos] = 0;
     else
@@ -90,37 +90,31 @@
   // nothing to do
   if (delLen == 0)
     return;
-
-  // calc textLen, store old one, calc delLen
+
   uint textLen = m_text.size();
-
+
   if (textLen == 0)
     return; // uh, again nothing real to do ;)
-
-  uint oldTextLen = textLen;
-
+
   if (pos >= textLen)
     return;
-
+
   if ((pos + delLen) > textLen)
     delLen = textLen - pos;
-
+
+  // BU, MOVE THE OLD TEXT AROUND
+  for (uint z = pos; z < textLen - delLen; z++)
+  {
+      m_text[z] = m_text[z+delLen];
+      m_attributes[z] = m_attributes[z+delLen];
+  }
+
+  // resize the stuff
   if (delLen < textLen)
     textLen -= delLen;
-  else
+  else // seems to happen when hitting Backspace at the beginning of a line...
     textLen = 0;
-
-  // BU, MOVE THE OLD TEXT AROUND
-  if (textLen > 0)
-  {
-    for (int z = pos; z < (int) oldTextLen; z++)
-    {
-      m_text[z] = m_text[z+delLen];
-      m_attributes[z] = m_attributes[z+delLen];
-    }
-  }
-
-  // resize the stuff
+
   m_text.resize (textLen);
   m_attributes.resize (textLen);
 }
@@ -177,12 +171,12 @@
     }
     return -1;
 }
-
+
 int TextLine::firstChar() const
 {
-  return nextNonSpaceChar(0);
-}
-
+  return nextNonSpaceChar(0);
+}
+
 int TextLine::lastChar() const
 {
     return previousNonSpaceChar(m_text.size() - 1);
@@ -192,10 +186,10 @@
 {
   if ( startCol >= m_text.size() )
     return QString ();
-
+
   if ( (startCol + length) > m_text.size())
     length = m_text.size() - startCol;
-
+
   return QString (m_text.data() + startCol, length);
 }

@@ -262,23 +256,23 @@
   }

   return false;
-}
-
-bool TextLine::searchText (uint startCol, const QRegExp &regexp, uint *foundAtCol, uint *matchLen, bool backwards)
-{
-  int index;
-
+}
+
+bool TextLine::searchText (uint startCol, const QRegExp &regexp, uint *foundAtCol, uint *matchLen, bool backwards)
+{
+  int index;
+
   if (backwards)
     index = regexp.searchRev (QConstString (this->m_text.data(), this->m_text.size()).string(), startCol);
   else
     index = regexp.search (QConstString (this->m_text.data(), this->m_text.size()).string(), startCol);
-
-   if (index > -1)
+
+   if (index > -1)
 	{
-	  (*foundAtCol) = index;
-		(*matchLen)=regexp.matchedLength();
-		return true;
-  }
+	  (*foundAtCol) = index;
+		(*matchLen)=regexp.matchedLength();
+		return true;
+  }

   return false;
 }
@@ -290,9 +284,9 @@
   if ( ! m_attributes.isEmpty())
   {
     attributesLen = 1;
-
+
     uint lastAttrib = m_attributes[0];
-
+
     for (uint z=0; z < m_attributes.size(); z++)
     {
       if (m_attributes[z] != lastAttrib)
@@ -301,8 +295,8 @@
         lastAttrib = m_attributes[z];
       }
     }
-  }
-
+  }
+
   return (4*sizeof(uint)) + (m_text.size()*sizeof(QChar)) + (attributesLen * sizeof(uchar)) + (attributesLen * sizeof(uint)) + 1 + (m_ctx.size() * sizeof(uint)) + (m_foldingList.size() * sizeof(signed char));
 }

@@ -314,16 +308,16 @@

   memcpy(buf, &l, sizeof(uint));
   buf += sizeof(uint);
-
+
   memcpy(buf, (char *) m_text.data(), sizeof(QChar)*l);
   buf += sizeof(QChar)*l;

   memcpy(buf, (char *) &m_flags, 1);
   buf += 1;
-
+
   char *attribLenPos = buf;
   buf += sizeof(uint);
-
+
   memcpy(buf, &lctx, sizeof(uint));
   buf += sizeof(uint);

@@ -333,11 +327,11 @@
   // hl size runlength encoding START

   uint attributesLen = 0;
-
+
   if ( ! m_attributes.isEmpty() )
   {
     attributesLen = 1;
-
+
     uchar lastAttrib = m_attributes[0];
     uint lastStart = 0;
     uint length = 0;
@@ -347,7 +341,7 @@
       if (m_attributes[z] != lastAttrib)
       {
         length = z - lastStart;
-
+
         memcpy(buf, &lastAttrib, sizeof(uchar));
         buf += sizeof(uchar);

@@ -367,9 +361,9 @@
     buf += sizeof(uchar);

     memcpy(buf, &length, sizeof(uint));
-    buf += sizeof(uint);
-  }
-
+    buf += sizeof(uint);
+  }
+
   memcpy(attribLenPos, &attributesLen, sizeof(uint));

   // hl size runlength encoding STOP
@@ -393,22 +387,22 @@
   // text + context length read
   memcpy((char *) &l, buf, sizeof(uint));
   buf += sizeof(uint);
-
+
   // text + attributes
   m_text.duplicate ((QChar *) buf, l);
   buf += sizeof(QChar)*l;
-
+
   m_attributes.resize (l);
-
+
   memcpy((char *) &m_flags, buf, 1);
   buf += 1;
-
+
   // we just restore a TextLine from a buffer first time
   if (m_flags == TextLine::flagNoOtherData)
   {
     m_flags = TextLine::flagVisible;
     m_attributes.fill (0);
-
+
     return buf;
   }

@@ -428,12 +422,12 @@
   uchar attrib = 0;
   uint length = 0;
   uint pos = 0;
-
+
   for (uint z=0; z < lattrib; z++)
   {
     if (pos >= m_attributes.size())
-      break;
-
+      break;
+
     memcpy((char *) &attrib, buf, sizeof(uchar));
     buf += sizeof(uchar);

@@ -442,21 +436,21 @@

     if ((pos+length) > m_attributes.size())
       length = m_attributes.size() - pos;
-
+
     memset (attr, attrib, length);

     pos += length;
     attr += length;
   }
-
+
   // hl size runlength encoding STOP
-
+
   m_ctx.duplicate ((uint *) buf, lctx);
   buf += sizeof(uint) * lctx;

   m_foldingList.duplicate ((signed char *) buf, lfold);
-  buf += lfold;
-
+  buf += lfold;
+
   return buf;
 }


fix page count in printing

fix page count in printing

BUG: 246699

--- part/utils/kateprinter.cpp
+++ part/utils/kateprinter.cpp
@@ -188,7 +188,7 @@
     uint currentPage( 1 );
     uint lastline = doc->lastLine(); // necessary to print selection only
     uint firstline( 0 );
-    int fontHeight = renderer.fontHeight();
+    const int fontHeight = renderer.fontHeight();
     KTextEditor::Range selectionRange;

     /*
@@ -340,51 +340,43 @@
       // now that we know the vertical amount of space needed,
       // it is possible to calculate the total number of pages
       // if needed, that is if any header/footer tag contains "%P".
-#if 0
       if ( !headerTagList.filter("%P").isEmpty() || !footerTagList.filter("%P").isEmpty() )
       {
         kDebug(13020)<<"'%P' found! calculating number of pages...";
-        uint _pages = 0;
-        uint _ph = maxHeight;
+        int pageHeight = maxHeight;
         if ( useHeader )
-          _ph -= ( headerHeight + innerMargin );
+          pageHeight -= ( headerHeight + innerMargin );
         if ( useFooter )
-          _ph -= innerMargin;
-        int _lpp = _ph / fontHeight;
-        uint _lt = 0, _c=0;
-
-        // add space for guide if required
+          pageHeight -= innerMargin;
+        const int linesPerPage = pageHeight / fontHeight;
+//         kDebug() << "Lines per page:" << linesPerPage;
+
+        // calculate total layouted lines in the document
+        int totalLines = 0;
+        // TODO: right now ignores selection printing
+        for (int i = firstline; i <= lastline; ++i) {
+          KateLineLayoutPtr rangeptr(new KateLineLayout(doc));
+          rangeptr->setLine(i);
+          renderer.layoutLine(rangeptr, (int)maxWidth, false);
+          totalLines += rangeptr->viewLineCount();
+        }
+        int totalPages = (totalLines / linesPerPage)
+                      + ((totalLines % linesPerPage) > 0 ? 1 : 0);
+//         kDebug() << "_______ pages:" << (totalLines / linesPerPage);
+//         kDebug() << "________ rest:" << (totalLines % linesPerPage);
+
+        // TODO: add space for guide if required
 //         if ( useGuide )
 //           _lt += (guideHeight + (fontHeight /2)) / fontHeight;
-        long _lw;
-        for ( uint i = firstline; i < lastline; i++ )
-        {
-          //FIXME: _lw = renderer.textWidth( doc->kateTextLine( i ), -1 );
-          _lw = 80 * renderer.spaceWidth(); //FIXME: just a stand-in
-          while ( _lw >= 0 )
-          {
-            _c++;
-            _lt++;
-            if ( (int)_lt  == _lpp )
-            {
-              _pages++;
-              _lt = 0;
-            }
-            _lw -= maxWidth;
-            if ( ! _lw ) _lw--; // skip lines matching exactly!
-          }
-        }
-        if ( _lt ) _pages++; // last page

         // substitute both tag lists
         QString re("%P");
         QStringList::Iterator it;
         for ( it=headerTagList.begin(); it!=headerTagList.end(); ++it )
-          (*it).replace( re, QString( "%1" ).arg( _pages ) );
+          (*it).replace( re, QString( "%1" ).arg( totalPages ) );
         for ( it=footerTagList.begin(); it!=footerTagList.end(); ++it )
-          (*it).replace( re, QString( "%1" ).arg( _pages ) );
+          (*it).replace( re, QString( "%1" ).arg( totalPages ) );
       }
-#endif
     } // end prepare block

      /*
@@ -395,7 +387,7 @@
       startCol = 0;
       endCol = 0;

-      if ( y + fontHeight >= maxHeight )
+      if ( y + fontHeight > maxHeight )
       {
         kDebug(13020)<<"Starting new page,"<<lineCount<<"lines up to now.";
         printer.newPage();
@@ -651,15 +643,15 @@
       // clip and adjust the painter position as necessary
       int _lines = (*rangeptr)->viewLineCount(); // number of "sublines" to paint.

+      int proceedLines = _lines;
       if (remainder) {
-        int _height = (maxHeight-y)/fontHeight;
-        _height = qMin(_height, remainder);
+        proceedLines = qMin((maxHeight - y) / fontHeight, remainder);

         paint.translate(0, -(_lines-remainder)*fontHeight+1);
-        paint.setClipRect(0, (_lines-remainder)*fontHeight+1, maxWidth, _height*fontHeight); //### drop the crosspatch in printerfriendly mode???
-        remainder -= _height;
+        paint.setClipRect(0, (_lines-remainder)*fontHeight+1, maxWidth, proceedLines*fontHeight); //### drop the crosspatch in printerfriendly mode???
+        remainder -= proceedLines;
       }
-      else if (fontHeight*_lines > maxHeight-y) {
+      else if (y + fontHeight * _lines > maxHeight) {
         remainder = _lines - ((maxHeight-y)/fontHeight);
         paint.setClipRect(0, 0, maxWidth, (_lines-remainder)*fontHeight+1); //### drop the crosspatch in printerfriendly mode???
       }
@@ -667,9 +659,9 @@
       renderer.paintTextLine(paint, *rangeptr, 0, (int)maxWidth);

       paint.setClipping(false);
-      paint.translate(_xadjust, (fontHeight * _lines));
-
-      y += fontHeight*_lines;
+      paint.translate(_xadjust, (fontHeight * (_lines-remainder)));
+
+      y += fontHeight * proceedLines;

       if ( ! remainder )
       lineCount++;


demos/painter_path_test: make matrix brush mode being on better

--- demos/painter_path_test/main.cpp
+++ demos/painter_path_test/main.cpp
@@ -201,7 +201,7 @@
   float m_angle;
   PanZoomTrackerSDLEvent m_path_zoomer;

-  bool m_translate_brush, m_matrix_brush;
+  bool m_matrix_brush;

   vec2 m_gradient_p0, m_gradient_p1;
   float m_gradient_r0, m_gradient_r1;
@@ -298,7 +298,13 @@
   construct_dash_patterns(void);

   vec2
-  item_coordinates(ivec2 c);
+  item_coordinates(ivec2 c)
+  {
+    return item_coordinates(vec2(c));
+  }
+
+  vec2
+  item_coordinates(vec2 c);

   vec2
   brush_item_coordinate(ivec2 c);
@@ -382,12 +388,6 @@
   gradient_spread_type(void)
   {
     return m_paths[m_selected_path].m_gradient_spread_type;
-  }
-
-  bool&
-  translate_brush(void)
-  {
-    return m_paths[m_selected_path].m_translate_brush;
   }

   bool&
@@ -549,6 +549,8 @@

   Path m_clip_window_path;
   bool m_clip_window_path_dirty;
+
+  float3x3 m_pixel_matrix;
 };

 ///////////////////////////////////
@@ -563,7 +565,6 @@
   m_shear(1.0f, 1.0f),
   m_shear2(1.0f, 1.0f),
   m_angle(0.0f),
-  m_translate_brush(false),
   m_matrix_brush(false),
   m_gradient_spread_type(PainterBrush::gradient_repeat),
   m_repeat_window(false),
@@ -735,9 +736,8 @@
             << "\tctrl-i: toggle mipmap filtering when applying an image\n"
             << "\ts: cycle through defined color stops for gradient\n"
             << "\tg: cycle through gradient types (linear or radial)\n"
-            << "\th: toggle repeat gradient\n"
-            << "\tt: toggle translate brush\n"
-            << "\ty: toggle matrix brush\n"
+            << "\th: cycle though gradient spead types\n"
+            << "\ty: toggle applying matrix brush so that brush appears to be in pixel coordinates\n"
             << "\to: toggle clipping window\n"
             << "\tz: increase/decrease curve flatness\n"
             << "\t4,6,2,8 (number pad): change location of clipping window\n"
@@ -1076,29 +1076,25 @@

 vec2
 painter_stroke_test::
-brush_item_coordinate(ivec2 scr)
+brush_item_coordinate(ivec2 q)
 {
   vec2 p;
-  p = item_coordinates(scr);

   if (matrix_brush())
     {
-      p *= zoomer().transformation().scale();
-    }
-
-  if (translate_brush())
-    {
-      p += zoomer().transformation().translation();
+      p = vec2(q);
+    }
+  else
+    {
+      p = item_coordinates(q);
     }
   return p;
 }

 vec2
 painter_stroke_test::
-item_coordinates(ivec2 scr)
-{
-  vec2 p(scr);
-
+item_coordinates(vec2 p)
+{
   /* unapply zoomer()
    */
   p = zoomer().transformation().apply_inverse_to_point(p);
@@ -1252,12 +1248,7 @@

         case SDLK_y:
           matrix_brush() = !matrix_brush();
-          std::cout << "Matrix brush: " << on_off(matrix_brush()) << "\n";
-          break;
-
-        case SDLK_t:
-          translate_brush() = !translate_brush();
-          std::cout << "Translate brush: " << on_off(translate_brush()) << "\n";
+          std::cout << "Make brush appear as-if in pixel coordinates: " << on_off(matrix_brush()) << "\n";
           break;

         case SDLK_h:
@@ -1732,21 +1723,23 @@
       PainterBrush fill_brush;

       fill_brush.color(m_fill_red.value(), m_fill_green.value(),
-                     m_fill_blue.value(), m_fill_alpha.value());
-      if (translate_brush())
-        {
-          fill_brush.transformation_translate(zoomer().transformation().translation());
-        }
-      else
-        {
-          fill_brush.no_transformation_translation();
-        }
+                       m_fill_blue.value(), m_fill_alpha.value());

       if (matrix_brush())
         {
-          float2x2 m;
-          m(0, 0) = m(1, 1) = zoomer().transformation().scale();
-          fill_brush.transformation_matrix(m);
+          /* We want the effect that the brush is in the pixel-coordinates
+           * so we make the transformation the same transformation
+           * that is applied to painter.
+           */
+          float m;
+          m = zoomer().transformation().scale();
+
+          fill_brush.no_transformation();
+          fill_brush.apply_translate(zoomer().transformation().translation());
+          fill_brush.apply_shear(m, m);
+          fill_brush.apply_shear(shear().x(), shear().y());
+          fill_brush.apply_rotate(angle() * M_PI / 180.0f);
+          fill_brush.apply_shear(shear2().x(), shear2().y());
         }
       else
         {
@@ -1976,25 +1969,30 @@
     {
       float r0, r1;
       vec2 p0, p1;
-      float inv_scale;
-
-      inv_scale = 1.0f / zoomer().transformation().scale();
-      r0 = 15.0f * inv_scale;
-      r1 = 30.0f * inv_scale;
+
+      r0 = 15.0f;
+      r1 = 30.0f;

       p0 = gradient_p0();
       p1 = gradient_p1();

-      if (translate_brush())
-        {
-          p0 -= zoomer().transformation().translation();
-          p1 -= zoomer().transformation().translation();
-        }
-
       if (matrix_brush())
         {
-          p0 *= inv_scale;
-          p1 *= inv_scale;
+          /* p0, p1 are suppose to be in screen coordinates,
+           * avoid the drama of unapplying coordinates and just
+           * change coordinate system temporarily to pixel
+           * coordinates
+           */
+          m_painter->save();
+          m_painter->transformation(m_pixel_matrix);
+        }
+      else
+        {
+          float inv_scale;
+
+          inv_scale = 1.0f / zoomer().transformation().scale();
+          r0 *= inv_scale;
+          r1 *= inv_scale;
         }

       if (!m_black_pen)
@@ -2009,6 +2007,11 @@

       fill_centered_rect(p1, r1, PainterData(m_white_pen));
       fill_centered_rect(p1, r0, PainterData(m_black_pen));
+
+      if (matrix_brush())
+        {
+          m_painter->restore();
+        }
     }
 }

@@ -2068,6 +2071,8 @@
                              .join_style(Painter::no_joins),
                              Painter::shader_anti_alias_none);
     }
+
+  m_pixel_matrix = m_painter->transformation();

   /* apply zoomer() */
   m_painter->concat(zoomer().transformation().matrix3());


[fuchsia, arm64] Use mx_cache_flush instead of removed __clear_cache.

Review-Url: https://codereview.chromium.org/2987873002 .

--- runtime/vm/cpu_arm64.cc
+++ runtime/vm/cpu_arm64.cc
@@ -13,9 +13,11 @@

 #if !defined(USING_SIMULATOR)
 #if !defined(HOST_OS_FUCHSIA)
-#include <sys/syscall.h> /* NOLINT */
+#include <sys/syscall.h>
+#else
+#include <magenta/syscalls.h>
 #endif
-#include <unistd.h> /* NOLINT */
+#include <unistd.h>
 #endif

 namespace dart {
@@ -34,12 +36,15 @@

 // ARM recommends using the gcc intrinsic __clear_cache on Linux and Android.
 // blogs.arm.com/software-enablement/141-caches-and-self-modifying-code/
-#if defined(HOST_OS_ANDROID) || defined(HOST_OS_FUCHSIA) ||                    \
-    defined(HOST_OS_LINUX)
+#if defined(HOST_OS_ANDROID) || defined(HOST_OS_LINUX)
   extern void __clear_cache(char*, char*);
   char* beg = reinterpret_cast<char*>(start);
   char* end = reinterpret_cast<char*>(start + size);
   ::__clear_cache(beg, end);
+#elif defined(HOST_OS_FUCHSIA)
+  mx_status_t result = mx_cache_flush(reinterpret_cast<const void*>(start),
+                                      size, MX_CACHE_FLUSH_INSN);
+  ASSERT(result == MX_OK);
 #else
 #error FlushICache only tested/supported on Android, Fuchsia, and Linux
 #endif


Fix hash test for windows.

Fix hash test for windows.

--- groups/bsl/bslstl/bslstl_error.t.cpp
+++ groups/bsl/bslstl/bslstl_error.t.cpp
@@ -1256,7 +1256,13 @@
                     printf("\t%d %s %d %zu\n",
                            j, cj.category().name(), cj.value(), hasher(cj));
                 }
-                ASSERT((i == j) == (hasher(ci) == hasher(cj)));
+#ifdef BSLS_PLATFORM_OS_WINDOWS
+                // Windows implementation appears to not include the category.
+                bool equal = ci.value() == cj.value();
+#else
+                bool equal = i == j;
+#endif
+                ASSERT(equal == (hasher(ci) == hasher(cj)));
             }
         }

@@ -1294,8 +1300,13 @@
                     printf("\t%d %s %d %zu\n",
                            j, cj.category().name(), cj.value(), hasher(cj));
                 }
-                ASSERT((i == j) ==
-                       (hasher(conditions[i]) == hasher(conditions[j])));
+#ifdef BSLS_PLATFORM_OS_WINDOWS
+                // Windows implementation appears to not include the category.
+                bool equal = ci.value() == cj.value();
+#else
+                bool equal = i == j;
+#endif
+                ASSERT(equal == (hasher(ci) == hasher(cj)));
             }
         }
 #endif


Set hovering text to able showing utf8 texts.

--- RexLogicModule/Environment/Primitive.cpp
+++ RexLogicModule/Environment/Primitive.cpp
@@ -1254,7 +1254,7 @@
         assert(component.get());
         EC_HoveringText &hoveringText = *(checked_static_cast<EC_HoveringText *>(component.get()));
         hoveringText.SetTextColor(color);
-        hoveringText.ShowMessage(text.c_str());
+        hoveringText.ShowMessage(QString::fromUtf8(text.c_str()));
     }
 }


Fixed another warning.

Fixed another warning.

--- Utilities/WebSocketConnection.cpp
+++ Utilities/WebSocketConnection.cpp
@@ -20,7 +20,7 @@
 }

 void WebSocketConnection::doHandshake() {
-	uint16 i, start, end;
+	uint16 start = 0, end = 0;
 	DataStream keyAndMagic;
 	DataStream response;
 	uint8 hash[Cryptography::SHA1_LENGTH];
@@ -34,7 +34,7 @@
 		return;
 	}

-	for (i = 0; i < this->bytesReceived - 19U; i++) {
+	for (uint16 i = 0; i < this->bytesReceived - 19U; i++) {
 		if (memcmp("Sec-WebSocket-Key: ", this->buffer + i, 19) == 0) {
 			start = i + 19;
 			end = start;


INTEGRATION: CWS changefileheader (1.11.12); FILE MERGED 2008/03/28 16:30:12 rt 1.11.12.1: #i87441# Change license header to LPGL v3.

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


hdm_serialize: allow empty strings to be put in kernel serailzation params

Help implementing 'save as' function by setting deep_copy_suffix="".

--- bs_bos_core_data_storage/src/hdm_serialize_action.cpp
+++ bs_bos_core_data_storage/src/hdm_serialize_action.cpp
@@ -41,7 +41,8 @@
 std::vector< std::string > hdm_serialize_set_project_prop(
 	const std::string& prj_path = "",
 	const std::string& prj_name = "",
-	const std::string& deep_copy_suffix = ""
+	const std::string& deep_copy_suffix = "",
+	bool force = false
 ) {
 	// save project path for serialization code
 	kernel::idx_dt_ptr p_dt = BS_KERNEL.pert_idx_dt(hdm::bs_type());
@@ -55,13 +56,13 @@
 	p_dt->clear< std::string >();

 	// remember project path
-	if(prj_path.size() > 0 || prj_name.size() > 0)
+	if(force || prj_path.size() > 0 || prj_name.size() > 0)
 		p_dt->insert< std::string >(prj_path);
 	// and project name
-	if(prj_name.size() > 0 || deep_copy_suffix.size() > 0)
+	if(force || prj_name.size() > 0 || deep_copy_suffix.size() > 0)
 		p_dt->insert< std::string >(prj_name);
 	// and deep copy suffix
-	if(deep_copy_suffix.size() > 0) {
+	if(force || deep_copy_suffix.size() > 0) {
 		p_dt->insert< std::string >(deep_copy_suffix);
 	}

@@ -233,7 +234,7 @@
 //BOOST_PYTHON_FUNCTION_OVERLOADS(hdm_serialize_from_str_overl, hdm_serialize_from_str, 3, 4)

 BOOST_PYTHON_FUNCTION_OVERLOADS(hdm_serialize_setpprop_overl,
-	hdm_serialize_set_project_prop, 0, 3
+	hdm_serialize_set_project_prop, 0, 4
 )

 namespace python {


CAdditiveBodyState: Dehardcode array size

--- Runtime/Character/CAdditiveBodyState.cpp
+++ Runtime/Character/CAdditiveBodyState.cpp
@@ -14,9 +14,9 @@
   const CPASAnimState* aimState = bc.GetPASDatabase().GetAnimState(22);

   // Left, Right, Up, Down
-  for (int i = 0; i < 4; ++i) {
-    CPASAnimParmData parms(22, CPASAnimParm::FromEnum(i));
-    std::pair<float, s32> best = bc.GetPASDatabase().FindBestAnimation(parms, *mgr.GetActiveRandom(), -1);
+  for (size_t i = 0; i < x8_anims.size(); ++i) {
+    const CPASAnimParmData parms(22, CPASAnimParm::FromEnum(s32(i)));
+    const std::pair<float, s32> best = bc.GetPASDatabase().FindBestAnimation(parms, *mgr.GetActiveRandom(), -1);
     x8_anims[i] = best.second;
     x18_angles[i] = zeus::degToRad(aimState->GetAnimParmData(x8_anims[i], 1).GetReal32Value());
   }