Also unfold the reverse reference

Also unfold the reverse reference

--- src/phase_unfolder.cpp
+++ src/phase_unfolder.cpp
@@ -155,7 +155,6 @@
     return haplotype_paths;
 }

-// TODO: Also generate paths backwards.
 void PhaseUnfolder::generate_paths(VG& component, vg::id_t from) {
     static int component_id = 0;
     for (size_t path_rank = 1; path_rank <= this->xg_index.max_path_rank(); path_rank++) {
@@ -164,26 +163,45 @@

         std::vector<size_t> occurrences = this->xg_index.node_ranks_in_path(from, path_rank);
         for (size_t occurrence : occurrences) {
-            gbwt::node_type prev = gbwt::Node::encode(path.node(occurrence), path.is_reverse(occurrence));
-            path_type buffer { prev };
-            bool found_border = false;
-            for (size_t i = occurrence + 1; i < path_length; i++) {
-                gbwt::node_type curr = gbwt::Node::encode(path.node(i), path.is_reverse(i));
-                Edge candidate = xg::make_edge(gbwt::Node::id(prev), gbwt::Node::is_reverse(prev),
-                                               gbwt::Node::id(curr), gbwt::Node::is_reverse(curr));
-                if (!component.has_edge(candidate)) {
-                    break;
-                }
-                buffer.push_back(curr);
-                if (this->border.find(gbwt::Node::id(curr)) != this->border.end()) {
-                    this->insert_path(buffer);  // Insert a border-to-border path.
-                    found_border = true;
-                    break;
-                }
-                prev = curr;
-            }
-            if (!found_border) {
-                this->insert_path(buffer);  // Insert a maximal path.
+            // Forward.
+            {
+                gbwt::node_type prev = gbwt::Node::encode(path.node(occurrence), path.is_reverse(occurrence));
+                path_type buffer { prev };
+                for (size_t i = occurrence + 1; i < path_length; i++) {
+                    gbwt::node_type curr = gbwt::Node::encode(path.node(i), path.is_reverse(i));
+                    Edge candidate = xg::make_edge(gbwt::Node::id(prev), gbwt::Node::is_reverse(prev),
+                                                   gbwt::Node::id(curr), gbwt::Node::is_reverse(curr));
+                    if (!component.has_edge(candidate)) {
+                        break;  // Found a maximal path.
+                    }
+                    buffer.push_back(curr);
+                    if (this->border.find(gbwt::Node::id(curr)) != this->border.end()) {
+                        break;  // Found a border-to-border path.
+                    }
+                    prev = curr;
+                }
+                this->insert_path(buffer);
+            }
+
+            // Backward.
+            {
+                gbwt::node_type prev = gbwt::Node::encode(path.node(occurrence), !path.is_reverse(occurrence));
+                path_type buffer { prev };
+                bool found_border = false;
+                for (size_t i = occurrence; i > 0 ; i--) {
+                    gbwt::node_type curr = gbwt::Node::encode(path.node(i - 1), !path.is_reverse(i - 1));
+                    Edge candidate = xg::make_edge(gbwt::Node::id(prev), gbwt::Node::is_reverse(prev),
+                                                   gbwt::Node::id(curr), gbwt::Node::is_reverse(curr));
+                    if (!component.has_edge(candidate)) {
+                        break;  // Found a maximal path.
+                    }
+                    buffer.push_back(curr);
+                    if (this->border.find(gbwt::Node::id(curr)) != this->border.end()) {
+                        break;  // Found a border-to-border path.
+                    }
+                    prev = curr;
+                }
+                this->insert_path(buffer);
             }
         }
     }


fix bugs

fix bugs

--- src/pixpad/console.cpp
+++ src/pixpad/console.cpp
@@ -48,22 +48,9 @@
 			return 0;
 		}, (void*)this))
 		{
-			if (!m_input_beg[0])
-				return;
-			logger->output(m_input_buf);
-			std::string cmd_name = strtok(m_input_beg, " ");
-			if (cmd_name == "help")
-			{
-				for (auto &it : m_commands)
-					log_info("- %s\t\t%s", it.first.c_str(), it.second.second.c_str());
-				log_info("- help\t\tshow help");
-			}
-			else {
-				auto iter = m_commands.find(cmd_name);
-				if (iter == m_commands.end())
-					log_error("Unkonwn command");
-				else
-					iter->second.first(m_input_beg + cmd_name.size() + 1);
+			if (m_input_beg[0]) {
+				logger->output(m_input_buf);
+				process_input();
 			}
 			m_input_beg[0] = 0;
 		}
@@ -79,6 +66,24 @@

 	void on_input_end()
 	{
+	}
+
+	void process_input()
+	{
+		std::string cmd_name = strtok(m_input_beg, " ");
+		if (cmd_name == "help")
+		{
+			for (auto &it : m_commands)
+				log_info("- %s\t\t%s", it.first.c_str(), it.second.second.c_str());
+			log_info("- help\t\tshow help");
+			return;
+		}
+		auto iter = m_commands.find(cmd_name);
+		if (iter == m_commands.end()) {
+			log_error("Unkonwn command");
+			return;
+		}
+		iter->second.first(m_input_beg + cmd_name.size() + 1);
 	}

 	void draw_log(const std::string &str)


Make sure the following can't happen:

Make sure the following can't happen:

- sync folder
- refresh cache (without clearing uid map)
- sync, during refresh, list all mails in folder, they are wrongly
  considered locally present -> no download
- folder is empty locally
- sync
- folder is emptied on the server, since the mails that were supposed to be
  there locally are not -> they must have been deleted
- make unhappy face because of mail loss

svn path=/branches/KDE_3_3_BRANCH/kdepim/; revision=347897

--- kmail/cachedimapjob.cpp
+++ kmail/cachedimapjob.cpp
@@ -586,6 +586,7 @@
         //               << "!" << endl;
         mFolder->expunge();
         mFolder->setLastUid( 0 );
+        mFolder->clearUidMap();
       }
     } else
       kdDebug(5006) << "No uidvalidity available for folder "


Need unistd for fsync()

Need unistd for fsync()

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

--- kmail/compactionjob.cpp
+++ kmail/compactionjob.cpp
@@ -42,6 +42,7 @@

 #include <sys/types.h>
 #include <sys/stat.h>
+#include <unistd.h>
 #include <errno.h>

 using namespace KMail;


Fixed a bug where print would call puts(void), a function which doesn't exist, instead of puts(""), a function which prints \n to stdout.

--- koberi-c/translator.cpp
+++ koberi-c/translator.cpp
@@ -265,7 +265,7 @@

     /* If no parameters are passed print \n */
     if (not printStatements.size()) {
-        return parameter("puts("")", "");;
+        return parameter("puts(\"\")", "");
     }

     for (size_t i = 0; i < parameters.size(); ++i) {


Open the transaction to collect declarations coming from the dynamic expressions.

--- interpreter/cling/lib/Interpreter/DynamicLookup.cpp
+++ interpreter/cling/lib/Interpreter/DynamicLookup.cpp
@@ -749,6 +749,12 @@
                                 MultiLevelTemplateArgumentList(TemplateArgs));

     FunctionDecl* Fn = dyn_cast<FunctionDecl>(D);
+
+    // We expect incoming declarations (instantiations) and we
+    // need to open the transaction to collect them.
+    Transaction::State oldState = getTransaction()->getState();
+    getTransaction()->setState(Transaction::kCollecting);
+
     // Creates new body of the substituted declaration
     m_Sema->InstantiateFunctionDefinition(Fn->getLocation(), Fn, true, true);

@@ -766,6 +772,8 @@
                                                 VK_RValue,
                                                 m_NoSLoc
                                                 ).takeAs<DeclRefExpr>();
+
+    getTransaction()->setState(oldState);

     // TODO: Figure out a way to avoid passing in wrong source locations
     // of the symbol being replaced. This is important when we calculate the


introduce the option to analyze with PROOF, plus cosmetics

--- PWG4/macros/ana.C
+++ PWG4/macros/ana.C
@@ -10,22 +10,36 @@
 //  Author : Gustavo Conesa Balbastre (INFN-LNF)
 //
 //-------------------------------------------------
-enum anaModes {mLocal=0, mGRID=3,mPlugin=4};
+enum anaModes {mLocal=0, mPROOF=1, mPlugin=2, mGRID=3};
 //mLocal    = 0: Analyze locally files in your computer
-//mGRID     = 3: Analyze files on GRID
-//mPlugin   = 4: Analyze files on GRID with Plugin
+//mPROOF    = 1: Analyze files on GRID with Plugin
+//mPlugin   = 2: Analyze files on GRID with Plugin
+//mGRID     = 3: Analyze files on GRID, jobs launched from aliensh

 //---------------------------------------------------------------------------
-//Settings to read locally several files, only for "mLocal" mode
-//The different values are default, they can be set with environmental
-//variables: INDIR, PATTERN, NFILES, respectivelly
-
-char * kInDir = "/user/data/files/";
+// Settings to read locally several files, only for "mLocal" mode
+// The different values are default, they can be set with environmental
+// variables: INDIR, PATTERN, NFILES, respectivelly
+
+char * kInDir   = "/user/data/files/";
 char * kPattern = ""; // Data are in files kInDir/kPattern+i
-Int_t  kFile = 1; // Number of files for local analysis
+Int_t  kFile    = 1;
+
 //---------------------------------------------------------------------------
-//Collection file for grid analysis
+// Dataset for proof analysis, mode=mPROOF
+// char * kDataset = "/alice/vernet/PbPb_LHC10h_ESD";
+
+char *  kDatasetPROOF     = "/alice/vernet/LHC11b_149646";
+//char *  kDatasetPROOF     = "/alice/vernet/LHC11b10a_AOD046";//LHC11d_AOD076
+Int_t   kDatasetNMaxFiles = 20;
+TString ccin2p3UserName   = "arbor" ;
+TString alienUserName     = "narbor" ;
+
+//---------------------------------------------------------------------------
+// Collection file for grid analysis
+
 char * kXML = "collection.xml";
+
 //---------------------------------------------------------------------------
 //Scale histograms from file. Change to kTRUE when xsection file exists
 //Put name of file containing xsection
@@ -38,16 +52,17 @@

 //Set some default values, but used values are set in the code!

-Bool_t  kMC = kFALSE; //With real data kMC = kFALSE
+Bool_t  kMC        = kFALSE; //With real data kMC = kFALSE
 TString kInputData = "ESD"; //ESD, AOD, MC, deltaAOD
-Int_t   kYear = 2011;
+Int_t   kYear      = 2011;
 TString kCollision = "pp";
-Bool_t  outAOD = kTRUE; //Some tasks doesnt need it.
+Bool_t  outAOD     = kTRUE; //Some tasks doesnt need it.
 TString kTreeName;
-TString kPass = "";
+TString kPass      = "";
 char    kTrigger[1024];
-Int_t   kRun = 0;
-
+Int_t   kRun       = 0;
+
+//________________________
 void ana(Int_t mode=mGRID)
 {
   // Main
@@ -58,7 +73,7 @@
   // change whatever you need for your analysis case
   // ------------------------------------------------------------------

-  LoadLibraries() ;
+  LoadLibraries(mode) ;
   //gSystem->ListLibraries();

   //-------------------------------------------------------------------------------------------------
@@ -85,7 +100,8 @@
   printf("number of entries # %lld, skipped %d\n", chain->GetEntries()) ;
   printf("*********************************************\n");

-  if(!chain){
+  if(!chain)
+  {
     printf("STOP, no chain available\n");
     return;
   }
@@ -96,7 +112,8 @@
   //  Alien handler part
   //------------------------------------------
   AliAnalysisGrid *alienHandler=0x0;
-  if(mode==mPlugin){
+  if(mode==mPlugin)
+  {
     // Create and configure the alien handler plugin
     gROOT->LoadMacro("CreateAlienHandler.C");
     alienHandler = CreateAlienHandler();
@@ -111,24 +128,28 @@
   //mgr->SetSkipTerminate(kTRUE);
   //mgr->SetNSysInfo(1);

-  if(mode==mPlugin){
+  if(mode==mPlugin)
+  {
     // Connect plugin to the analysis manager
     mgr->SetGridHandler(alienHandler);
   }

   // MC handler
-  if((kMC || kInputData == "MC") && !kInputData.Contains("AOD")){
+  if((kMC || kInputData == "MC") && !kInputData.Contains("AOD"))
+  {
     AliMCEventHandler* mcHandler = new AliMCEventHandler();
     mcHandler->SetReadTR(kFALSE);//Do not search TrackRef file
     mgr->SetMCtruthEventHandler(mcHandler);
-    if( kInputData == "MC") {
+    if( kInputData == "MC")
+    {
       cout<<"MC INPUT EVENT HANDLER"<<endl;
       mgr->SetInputEventHandler(NULL);
     }
   }

   // AOD output handler
-  if(kInputData!="deltaAOD" && outAOD){
+  if(kInputData!="deltaAOD" && outAOD)
+  {
     cout<<"Init output handler"<<endl;
     AliAODHandler* aodoutHandler   = new AliAODHandler();
     aodoutHandler->SetOutputFileName("aod.root");
@@ -138,14 +159,16 @@

   //input

-  if(kInputData == "ESD"){
+  if(kInputData == "ESD")
+  {
     // ESD handler
     AliESDInputHandler *esdHandler = new AliESDInputHandler();
     esdHandler->SetReadFriends(kFALSE);
     mgr->SetInputEventHandler(esdHandler);
     cout<<"ESD handler "<<mgr->GetInputEventHandler()<<endl;
   }
-  else if(kInputData.Contains("AOD")){
+  else if(kInputData.Contains("AOD"))
+  {
     // AOD handler
     AliAODInputHandler *aodHandler = new AliAODInputHandler();
     mgr->SetInputEventHandler(aodHandler);
@@ -166,7 +189,8 @@
   AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(kMC);

   // Centrality
-  if(kCollision=="PbPb"){
+  if(kCollision=="PbPb")
+  {
     gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskCentrality.C");
     AliCentralitySelectionTask *taskCentrality = AddTaskCentrality();
     taskCentrality->SetPass(2); // remember to set the pass you are processing!!!
@@ -175,16 +199,17 @@
   // Simple event counting tasks
   AddTaskCounter("");   // All
   AddTaskCounter("MB"); // Min Bias
-  if(!kMC){
+  if(!kMC)
+  {
     AddTaskCounter("INT7"); // Min Bias
     AddTaskCounter("EMC1"); // Trig Th > 1.5 GeV approx
     AddTaskCounter("EMC7"); // Trig Th > 4-5 GeV
     AddTaskCounter("PHOS"); //
   }
-
+
   Bool_t kPrint   = kFALSE;
   Bool_t deltaAOD = kFALSE;
-
+
   gROOT->LoadMacro("AddTaskPartCorr.C");        // $ALICE_ROOT/PWG4/macros
   gROOT->LoadMacro("AddTaskEMCALClusterize.C"); // $ALICE_ROOT/PWG4/CaloCalib/macros

@@ -221,10 +246,10 @@
   {

     AliAnalysisTaskParticleCorrelation *anav1tr  = AddTaskPartCorr(kInputData, "EMCAL",   kPrint,kMC, deltaAOD,  outputFile.Data(),
-                                                                  kYear,kRun,kCollision,"EMC7",arrayNameV1);
+                                                                   kYear,kRun,kCollision,"EMC7",arrayNameV1);

     AliAnalysisTaskParticleCorrelation *anav1mb  = AddTaskPartCorr(kInputData, "EMCAL",   kPrint,kMC, deltaAOD,  outputFile.Data(),
-                                                                  kYear,kRun,kCollision,"INT7",arrayNameV1);
+                                                                   kYear,kRun,kCollision,"INT7",arrayNameV1);
   }
   else
   {// No trigger (should be MB, but for single particle productions it does not work)
@@ -243,7 +268,7 @@

   if(!kMC)
   {
-
+
     AliAnalysisTaskParticleCorrelation *anav2tr  = AddTaskPartCorr(kInputData, "EMCAL",   kPrint,kMC, deltaAOD,  outputFile.Data(),
                                                                    kYear,kRun,kCollision,"EMC7",arrayNameV2);

@@ -260,50 +285,82 @@
   // PHOS
   // -----

-   //Add here PHOS tender or whatever is needed
-
-   if(!kMC)
-   {
-
-   AliAnalysisTaskParticleCorrelation *anav1tr = AddTaskPartCorr(kInputData, "PHOS", kPrint,kMC, deltaAOD,  outputFile.Data(),
-                                                                 kYear,kRun,kCollision,"PHOS",""); // PHOS trigger
-
-
-   AliAnalysisTaskParticleCorrelation *anav1mb = AddTaskPartCorr(kInputData, "PHOS",   kPrint,kMC, deltaAOD,  outputFile.Data(),
-                                                                 kYear,kRun,kCollision,"INT7","");
-
-   }
-   else
-   {// No trigger
-
-   AliAnalysisTaskParticleCorrelation *anav1mb = AddTaskPartCorr(kInputData, "PHOS",   kPrint,kMC, deltaAOD,  outputFile.Data(),
-                                                                 kYear,kRun,kCollision,"","");
-
-   }
-
-
+  //Add here PHOS tender or whatever is needed
+
+  if(!kMC)
+  {
+
+    AliAnalysisTaskParticleCorrelation *anav1tr = AddTaskPartCorr(kInputData, "PHOS", kPrint,kMC, deltaAOD,  outputFile.Data(),
+                                                                  kYear,kRun,kCollision,"PHOS",""); // PHOS trigger
+
+
+    AliAnalysisTaskParticleCorrelation *anav1mb = AddTaskPartCorr(kInputData, "PHOS",   kPrint,kMC, deltaAOD,  outputFile.Data(),
+                                                                  kYear,kRun,kCollision,"INT7","");
+
+  }
+  else
+  {// No trigger
+
+    AliAnalysisTaskParticleCorrelation *anav1mb = AddTaskPartCorr(kInputData, "PHOS",   kPrint,kMC, deltaAOD,  outputFile.Data(),
+                                                                  kYear,kRun,kCollision,"","");
+
+  }

   //-----------------------
   // Run the analysis
   //-----------------------
   mgr->InitAnalysis();
   mgr->PrintStatus();
-  if(mode==mPlugin){
-    mgr->StartAnalysis("grid");
-    cout <<" Analysis sent to GRID sucessfully "<< endl ;
-  }
-  else{
-    mgr->StartAnalysis("local",chain);
-    cout <<" Analysis ended sucessfully "<< endl ;
-  }
-
-
+
+  if      (mode == mPlugin) mgr->StartAnalysis("grid");
+  else if (mode == mPROOF ) mgr->StartAnalysis("proof",chain);
+  else                      mgr->StartAnalysis("local",chain);
+
+  cout <<" Analysis ended sucessfully "<< endl ;

 }

-//___________________
-void  LoadLibraries()
+//_____________________________
+void  LoadLibraries(Int_t mode)
 {
+
+  if (mode == mPROOF) {
+    //TProof::Mgr("ccalpmaster")->SetROOTVersion("ALICE_v5-27-06b");
+    gROOT->LoadMacro("/afs/in2p3.fr/group/alice/laf/EnableAliRootForLAF.C");
+    TProof* proof = EnableAliRootForLAF("ccaplmaster",nPROOFWorkers.Data(),ccin2p3UserName.Data(),alienUserName.Data(),"",kFALSE,kTRUE,kTRUE,"OADB:ANALYSIS:ANALYSISalice:AOD:ESD:CORRFW:STEERBase:EMCALUtils:PHOSUtils:PWG4PartCorrBase:PWG4PartCorrDep:PWG4CaloCalib");
+
+    //  TProof* proof = TProof::Open("ccaplmaster",Form("workers=%s",nPROOFWorkers.Data()));
+
+    //     //proof->ClearPackages();
+    //     proof->UploadPackage("STEERBase");
+    //     proof->UploadPackage("ESD");
+    //     proof->UploadPackage("AOD");
+    //     proof->UploadPackage("ANALYSIS");
+    //     proof->UploadPackage("OADB");
+    //     proof->UploadPackage("ANALYSISalice");
+    //     proof->UploadPackage("CORRFW");
+    //     //proof->UploadPackage("JETAN");
+    //     proof->UploadPackage("PHOSUtils");
+    //     proof->UploadPackage("EMCALUtils");
+    //     proof->UploadPackage("PWG4PartCorrBase");
+    //     proof->UploadPackage("PWG4PartCorrDep");
+    //     proof->UploadPackage("PWG4CaloCalib");
+
+    //     proof->EnablePackage("STEERBase");
+    //     proof->EnablePackage("ESD");
+    //     proof->EnablePackage("AOD");
+    //     proof->EnablePackage("ANALYSIS");
+    //     proof->EnablePackage("OADB");
+    //     proof->EnablePackage("ANALYSISalice");
+    //     proof->EnablePackage("CORRFW");
+    //     //proof->EnablePackage("JETAN");
+    //     proof->EnablePackage("PHOSUtils");
+    //     proof->EnablePackage("EMCALUtils");
+    //     proof->EnablePackage("PWG4PartCorrBase");
+    //     proof->EnablePackage("PWG4PartCorrDep");
+    //     proof->EnablePackage("PWG4CaloCalib");
+    return;
+  }

   //--------------------------------------
   // Load the needed libraries most of them already loaded by aliroot
@@ -365,6 +422,7 @@

 }

+//_________________________________
 void SetupPar(char* pararchivename)
 {
   //Load par files, create analysis libraries
@@ -407,7 +465,9 @@
   printf("Current dir: %s\n", ocwd.Data());
 }

-void CheckInputData(const anaModes mode){
+//______________________________________
+void CheckInputData(const anaModes mode)
+{
   //Sets input data and tree

   TString ocwd = gSystem->WorkingDirectory();
@@ -441,17 +501,18 @@
     char fileG[120] ;
     char fileEm[120] ;
     for (Int_t event = 0 ; event < kFile ; event++) {
-      sprintf(fileE, "%s/%s%d/AliESDs.root", kInDir,kPattern,event) ;
-      sprintf(fileA, "%s/%s%d/AliAOD.root", kInDir,kPattern,event) ;
-      sprintf(fileG, "%s/%s%d/galice.root", kInDir,kPattern,event) ;
+      sprintf(fileE,  "%s/%s%d/AliESDs.root",    kInDir,kPattern,event) ;
+      sprintf(fileA,  "%s/%s%d/AliAOD.root",     kInDir,kPattern,event) ;
+      sprintf(fileG,  "%s/%s%d/galice.root",     kInDir,kPattern,event) ;
       sprintf(fileEm, "%s/%s%d/embededAOD.root", kInDir,kPattern,event) ;

       TFile * fESD = TFile::Open(fileE) ;
       TFile * fAOD = TFile::Open(fileA) ;

       //Check if file exists and add it, if not skip it
-      if (fESD)  {
-        kTreeName ="esdTree";
+      if (fESD)
+      {
+        kTreeName  = "esdTree";
         kInputData = "ESD";
         TFile * fG = TFile::Open(fileG);
         if(fG) { kMC = kTRUE; fG->Close();}
@@ -466,8 +527,9 @@

         return;
       }
-      else if(fAOD){
-        kTreeName ="aodTree";
+      else if(fAOD)
+      {
+        kTreeName  = "aodTree";
         kInputData = "AOD";
         if(((TTree*) fAOD->Get("aodTree"))->GetBranch("mcparticles")) kMC=kTRUE;
         else kMC = kFALSE;
@@ -480,14 +542,16 @@
         kRun = aod->GetRunNumber();
         return;
       }
-      else if(TFile::Open(fileEm)){
+      else if(TFile::Open(fileEm))
+      {
         kTreeName  = "aodTree";
         kInputData = "AOD";
         kMC        = kTRUE;

         return;
       }
-      else if(TFile::Open(fileG)){
+      else if(TFile::Open(fileG))
+      {
         kTreeName  = "TE";
         kInputData = "MC";
         kMC        = kTRUE;
@@ -539,42 +603,106 @@
       else if(alienURL.Contains("pass2")) kPass = "pass2";
       else if(alienURL.Contains("pass3")) kPass = "pass3";

+      kRun = AliAnalysisManager::GetRunFromAlienPath(alienURL.Data());
+      printf("Run number from alien path = %d\n",kRun);
+
       TFile * fAOD = 0 ;
       //Check if file exists and add it, if not skip it
-      if (alienURL.Contains("AliESDs.root"))  {
-        kTreeName ="esdTree";
+      if (alienURL.Contains("AliESDs.root"))
+      {
+        kTreeName  = "esdTree";
         kInputData = "ESD";
         alienURL.ReplaceAll("AliESDs.root","galice.root");
         if(TFile::Open(alienURL)) kMC=kTRUE;
         else kMC = kFALSE;
-
-        kRun = AliAnalysisManager::GetRunFromAlienPath(alienURL.Data());
-        printf("Run number from alien path = %d\n",kRun);
-
         return;
       }
-      else if(alienURL.Contains("AliAOD.root")){
-        kTreeName ="aodTree";
+      else if(alienURL.Contains("AliAOD.root"))
+      {
+        kTreeName  = "aodTree";
         kInputData = "AOD";
         fAOD = TFile::Open(alienURL);
         if(((TTree*) fAOD->Get("aodTree"))->GetBranch("mcparticles")) kMC=kTRUE;
         else kMC = kFALSE;
         return;
       }
-      else if(alienURL.Contains("embededAOD.root")){
-        kTreeName ="aodTree";
+      else if(alienURL.Contains("embededAOD.root"))
+      {
+        kTreeName  = "aodTree";
         kInputData = "AOD";
         kMC=kTRUE;
         return;
       }
-      else if(alienURL.Contains("galice.root")){
-        kTreeName ="TE";
+      else if(alienURL.Contains("galice.root"))
+      {
+        kTreeName  = "TE";
         kInputData = "MC";
         kMC=kTRUE;
         return;
       }
     }
   }// xml analysis
+  //------------------------------
+  //PROOF files
+  //-----------------------------
+  else if(mode == mPROOF){
+
+    TFileCollection* coll  = gProof->GetDataSet(kDatasetPROOF)->GetStagedSubset();
+
+    TIter iter(coll->GetList());
+
+    TFileInfo* fileInfo = 0;
+    while ((fileInfo = dynamic_cast<TFileInfo*> (iter())))
+    {
+      if (fileInfo->GetFirstUrl()) {
+        TString ProofURL = fileInfo->GetFirstUrl()->GetUrl();
+        cout << "================== " << ProofURL << endl ;
+
+        if     (ProofURL.Contains("pass1")) kPass = "pass1";
+        else if(ProofURL.Contains("pass2")) kPass = "pass2";
+        else if(ProofURL.Contains("pass3")) kPass = "pass3";
+
+        kRun = AliAnalysisManager::GetRunFromAlienPath(ProofURL.Data());
+        printf("Run number from alien path = %d\n",kRun);
+
+        TFile * fAOD = 0 ;
+        //Check if file exists and add it, if not skip it
+        if (ProofURL.Contains("AliESDs.root"))
+        {
+          kTreeName  = "esdTree";
+          kInputData = "ESD";
+          alienURL.ReplaceAll("AliESDs.root","galice.root");
+          if(TFile::Open(ProofURL)) kMC=kTRUE;
+          else kMC = kFALSE;
+
+          return;
+        }
+        else if(ProofURL.Contains("AliAOD.root"))
+        {
+          kTreeName  = "aodTree";
+          kInputData = "AOD";
+          fAOD = TFile::Open(ProofURL);
+          if(((TTree*) fAOD->Get("aodTree"))->GetBranch("mcparticles")) kMC=kTRUE;
+          else kMC = kFALSE;
+          return;
+        }
+        else if(ProofURL.Contains("embededAOD.root"))
+        {
+          kTreeName  = "aodTree";
+          kInputData = "AOD";
+          kMC=kTRUE;
+          return;
+        }
+        else if(ProofURL.Contains("galice.root"))
+        {
+          kTreeName  = "TE";
+          kInputData = "MC";
+          kMC=kTRUE;
+          return;
+        }
+      }
+    }
+  }// proof analysis

   gSystem->ChangeDirectory(ocwd.Data());

@@ -587,7 +715,7 @@
   TString ocwd = gSystem->WorkingDirectory();

   //---------------------------------------
-  //Local files analysis
+  // Local files analysis
   //---------------------------------------
   if(mode == mLocal){
     //If you want to add several ESD files sitting in a common directory INDIR
@@ -620,21 +748,21 @@
       char * kGener = gSystem->Getenv("GENER");
       if(kGener) {
         cout<<"GENER "<<kGener<<endl;
-        if(!strcmp(kGener,"PYTHIA")) kXSFileName = "pyxsec.root";
+        if     (!strcmp(kGener,"PYTHIA")) kXSFileName = "pyxsec.root";
         else if(!strcmp(kGener,"HERWIG")) kXSFileName = "hexsec.root";
         else cout<<" UNKNOWN GENER, use default: "<<kXSFileName<<endl;
       }
       else cout<<" GENER not set, use default xs file name: "<<kXSFileName<<endl;

-      cout<<"INDIR   : "<<kInDir<<endl;
-      cout<<"NFILES  : "<<kFile<<endl;
-      cout<<"PATTERN : " <<kPattern<<endl;
+      cout<<"INDIR   : "<<kInDir     <<endl;
+      cout<<"NFILES  : "<<kFile      <<endl;
+      cout<<"PATTERN : "<<kPattern   <<endl;
       cout<<"XSFILE  : "<<kXSFileName<<endl;

       TString datafile="";
-      if(kInputData == "ESD") datafile = "AliESDs.root" ;
-      else if(kInputData.Contains("AOD")) datafile = "AliAOD.root" ;//////////
-      else if(kInputData == "MC")  datafile = "galice.root" ;
+      if     (kInputData == "ESD")        datafile = "AliESDs.root" ;
+      else if(kInputData.Contains("AOD")) datafile = "AliAOD.root"  ;
+      else if(kInputData == "MC")         datafile = "galice.root"  ;

       //Loop on ESD/AOD/MC files, add them to chain
       Int_t event =0;
@@ -643,7 +771,7 @@
       char filexs[120] ;

       for (event = 0 ; event < kFile ; event++) {
-        sprintf(file, "%s/%s%d/%s", kInDir,kPattern,event,datafile.Data()) ;
+        sprintf(file,   "%s/%s%d/%s", kInDir,kPattern,event,datafile.Data()) ;
         sprintf(filexs, "%s/%s%d/%s", kInDir,kPattern,event,kXSFileName) ;
         TFile * fData = 0 ;
         //Check if file exists and add it, if not skip it
@@ -669,8 +797,8 @@
   }// local files analysis

   //------------------------------
-  //GRID xml files
-  //-----------------------------
+  // GRID xml files
+  //------------------------------
   else if(mode == mGRID){
     //Get colection file. It is specified by the environmental
     //variable XML
@@ -681,6 +809,7 @@
       AliError(Form("%s not found", kXML)) ;
       return kFALSE ;
     }
+
     TGridResult* result = collection->GetGridResult("",0 ,0);

     // Makes the ESD chain
@@ -693,6 +822,18 @@
       chainxs->Add(alienURL) ;
     }
   }// xml analysis
+
+  //------------------------------
+  // PROOF
+  //------------------------------
+  else if (mode == mPROOF) {
+
+    TFileCollection* ds= gProof->GetDataSet(kDatasetPROOF)->GetStagedSubset();
+
+    gROOT->LoadMacro("/afs/in2p3.fr/group/alice/laf/dataset_management/CreateChainFromDataSet.C");
+    chain = CreateChainFromDataSet(ds, kTreeName , kDatasetNMaxFiles);
+    printf("chain has %d entries\n",chain->GetEntries());
+  }

   gSystem->ChangeDirectory(ocwd.Data());

@@ -719,7 +860,8 @@
   ntr = 0;

   Int_t nfiles =  tree->GetEntries()  ;
-  if (tree && nfiles > 0) {
+  if (tree && nfiles > 0)
+  {
     tree->SetBranchAddress("xsection",&xsection);
     tree->SetBranchAddress("ntrials",&ntrials);
     for(Int_t i = 0; i < nfiles; i++){
@@ -739,7 +881,6 @@

 }

-
 //______________________________
 void CheckEnvironmentVariables()
 {
@@ -803,7 +944,7 @@

 }

-//_____________________________________________________________
+//_______________________________________________
 void AddTaskCounter(const TString trigger = "MB")
 {

@@ -814,23 +955,28 @@
   if     (kCollision=="pp"  )   counter->SetZVertexCut(50.);  //Open cut
   else if(kCollision=="PbPb")   counter->SetZVertexCut(10.);  //Centrality defined in this range.

-  if(trigger=="EMC7"){
+  if(trigger=="EMC7")
+  {
     printf("counter trigger EMC7\n");
     counter->SelectCollisionCandidates(AliVEvent::kEMC7);
   }
-  else if (trigger=="INT7"){
+  else if (trigger=="INT7")
+  {
     printf("counter trigger INT7\n");
     counter->SelectCollisionCandidates(AliVEvent::kINT7);
   }
-  if(trigger=="EMC1"){
+  if(trigger=="EMC1")
+  {
     printf("counter trigger EMC1\n");
     counter->SelectCollisionCandidates(AliVEvent::kEMC1);
   }
-  else if(trigger=="MB"){
+  else if(trigger=="MB")
+  {
     printf("counter trigger MB\n");
     counter->SelectCollisionCandidates(AliVEvent::kMB);
   }
-  else if(trigger=="PHOS"){
+  else if(trigger=="PHOS")
+  {
     printf("counter trigger PHOS\n");
     counter->SelectCollisionCandidates(AliVEvent::kPHI7);
   }


adding basic grid

adding basic grid


semi-transparent about box

semi-transparent about box

--- Player/Player.cpp
+++ Player/Player.cpp
@@ -207,6 +207,8 @@
 public:
     CAboutDlg();

+    BOOL OnInitDialog() override;
+
 // Dialog Data
     enum { IDD = IDD_ABOUTBOX };

@@ -222,6 +224,13 @@

 CAboutDlg::CAboutDlg() : CDialogEx(CAboutDlg::IDD)
 {
+}
+
+BOOL CAboutDlg::OnInitDialog()
+{
+    ModifyStyleEx(0, WS_EX_LAYERED);
+    SetLayeredWindowAttributes(0, (255 * 75) / 100, LWA_ALPHA);
+    return __super::OnInitDialog();
 }

 void CAboutDlg::DoDataExchange(CDataExchange* pDX)


div nodes without size now pass events to children at negative coordinates.

git-svn-id: f4e1a40f847802203273bde8e26df4d11611876a@3691 44470bb9-56e9-0310-a0f8-c586564d3dc6

--- src/player/DivNode.cpp
+++ src/player/DivNode.cpp
@@ -251,8 +251,9 @@

 NodePtr DivNode::getElementByPos(const DPoint & pos)
 {
-    if (pos.x >= 0 && pos.y >= 0 && pos.x < getSize().x && pos.y < getSize().y &&
-            reactsToMouseEvents())
+    if (reactsToMouseEvents() &&
+            ((getSize() == DPoint(10000, 10000) ||
+             (pos.x >= 0 && pos.y >= 0 && pos.x < getSize().x && pos.y < getSize().y))))
     {
         for (int i=getNumChildren()-1; i>=0; i--) {
             // TODO: Move coordinate handling to Node (& get rid of AreaNode entirely?)
@@ -270,12 +271,12 @@
             }
         }
         // Pos isn't in any of the children.
-        if (getSize() != DPoint(10000, 10000)) {
+        if (getSize() == DPoint(10000, 10000)) {
+            // Explicit width/height not given: div itself doesn't react.
+            return NodePtr();
+        } else {
             // Explicit width/height given for div.
             return getThis();
-        } else {
-            // Explicit width/height not given: div itself doesn't react.
-            return NodePtr();
         }
     } else {
         return NodePtr();


Remove Mac code from Gel

Remove Mac code from Gel

Add a preprocessor error if someone attempts to build on Mac.

--- gel/gel.hpp
+++ gel/gel.hpp
@@ -5,7 +5,9 @@

 //deprecated functions are not included

-#if !(defined(__APPLE__) || defined(__MACH__))
+#if (defined(__APPLE__) || defined(__MACH__))
+#error Gel is unnecessary on Macs, as all available OpenGL functions are natively exported.
+#endif

 #if defined(_WIN32)
 #	define GEL_MSWINDOWS
@@ -36,13 +38,6 @@
 #	else
 #		define GEL_API
 #	endif //defined(__linux__) || defined(__linux)
-#elif defined(__APPLE__) && defined(__MACH__)
-#	define GEL_MACOSX
-#	if defined(GEL_BUILDING_LIBRARY)
-#		define GEL_API __attribute__((visibility("default")))
-#	else
-#		define GEL_API
-#	endif //GEL_BUILDING_LIBRARY
 #endif //_WIN32

 #include <GL/gl.h>
@@ -710,6 +705,4 @@
 #	endif //!GEL_BUILDING_LIBRARY
 #endif //GEL_MSWINDOWS

-#endif //PLATFORM_MACOSX
-
 #endif //GEL


NativeProcessProtocolTest: fix -Winconsistent-missing-override warning

The warning comes from the fact that the MOCK_METHOD macros don't use the
override keyword internally. This makes us not use it in the manually overriden
methods either, to be consistent.

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

--- unittests/Host/NativeProcessProtocolTest.cpp
+++ unittests/Host/NativeProcessProtocolTest.cpp
@@ -24,6 +24,9 @@
   MOCK_METHOD1(DidExec, void(NativeProcessProtocol *Process));
 };

+// NB: This class doesn't use the override keyword to avoid
+// -Winconsistent-missing-override warnings from the compiler. The
+// inconsistency comes from the overriding definitions in the MOCK_*** macros.
 class MockProcess : public NativeProcessProtocol {
 public:
   MockProcess(NativeDelegate &Delegate, const ArchSpec &Arch,
@@ -47,9 +50,9 @@
   MOCK_METHOD2(GetFileLoadAddress,
                Status(const llvm::StringRef &FileName, addr_t &Addr));

-  const ArchSpec &GetArchitecture() const override { return Arch; }
+  const ArchSpec &GetArchitecture() const /*override*/ { return Arch; }
   Status SetBreakpoint(lldb::addr_t Addr, uint32_t Size,
-                       bool Hardware) override {
+                       bool Hardware) /*override*/ {
     if (Hardware)
       return SetHardwareBreakpoint(Addr, Size);
     else
@@ -59,9 +62,9 @@
   // Redirect base class Read/Write Memory methods to functions whose signatures
   // are more mock-friendly.
   Status ReadMemory(addr_t Addr, void *Buf, size_t Size,
-                    size_t &BytesRead) override;
+                    size_t &BytesRead) /*override*/;
   Status WriteMemory(addr_t Addr, const void *Buf, size_t Size,
-                     size_t &BytesWritten) override;
+                     size_t &BytesWritten) /*override*/;

   MOCK_METHOD2(ReadMemory,
                llvm::Expected<std::vector<uint8_t>>(addr_t Addr, size_t Size));


Change ABI version to 0.2.1 (#45)

Change ABI version to 0.2.1 (#45)

This is necessary because the new proxy_get_log_level function
only exists there.

Signed-off-by: Gregory Brail <097acd6135be8192f004929e5c75bb0572ce672c@google.com>

--- proxy_wasm_intrinsics.cc
+++ proxy_wasm_intrinsics.cc
@@ -17,7 +17,7 @@
 #include "proxy_wasm_intrinsics.h"

 // Required Proxy-Wasm ABI version.
-extern "C" PROXY_WASM_KEEPALIVE void proxy_abi_version_0_2_0() {}
+extern "C" PROXY_WASM_KEEPALIVE void proxy_abi_version_0_2_1() {}

 static std::unordered_map<std::string, RootFactory> *root_factories = nullptr;
 static std::unordered_map<std::string, ContextFactory> *context_factories = nullptr;


KPilotInstaller::startDaemonIfNeeded was trying to start the daemon
even if it found it running. Calculated fDaemonWasRunning then ignored
it.

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

--- kpilot/kpilot/kpilot.cc
+++ kpilot/kpilot/kpilot.cc
@@ -234,7 +234,7 @@
 		fDaemonWasRunning = true;
 	}

-	if (KApplication::startServiceByDesktopName(
+	if (!fDaemonWasRunning && KApplication::startServiceByDesktopName(
 		"kpilotdaemon",
 		QString::null, &daemonError, &daemonDCOP, &daemonPID
 #if (KDE_VERSION >= 220)
@@ -856,6 +856,9 @@

 // $Log$
+// Revision 1.71  2002/01/26 15:00:01  adridg
+// An icon for the address viewer
+//
 // Revision 1.70  2002/01/25 21:43:12  adridg
 // ToolTips->WhatsThis where appropriate; vcal conduit discombobulated - it doesn't eat the .ics file anymore, but sync is limited; abstracted away more pilot-link
 //


Order popup button like the file menu, and make list always available (it already was from the menu)

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

--- kpilot/kpilot/kpilot.cc
+++ kpilot/kpilot/kpilot.cc
@@ -590,7 +590,20 @@
 		"should be a FullSync (check data on both sides)."));
 	syncPopup->insert(a);

-#ifdef DEBUG
+	a = new KAction(i18n("&Backup"), CSL1("backup"), 0,
+		this, SLOT(slotBackupRequested()),
+		actionCollection(), "file_backup");
+	a->setWhatsThis(i18n("Tell the daemon that the next HotSync "
+		"should back up the Handheld to the PC."));
+	syncPopup->insert(a);
+
+	a = new KAction(i18n("&Restore"), CSL1("restore"), 0,
+		this, SLOT(slotRestoreRequested()),
+		actionCollection(), "file_restore");
+	a->setWhatsThis(i18n("Tell the daemon that the next HotSync "
+		"should restore the Handheld from data on the PC."));
+	syncPopup->insert(a);
+
 	a = new KAction(i18n("&List only"),CSL1("list"),0,
 		this,SLOT(slotListSyncRequested()),
 		actionCollection(), "file_list");
@@ -598,20 +611,8 @@
 		"should just list the files on the Handheld and do nothing "
 		"else."));
 	syncPopup->insert(a);
-#endif
-	a = new KAction(i18n("&Backup"), CSL1("backup"), 0,
-		this, SLOT(slotBackupRequested()),
-		actionCollection(), "file_backup");
-	a->setWhatsThis(i18n("Tell the daemon that the next HotSync "
-		"should back up the Handheld to the PC."));
-	syncPopup->insert(a);
-
-	a = new KAction(i18n("&Restore"), CSL1("restore"), 0,
-		this, SLOT(slotRestoreRequested()),
-		actionCollection(), "file_restore");
-	a->setWhatsThis(i18n("Tell the daemon that the next HotSync "
-		"should restore the Handheld from data on the PC."));
-	syncPopup->insert(a);
+
+

 	a = new KAction(i18n("Rese&t Link"),CSL1("reload"), 0,
 		this, SLOT(slotResetLink()),


Temporarily disable broken instancing support

--- src/projectbuilder.cpp
+++ src/projectbuilder.cpp
@@ -165,7 +165,11 @@
     {
         // Retrieve the name of the referenced object.
         Object* max_object = node->GetObjectRef();
-        const std::string object_name = utf8_encode(max_object->GetObjectName());
+        std::string object_name = utf8_encode(max_object->GetObjectName());
+
+        // todo: handle instancing.
+        if (assembly.objects().get_by_name(object_name.c_str()) != 0)
+            object_name = asr::make_unique_name(object_name, assembly.objects());

         // Create the object if it doesn't already exist in the appleseed scene.
         if (assembly.objects().get_by_name(object_name.c_str()) == 0)


Omit the 'out_file_index != -1' check when possible.

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

--- utils/TableGen/LLVMCConfigurationEmitter.cpp
+++ utils/TableGen/LLVMCConfigurationEmitter.cpp
@@ -1572,6 +1572,47 @@
   }
 };

+bool IsOutFileIndexCheckRequiredStr (const Init* CmdLine) {
+  StrVector StrVec;
+  TokenizeCmdline(InitPtrToString(CmdLine), StrVec);
+
+  for (StrVector::const_iterator I = StrVec.begin(), E = StrVec.end();
+       I != E; ++I) {
+    if (*I == "$OUTFILE")
+      return false;
+  }
+
+  return true;
+}
+
+class IsOutFileIndexCheckRequiredStrCallback {
+  bool* ret_;
+
+public:
+  IsOutFileIndexCheckRequiredStrCallback(bool* ret) : ret_(ret)
+  {}
+
+  void operator()(const Init* CmdLine) {
+    if (IsOutFileIndexCheckRequiredStr(CmdLine))
+      *ret_ = true;
+  }
+};
+
+bool IsOutFileIndexCheckRequiredCase (Init* CmdLine) {
+  bool ret = false;
+  WalkCase(CmdLine, Id(), IsOutFileIndexCheckRequiredStrCallback(&ret));
+  return ret;
+}
+
+/// IsOutFileIndexCheckRequired - Should we emit an "out_file_index != -1" check
+/// in EmitGenerateActionMethod() ?
+bool IsOutFileIndexCheckRequired (Init* CmdLine) {
+  if (typeid(*CmdLine) == typeid(StringInit))
+    return IsOutFileIndexCheckRequiredStr(CmdLine);
+  else
+    return IsOutFileIndexCheckRequiredCase(CmdLine);
+}
+
 // EmitGenerateActionMethod - Emit either a normal or a "join" version of the
 // Tool::GenerateAction() method.
 void EmitGenerateActionMethod (const ToolDescription& D,
@@ -1592,12 +1633,17 @@
   O.indent(Indent2) << "bool stop_compilation = !HasChildren;\n";
   O.indent(Indent2) << "const char* output_suffix = \""
                     << D.OutputSuffix << "\";\n";
-  O.indent(Indent2) << "int out_file_index = -1;\n\n";
-
-  // cmd_line is either a string or a 'case' construct.
+
   if (!D.CmdLine)
     throw "Tool " + D.Name + " has no cmd_line property!";
-  else if (typeid(*D.CmdLine) == typeid(StringInit))
+
+  bool IndexCheckRequired = IsOutFileIndexCheckRequired(D.CmdLine);
+  O.indent(Indent2) << "int out_file_index"
+                    << (IndexCheckRequired ? " = -1" : "")
+                    << ";\n\n";
+
+  // Process the cmd_line property.
+  if (typeid(*D.CmdLine) == typeid(StringInit))
     EmitCmdLineVecFill(D.CmdLine, D.Name, IsJoin, Indent2, O);
   else
     EmitCaseConstructHandler(D.CmdLine, Indent2,
@@ -1614,9 +1660,11 @@
     << "std::string out_file = OutFilename("
     << (IsJoin ? "sys::Path(),\n" : "inFile,\n");
   O.indent(Indent3) << "TempDir, stop_compilation, output_suffix).str();\n\n";
-  // TODO: emit this check only when necessary.
-  O.indent(Indent2) << "if (out_file_index != -1)\n";
-  O.indent(Indent3) << "vec[out_file_index] = out_file;\n";
+
+  if (IndexCheckRequired)
+    O.indent(Indent2) << "if (out_file_index != -1)\n";
+  O.indent(IndexCheckRequired ? Indent3 : Indent2)
+    << "vec[out_file_index] = out_file;\n";

   // Handle the Sink property.
   if (D.isSink()) {


vttdemux::ChapterAtomParser: check for NULL display string

prevents segfault due to strlen(NULL)

BUG=webm:1382

Change-Id: I536663e287d151e11bf7074349a34d922cb9856a

--- vttdemux.cc
+++ vttdemux.cc
@@ -262,6 +262,8 @@
     const mkvparser::Chapters::Display* display)
     : display_(display) {
   str_ = display->GetString();
+  if (str_ == NULL)
+    return;
   const size_t len = strlen(str_);
   str_end_ = str_ + len;
 }
@@ -269,7 +271,7 @@
 ChapterAtomParser::~ChapterAtomParser() {}

 int ChapterAtomParser::GetChar(char* c) {
-  if (str_ >= str_end_)  // end-of-stream
+  if (str_ == NULL || str_ >= str_end_)  // end-of-stream
     return 1;  // per the semantics of libwebvtt::Reader::GetChar

   *c = *str_++;  // consume this character in the stream


SFDP: Sector Map Parameter Tbl parsing refactored

Making search for common erase type between regions more clear

--- drivers/source/SFDP.cpp
+++ drivers/source/SFDP.cpp
@@ -189,7 +189,6 @@
     int status = 0;
     uint32_t tmp_region_size = 0;
     uint8_t type_mask;
-    int i_ind = 0;
     int prev_boundary = 0;
     // Default set to all type bits 1-4 are common
     int min_common_erase_type_bits = SFDP_ERASE_BITMASK_ALL;
@@ -235,32 +234,29 @@

     // Loop through Regions and set for each one: size, supported erase types, high boundary offset
     // Calculate minimum Common Erase Type for all Regions
-    for (i_ind = 0; i_ind < sfdp_info.smptbl.region_cnt; i_ind++) {
-        tmp_region_size = ((*((uint32_t *)&smptbl_buff[(i_ind + 1) * 4])) >> 8) & 0x00FFFFFF; // bits 9-32
-        sfdp_info.smptbl.region_size[i_ind] = (tmp_region_size + 1) * 256; // Region size is 0 based multiple of 256 bytes;
-
-        sfdp_info.smptbl.region_erase_types_bitfld[i_ind] = smptbl_buff[(i_ind + 1) * 4] & 0x0F; // bits 1-4
-
-        min_common_erase_type_bits &= sfdp_info.smptbl.region_erase_types_bitfld[i_ind];
-
-        sfdp_info.smptbl.region_high_boundary[i_ind] = (sfdp_info.smptbl.region_size[i_ind] - 1) + prev_boundary;
-
-        prev_boundary = sfdp_info.smptbl.region_high_boundary[i_ind] + 1;
+    for (auto idx = 0; idx < sfdp_info.smptbl.region_cnt; idx++) {
+        tmp_region_size = ((*((uint32_t *)&smptbl_buff[(idx + 1) * 4])) >> 8) & 0x00FFFFFF; // bits 9-32
+        sfdp_info.smptbl.region_size[idx] = (tmp_region_size + 1) * 256; // Region size is 0 based multiple of 256 bytes;
+
+        sfdp_info.smptbl.region_erase_types_bitfld[idx] = smptbl_buff[(idx + 1) * 4] & 0x0F; // bits 1-4
+
+        min_common_erase_type_bits &= sfdp_info.smptbl.region_erase_types_bitfld[idx];
+
+        sfdp_info.smptbl.region_high_boundary[idx] = (sfdp_info.smptbl.region_size[idx] - 1) + prev_boundary;
+
+        prev_boundary = sfdp_info.smptbl.region_high_boundary[idx] + 1;
     }

     // Calc minimum Common Erase Size from min_common_erase_type_bits
     type_mask = SFDP_ERASE_BITMASK_TYPE1;
-    for (i_ind = 0; i_ind < 4; i_ind++) {
+    // If no common erase type is found between regions
+    sfdp_info.smptbl.regions_min_common_erase_size = 0;
+    for (auto idx = 0; idx < 4; idx++) {
         if (min_common_erase_type_bits & type_mask) {
-            sfdp_info.smptbl.regions_min_common_erase_size = sfdp_info.smptbl.erase_type_size_arr[i_ind];
+            sfdp_info.smptbl.regions_min_common_erase_size = sfdp_info.smptbl.erase_type_size_arr[idx];
             break;
         }
         type_mask = type_mask << 1;
-    }
-
-    if (i_ind == 4) {
-        // No common erase type was found between regions
-        sfdp_info.smptbl.regions_min_common_erase_size = 0;
     }

 EXIT:


New SecureTrie.

New SecureTrie.

--- MixClient.cpp
+++ MixClient.cpp
@@ -79,7 +79,7 @@
 	m_watches.clear();

 	m_stateDB = OverlayDB();
-	TrieDB<Address, MemoryDB> accountState(&m_stateDB);
+	SecureTrieDB<Address, MemoryDB> accountState(&m_stateDB);
 	accountState.init();
 	std::map<Address, Account> genesisState = { std::make_pair(KeyPair(c_userAccountSecret).address(), Account(_balance, Account::NormalCreation)) };
 	dev::eth::commit(genesisState, static_cast<MemoryDB&>(m_stateDB), accountState);


updated lab4

updated lab4

--- Proj2/udpchain.cc
+++ Proj2/udpchain.cc
@@ -28,7 +28,6 @@
 main (int argc, char *argv[])
 {
   bool verbose = true;
-//  uint32_t nCsma = 5;

   CommandLine cmd;
   cmd.AddValue ("verbose", "Tell echo applications to log if true", verbose);
@@ -42,19 +41,8 @@
 export NS_LOG=UdpEchoClientApplication=level_all;
     }

-//  NodeContainer p2pNodes;
-//  p2pNodes.Create (2);
-
   NodeContainer csmaNodes;
-//  csmaNodes.Add (p2pNodes.Get (1));
   csmaNodes.Create (4);
-
-//  PointToPointHelper pointToPoint;
-//  pointToPoint.SetDeviceAttribute ("DataRate", StringValue ("5Mbps"));
-//  pointToPoint.SetChannelAttribute ("Delay", StringValue ("2ms"));
-
-//  NetDeviceContainer p2pDevices;
-//  p2pDevices = pointToPoint.Install (p2pNodes);

   CsmaHelper csma;
   csma.SetChannelAttribute ("DataRate", StringValue ("1Mbps"));
@@ -68,10 +56,7 @@

   Ipv4AddressHelper address;
   address.SetBase ("10.1.1.0", "255.255.255.0");
-//  Ipv4InterfaceContainer p2pInterfaces;
-//  p2pInterfaces = address.Assign (p2pDevices);

-//  address.SetBase ("10.1.2.0", "255.255.255.0");
   Ipv4InterfaceContainer csmaInterfaces;
   csmaInterfaces = address.Assign (csmaDevices);


Longer timeout

Longer timeout

--- PyPort/PyTest.cpp
+++ PyPort/PyTest.cpp
@@ -679,7 +679,7 @@
 		LOGINFO("Waiting for all events to be queued");
 		REQUIRE_NOTHROW
 		(
-			if (!WaitIOSFnResult(IOS, 10, [&]()
+			if (!WaitIOSFnResult(IOS, 15, [&]()
 				{
 					if(block_counts[0]+block_counts[1]+block_counts[2]+block_counts[3] < 15000)
 						return false;


[Android] Fix Android JNI Crash (#2827)

[Android] Fix Android JNI Crash (#2827)

* [Android] Fix Android JNI Crash

`jni_object()` in `ReportException()` could be nullptr if `InitFramework()` is not invoked.

```
JNI DETECTED ERROR IN APPLICATION: obj == null
 in call to CallVoidMethodV
from int com.taobao.weex.bridge.WXBridge.nativeCreateInstanceContext(java.lang.String, java.lang.String, java.lang.String, com.taobao.weex.bridge.WXJSObject[])
......

(_JNIEnv::CallVoidMethod(_jobject*, _jmethodID*, ...)+22)
(WeexCore::WXBridge::ReportException(_JNIEnv*, char const*, char const*, char const*)+132)
 (WeexCore::AndroidSide::ReportException(char const*, char const*, char const*)+34)
......

(WeexCore::CoreSideInPlatform::CreateInstance(char const*, char const*, char const*, int, char const*, char const*, char const*, std::__ndk1::vector<InitFrameworkParams*, std::__ndk1::allocator<InitFrameworkParams*>>&, char const*)+820)
at com.taobao.weex.bridge.WXBridge.nativeCreateInstanceContext(Native method)
at com.taobao.weex.bridge.WXBridge.createInstanceContext(Taobao:233)
at com.taobao.weex.bridge.WXBridgeManager.invokeCreateInstanceContext(Taobao:1981)
at com.taobao.weex.bridge.WXBridgeManager.invokeCreateInstance(Taobao:1709)
```

* Fix crash in EagleBridge::WeexCoreHandler::PostTaskToMsgLoop

message_loop() in PostTaskToMsgLoop() could be nullptr if InitFramework() is not invoked.

* Avoid multiple initialization.

* Revert changes of InitSciptThread

* Post successCallback in RequestHandler to JSThread.

* Revert "Post successCallback in RequestHandler to JSThread."

This reverts commit 04bc4068

* Delete `;`

--- weex_core/Source/android/wrap/wx_bridge.cpp
+++ weex_core/Source/android/wrap/wx_bridge.cpp
@@ -39,7 +39,6 @@
 #include "base/android/jni_type.h"
 #include "base/android/jni/jbytearray_ref.h"
 #include "base/android/jniprebuild/jniheader/WXBridge_jni.h"
-#include "base/log_defines.h"
 #include "core/config/core_environment.h"
 #include "core/layout/layout.h"
 #include "core/layout/measure_func_adapter_impl_android.h"
@@ -305,7 +304,9 @@

 static jint InitFramework(JNIEnv* env, jobject object, jstring script,
                           jobject params) {
-  WXBridge::Instance()->Reset(env, object);
+  if (!WXBridge::Instance()->jni_object()) {
+    WXBridge::Instance()->Reset(env, object);
+  }
   // Init platform thread --- ScriptThread
   WeexCoreManager::Instance()->InitScriptThread();
   // Exception handler for so
@@ -620,6 +621,9 @@

   // If strategy is DATA_RENDER_BINARY, jscript is a jbyteArray, otherwise jstring
   // TODO use better way
+  if (!WXBridge::Instance()->jni_object()) {
+    WXBridge::Instance()->Reset(env, jcaller);
+  }
   if (scoped_render_strategy.getChars() != nullptr
       && strcmp(scoped_render_strategy.getChars(), "DATA_RENDER_BINARY") == 0) {
     JByteArrayRef byte_array(env, static_cast<jbyteArray>(jscript.Get()));


FIX the loop that iterates cList

FIX the loop that iterates cList

--- SSPSolution/SSPSolution/System.cpp
+++ SSPSolution/SSPSolution/System.cpp
@@ -153,6 +153,7 @@
 		for (iter = cList.begin(); iter != cList.end();)
 		{
 			this->m_camera->SetCameraPos(iter->pos);
+			iter++;
 		}
 	}


Modified the view distance to push the transparency out further

Former-commit-id: 0a7ad2cb8947877e7a28394df89769630ccfc0e0

--- Sample/source/ViewDistanceCalc.cpp
+++ Sample/source/ViewDistanceCalc.cpp
@@ -47,7 +47,8 @@

 	//Fog has to end before view distance
 	//because view distance is not perfect
-	fogDistance = GetViewDistance()*.80f;
+	//fogDistance = GetViewDistance()*.80f;
+	fogDistance = GetViewDistance();
 }

 //Retrieve a pair of coordinates representing the appropriate draw section


RGBLut: optimize... a bit

RGBLut: optimize... a bit

a single-dimension table depending on a template parameter should be OK

--- RGBLut/RGBLut.cpp
+++ RGBLut/RGBLut.cpp
@@ -194,7 +194,6 @@
     // ctor
     RGBLutProcessor(OFX::ImageEffect &instance, const OFX::RenderArguments &args, OFX::ParametricParam  *lookupTable)
     : RGBLutProcessorBase(instance)
-    , _lookupTable(nComponents * (nbValues + 1))
     {
         // build the LUT
         assert(lookupTable);
@@ -202,6 +201,7 @@
         // except for float, maxValue is the same as nbValues
         assert(maxValue == 1 || (maxValue == nbValues));
         for (int component = 0; component < nComponents; ++component) {
+            _lookupTable[component].resize(nbValues+1);
             int lutIndex = nComponents == 1 ? kCurveAlpha : componentToCurve(component); // special case for components == alpha only
             bool applyMaster = lutIndex != kCurveAlpha;
             for (int position = 0; position <= nbValues; ++position) {
@@ -214,7 +214,7 @@
                     value += lookupTable->getValue(kCurveMaster, args.time, parametricPos) - parametricPos;
                 }
                 // set that in the lut
-                _lookupTable[component * (nbValues + 1) + position] = clamp<PIX>(value, maxValue);
+                _lookupTable[component][position] = clamp<PIX>(value, maxValue);
             }
         }
     }
@@ -250,21 +250,20 @@
     // on input to interpolate, value should be normalized to the [0-1] range
     float interpolate(int component, float value) {
         if (value < 0.) {
-            return _lookupTable[component * (nbValues + 1)];
+            return _lookupTable[component][0];
         } else if (value >= 1.) {
-            return _lookupTable[component * (nbValues + 1) + nbValues];
+            return _lookupTable[component][nbValues];
         } else {
             int i = (int)(value * nbValues);
             assert(0 <= i && i < nbValues);
             float alpha = value * nbValues - i;
             assert(0 <= alpha && alpha < 1.);
-            return _lookupTable[component * (nbValues + 1) + i] * (1.-alpha) + _lookupTable[component * (nbValues + 1) + i + 1] * alpha;
+            return _lookupTable[component][i] * (1.-alpha) + _lookupTable[component][i+1] * alpha;
         }
     }

 private:
-    //float _lookupTable[nComponents][nbValues+1];
-    std::vector<float> _lookupTable;
+    std::vector<float> _lookupTable[nComponents];
 };

 using namespace OFX;


Update blip entity to use the new debugging implementation.

--- source/Entity/Blip.cpp
+++ source/Entity/Blip.cpp
@@ -1,3 +1,4 @@
+// ------------------------------------------------------------------------------------------------
 #include "Entity/Blip.hpp"
 #include "Core.hpp"

@@ -20,8 +21,9 @@
     }
     else
     {
-        LogWrn(_SC("Attempting to <get blip world> using an invalid reference: %d"), m_ID);
-    }
+        BadRef("@world", "get world");
+    }
+
     return SQMOD_UNKNOWN;
 }

@@ -34,8 +36,9 @@
     }
     else
     {
-        LogWrn(_SC("Attempting to <get blip scale> using an invalid reference: %d"), m_ID);
-    }
+        BadRef("@scale", "get scale");
+    }
+
     return SQMOD_UNKNOWN;
 }

@@ -48,7 +51,7 @@
     }
     else
     {
-        LogWrn(_SC("Attempting to <get blip position> using an invalid reference: %d"), m_ID);
+        BadRef("@position", "get position");
     }

     return Vector3::NIL;
@@ -63,7 +66,7 @@
     }
     else
     {
-        LogWrn(_SC("Attempting to <get blip position> using an invalid reference: %d"), m_ID);
+        BadRef("@pos_x", "get x axis");
     }

     return 0.0;
@@ -78,7 +81,7 @@
     }
     else
     {
-        LogWrn(_SC("Attempting to <get blip position> using an invalid reference: %d"), m_ID);
+        BadRef("@pos_y", "get y axis");
     }

     return 0.0;
@@ -93,7 +96,7 @@
     }
     else
     {
-        LogWrn(_SC("Attempting to <get blip position> using an invalid reference: %d"), m_ID);
+        BadRef("@pos_z", "get z axis");
     }

     return 0.0;
@@ -108,7 +111,7 @@
     }
     else
     {
-        LogWrn(_SC("Attempting to <get blip color> using an invalid reference: %d"), m_ID);
+        BadRef("@color", "get color");
     }

     return Color4::NIL;
@@ -123,7 +126,7 @@
     }
     else
     {
-        LogWrn(_SC("Attempting to <get blip sprite> using an invalid reference: %d"), m_ID);
+        BadRef("@spr_id", "get sprite id");
     }

     return SQMOD_UNKNOWN;
@@ -314,7 +317,7 @@
     // Output debugging information
     LogDbg("Registration of <CBlip> type was successful");
     // Output debugging information
-    LogDbg("Beginning registration of <Blip functions> type");
+    LogDbg("Beginning registration of <Blip> functions");
     // Register global functions related to this entity type
     Sqrat::RootTable(vm)
     /* Create BaseBlip [E]xtended [S]ubstitute */
@@ -358,7 +361,7 @@
     .Overload< CBlip (*)(SQInt32, SQInt32, const Vector3 &, SQInt32, const Color4 &, SQInt32, SQInt32, SqObj &) >
         (_SC("CreateBlip_CF"), &CreateBlip_CF);
     // Output debugging information
-    LogDbg("Registration of <Blip functions> type was successful");
+    LogDbg("Registration of <Blip> functions was successful");
     // Registration succeeded
     return true;
 }


Use the standard (void) to mark unused parameters.

--- source/grid/grid_in.cc
+++ source/grid/grid_in.cc
@@ -1468,9 +1468,7 @@
 void GridIn<2>::read_netcdf (const std::string &filename)
 {
 #ifndef DEAL_II_WITH_NETCDF
-  // do something with unused
-  // filename
-  filename.c_str();
+  (void)filename;
   AssertThrow(false, ExcNeedsNetCDF());
 #else
   const unsigned int dim=2;


Cascade Level commands.

Cascade Level commands.

Simple _Move to level_ for setting `action.bri` and _Step_ and _Stop_
as issued by Hue dimmer switch.

--- gateway.cpp
+++ gateway.cpp
@@ -13,6 +13,10 @@
 #define ONOFF_COMMAND_TOGGLE  0x02
 #define ONOFF_COMMAND_OFF_WITH_EFFECT  0x040
 #define ONOFF_COMMAND_ON_WITH_TIMED_OFF  0x42
+#define LEVEL_COMMAND_MOVE_TO_LEVEL 0x00
+#define LEVEL_COMMAND_STEP 0x02
+#define LEVEL_COMMAND_STOP 0x03
+

 #define PHILIPS_MAC_PREFIX QLatin1String("001788")

@@ -35,6 +39,7 @@
         quint8 sceneId;
         quint8 level;
     } param;
+    quint8 mode;
     quint16 transitionTime;
 };

@@ -280,9 +285,22 @@
             else if (ind.clusterId() == 0x0006) // onoff
             {
             }
-//            else if (ind.clusterId() == 0x0008) // level
-//            {
-//            }
+            else if (ind.clusterId() == 0x0008) // level
+            {
+                if (zclFrame.commandId() == LEVEL_COMMAND_MOVE_TO_LEVEL)
+                {
+                    // payload U8 level, U16 transition time
+                    cmd.param.level = zclFrame.payload().at(0);
+                    // cmd.transitionTime = zclFrame.payload().at(1);
+                }
+                else if (zclFrame.commandId() == LEVEL_COMMAND_STEP)
+                {
+                    // payload U8 mode, U8 step size, U16 transitionTime
+                    cmd.mode = zclFrame.payload().at(0);
+                    cmd.param.level = zclFrame.payload().at(1);
+                    // cmd.transitionTime = zclFrame.payload().at(2);
+                }
+            }
             else
             {
                 continue;
@@ -564,6 +582,32 @@
                     map[QLatin1String("on")] = false;
                 }
             }
+            else if (cmd.clusterId == 0x0008)
+            {
+                if (cmd.commandId == LEVEL_COMMAND_MOVE_TO_LEVEL)
+                {
+                      url.sprintf("http://%s:%u/api/%s/groups/%u/action",
+                                  qPrintable(address.toString()), port, qPrintable(apikey), cmd.groupId);
+                      double level = cmd.param.level;
+                      map[QLatin1String("bri")] = level;
+                      // map[QLatin1String("transitiontime")] = cmd.transitionTime;
+                }
+                else if (cmd.commandId == LEVEL_COMMAND_STEP)
+                {
+                      url.sprintf("http://%s:%u/api/%s/groups/%u/action",
+                                  qPrintable(address.toString()), port, qPrintable(apikey), cmd.groupId);
+                      double level = cmd.param.level * (cmd.mode ? -1 : 1);
+                      map[QLatin1String("bri_inc")] = level;
+                      // map[QLatin1String("transitiontime")] = cmd.transitionTime;
+                }
+                else if (cmd.commandId == LEVEL_COMMAND_STOP)
+                {
+                      url.sprintf("http://%s:%u/api/%s/groups/%u/action",
+                                  qPrintable(address.toString()), port, qPrintable(apikey), cmd.groupId);
+                      map[QLatin1String("bri_inc")] = 0.0;
+                      // map[QLatin1String("transitiontime")] = cmd.transitionTime;
+                }
+            }

             commands.pop_back();


Fix a rendering bug

Fix a rendering bug

--- src/CAS/visitors/rendering/InfixRender.hpp
+++ src/CAS/visitors/rendering/InfixRender.hpp
@@ -175,8 +175,9 @@
     if (!noParenthesisInExponent())
     {
         id = exp.getChild(1)->id();
-        if (id == Expressions::ID::add || id == Expressions::ID::divide ||
-            id == Expressions::ID::modulus || id == Expressions::ID::multiply)
+        if (id == Expressions::ID::add     || id == Expressions::ID::divide   ||
+            id == Expressions::ID::modulus || id == Expressions::ID::multiply ||
+            id == Expressions::ID::negate)
             exponent = renderParenthesis(exponent);
     }
     this->childResults.push(renderSuperscript(base, exponent));


Replace #include "TMCParticle6.h" by "TMCParticle.h"

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


Doh - fix previous commit to compile.

Doh - fix previous commit to compile.

--- src/Core/ECEditorModule/ECEditorWindow.cpp
+++ src/Core/ECEditorModule/ECEditorWindow.cpp
@@ -694,8 +694,8 @@
     }

     EntityList old_entities = ecBrowser->Entities();
-    std::sort(entities.begin(), entities.end());
-    std::sort(old_entities.begin(), old_entities.end());
+    entities.sort();
+    old_entities.sort();

     // Check what entities need to get removed/added to browser.
     EntityList::iterator iter1 = old_entities.begin(), iter2 = entities.begin();


ConsoleAPI::ClearLog: Check that native console exists. If not and we call cls, we see a console flashing briefly on the screen which is undesirable.

--- src/Core/TundraCore/Console/ConsoleAPI.cpp
+++ src/Core/TundraCore/Console/ConsoleAPI.cpp
@@ -263,7 +263,9 @@
     if (consoleWidget)
         consoleWidget->ClearLog();
 #ifdef _WINDOWS
-    (void)system("cls");
+    // Check that native console exists. If not and we call cls, we see a console flashing briefly on the screen which is undesirable.
+    if (GetConsoleWindow())
+        (void)system("cls");
 #else
     (void)system("clear");
 #endif


condition_add_with_args should have a return value

--- python/python_object.cpp
+++ python/python_object.cpp
@@ -875,8 +875,8 @@
 		return 0;
 	}

-	conds.AddTo(self->handle, cond, condArgs);
-	Py_RETURN_NONE;
+	auto result = conds.AddTo(self->handle, cond, condArgs);
+	return PyInt_FromLong(result);
 }

 static PyObject* PyObjHandle_IsFriendly(PyObject* obj, PyObject* args) {


Missing ImfInputFile #include in ExrDecoder.cpp

--- Readers/ExrDecoder.cpp
+++ Readers/ExrDecoder.cpp
@@ -19,6 +19,7 @@
 #include <QtCore/QMutex>
 #include <ImfPixelType.h>
 #include <ImfChannelList.h>
+#include <ImfInputFile.h>
 #ifdef __POWITER_WIN32__
 #include <ImfStdIO.h>
 #endif


Enable scene to be set to null.

Enable scene to be set to null.


x Parsing issues with MPEG-4 frames containing more than 1 audio frame

git-svn-id: 294f12855175db510999321cff72188496f07bec@4103 45c5ae6f-87cc-4fd0-92ee-e4f023fd80da

--- Source/MediaInfo/File__Analyze.cpp
+++ Source/MediaInfo/File__Analyze.cpp
@@ -409,28 +409,30 @@
                 return;
         }

-        #if MEDIAINFO_DEMUX
-        if (!IsSub && Config->Demux_EventWasSent && Buffer_Offset==0) //If there was no byte consumed
-        {
-            Config->File_Buffer_Repeat=true;
-        }
-        else
-        #endif //MEDIAINFO_DEMUX
         if (Buffer_Temp_Size==0) //If there was no copy
         {
-            if (Buffer_Temp!=NULL && Buffer_Temp_Size_Max<ToAdd_Size-Buffer_Offset)
+            #if MEDIAINFO_DEMUX
+            if (!IsSub && Config->Demux_EventWasSent && Buffer_Offset==0) //If there was no byte consumed
             {
-                delete[] Buffer_Temp; Buffer_Temp=NULL; Buffer_Temp_Size=0; Buffer_Temp_Size_Max=0;
+                Config->File_Buffer_Repeat=true;
             }
-            if (Buffer_Temp==NULL)
+            else
+            #endif //MEDIAINFO_DEMUX
             {
-                size_t Buffer_Temp_Size_Max_ToAdd=ToAdd_Size-Buffer_Offset>32768?ToAdd_Size-Buffer_Offset:32768;
-                if (Buffer_Temp_Size_Max_ToAdd<Buffer_Temp_Size_Max) Buffer_Temp_Size_Max_ToAdd=Buffer_Temp_Size_Max;
-                Buffer_Temp_Size_Max=Buffer_Temp_Size_Max_ToAdd;
-                Buffer_Temp=new int8u[Buffer_Temp_Size_Max];
+                if (Buffer_Temp!=NULL && Buffer_Temp_Size_Max<ToAdd_Size-Buffer_Offset)
+                {
+                    delete[] Buffer_Temp; Buffer_Temp=NULL; Buffer_Temp_Size=0; Buffer_Temp_Size_Max=0;
+                }
+                if (Buffer_Temp==NULL)
+                {
+                    size_t Buffer_Temp_Size_Max_ToAdd=ToAdd_Size-Buffer_Offset>32768?ToAdd_Size-Buffer_Offset:32768;
+                    if (Buffer_Temp_Size_Max_ToAdd<Buffer_Temp_Size_Max) Buffer_Temp_Size_Max_ToAdd=Buffer_Temp_Size_Max;
+                    Buffer_Temp_Size_Max=Buffer_Temp_Size_Max_ToAdd;
+                    Buffer_Temp=new int8u[Buffer_Temp_Size_Max];
+                }
+                Buffer_Temp_Size=ToAdd_Size-Buffer_Offset;
+                std::memcpy(Buffer_Temp, ToAdd+Buffer_Offset, Buffer_Temp_Size);
             }
-            Buffer_Temp_Size=ToAdd_Size-Buffer_Offset;
-            std::memcpy(Buffer_Temp, ToAdd+Buffer_Offset, Buffer_Temp_Size);
         }
         else if (Buffer_Offset) //Already a copy, just moving it
         {
@@ -959,6 +961,11 @@
     {
         if (!Synched_Test())
             return false;
+        if ((FrameInfo_Next.DTS!=(int64u)-1 || FrameInfo_Next.PTS!=(int64u)-1) && Buffer_Offset+Element_Offset>=FrameInfo.Buffer_Offset)
+        {
+            FrameInfo=FrameInfo_Next;
+            FrameInfo_Next=frame_info();
+        }
         if (!Synched)
         {
             Element[Element_Level].IsComplete=true; //Else the trusting algo will think it


Tileset based on collection of images in progress

--- Source/Urho3D/Urho2D/TmxFile2D.cpp
+++ Source/Urho3D/Urho2D/TmxFile2D.cpp
@@ -534,24 +534,10 @@
     else
         tileSetElem = element;

-    XMLElement imageElem = tileSetElem.GetChild("image");
-    String textureFilePath = GetParentPath(GetName()) + imageElem.GetAttribute("source");
-    ResourceCache* cache = GetSubsystem<ResourceCache>();
-    SharedPtr<Texture2D> texture(cache->GetResource<Texture2D>(textureFilePath));
-    if (!texture)
-    {
-        URHO3D_LOGERROR("Could not load texture " + textureFilePath);
-        return false;
-    }
-
-    tileSetTextures_.Push(texture);
-
     int tileWidth = tileSetElem.GetInt("tilewidth");
     int tileHeight = tileSetElem.GetInt("tileheight");
     int spacing = tileSetElem.GetInt("spacing");
     int margin = tileSetElem.GetInt("margin");
-    int imageWidth = imageElem.GetInt("width");
-    int imageHeight = imageElem.GetInt("height");

     // Set hot spot at left bottom
     Vector2 hotSpot(0.0f, 0.0f);
@@ -562,27 +548,71 @@
         hotSpot.y_ += offsetElem.GetFloat("y") / (float)tileHeight;
     }

-    int gid = firstgid;
-    for (int y = margin; y + tileHeight <= imageHeight - margin; y += tileHeight + spacing)
-    {
-        for (int x = margin; x + tileWidth <= imageWidth - margin; x += tileWidth + spacing)
-        {
-            SharedPtr<Sprite2D> sprite(new Sprite2D(context_));
-            sprite->SetTexture(texture);
-            sprite->SetRectangle(IntRect(x, y, x + tileWidth, y + tileHeight));
-            sprite->SetHotSpot(hotSpot);
-
-            gidToSpriteMapping_[gid++] = sprite;
+    ResourceCache* cache = GetSubsystem<ResourceCache>();
+    {
+        XMLElement imageElem = tileSetElem.GetChild("image");
+        // Tileset based on single tileset image
+        if (imageElem.NotNull()) {
+            String textureFilePath = GetParentPath(GetName()) + imageElem.GetAttribute("source");
+            SharedPtr<Texture2D> texture(cache->GetResource<Texture2D>(textureFilePath));
+            if (!texture)
+            {
+                URHO3D_LOGERROR("Could not load texture " + textureFilePath);
+                return false;
+            }
+
+            tileSetTextures_.Push(texture);
+
+            int imageWidth = imageElem.GetInt("width");
+            int imageHeight = imageElem.GetInt("height");
+
+            int gid = firstgid;
+            for (int y = margin; y + tileHeight <= imageHeight - margin; y += tileHeight + spacing)
+            {
+                for (int x = margin; x + tileWidth <= imageWidth - margin; x += tileWidth + spacing)
+                {
+                    SharedPtr<Sprite2D> sprite(new Sprite2D(context_));
+                    sprite->SetTexture(texture);
+                    sprite->SetRectangle(IntRect(x, y, x + tileWidth, y + tileHeight));
+                    sprite->SetHotSpot(hotSpot);
+
+                    gidToSpriteMapping_[gid++] = sprite;
+                }
+            }
         }
     }

     for (XMLElement tileElem = tileSetElem.GetChild("tile"); tileElem; tileElem = tileElem.GetNext("tile"))
     {
+        int gid = firstgid + tileElem.GetInt("id");
+        // Tileset based on collection of images
+        XMLElement imageElem = tileElem.GetChild("image");
+        if (imageElem.NotNull()) {
+            String textureFilePath = GetParentPath(GetName()) + imageElem.GetAttribute("source");
+            URHO3D_LOGERRORF("textureFilePath = %s", textureFilePath.CString());
+            SharedPtr<Texture2D> texture(cache->GetResource<Texture2D>(textureFilePath));
+            if (texture) {
+                tileSetTextures_.Push(texture);
+                int imageWidth = imageElem.GetInt("width");
+                int imageHeight = imageElem.GetInt("height");
+
+                SharedPtr<Sprite2D> sprite(new Sprite2D(context_));
+                sprite->SetTexture(texture);
+                sprite->SetRectangle(IntRect(0, 0, imageWidth, imageHeight));
+                sprite->SetHotSpot(hotSpot);
+
+                gidToSpriteMapping_[gid] = sprite;
+            }
+        }
+        if (gidToSpriteMapping_.Find(gid) == gidToSpriteMapping_.End()) {
+            URHO3D_LOGERRORF("No texture found for tile with gid %d", gid);
+            return false;
+        }
         if (tileElem.HasChild("properties"))
         {
             SharedPtr<PropertySet2D> propertySet(new PropertySet2D());
             propertySet->Load(tileElem.GetChild("properties"));
-            gidToPropertySetMapping_[firstgid + tileElem.GetInt("id")] = propertySet;
+            gidToPropertySetMapping_[gid] = propertySet;
         }
     }


[bugfix] the path and video file padding is fixed for platform independency

--- qt_source/mainwindow.cpp
+++ qt_source/mainwindow.cpp
@@ -5,6 +5,7 @@
 #include <QNetworkReply>
 #include <QMessageBox>
 #include <QDesktopWidget>
+#include <QDir>
 #include <time.h>
 #include <sstream>

@@ -23,7 +24,7 @@
     m_savedPrefs = new QSettings("UCSD","Tally");
     m_defaultWebAddress = m_savedPrefs->value("defaultWebAddress","http://canbal.github.com/Tally/").toString();
     m_videoMode = m_savedPrefs->value("videoMode",1).toInt();
-    m_pathToCLMP = m_savedPrefs->value("pathToCLMP","c:/Program Files (x86)/Windows Media Player/wmplayer.exe").toString();
+    m_pathToCLMP = m_savedPrefs->value("pathToCLMP","C:\Program Files (x86)\Windows Media Player\wmplayer.exe").toString();
     m_argsCLMP = m_savedPrefs->value("argStringCLMP","/fullscreen /play /close").toString().split(" ");
     m_settings = new Settings();
     m_settings->setWindowModality(Qt::ApplicationModal);    // disables other windows while this one is open
@@ -308,7 +309,7 @@
         if (reply->error() == 99) {
             command = "unknown_error"; // happens when using with Ubuntu 12.04 64-bit Apache server, handle explicitly
         } else {
-            command = "error";
+            command = "error";
 			msgBoxError("Error with server response", reply->errorString().toStdString());
         }
     }
@@ -425,10 +426,11 @@
 // plays the videos within a test case
 void MainWindow::playMediaList(std::string path, Json::Value mediaList)
 {
+    QDir directory(QString("%1").arg(path.c_str()));
     QString fullMedia;
     QStringList fullMediaList;
     for (unsigned int ii=0; ii < mediaList.size(); ii++) {
-        fullMedia = QString("%1/%2").arg(path.c_str()).arg(mediaList[ii].asCString());
+        fullMedia = QDir::toNativeSeparators(directory.absoluteFilePath(QString("%1").arg(mediaList[ii].asCString())));
         ui->status->setText(QString("Playing %1").arg(fullMedia.toStdString().c_str()));
         fullMediaList << fullMedia;
     }


Update BinaryTree.cpp

Update BinaryTree.cpp

--- sources/BinaryTree.cpp
+++ sources/BinaryTree.cpp
@@ -91,7 +91,7 @@
 	curEl = root;
 	if (curEl != NULL)
 	{
-		cout << curEl->x;
+		cout << curEl->x << endl;
 		Out(curEl->left);
 		Out(curEl->right);
 	}


Avoid leaking a shared worker global scope on a failed script load.

The spec tells us,

 http://whatwg.org/specs/web-apps/current-work/#run-a-worker

that in case of failure to load the script of a (shared) worker, we
should report the failure and abort (step 4.) The global scope's
closing flag will be left as false, meaning that we can safely shut
down and destroy the shared worker global scope. Do so.

R=
BUG=364390

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

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@177178 bbb929c8-8fbe-4397-9dbb-9b2b20218538

--- Source/web/WebSharedWorkerImpl.cpp
+++ Source/web/WebSharedWorkerImpl.cpp
@@ -177,8 +177,10 @@
     if (m_askedToTerminate)
         return;
     m_askedToTerminate = true;
-    if (m_mainScriptLoader)
+    if (m_mainScriptLoader) {
         m_mainScriptLoader->cancel();
+        m_mainScriptLoader.clear();
+    }
     if (m_workerThread)
         m_workerThread->stop();
 }
@@ -344,9 +346,16 @@
     ASSERT(m_loadingDocument);
     ASSERT(m_mainScriptLoader);
     if (m_mainScriptLoader->failed() || m_askedToTerminate) {
-        m_mainScriptLoader.clear();
+        m_mainScriptLoader->cancel();
         if (client())
             client()->workerScriptLoadFailed();
+
+        // The SharedWorker was unable to load the initial script, so
+        // shut it down right here unless we're here handling a load
+        // cancellation failure triggered by an explicit shared worker
+        // termination call (via terminateWorkerContext().)
+        if (!m_askedToTerminate)
+            delete this;
         return;
     }
     WorkerThreadStartMode startMode = m_pauseWorkerContextOnStart ? PauseWorkerGlobalScopeOnStart : DontPauseWorkerGlobalScopeOnStart;


Fixed typos.

Fixed typos.

--- src/IECore/bindings/LineSegmentBinding.cpp
+++ src/IECore/bindings/LineSegmentBinding.cpp
@@ -84,11 +84,11 @@
 	s << "IECore." << typeName<L>() << "( ";

 	object item0( x.p0 );
-	assert( item.attr0( "__repr__" ) != object() );
+	assert( item0.attr( "__repr__" ) != object() );
 	s << call_method< std::string >( item0.ptr(), "__repr__" ) << ", ";

 	object item1( x.p1 );
-	assert( item.attr1( "__repr__" ) != object() );
+	assert( item1.attr( "__repr__" ) != object() );
 	s << call_method< std::string >( item1.ptr(), "__repr__" ) << " )";

 	return s.str();


fixed null string crash in scene cache writer

--- src/IECoreHoudini/ROP_SceneCacheWriter.cpp
+++ src/IECoreHoudini/ROP_SceneCacheWriter.cpp
@@ -264,7 +264,7 @@
 				else if ( numShapes == 1 )
 				{
 					const char *name = tuple->getTableString( nameAttr, tuple->validateTableHandle( nameAttr, 0 ) );
-					if ( !strcmp( name, "" ) || !strcmp( name, "/" ) )
+					if( ( name == 0 ) || ( !strcmp( name, "" ) || !strcmp( name, "/" ) ) )
 					{
 						reRoot = true;
 					}


Sketcher: [skip ci] fix computing of hotspot of sketcher icons on macOS


Railfence - Fixed bug length

Railfence - Fixed bug length

--- Railfence.cpp
+++ Railfence.cpp
@@ -69,7 +69,7 @@
 	}

 	// Go through every vector element, check if string is not empty, push back the first character and erase it.
-	for (unsigned int i = 0; i <= textlength; i++)
+	for (unsigned int i = 0; i < textlength + remainder; i++)
 	{
 		for (unsigned int j = 0; j < key; j++)
 		{


Correct way to invoke macro compilation

Correct way to invoke macro compilation

--- Spectra/SelectorTree/RunSelector.C
+++ Spectra/SelectorTree/RunSelector.C
@@ -21,7 +21,7 @@
     }
   }

-  gSystem->Load("AODSelector.cxx++g");
+  gROOT->LoadMacro("AODSelector.cxx++g");

   const double kCent[5] = {0.,10.,20.,40.,60.};
   const double kBins[29] = {


Prevent crashing using '/' in scripts and allow 2byte and 1 bytes characters to co-exist

--- jni/application/onscripter/ONScripter_text.cpp
+++ jni/application/onscripter/ONScripter_text.cpp
@@ -1140,7 +1140,8 @@
         string_buffer_offset++;
         return true;
     }
-    else if ( ch == '/' && !(script_h.getEndStatus() & ScriptHandler::END_1BYTE_CHAR) ){
+    else if ( ch == '/' && !(script_h.getEndStatus() & ScriptHandler::END_1BYTE_CHAR)
+               && script_h.getStringBuffer()[string_buffer_offset + 1] == '\n'){    // Do not crash when scripts use '/'
         if ( ruby_struct.stage == RubyStruct::BODY ){
             current_page->add('/');
             sentence_font.addLineOffset(ruby_struct.margin);
@@ -1230,12 +1231,15 @@
             clickstr_state = CLICK_NONE;
         }

+        bool characterIs1Byte = (ch & 0x80) == 0;
         bool flush_flag = true;
         if ( skip_mode || ctrl_pressed_status )
             flush_flag = false;
+
         if ( script_h.getStringBuffer()[ string_buffer_offset + 1 ] &&
              !(script_h.getEndStatus() & ScriptHandler::END_1BYTE_CHAR)){
-            out_text[1] = script_h.getStringBuffer()[ string_buffer_offset + 1 ];
+            if (!characterIs1Byte)  // Let 1 Byte characters play nice with 2 byte characters
+                out_text[1] = script_h.getStringBuffer()[ string_buffer_offset + 1 ];
             drawChar( out_text, &sentence_font, flush_flag, true, accumulation_surface, &text_info );
             num_chars_in_sentence++;
         }
@@ -1297,7 +1301,7 @@
         }

         if ( script_h.getStringBuffer()[ string_buffer_offset + 1 ] &&
-             !(script_h.getEndStatus() & ScriptHandler::END_1BYTE_CHAR))
+             !(script_h.getEndStatus() & ScriptHandler::END_1BYTE_CHAR) && !characterIs1Byte)
             string_buffer_offset++;
         string_buffer_offset++;


Don't use std::begin and std::end for std::array

--- engine/formats/Json.hpp
+++ engine/formats/Json.hpp
@@ -354,8 +354,8 @@
         private:
             static bool hasByteOrderMark(Iterator begin, Iterator end) noexcept
             {
-                for (auto i = std::begin(utf8ByteOrderMark); i != std::end(utf8ByteOrderMark); ++i)
-                    if (begin == end || static_cast<std::uint8_t>(*begin) != *i)
+                for (const auto b : utf8ByteOrderMark)
+                    if (begin == end || static_cast<std::uint8_t>(*begin) != b)
                         return false;
                     else
                         ++begin;
@@ -701,8 +701,8 @@
             static std::string encode(const Value& value, bool whitespaces, bool byteOrderMark)
             {
                 std::string result;
-                if (byteOrderMark) result.assign(std::begin(utf8ByteOrderMark),
-                                                 std::end(utf8ByteOrderMark));
+                if (byteOrderMark) result.assign(utf8ByteOrderMark.begin(),
+                                                 utf8ByteOrderMark.end());
                 encode(value, result, whitespaces);
                 return result;
             }


PAL10121 - apply in preferences dialog didn't work

--- src/SalomeApp/SalomeApp_PreferencesDlg.cxx
+++ src/SalomeApp/SalomeApp_PreferencesDlg.cxx
@@ -80,4 +80,5 @@
 void SalomeApp_PreferencesDlg::onApply()
 {
   myPrefs->store();
+  myPrefs->toBackup();
 }


Fix typos in ProducerEventProcessorTest

Fix typos in ProducerEventProcessorTest

--- src/Service/ProducerEventProcessorTest.cpp
+++ src/Service/ProducerEventProcessorTest.cpp
@@ -153,7 +153,7 @@
   EXPECT_EQ(actual_interned_callstack.intern().pcs()[2], 3);
 }

-TEST(ProducerEventProcessor, TwoInternedCallstacskDifferentProducersSameKey) {
+TEST(ProducerEventProcessor, TwoInternedCallstacksDifferentProducersSameKey) {
   MockCaptureEventBuffer buffer;
   auto producer_event_processor = ProducerEventProcessor::Create(&buffer);

@@ -450,23 +450,23 @@
   callstack2->add_pcs(8);

   ClientCaptureEvent interned_callstack_event1;
-  ClientCaptureEvent callstack_sameple_event1;
+  ClientCaptureEvent callstack_sample_event1;
   ClientCaptureEvent interned_callstack_event2;
-  ClientCaptureEvent callstack_sameple_event2;
+  ClientCaptureEvent callstack_sample_event2;
   EXPECT_CALL(buffer, AddEvent)
       .Times(4)
       .WillOnce(SaveArg<0>(&interned_callstack_event1))
-      .WillOnce(SaveArg<0>(&callstack_sameple_event1))
+      .WillOnce(SaveArg<0>(&callstack_sample_event1))
       .WillOnce(SaveArg<0>(&interned_callstack_event2))
-      .WillOnce(SaveArg<0>(&callstack_sameple_event2));
+      .WillOnce(SaveArg<0>(&callstack_sample_event2));

   producer_event_processor->ProcessEvent(1, event1);
   producer_event_processor->ProcessEvent(1, event2);

   ASSERT_EQ(interned_callstack_event1.event_case(), ClientCaptureEvent::kInternedCallstack);
   ASSERT_EQ(interned_callstack_event2.event_case(), ClientCaptureEvent::kInternedCallstack);
-  ASSERT_EQ(callstack_sameple_event1.event_case(), ClientCaptureEvent::kCallstackSample);
-  ASSERT_EQ(callstack_sameple_event2.event_case(), ClientCaptureEvent::kCallstackSample);
+  ASSERT_EQ(callstack_sample_event1.event_case(), ClientCaptureEvent::kCallstackSample);
+  ASSERT_EQ(callstack_sample_event2.event_case(), ClientCaptureEvent::kCallstackSample);

   const InternedCallstack& interned_callstack1 = interned_callstack_event1.interned_callstack();
   EXPECT_NE(interned_callstack1.key(), orbit_grpc_protos::kInvalidInternId);
@@ -484,13 +484,13 @@
   EXPECT_EQ(interned_callstack2.intern().pcs(2), 7);
   EXPECT_EQ(interned_callstack2.intern().pcs(3), 8);

-  const CallstackSample& callstack_sample1 = callstack_sameple_event1.callstack_sample();
+  const CallstackSample& callstack_sample1 = callstack_sample_event1.callstack_sample();
   EXPECT_EQ(callstack_sample1.pid(), kPid1);
   EXPECT_EQ(callstack_sample1.tid(), kTid1);
   EXPECT_EQ(callstack_sample1.timestamp_ns(), kTimestampNs1);
   EXPECT_EQ(callstack_sample1.callstack_id(), interned_callstack1.key());

-  const CallstackSample& callstack_sample2 = callstack_sameple_event2.callstack_sample();
+  const CallstackSample& callstack_sample2 = callstack_sample_event2.callstack_sample();
   EXPECT_EQ(callstack_sample2.pid(), kPid2);
   EXPECT_EQ(callstack_sample2.tid(), kTid2);
   EXPECT_EQ(callstack_sample2.timestamp_ns(), kTimestampNs2);
@@ -524,20 +524,20 @@
   callstack2->add_pcs(4);

   ClientCaptureEvent interned_callstack_event1;
-  ClientCaptureEvent callstack_sameple_event1;
-  ClientCaptureEvent callstack_sameple_event2;
+  ClientCaptureEvent callstack_sample_event1;
+  ClientCaptureEvent callstack_sample_event2;
   EXPECT_CALL(buffer, AddEvent)
       .Times(3)
       .WillOnce(SaveArg<0>(&interned_callstack_event1))
-      .WillOnce(SaveArg<0>(&callstack_sameple_event1))
-      .WillOnce(SaveArg<0>(&callstack_sameple_event2));
+      .WillOnce(SaveArg<0>(&callstack_sample_event1))
+      .WillOnce(SaveArg<0>(&callstack_sample_event2));

   producer_event_processor->ProcessEvent(1, event1);
   producer_event_processor->ProcessEvent(1, event2);

   ASSERT_EQ(interned_callstack_event1.event_case(), ClientCaptureEvent::kInternedCallstack);
-  ASSERT_EQ(callstack_sameple_event1.event_case(), ClientCaptureEvent::kCallstackSample);
-  ASSERT_EQ(callstack_sameple_event2.event_case(), ClientCaptureEvent::kCallstackSample);
+  ASSERT_EQ(callstack_sample_event1.event_case(), ClientCaptureEvent::kCallstackSample);
+  ASSERT_EQ(callstack_sample_event2.event_case(), ClientCaptureEvent::kCallstackSample);

   const InternedCallstack& interned_callstack1 = interned_callstack_event1.interned_callstack();
   EXPECT_NE(interned_callstack1.key(), orbit_grpc_protos::kInvalidInternId);
@@ -547,13 +547,13 @@
   EXPECT_EQ(interned_callstack1.intern().pcs(2), 3);
   EXPECT_EQ(interned_callstack1.intern().pcs(3), 4);

-  const CallstackSample& callstack_sample1 = callstack_sameple_event1.callstack_sample();
+  const CallstackSample& callstack_sample1 = callstack_sample_event1.callstack_sample();
   EXPECT_EQ(callstack_sample1.pid(), kPid1);
   EXPECT_EQ(callstack_sample1.tid(), kTid1);
   EXPECT_EQ(callstack_sample1.timestamp_ns(), kTimestampNs1);
   EXPECT_EQ(callstack_sample1.callstack_id(), interned_callstack1.key());

-  const CallstackSample& callstack_sample2 = callstack_sameple_event2.callstack_sample();
+  const CallstackSample& callstack_sample2 = callstack_sample_event2.callstack_sample();
   EXPECT_EQ(callstack_sample2.pid(), kPid2);
   EXPECT_EQ(callstack_sample2.tid(), kTid2);
   EXPECT_EQ(callstack_sample2.timestamp_ns(), kTimestampNs2);


fix in virial computation

fix in virial computation

--- kernels/cpu/src/actions/CPUCalculateForces.cpp
+++ kernels/cpu/src/actions/CPUCalculateForces.cpp
@@ -254,7 +254,7 @@
                                 potential->calculateForceAndEnergy(forceUpdate, mySecondOrderEnergy, x_ij);
                                 force += forceUpdate;
                                 if(COMPUTE_VIRIAL && *particleIt < neighborIndex) {
-                                    virialUpdate += math::outerProduct(-1.*x_ij, force);
+                                    virialUpdate += math::outerProduct(-1.*x_ij, forceUpdate);
                                 }
                             }
                         }


pragma valid only for GCC 4.3+

pragma valid only for GCC 4.3+

git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@6504 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- keypoints/include/pcl/keypoints/impl/susan.hpp
+++ keypoints/include/pcl/keypoints/impl/susan.hpp
@@ -225,7 +225,7 @@
   if (normals_->empty ())
   {
     normals_->reserve (surface_->size ());
-    if (surface_->height == 1 ) // not organized
+    if (!surface_->isOrganized ()) // not organized
     {
       pcl::NormalEstimation<PointInT, NormalT> normal_estimation;
       normal_estimation.setInputCloud(surface_);
@@ -303,7 +303,7 @@
   label_idx_ = pcl::getFieldIndex<PointOutT> (output, "label", out_fields_);

   const int surface_size = static_cast<int> (surface_->size ());
-#if defined (HAVE_OPENMP) && (!defined(_WIN32) || ((__GNUC__ > 4) && (__GNUC_MINOR__ > 2)))
+#if defined (HAVE_OPENMP) && (!defined(_WIN32) || ((__GNUC__ > 4) && (__GNUC_MINOR__ >= 3)))
 #pragma omp parallel for shared (response) num_threads(threads_)
 #endif
   for (int point_index = 0; point_index < surface_size; ++point_index)
@@ -357,7 +357,7 @@
             memcpy (reinterpret_cast<char*> (&point_out) + out_fields_[label_idx_].offset,
                     &label, sizeof (uint32_t));
           }
-#if defined (HAVE_OPENMP) && (!defined(_WIN32) || ((__GNUC__ > 4) && (__GNUC_MINOR__ > 2)))
+#if defined (HAVE_OPENMP) && (!defined(_WIN32) || ((__GNUC__ > 4) && (__GNUC_MINOR__ >= 3)))
 #pragma omp critical
 #endif
           response->push_back (point_out);
@@ -393,7 +393,7 @@
                 memcpy (reinterpret_cast<char*> (&point_out) + out_fields_[label_idx_].offset,
                         &label, sizeof (uint32_t));
               }
-#if defined (HAVE_OPENMP) && (!defined(_WIN32) || ((__GNUC__ > 4) && (__GNUC_MINOR__ > 2)))
+#if defined (HAVE_OPENMP) && (!defined(_WIN32) || ((__GNUC__ > 4) && (__GNUC_MINOR__ >= 3)))
 #pragma omp critical
 #endif
               response->push_back (point_out);
@@ -414,7 +414,7 @@
     output.points.clear ();
     output.points.reserve (response->points.size());

-#if defined (HAVE_OPENMP) && (!defined(_WIN32) || ((__GNUC__ > 4) && (__GNUC_MINOR__ > 2)))
+#if defined (HAVE_OPENMP) && (!defined(_WIN32) || ((__GNUC__ > 4) && (__GNUC_MINOR__ >= 3)))
 #pragma omp parallel for shared (output) num_threads(threads_)
 #endif
     for (int idx = 0; idx < static_cast<int> (response->points.size ()); ++idx)
@@ -439,7 +439,7 @@
         }
       }
       if (is_minima)
-#if defined (HAVE_OPENMP) && (!defined(_WIN32) || ((__GNUC__ > 4) && (__GNUC_MINOR__ > 2)))
+#if defined (HAVE_OPENMP) && (!defined(_WIN32) || ((__GNUC__ > 4) && (__GNUC_MINOR__ >= 3)))
 #pragma omp critical
 #endif
         output.points.push_back (response->points[idx]);


fix for bad anchoring when using horizontal or vertical anchor flags

--- engine/src/gui_node.cpp
+++ engine/src/gui_node.cpp
@@ -204,17 +204,12 @@
                 node->bounds.min = vec2_t(0);
                 node->bounds.max = absolute_desired_size;

-                if (node->has_parent())
-                {
-                    node->bounds += vec2_t(node->parent->padding.left, node->parent->padding.bottom);
-                }
-
                 vec2_t anchor_location;
                 vec2_t anchor_translation;

                 if ((node->anchor_flags & GUI_ANCHOR_FLAG_HORIZONTAL) == GUI_ANCHOR_FLAG_HORIZONTAL)
                 {
-                    anchor_location.x = (sibling_bounds.max.x - sibling_bounds.min.x) / 2;
+                    anchor_location.x = sibling_bounds.min.x + (sibling_bounds.width() / 2);
                     anchor_translation.x = -((absolute_desired_size.x / 2) + ((node->margin.right - node->margin.left) / 2));
                 }
                 else
@@ -233,7 +228,7 @@

                 if ((node->anchor_flags & GUI_ANCHOR_FLAG_VERTICAL) == GUI_ANCHOR_FLAG_VERTICAL)
                 {
-                    anchor_location.y = (sibling_bounds.max.y - sibling_bounds.min.y) / 2;
+                    anchor_location.y = sibling_bounds.min.y + (sibling_bounds.height() / 2);
                     anchor_translation.y = -((absolute_desired_size.y / 2) + ((node->margin.top - node->margin.bottom) / 2));
                 }
                 else


Add additional logging when we warmup a DurabilityMonitor

Currently we log useful information when we create a vBucket such as
the high seqno and persisted snapshot ranges. We do not log the HCS
or HPS warmed up as this is done in a different warmup phase after
we have created the VBucket. Add some extra logging as these values
are useful when determining if we have warmed up correctly.

Change-Id: Id97a3795035269579b6607fed59202ae462c1371
Reviewed-on: http://review.couchbase.org/115252
Reviewed-by: Dave Rigby <a09264da4832c7ff1d3bf1608a19f4b870f93750@couchbase.com>
Tested-by: Build Bot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>

--- engines/ep/src/ep_vb.cc
+++ engines/ep/src/ep_vb.cc
@@ -753,6 +753,14 @@
         Expects(res == MutationStatus::NotFound);
     }

+    EP_LOG_INFO(
+            "EPVBucket::loadOutstandingPrepares: ({}) created DM with HCS:{}, "
+            "HPS:{}, number of prepares loaded:{}",
+            getId(),
+            vbs.highCompletedSeqno,
+            vbs.highPreparedSeqno,
+            outstandingPrepares.size());
+
     // Second restore them into the appropriate DurabilityMonitor.
     switch (getState()) {
     case vbucket_state_active: {


Correctly handle global-argument aliases induced in main

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

--- lib/Analysis/DataStructure/BottomUpClosure.cpp
+++ lib/Analysis/DataStructure/BottomUpClosure.cpp
@@ -434,13 +434,41 @@

 void BUDataStructures::calculateGraph(DSGraph &Graph) {
+  // If this graph contains the main function, clone the globals graph into this
+  // graph before we inline callees and other fun stuff.
+  bool ContainsMain = false;
+  DSGraph::ReturnNodesTy &ReturnNodes = Graph.getReturnNodes();
+
+  for (DSGraph::ReturnNodesTy::iterator I = ReturnNodes.begin(),
+         E = ReturnNodes.end(); I != E; ++I)
+    if (I->first->hasExternalLinkage() && I->first->getName() == "main") {
+      ContainsMain = true;
+      break;
+    }
+
+  // If this graph contains main, copy the contents of the globals graph over.
+  // Note that this is *required* for correctness.  If a callee contains a use
+  // of a global, we have to make sure to link up nodes due to global-argument
+  // bindings.
+  if (ContainsMain) {
+    const DSGraph &GG = *Graph.getGlobalsGraph();
+    ReachabilityCloner RC(Graph, GG,
+                          DSGraph::DontCloneCallNodes |
+                          DSGraph::DontCloneAuxCallNodes);
+
+    // Clone the global nodes into this graph.
+    for (DSScalarMap::global_iterator I = GG.getScalarMap().global_begin(),
+           E = GG.getScalarMap().global_end(); I != E; ++I)
+      if (isa<GlobalVariable>(*I))
+        RC.getClonedNH(GG.getNodeForValue(*I));
+  }
+
+
   // Move our call site list into TempFCs so that inline call sites go into the
   // new call site list and doesn't invalidate our iterators!
   std::list<DSCallSite> TempFCs;
   std::list<DSCallSite> &AuxCallsList = Graph.getAuxFunctionCalls();
   TempFCs.swap(AuxCallsList);
-
-  DSGraph::ReturnNodesTy &ReturnNodes = Graph.getReturnNodes();

   bool Printed = false;
   std::vector<Function*> CalledFuncs;


white space cleanups

white space cleanups

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

--- lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
+++ lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
@@ -61,8 +61,8 @@
   // Implements expansion for UINT_TO_FLOAT; falls back to UnrollVectorOp if
   // SINT_TO_FLOAT and SHR on vectors isn't legal.
   SDValue ExpandUINT_TO_FLOAT(SDValue Op);
-  // Implement vselect in terms of XOR, AND,OR when blend is not supported
-  //  by the target.
+  // Implement vselect in terms of XOR, AND, OR when blend is not supported
+  // by the target.
   SDValue ExpandVSELECT(SDValue Op);
   SDValue ExpandFNEG(SDValue Op);
   // Implements vector promotion; this is essentially just bitcasting the
@@ -277,9 +277,8 @@
   // AND,OR,XOR, we will have to scalarize the op.
   if (!TLI.isOperationLegalOrCustom(ISD::AND, VT) ||
       !TLI.isOperationLegalOrCustom(ISD::XOR, VT) ||
-      !TLI.isOperationLegalOrCustom(ISD::OR, VT)) {
-    return DAG.UnrollVectorOp(Op.getNode());
-  }
+      !TLI.isOperationLegalOrCustom(ISD::OR, VT))
+        return DAG.UnrollVectorOp(Op.getNode());

   assert(VT.getSizeInBits() == OVT.getSizeInBits() && "Invalid mask size");
   // Bitcast the operands to be the same type as the mask.


Remove pointless assertion after r190376

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

--- lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
+++ lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
@@ -600,8 +600,6 @@

   // Generate a mask operand.
   EVT MaskTy = VT.changeVectorElementTypeToInteger();
-  assert(MaskTy.getSizeInBits() == Op1.getValueType().getSizeInBits()
-         && "Invalid mask size");

   // What is the size of each element in the vector mask.
   EVT BitTy = MaskTy.getScalarType();