* Allow dumping one file. * Improve output.

--- examples/dump/main.cpp
+++ examples/dump/main.cpp
@@ -30,6 +30,7 @@
 #include <hadesmem/pelib/section.hpp>
 #include <hadesmem/pelib/tls_dir.hpp>
 #include <hadesmem/pelib/dos_header.hpp>
+#include <hadesmem/pelib/export_dir.hpp>
 #include <hadesmem/pelib/import_dir.hpp>
 #include <hadesmem/pelib/nt_headers.hpp>
 #include <hadesmem/detail/self_path.hpp>
@@ -134,6 +135,8 @@
   std::wcout << "\t\tNewHeaderOffset: " << std::hex
     << dos_hdr.GetNewHeaderOffset() << std::dec << "\n";
   std::wcout << std::noboolalpha;
+
+  std::wcout << "\n\tNT Headers:\n";

   hadesmem::NtHeaders nt_hdrs(process, pe_file);
   std::wcout << std::boolalpha;
@@ -308,9 +311,47 @@
 void DumpExports(hadesmem::Process const& process, PVOID module,
   hadesmem::PeFileType type)
 {
+  hadesmem::PeFile pe_file(process, module, type);
+  std::unique_ptr<hadesmem::ExportDir> export_dir;
+  try
+  {
+    export_dir.reset(new hadesmem::ExportDir(process, pe_file));
+  }
+  catch (std::exception const& /*e*/)
+  {
+    return;
+  }
+
+  std::wcout << "\n\tExport Dir:\n";
+
+  std::wcout << std::boolalpha;
+  std::wcout << "\n";
+  std::wcout << "\t\tGetCharacteristics: " << std::hex
+    << export_dir->GetCharacteristics() << std::dec << "\n";
+  std::wcout << "\t\tGetTimeDateStamp: " << std::hex
+    << export_dir->GetTimeDateStamp() << std::dec << "\n";
+  std::wcout << "\t\tGetMajorVersion: " << std::hex
+    << export_dir->GetMajorVersion() << std::dec << "\n";
+  std::wcout << "\t\tGetMinorVersion: " << std::hex
+    << export_dir->GetMinorVersion() << std::dec << "\n";
+  std::wcout << "\t\tGetName: " << std::hex
+    << export_dir->GetName().c_str() << std::dec << "\n";
+  std::wcout << "\t\tGetOrdinalBase: " << std::hex
+    << export_dir->GetOrdinalBase() << std::dec << "\n";
+  std::wcout << "\t\tGetNumberOfFunctions: " << std::hex
+    << export_dir->GetNumberOfFunctions() << std::dec << "\n";
+  std::wcout << "\t\tGetNumberOfNames: " << std::hex
+    << export_dir->GetNumberOfNames() << std::dec << "\n";
+  std::wcout << "\t\tGetAddressOfFunctions: " << std::hex
+    << export_dir->GetAddressOfFunctions() << std::dec << "\n";
+  std::wcout << "\t\tGetAddressOfNames: " << std::hex
+    << export_dir->GetAddressOfNames() << std::dec << "\n";
+  std::wcout << "\t\tGetAddressOfNameOrdinals: " << std::hex
+    << export_dir->GetAddressOfNameOrdinals() << std::dec << "\n";
+  std::wcout << std::noboolalpha;
+
   std::wcout << "\n\tExports:\n";

-  hadesmem::PeFile pe_file(process, module, type);
   hadesmem::ExportList exports(process, pe_file);
   for (auto const& e : exports)
   {
@@ -359,10 +400,14 @@
 void DumpImports(hadesmem::Process const& process, PVOID module,
   hadesmem::PeFileType type)
 {
-  std::wcout << "\n\tImport Dirs:\n";
-
   hadesmem::PeFile pe_file(process, module, type);
   hadesmem::ImportDirList import_dirs(process, pe_file);
+
+  if (std::begin(import_dirs) != std::end(import_dirs))
+  {
+    std::wcout << "\n\tImport Dirs:\n";
+  }
+
   for (auto const& dir : import_dirs)
   {
     std::wcout << std::boolalpha;
@@ -545,6 +590,9 @@
     hadesmem::PeFile const pe_file(process, buf.data(),
       hadesmem::PeFileType::Data);
     hadesmem::NtHeaders const nt_hdr(process, pe_file);
+    // TODO: Fix this check. The machine type is not required to be set (or
+    // can be invalid? - check this) when no code is being executed
+    // (e.g. data or resource only PEs).
 #if defined(HADESMEM_ARCH_X86)
     if (nt_hdr.GetMachine() != IMAGE_FILE_MACHINE_I386)
 #elif defined(HADESMEM_ARCH_X64)
@@ -623,7 +671,8 @@
       "General options");
     opts_desc.add_options()
       ("help", "produce help message")
-      ("pid", boost::program_options::value<DWORD>(), "process id")
+      ("pid", boost::program_options::value<DWORD>(), "target process id")
+      ("file", boost::program_options::wvalue<std::wstring>(), "target file")
       ;

     std::vector<std::wstring> const args = boost::program_options::
@@ -676,20 +725,27 @@
     }
     else
     {
-      std::wcout << "\nProcesses:\n";
-
-      hadesmem::ProcessList const processes;
-      for (auto const& process_entry : processes)
-      {
-        DumpProcessEntry(process_entry);
-      }
-
-      std::wcout << "\nFiles:\n";
-
-      boost::filesystem::path const self_path =
-        hadesmem::detail::GetSelfPath();
-      boost::filesystem::path const root_dir = self_path.root_path();
-      DumpDir(root_dir);
+      if (var_map.count("file"))
+      {
+        DumpFile(var_map["file"].as<std::wstring>());
+      }
+      else
+      {
+        std::wcout << "\nProcesses:\n";
+
+        hadesmem::ProcessList const processes;
+        for (auto const& process_entry : processes)
+        {
+          DumpProcessEntry(process_entry);
+        }
+
+        std::wcout << "\nFiles:\n";
+
+        boost::filesystem::path const self_path =
+          hadesmem::detail::GetSelfPath();
+        boost::filesystem::path const root_dir = self_path.root_path();
+        DumpDir(root_dir);
+      }
     }

     return 0;


* Fix a gigantic bug because I'm an idiot.

--- examples/dump/main.cpp
+++ examples/dump/main.cpp
@@ -329,7 +329,7 @@
   boost::filesystem::directory_iterator iter(path, ec);
   boost::filesystem::directory_iterator end;

-  while (iter != end && !ec);
+  while (iter != end && !ec)
   {
     auto const& cur_path = *iter;


Initialize sigaction.sa_restorer

Initialize sigaction.sa_restorer

CID=102008
BUG=none
TEST=none

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

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

--- base/process_util_posix.cc
+++ base/process_util_posix.cc
@@ -802,8 +802,8 @@
   // to be ignored.  Therefore, when testing that same code, it should run
   // with SIGPIPE ignored as well.
   struct sigaction action;
+  memset(&action, 0, sizeof(action));
   action.sa_handler = SIG_IGN;
-  action.sa_flags = 0;
   sigemptyset(&action.sa_mask);
   bool success = (sigaction(SIGPIPE, &action, NULL) == 0);


fix warning

fix warning

--- Dev/Cpp/Test/Turbulence/TurbulenceTest.cpp
+++ Dev/Cpp/Test/Turbulence/TurbulenceTest.cpp
@@ -16,8 +16,8 @@
 	printf("Turbulence Test\n");

 	CurlNoise noise(0);
-	noise.Octave = 1.0f;
-	noise.Scale = 1.0f;
+	noise.Octave = 1;
+	noise.Scale = 1;

 	Vec3f position{0.0f, 0.0f, 0.0f};
 	for (uint32_t iteration = 0; iteration < IterationCount; iteration++) {


Fix a typo that broke the posix build.

Fix a typo that broke the posix build.

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

--- base/thread_local_posix.cc
+++ base/thread_local_posix.cc
@@ -24,7 +24,7 @@

 // static
 void* ThreadLocalPlatform::GetValueFromSlot(SlotType& slot) {
-  return pthread_getspecific(slot_);
+  return pthread_getspecific(slot);
 }

 // static


Persuade EliminationCGSolver to run.

Persuade EliminationCGSolver to run.

Several issues: ugly hacks (dynamic_cast), not sure it's the right answer, poor
interface. But we are making progress.

--- examples/ex-normal.cpp
+++ examples/ex-normal.cpp
@@ -117,6 +117,11 @@
          }
       }
    }
+   for (int d = 0; d < dim; ++d)
+   {
+      d_dofs[d]->Sort();
+      d_dofs[d]->Unique();
+   }

    out->Finalize();
    return out;
@@ -176,9 +181,10 @@
        columns will be inverted (or approximately inverted in a
        preconditioner, depending on options) to eliminate the constraint.

-       @todo implement
+       @todo this can be done with only secondary_dofs given in interface
    */
-   void SetElimination(Array<int> secondary_dofs);
+   void SetElimination(Array<int>& primary_dofs,
+                       Array<int>& secondary_dofs);

    /** @brief Solve the constrained system.

@@ -204,9 +210,14 @@
    GMRESSolver gmres;
    TransposeOperator * tr_B;

+   /// todo: next three go in some secondary object,
+   /// like EliminationCGSolver ?
+   /// (in principle the gmres also belongs in this secondary object)
    Solver * primal_pc;  // not owned
    Solver * dual_pc;  // owned
    BlockDiagonalPreconditioner * block_pc;  // owned
+
+   EliminationCGSolver * elim_solver;

    mutable Vector workb;
    mutable Vector workx;
@@ -220,7 +231,8 @@
    gmres(MPI_COMM_WORLD),
    primal_pc(NULL),
    dual_pc(NULL),
-   block_pc(NULL)
+   block_pc(NULL),
+   elim_solver(NULL)
 {
    offsets[0] = 0;
    offsets[1] = A.Height();
@@ -248,6 +260,7 @@
    delete tr_B;
    delete dual_pc;
    delete block_pc;
+   delete elim_solver;
 }

 void ConstrainedSolver::SetPrimalPreconditioner(Solver& pc)
@@ -261,6 +274,32 @@
    gmres.SetPreconditioner(*block_pc);
 }

+/// @todo consistency in primary/secondary notation
+void ConstrainedSolver::SetElimination(Array<int>& primary_dofs,
+                                       Array<int>& secondary_dofs)
+{
+   // SparseMatrix& A = dynamic_cast<SparseMatrix&>(block_op->GetBlock(0, 0));
+   HypreParMatrix& A = dynamic_cast<HypreParMatrix&>(block_op->GetBlock(0, 0));
+   SparseMatrix& B = dynamic_cast<SparseMatrix&>(block_op->GetBlock(1, 0));
+
+   MFEM_VERIFY(secondary_dofs.Size() == B.Height(),
+               "Wrong number of dofs for elimination!");
+
+   //// TODO ugly ugly hack
+   SparseMatrix * hypre_diag = new SparseMatrix;
+   A.GetDiag(*hypre_diag);
+
+/*
+   Array<int> primary_dofs;
+   secondary_dofs.Sort();
+
+   // could go through nonzeros in B, nonzero columns not in secondary_dofs
+   // are assumed to be primary dofs, not sure it is worth the effort
+*/
+
+   elim_solver = new EliminationCGSolver(*hypre_diag, B, primary_dofs, secondary_dofs);
+}
+
 void ConstrainedSolver::Mult(const Vector& b, Vector& x) const
 {
    workb = 0.0;
@@ -271,7 +310,16 @@
       workx(i) = x(i);
    }

-   gmres.Mult(workb, workx);
+   if (elim_solver)
+   {
+      // TODO: current implementation of EliminationCGSolver::Mult()
+      // painstakingly undoes all the stuff you do with workb, workx here
+      elim_solver->Mult(workb, workx);
+   }
+   else
+   {
+      gmres.Mult(workb, workx);
+   }

    for (int i = 0; i < b.Size(); ++i)
    {
@@ -296,6 +344,7 @@
    bool visualization = true;
    int boundary_attribute = 0;
    int refine = -1;
+   bool elimination = false;

    OptionsParser args(argc, argv);
    args.AddOption(&mesh_file, "-m", "--mesh",
@@ -316,6 +365,9 @@
                   "Which attribute to apply essential conditions on.");
    args.AddOption(&refine, "--refine", "--refine",
                   "Levels of serial refinement (-1 for automatic)");
+   args.AddOption(&elimination, "--elimination", "--elimination",
+                  "--no-elimination", "--no-elimination",
+                  "Use elimination solver for saddle point system.");

    args.Parse();
    if (!args.Good())
@@ -438,6 +490,11 @@
    Array<int> x_dofs, y_dofs, z_dofs;
    SparseMatrix * constraint_mat = BuildNormalConstraints(fespace, constraint_atts,
                                                           x_dofs, y_dofs, z_dofs);
+   std::cout << "constraint_mat is " << constraint_mat->Height() << " by "
+             << constraint_mat->Width() << std::endl;
+   std::cout << "x_dofs.Size() = " << x_dofs.Size()
+             << ", y_dofs.Size() = " << y_dofs.Size()
+             << ", z_dofs.Size() = " << z_dofs.Size() << std::endl;
    {
       std::ofstream out("constraint.sparsematrix");
       constraint_mat->Print(out, 1);
@@ -483,7 +540,16 @@
    ConstrainedSolver constrained(*A, *constraint_mat);
    HypreBoomerAMG prec;
    prec.SetPrintLevel(0);
-   constrained.SetPrimalPreconditioner(prec);
+   if (elimination)
+   {
+      y_dofs.Append(z_dofs);
+      y_dofs.Sort();
+      constrained.SetElimination(y_dofs, x_dofs);
+   }
+   else
+   {
+      constrained.SetPrimalPreconditioner(prec);
+   }
    constrained.Mult(B, X);

    // 14. Recover the parallel grid function corresponding to X. This is the


beginSmoothScroll tries to do a simple animation for a given length in seconds, specified as a double. To do a half-second animation, it did base::TimeDelta::FromSeconds(0.5). base::TimeDelta::FromSeconds takes an in64, so this silently converts to FromSeconds(0) causing the smooth scroll to do exactly one step and stop.

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

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

--- content/browser/renderer_host/render_widget_host_view_base.cc
+++ content/browser/renderer_host/render_widget_host_view_base.cc
@@ -22,10 +22,10 @@
 namespace content {

 // How long a smooth scroll gesture should run when it is a near scroll.
-static const double kDurationOfNearScrollGestureSec = 0.15;
+static const int64 kDurationOfNearScrollGestureMs = 150;

 // How long a smooth scroll gesture should run when it is a far scroll.
-static const double kDurationOfFarScrollGestureSec = 0.5;
+static const int64 kDurationOfFarScrollGestureMs = 500;

 // static
 RenderWidgetHostViewPort* RenderWidgetHostViewPort::FromRWHV(
@@ -130,13 +130,13 @@

   virtual bool ForwardInputEvents(base::TimeTicks now,
                                   RenderWidgetHost* host) OVERRIDE {
-    double duration_in_seconds;
+    int64 duration_in_ms;
     if (scroll_far_)
-      duration_in_seconds = kDurationOfFarScrollGestureSec;
+      duration_in_ms = kDurationOfFarScrollGestureMs;
     else
-      duration_in_seconds = kDurationOfNearScrollGestureSec;
+      duration_in_ms = kDurationOfNearScrollGestureMs;

-    if (now - start_time_ > base::TimeDelta::FromSeconds(duration_in_seconds))
+    if (now - start_time_ > base::TimeDelta::FromMilliseconds(duration_in_ms))
       return false;

     WebKit::WebMouseWheelEvent event;


Fix missing header leading to MIPS compile failure.

BUG=507771
TEST=none

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

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

--- content/common/gpu/media/video_encode_accelerator_unittest.cc
+++ content/common/gpu/media/video_encode_accelerator_unittest.cc
@@ -18,6 +18,7 @@
 #include "base/strings/string_split.h"
 #include "base/strings/stringprintf.h"
 #include "base/sys_byteorder.h"
+#include "base/threading/thread_checker.h"
 #include "base/time/time.h"
 #include "base/timer/timer.h"
 #include "content/common/gpu/media/video_accelerator_unittest_helpers.h"


Slot 0(id) and 1(object type) are reserved

--- utils.cc
+++ utils.cc
@@ -654,7 +654,7 @@
 	std::string _md5(md5(standard_name), 24, 8);
 	unsigned int slot = hex2int(_md5);
 	if (slot == 0x00000000) {
-		slot = 0x00000001;
+		slot = 0x00000002; // 0->id; 1->type
 	} else if (slot == 0xffffffff) {
 		slot = 0xfffffffe;
 	}


Support general coefficients in shared memory H(div) mass kernels

--- fem/bilininteg_hdiv.cpp
+++ fem/bilininteg_hdiv.cpp
@@ -328,7 +328,7 @@

    const auto bo = Reshape(Bo_.Read(), Q1D, D1D-1);
    const auto bc = Reshape(Bc_.Read(), Q1D, D1D);
-   const auto D = Reshape(op_.Read(), Q1D, Q1D, 3, NE);
+   const auto D = Reshape(op_.Read(), Q1D, Q1D, symmetric ? 3 : 4, NE);
    const auto x = Reshape(x_.Read(), D1D*(D1D-1), VDIM, NE);
    auto y = y_.ReadWrite();

@@ -423,10 +423,11 @@

                const double D11 = D(qx,qy,0,e);
                const double D12 = D(qx,qy,1,e);
-               const double D22 = D(qx,qy,2,e);
+               const double D21 = symmetric ? D12 : D(qx,qy,2,e);
+               const double D22 = symmetric ? D(qx,qy,2,e) : D(qx,qy,3,e);

                QQ(qx,qy,0) = D11*Qx + D12*Qy;
-               QQ(qx,qy,1) = D12*Qx + D22*Qy;
+               QQ(qx,qy,1) = D21*Qx + D22*Qy;
             }
          }
       }
@@ -816,7 +817,7 @@

    const auto bo = Reshape(Bo_.Read(), Q1D, D1D-1);
    const auto bc = Reshape(Bc_.Read(), Q1D, D1D);
-   const auto D = Reshape(op_.Read(), Q1D, Q1D, Q1D, 6, NE);
+   const auto D = Reshape(op_.Read(), Q1D, Q1D, Q1D, symmetric ? 6 : 9, NE);
    const auto x = Reshape(x_.Read(), D1D*(D1D-1)*(D1D-1), VDIM, NE);
    auto y = y_.ReadWrite();

@@ -980,13 +981,16 @@
                   const double D11 = D(qx,qy,qz,0,e);
                   const double D12 = D(qx,qy,qz,1,e);
                   const double D13 = D(qx,qy,qz,2,e);
-                  const double D22 = D(qx,qy,qz,3,e);
-                  const double D23 = D(qx,qy,qz,4,e);
-                  const double D33 = D(qx,qy,qz,5,e);
+                  const double D21 = symmetric ? D12 : D(qx,qy,qz,3,e);
+                  const double D22 = symmetric ? D(qx,qy,qz,3,e) : D(qx,qy,qz,4,e);
+                  const double D23 = symmetric ? D(qx,qy,qz,4,e) : D(qx,qy,qz,5,e);
+                  const double D31 = symmetric ? D13 : D(qx,qy,qz,6,e);
+                  const double D32 = symmetric ? D23 : D(qx,qy,qz,7,e);
+                  const double D33 = symmetric ? D(qx,qy,qz,5,e) : D(qx,qy,qz,8,e);

                   QQQ(qx,qy,qz,0) = D11*Qx + D12*Qy + D13*Qz;
-                  QQQ(qx,qy,qz,1) = D12*Qx + D22*Qy + D23*Qz;
-                  QQQ(qx,qy,qz,2) = D13*Qx + D23*Qy + D33*Qz;
+                  QQQ(qx,qy,qz,1) = D21*Qx + D22*Qy + D23*Qz;
+                  QQQ(qx,qy,qz,2) = D31*Qx + D32*Qy + D33*Qz;
                }
             }
          }


Add base initialization for MockDirectoryIterator

--- fileSystemProxyMock.cpp
+++ fileSystemProxyMock.cpp
@@ -36,7 +36,9 @@
 using namespace FileSystemProxy;

-MockDirectoryIterator::MockDirectoryIterator (const string path) {
+MockDirectoryIterator::MockDirectoryIterator (const string path)
+    : DirectoryIterator(path) {
+
     // Not yet implemented.
 }


DistFromOutside working correctly for points which are inside the shape at 1E-8 close to Z boundaries

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

--- geom/geom/src/TGeoArb8.cxx
+++ geom/geom/src/TGeoArb8.cxx
@@ -602,35 +602,25 @@
 // Computes distance from outside point to surface of the shape.
    Double_t sdist = TGeoBBox::DistFromOutside(point,dir, fDX, fDY, fDZ, fOrigin, step);
    if (sdist>=step) return TGeoShape::Big();
-   Double_t dist[5];
+   Double_t snext;
+   // check Z planes
+   if (TMath::Abs(point[2])>fDz-1.E-8) {
+      Double_t pt[3];
+      if (point[2]*dir[2]<0) {
+         pt[2]=fDz*TMath::Sign(1.,point[2]);
+         snext = TMath::Max((pt[2]-point[2])/dir[2],0.);
+         for (Int_t j=0; j<2; j++) pt[j]=point[j]+snext*dir[j];
+         if (Contains(&pt[0])) return snext;
+      }
+   }
    // check lateral faces
-   Int_t i;
-   for (i=0; i<4; i++) {
-      dist[i]=DistToPlane(point, dir, i, kFALSE);
-   }
-   // check Z planes
-   dist[4]=TGeoShape::Big();
-   if (TMath::Abs(point[2])>fDz) {
-      if (!TGeoShape::IsSameWithinTolerance(dir[2],0)) {
-         Double_t pt[3];
-         if (point[2]>0) {
-            dist[4] = (fDz-point[2])/dir[2];
-            pt[2]=fDz;
-         } else {
-            dist[4] = (-fDz-point[2])/dir[2];
-            pt[2]=-fDz;
-         }
-         if (dist[4]<0) {
-            dist[4]=TGeoShape::Big();
-         } else {
-            for (Int_t j=0; j<2; j++) pt[j]=point[j]+dist[4]*dir[j];
-            if (!Contains(&pt[0])) dist[4]=TGeoShape::Big();
-         }
-      }
-   }
-   Double_t distmin = dist[0];
-   for (i=1;i<5;i++) if (dist[i] < distmin) distmin = dist[i];
-   return distmin;
+   Double_t dist;
+   snext = TGeoShape::Big();
+   for (Int_t i=0; i<4; i++) {
+      dist = DistToPlane(point, dir, i, kFALSE);
+      if (dist<snext) snext = dist;
+   }
+   return snext;
 }

 //_____________________________________________________________________________


Precision fix

Precision fix

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

--- geom/geom/src/TGeoPgon.cxx
+++ geom/geom/src/TGeoPgon.cxx
@@ -1549,7 +1549,7 @@
 // Computes projected distance at a given Z for a given ray inside a given sector
 // and fills coefficients:
 //   Rproj = a + b*z
-   if (TMath::Abs(dir[2])<1E-8) {
+   if (TMath::Abs(dir[2])<TGeoShape::Tolerance()) {
       a =  b = TGeoShape::Big();
       return TGeoShape::Big();
    }


Update Freddy-el-Humano.cpp

Update Freddy-el-Humano.cpp

--- OmegaUp/Freddy-el-Humano.cpp
+++ OmegaUp/Freddy-el-Humano.cpp
@@ -1,3 +1,5 @@
+//https://omegaup.com/arena/problem/Freddy-el-Humano#
+
 #include <cstdio>
 #include <algorithm>
 #include <iostream>


Fix fdo#33816 - don't loop infinitely when using Apple Remote

Removed erratic loop condition - we simply want to check if any
frame has fullscreen flag set.

--- vcl/aqua/source/app/salinst.cxx
+++ vcl/aqua/source/app/salinst.cxx
@@ -626,9 +626,9 @@
         bool bIsFullScreenMode = false;

         std::list<AquaSalFrame*>::iterator it = pSalData->maFrames.begin();
-        while( (*it) &&  ( (it != pSalData->maFrames.end() ) || ( (*it)->mbFullScreen == false ) ) )
-        {
-            if ( ((*it)->mbFullScreen == true) )
+        while( it != pSalData->maFrames.end() )
+        {
+            if ( (*it) && ((*it)->mbFullScreen == true) )
                 bIsFullScreenMode = true;
             ++it;
         }


[AT-SPI] Clean up event emission code for BridgeObject

1. Ensure early return if !IsUp() or IsHidden().
2. Use a map to convert C++ names to DBus names.

Change-Id: Iab0548c0561d9db0224ef81815a87b7d1aa012d7

--- dali/internal/accessibility/bridge/bridge-object.cpp
+++ dali/internal/accessibility/bridge/bridge-object.cpp
@@ -21,6 +21,8 @@
 // EXTERNAL INCLUDES
 #include <iostream>
 #include <string>
+#include <string_view>
+#include <unordered_map>

 using namespace Dali::Accessibility;

@@ -46,7 +48,11 @@

 void BridgeObject::EmitActiveDescendantChanged(Accessible* obj, Accessible* child)
 {
-  if(!IsUp()) return;
+  if(!IsUp() || obj->IsHidden() || child->IsHidden())
+  {
+    return;
+  }
+
   auto index = child->GetIndexInParent();

   mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<Address>, Address>(
@@ -60,47 +66,30 @@
     {"", "root"});
 }

-void BridgeObject::Emit(Accessible* obj, Dali::Accessibility::ObjectPropertyChangeEvent event)
-{
-  if(!IsUp()) return;
-  const char* name = nullptr;
-
-  switch(event)
-  {
-    case ObjectPropertyChangeEvent::NAME:
-    {
-      name = "accessible-name";
-      break;
-    }
-    case ObjectPropertyChangeEvent::DESCRIPTION:
-    {
-      name = "accessible-description";
-      break;
-    }
-    case ObjectPropertyChangeEvent::VALUE:
-    {
-      name = "accessible-value";
-      break;
-    }
-    case ObjectPropertyChangeEvent::PARENT:
-    {
-      name = "accessible-parent";
-      break;
-    }
-    case ObjectPropertyChangeEvent::ROLE:
-    {
-      name = "accessible-role";
-      break;
-    }
-  }
-
-  if(name)
+void BridgeObject::Emit(Accessible* obj, ObjectPropertyChangeEvent event)
+{
+  static const std::unordered_map<ObjectPropertyChangeEvent, std::string_view> eventMap{
+    {ObjectPropertyChangeEvent::NAME, "accessible-name"},
+    {ObjectPropertyChangeEvent::DESCRIPTION, "accessible-description"},
+    {ObjectPropertyChangeEvent::VALUE, "accessible-value"},
+    {ObjectPropertyChangeEvent::PARENT, "accessible-parent"},
+    {ObjectPropertyChangeEvent::ROLE, "accessible-role"},
+  };
+
+  if(!IsUp() || obj->IsHidden())
+  {
+    return;
+  }
+
+  auto eventName = eventMap.find(event);
+
+  if(eventName != eventMap.end())
   {
     mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<int>, Address>(
       GetAccessiblePath(obj),
       AtspiDbusInterfaceEventObject,
       "PropertyChange",
-      name,
+      std::string{eventName->second},
       0,
       0,
       {0},
@@ -110,114 +99,41 @@

 void BridgeObject::Emit(Accessible* obj, WindowEvent event, unsigned int detail)
 {
-  if(!IsUp()) return;
-  const char* name = nullptr;
-
-  switch(event)
-  {
-    case WindowEvent::PROPERTY_CHANGE:
-    {
-      name = "PropertyChange";
-      break;
-    }
-    case WindowEvent::MINIMIZE:
-    {
-      name = "Minimize";
-      break;
-    }
-    case WindowEvent::MAXIMIZE:
-    {
-      name = "Maximize";
-      break;
-    }
-    case WindowEvent::RESTORE:
-    {
-      name = "Restore";
-      break;
-    }
-    case WindowEvent::CLOSE:
-    {
-      name = "Close";
-      break;
-    }
-    case WindowEvent::CREATE:
-    {
-      name = "Create";
-      break;
-    }
-    case WindowEvent::REPARENT:
-    {
-      name = "Reparent";
-      break;
-    }
-    case WindowEvent::DESKTOP_CREATE:
-    {
-      name = "DesktopCreate";
-      break;
-    }
-    case WindowEvent::DESKTOP_DESTROY:
-    {
-      name = "DesktopDestroy";
-      break;
-    }
-    case WindowEvent::DESTROY:
-    {
-      name = "Destroy";
-      break;
-    }
-    case WindowEvent::ACTIVATE:
-    {
-      name = "Activate";
-      break;
-    }
-    case WindowEvent::DEACTIVATE:
-    {
-      name = "Deactivate";
-      break;
-    }
-    case WindowEvent::RAISE:
-    {
-      name = "Raise";
-      break;
-    }
-    case WindowEvent::LOWER:
-    {
-      name = "Lower";
-      break;
-    }
-    case WindowEvent::MOVE:
-    {
-      name = "Move";
-      break;
-    }
-    case WindowEvent::RESIZE:
-    {
-      name = "Resize";
-      break;
-    }
-    case WindowEvent::SHADE:
-    {
-      name = "Shade";
-      break;
-    }
-    case WindowEvent::UU_SHADE:
-    {
-      name = "uUshade";
-      break;
-    }
-    case WindowEvent::RESTYLE:
-    {
-      name = "Restyle";
-      break;
-    }
-  }
-
-  if(name)
+  static const std::unordered_map<WindowEvent, std::string_view> eventMap{
+    {WindowEvent::PROPERTY_CHANGE, "PropertyChange"},
+    {WindowEvent::MINIMIZE, "Minimize"},
+    {WindowEvent::MAXIMIZE, "Maximize"},
+    {WindowEvent::RESTORE, "Restore"},
+    {WindowEvent::CLOSE, "Close"},
+    {WindowEvent::CREATE, "Create"},
+    {WindowEvent::REPARENT, "Reparent"},
+    {WindowEvent::DESKTOP_CREATE, "DesktopCreate"},
+    {WindowEvent::DESKTOP_DESTROY, "DesktopDestroy"},
+    {WindowEvent::DESTROY, "Destroy"},
+    {WindowEvent::ACTIVATE, "Activate"},
+    {WindowEvent::DEACTIVATE, "Deactivate"},
+    {WindowEvent::RAISE, "Raise"},
+    {WindowEvent::LOWER, "Lower"},
+    {WindowEvent::MOVE, "Move"},
+    {WindowEvent::RESIZE, "Resize"},
+    {WindowEvent::SHADE, "Shade"},
+    {WindowEvent::UU_SHADE, "uUshade"},
+    {WindowEvent::RESTYLE, "Restyle"},
+  };
+
+  if(!IsUp() || obj->IsHidden())
+  {
+    return;
+  }
+
+  auto eventName = eventMap.find(event);
+
+  if(eventName != eventMap.end())
   {
     mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<int>, Address>(
       GetAccessiblePath(obj),
       AtspiDbusInterfaceEventWindow,
-      name,
+      std::string{eventName->second},
       "",
       detail,
       0,
@@ -228,254 +144,69 @@

 void BridgeObject::EmitStateChanged(Accessible* obj, State state, int newValue, int reserved)
 {
-  if(!IsUp()) return;
-  const char* stateName = nullptr;
-
-  switch(state)
-  {
-    case State::INVALID:
-    {
-      stateName = "invalid";
-      break;
-    }
-    case State::ACTIVE:
-    {
-      stateName = "active";
-      break;
-    }
-    case State::ARMED:
-    {
-      stateName = "armed";
-      break;
-    }
-    case State::BUSY:
-    {
-      stateName = "busy";
-      break;
-    }
-    case State::CHECKED:
-    {
-      stateName = "checked";
-      break;
-    }
-    case State::COLLAPSED:
-    {
-      stateName = "collapsed";
-      break;
-    }
-    case State::DEFUNCT:
-    {
-      stateName = "defunct";
-      break;
-    }
-    case State::EDITABLE:
-    {
-      stateName = "editable";
-      break;
-    }
-    case State::ENABLED:
-    {
-      stateName = "enabled";
-      break;
-    }
-    case State::EXPANDABLE:
-    {
-      stateName = "expandable";
-      break;
-    }
-    case State::EXPANDED:
-    {
-      stateName = "expanded";
-      break;
-    }
-    case State::FOCUSABLE:
-    {
-      stateName = "focusable";
-      break;
-    }
-    case State::FOCUSED:
-    {
-      stateName = "focused";
-      break;
-    }
-    case State::HAS_TOOLTIP:
-    {
-      stateName = "has-tooltip";
-      break;
-    }
-    case State::HORIZONTAL:
-    {
-      stateName = "horizontal";
-      break;
-    }
-    case State::ICONIFIED:
-    {
-      stateName = "iconified";
-      break;
-    }
-    case State::MODAL:
-    {
-      stateName = "modal";
-      break;
-    }
-    case State::MULTI_LINE:
-    {
-      stateName = "multi-line";
-      break;
-    }
-    case State::MULTI_SELECTABLE:
-    {
-      stateName = "multiselectable";
-      break;
-    }
-    case State::OPAQUE:
-    {
-      stateName = "opaque";
-      break;
-    }
-    case State::PRESSED:
-    {
-      stateName = "pressed";
-      break;
-    }
-    case State::RESIZEABLE:
-    {
-      stateName = "resizable";
-      break;
-    }
-    case State::SELECTABLE:
-    {
-      stateName = "selectable";
-      break;
-    }
-    case State::SELECTED:
-    {
-      stateName = "selected";
-      break;
-    }
-    case State::SENSITIVE:
-    {
-      stateName = "sensitive";
-      break;
-    }
-    case State::SHOWING:
-    {
-      stateName = "showing";
-      break;
-    }
-    case State::SINGLE_LINE:
-    {
-      stateName = "single-line";
-      break;
-    }
-    case State::STALE:
-    {
-      stateName = "stale";
-      break;
-    }
-    case State::TRANSIENT:
-    {
-      stateName = "transient";
-      break;
-    }
-    case State::VERTICAL:
-    {
-      stateName = "vertical";
-      break;
-    }
-    case State::VISIBLE:
-    {
-      stateName = "visible";
-      break;
-    }
-    case State::MANAGES_DESCENDANTS:
-    {
-      stateName = "manages-descendants";
-      break;
-    }
-    case State::INDETERMINATE:
-    {
-      stateName = "indeterminate";
-      break;
-    }
-    case State::REQUIRED:
-    {
-      stateName = "required";
-      break;
-    }
-    case State::TRUNCATED:
-    {
-      stateName = "truncated";
-      break;
-    }
-    case State::ANIMATED:
-    {
-      stateName = "animated";
-      break;
-    }
-    case State::INVALID_ENTRY:
-    {
-      stateName = "invalid-entry";
-      break;
-    }
-    case State::SUPPORTS_AUTOCOMPLETION:
-    {
-      stateName = "supports-autocompletion";
-      break;
-    }
-    case State::SELECTABLE_TEXT:
-    {
-      stateName = "selectable-text";
-      break;
-    }
-    case State::IS_DEFAULT:
-    {
-      stateName = "is-default";
-      break;
-    }
-    case State::VISITED:
-    {
-      stateName = "visited";
-      break;
-    }
-    case State::CHECKABLE:
-    {
-      stateName = "checkable";
-      break;
-    }
-    case State::HAS_POPUP:
-    {
-      stateName = "has-popup";
-      break;
-    }
-    case State::READ_ONLY:
-    {
-      stateName = "read-only";
-      break;
-    }
-    case State::HIGHLIGHTED:
-    {
-      stateName = "highlighted";
-      break;
-    }
-    case State::HIGHLIGHTABLE:
-    {
-      stateName = "highlightable";
-      break;
-    }
-    case State::MAX_COUNT:
-    {
-      break;
-    }
-  }
-
-  if(stateName)
+  static const std::unordered_map<State, std::string_view> stateMap{
+    {State::INVALID, "invalid"},
+    {State::ACTIVE, "active"},
+    {State::ARMED, "armed"},
+    {State::BUSY, "busy"},
+    {State::CHECKED, "checked"},
+    {State::COLLAPSED, "collapsed"},
+    {State::DEFUNCT, "defunct"},
+    {State::EDITABLE, "editable"},
+    {State::ENABLED, "enabled"},
+    {State::EXPANDABLE, "expandable"},
+    {State::EXPANDED, "expanded"},
+    {State::FOCUSABLE, "focusable"},
+    {State::FOCUSED, "focused"},
+    {State::HAS_TOOLTIP, "has-tooltip"},
+    {State::HORIZONTAL, "horizontal"},
+    {State::ICONIFIED, "iconified"},
+    {State::MODAL, "modal"},
+    {State::MULTI_LINE, "multi-line"},
+    {State::MULTI_SELECTABLE, "multiselectable"},
+    {State::OPAQUE, "opaque"},
+    {State::PRESSED, "pressed"},
+    {State::RESIZEABLE, "resizable"},
+    {State::SELECTABLE, "selectable"},
+    {State::SELECTED, "selected"},
+    {State::SENSITIVE, "sensitive"},
+    {State::SHOWING, "showing"},
+    {State::SINGLE_LINE, "single-line"},
+    {State::STALE, "stale"},
+    {State::TRANSIENT, "transient"},
+    {State::VERTICAL, "vertical"},
+    {State::VISIBLE, "visible"},
+    {State::MANAGES_DESCENDANTS, "manages-descendants"},
+    {State::INDETERMINATE, "indeterminate"},
+    {State::REQUIRED, "required"},
+    {State::TRUNCATED, "truncated"},
+    {State::ANIMATED, "animated"},
+    {State::INVALID_ENTRY, "invalid-entry"},
+    {State::SUPPORTS_AUTOCOMPLETION, "supports-autocompletion"},
+    {State::SELECTABLE_TEXT, "selectable-text"},
+    {State::IS_DEFAULT, "is-default"},
+    {State::VISITED, "visited"},
+    {State::CHECKABLE, "checkable"},
+    {State::HAS_POPUP, "has-popup"},
+    {State::READ_ONLY, "read-only"},
+    {State::HIGHLIGHTED, "highlighted"},
+    {State::HIGHLIGHTABLE, "highlightable"},
+  };
+
+  if(!IsUp() || obj->IsHidden())
+  {
+    return;
+  }
+
+  auto stateName = stateMap.find(state);
+
+  if(stateName != stateMap.end())
   {
     mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<int>, Address>(
       GetAccessiblePath(obj),
       AtspiDbusInterfaceEventObject,
       "StateChanged",
-      stateName,
+      std::string{stateName->second},
       newValue,
       reserved,
       {0},
@@ -485,7 +216,10 @@

 void BridgeObject::EmitBoundsChanged(Accessible* obj, Dali::Rect<> rect)
 {
-  if(!IsBoundsChangedEventAllowed) return;
+  if(!IsUp() || !IsBoundsChangedEventAllowed || obj->IsHidden())
+  {
+    return;
+  }

   DBus::EldbusVariant<std::tuple<int32_t, int32_t, int32_t, int32_t> > tmp{
     std::tuple<int32_t, int32_t, int32_t, int32_t>{rect.x, rect.y, rect.width, rect.height}};
@@ -505,6 +239,11 @@

 void BridgeObject::EmitCursorMoved(Accessible* obj, unsigned int cursorPosition)
 {
+  if(!IsUp() || obj->IsHidden())
+  {
+    return;
+  }
+
   mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<int>, Address>(
     GetAccessiblePath(obj),
     AtspiDbusInterfaceEventObject,
@@ -518,32 +257,25 @@

 void BridgeObject::EmitTextChanged(Accessible* obj, TextChangedState state, unsigned int position, unsigned int length, const std::string& content)
 {
-  const char* stateName = nullptr;
-  switch(state)
-  {
-    case TextChangedState::INSERTED:
-    {
-      stateName = "insert";
-      break;
-    }
-    case TextChangedState::DELETED:
-    {
-      stateName = "delete";
-      break;
-    }
-    case TextChangedState::MAX_COUNT:
-    {
-      break;
-    }
-  }
-
-  if(stateName)
+  static const std::unordered_map<TextChangedState, std::string_view> stateMap{
+    {TextChangedState::INSERTED, "insert"},
+    {TextChangedState::DELETED, "delete"},
+  };
+
+  if(!IsUp() || obj->IsHidden())
+  {
+    return;
+  }
+
+  auto stateName = stateMap.find(state);
+
+  if(stateName != stateMap.end())
   {
     mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<std::string>, Address>(
       GetAccessiblePath(obj),
       AtspiDbusInterfaceEventObject,
       "TextChanged",
-      stateName,
+      std::string{stateName->second},
       position,
       length,
       {content},
@@ -553,6 +285,11 @@

 void BridgeObject::EmitMovedOutOfScreen(Accessible* obj, ScreenRelativeMoveType type)
 {
+  if(!IsUp() || obj->IsHidden())
+  {
+    return;
+  }
+
   mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<int>, Address>(
     GetAccessiblePath(obj),
     AtspiDbusInterfaceEventObject,


Fix abug which causes artifacts while generating isosurfaces. https://tracker.physiomeproject.org/show_bug.cgi?id=3826

git-svn-id: b9baf8c2d14a71b3ba9c27a102eb6e792fc13348@10983 3c1deb5b-d424-0410-962d-aba41a686d42

--- core/source/finite_element/finite_element_to_iso_surfaces.cpp
+++ core/source/finite_element/finite_element_to_iso_surfaces.cpp
@@ -1868,16 +1868,15 @@
 	unsigned int number_of_available_vertices = 0, insert_vertex_location = 0;
 	GLfloat place_holder[3];

+	total_number_of_triangles_to_add = 0;
 	for (Iso_mesh_map_const_iterator mesh_iter = mesh_map.begin();
 		mesh_iter != mesh_map.end(); mesh_iter++)
 	{
 		Iso_mesh& mesh = *(mesh_iter->second);
 		const Iso_triangle_list& triangle_list = mesh.triangle_list;
 		const int number_of_triangles = triangle_list.size();
-		total_number_of_triangles_to_add = 0;
 		if (0 < number_of_triangles)
 		{
-			GLfloat *dataField = NULL;
 			for (Iso_triangle_list_const_iterator triangle_iter = triangle_list.begin();
 				triangle_iter != triangle_list.end(); triangle_iter++)
 			{


Invert check for the case that there is no data left in the buffer

--- TRD/AliTRDrawFastStream.cxx
+++ TRD/AliTRDrawFastStream.cxx
@@ -1728,11 +1728,11 @@
   Int_t fEndOfDataCount = 0;
   fNWordsCounter = 0;

-  while ( *fpPos != ENDOFRAWDATAMARKER && fpPos < fpEnd ) {
+  while ( fpPos < fpEnd && *fpPos != ENDOFRAWDATAMARKER ) {
     fpPos++;
     fNWordsCounter++;
   }
-  while (*fpPos == ENDOFRAWDATAMARKER && fpPos < fpEnd ) {
+  while ( fpPos < fpEnd && *fpPos == ENDOFRAWDATAMARKER ) {
     fEndOfDataCount++;
     fpPos++;
   }


fixed ghi-electronics/TinyCLR-Devices/issues/109 for LPC

--- Targets/LPC17/LPC17_SPI.cpp
+++ Targets/LPC17/LPC17_SPI.cpp
@@ -390,7 +390,7 @@
     static const uint32_t c_SPI1_Base = 0x40030000; // 0xE0030000;
     static const uint32_t c_SPI2_Base = 0x400AC000; // 0x400AC000; // TQD

-    static const uint32_t c_SPI_Clk_KHz = (LPC17_SYSTEM_CLOCK_HZ/2/1000);
+    static const uint32_t c_SPI_Clk_KHz = (LPC17_SYSTEM_CLOCK_HZ / 2 / 1000);

     static const uint32_t c_SPI0 = 0;
     static const uint32_t c_SPI1 = 1;
@@ -535,21 +535,21 @@

     switch (g_SpiController[controller].Mode) {

-        case TinyCLR_Spi_Mode::Mode0: // CPOL = 0, CPHA = 0.
-
-            break;
-
-        case TinyCLR_Spi_Mode::Mode1: // CPOL = 0, CPHA = 1.
-            SPI.SSPxCR0 |= (1 << 7);
-            break;
-
-        case TinyCLR_Spi_Mode::Mode2: //  CPOL = 1, CPHA = 0.
-            SPI.SSPxCR0 |= (1 << 6);
-            break;
-
-        case TinyCLR_Spi_Mode::Mode3: // CPOL = 1, CPHA = 1
-            SPI.SSPxCR0 |= (1 << 6) | (1 << 7);
-            break;
+    case TinyCLR_Spi_Mode::Mode0: // CPOL = 0, CPHA = 0.
+
+        break;
+
+    case TinyCLR_Spi_Mode::Mode1: // CPOL = 0, CPHA = 1.
+        SPI.SSPxCR0 |= (1 << 7);
+        break;
+
+    case TinyCLR_Spi_Mode::Mode2: //  CPOL = 1, CPHA = 0.
+        SPI.SSPxCR0 |= (1 << 6);
+        break;
+
+    case TinyCLR_Spi_Mode::Mode3: // CPOL = 1, CPHA = 1
+        SPI.SSPxCR0 |= (1 << 6) | (1 << 7);
+        break;
     }

     SPI.SSPxCR0 &= ~(0xFF << 8);
@@ -818,17 +818,17 @@
         return TinyCLR_Result::SharingViolation;

     switch (controller) {
-        case 0:
-            LPC_SC->PCONP |= PCONP_PCSSP0;
-            break;
-
-        case 1:
-            LPC_SC->PCONP |= PCONP_PCSSP1;
-            break;
-
-        case 2:
-            LPC_SC->PCONP |= PCONP_PCSSP2;
-            break;
+    case 0:
+        LPC_SC->PCONP |= PCONP_PCSSP0;
+        break;
+
+    case 1:
+        LPC_SC->PCONP |= PCONP_PCSSP1;
+        break;
+
+    case 2:
+        LPC_SC->PCONP |= PCONP_PCSSP2;
+        break;
     }

     return TinyCLR_Result::Success;
@@ -851,39 +851,33 @@

     switch (controller) {
-        case 0:
-            LPC_SC->PCONP &= ~PCONP_PCSSP0;
-            break;
-
-        case 1:
-
-            break;
-
-        case 2:
-            LPC_SC->PCONP &= ~PCONP_PCSSP2;
-            break;
+    case 0:
+        LPC_SC->PCONP &= ~PCONP_PCSSP0;
+        break;
+
+    case 1:
+
+        break;
+
+    case 2:
+        LPC_SC->PCONP &= ~PCONP_PCSSP2;
+        break;
     }

     return TinyCLR_Result::Success;
 }

 int32_t LPC17_Spi_GetMinClockFrequency(const TinyCLR_Spi_Provider* self) {
-    // Theoretically this could read the Clock and PLL configurations
-    // to determine an actual realistic minimum, however there doesn't
-    // seem to be a lot of value in that since the CPU_SPI_Xaction_Start
-    // has to determine the applicability of the selected speed at the
-    // time a transaction is started anyway.
-    return 1;
+    // CPSDVSR min 2, max 254
+    // SCR min 0, max 127
+    return LPC17_AHB_CLOCK_HZ / (254 * (127 + 1));
+
 }

 int32_t LPC17_Spi_GetMaxClockFrequency(const TinyCLR_Spi_Provider* self) {
-    // Theoretically this could read the Clock and PLL configurations
-    // to determine an actual realistic maximum, however there doesn't
-    // seem to be a lot of value in that since the CPU_SPI_Xaction_Start
-    // has to determine the applicability of the selected speed at the
-    // time a transaction is started anyway.
-    // Max supported (e.g. not overclocked) AHB speed / 2
-    return 48000000;
+    // CPSDVSR min 2, max 254
+    // SCR min 0, max 127
+    return LPC17_AHB_CLOCK_HZ / (2 * (0 + 1));
 }

 int32_t LPC17_Spi_GetChipSelectLineCount(const TinyCLR_Spi_Provider* self) {


When the text size is too small the line width for the square root and the bars must be 1 pixel.

--- graf2d/graf/src/TLatex.cxx
+++ graf2d/graf/src/TLatex.cxx
@@ -1586,10 +1586,11 @@
             Analyse(x+GetHeight()*spec.fSize/2,y,spec,text+opSqrt+6,length-opSqrt-7);

             Short_t lineW = GetLineWidth();
+            SetLineWidth(0.);
             Double_t dx = (y2-y3)/8;
-            SetLineWidth(TMath::Max(2,(Int_t)(dx/2)));
+            if (spec.fSize>0.04) SetLineWidth(TMath::Max(2,(Int_t)(dx/2)));
             DrawLine(x1-2*dx,y1,x1-dx,y2,spec);
-            SetLineWidth((Int_t)(dx/4));
+            if (spec.fSize>0.04) SetLineWidth((Int_t)(dx/4));
             DrawLine(x1-dx,y2,x1,y3,spec);
             DrawLine(x1,y3,x2,y3,spec);
             SetLineWidth(lineW);
@@ -2089,6 +2090,7 @@
    // Get current line attributes.
    Short_t lineW = GetLineWidth();
    Int_t lineC = GetLineColor();
+   if (size<0.04) SetLineWidth(0.);

    TextSpec_t spec;
    spec.fAngle = angle;


Fix deadlock on conn status changes when introspecting FeatureConnected

--- TelepathyQt4/connection.cpp
+++ TelepathyQt4/connection.cpp
@@ -119,6 +119,7 @@
     // so Connection::status() and Connection::statusReason() are consistent
     bool introspectingMain;
     bool statusChangedWhileIntrospectingMain;
+    bool introspectingConnected;

     uint pendingStatus;
     uint pendingStatusReason;
@@ -205,6 +206,7 @@
       readinessHelper(parent->readinessHelper()),
       introspectingMain(false),
       statusChangedWhileIntrospectingMain(false),
+      introspectingConnected(false),
       pendingStatus((uint) -1),
       pendingStatusReason(ConnectionStatusReasonNoneSpecified),
       status((uint) -1),
@@ -545,8 +547,12 @@

 void Connection::Private::introspectConnected(Connection::Private *self)
 {
+    Q_ASSERT(!self->introspectingConnected);
+    self->introspectingConnected = true;
+
     if (self->pendingStatus == ConnectionStatusConnected) {
         self->readinessHelper->setIntrospectCompleted(FeatureConnected, true);
+        self->introspectingConnected = false;
     }
 }

@@ -577,6 +583,16 @@
         introspectMainQueue.clear();
     } else {
         readinessHelper->setCurrentStatus(status);
+
+        if (introspectingConnected) {
+            // We have to finish the Connected introspection for now, as ReadinessHelper waits for
+            // all introspect ops in flight for the current status to finish before it starts
+            // introspecting the new status
+            debug() << "Finishing FeatureConnected for status" << this->status <<
+                "to allow ReadinessHelper to introspect new status" << status;
+            readinessHelper->setIntrospectCompleted(FeatureConnected, true);
+            introspectingConnected = false;
+        }
     }
 }


disable wchar stuff for __DARWIN_OSX__

disable wchar stuff for __DARWIN_OSX__

--- TerrainSDK/vtdata/vtLog.cpp
+++ TerrainSDK/vtdata/vtLog.cpp
@@ -9,7 +9,10 @@
 #include "vtString.h"
 #include "vtLog.h"
 #include <stdarg.h>
+
+#ifndef __DARWIN_OSX__
 #include <wchar.h>		// for fputws()
+#endif

 #ifdef _MSC_VER
 #include <windows.h>	// for OutputDebugString, unfortunately
@@ -64,6 +67,7 @@

 void vtLog::_Log(const wchar_t *msg)
 {
+#ifndef __DARWIN_OSX__
 	if (m_log)
 	{
 		// it is not so useful to write wide characters to the file, which
@@ -73,6 +77,8 @@
 		fputs(str.eb_str(), m_log);
 		fflush(m_log);
 	}
+#endif	// __DARWIN_OSX__
+
 #ifdef _MSC_VER
 	OutputDebugStringW(msg);
 #endif
@@ -91,6 +97,7 @@

 void vtLog::Printf(const wchar_t *pFormat, ...)
 {
+#ifndef __DARWIN_OSX__
 	va_list va;
 	va_start(va, pFormat);

@@ -112,4 +119,5 @@
 #endif

 	_Log(ach);
+#endif	// __DARWIN_OSX__
 }


Add Limits typedef

Add Limits typedef

--- headers/vivace/utility.hpp
+++ headers/vivace/utility.hpp
@@ -15,6 +15,7 @@
 #ifndef VCE_UTILITY_HPP
 #define VCE_UTILITY_HPP

+#include <limits>
 #include <ostream>

 #include <vivace/meta.hpp>
@@ -45,6 +46,10 @@
         return Ordering::Equal;
     }
 }
+
+/// A collection of numeric limits.
+template <class T>
+using Limits = std::numeric_limits<T>;

 namespace detail {
     VCE_HAS_FIELD(HasRelocatable, RELOCATABLE);


hecl/hecl: Mark Hash interface as noexcept

These are utilized within some hash implementations, which shouldn't
throw, so these member functions can be marked as noexcept.

--- hecl/include/hecl/hecl.hpp
+++ hecl/include/hecl/hecl.hpp
@@ -437,36 +437,36 @@
   uint64_t hash = 0;

 public:
-  constexpr Hash() = default;
-  constexpr Hash(const Hash&) = default;
+  constexpr Hash() noexcept = default;
+  constexpr Hash(const Hash&) noexcept = default;
   constexpr Hash(Hash&&) noexcept = default;
-  constexpr Hash(uint64_t hashin) : hash(hashin) {}
-  explicit Hash(const void* buf, size_t len) : hash(XXH64((uint8_t*)buf, len, 0)) {}
-  explicit Hash(std::string_view str) : hash(XXH64((uint8_t*)str.data(), str.size(), 0)) {}
-  explicit Hash(std::wstring_view str) : hash(XXH64((uint8_t*)str.data(), str.size() * 2, 0)) {}
-
-  constexpr uint32_t val32() const { return uint32_t(hash) ^ uint32_t(hash >> 32); }
-  constexpr uint64_t val64() const { return uint64_t(hash); }
-  constexpr size_t valSizeT() const { return size_t(hash); }
+  constexpr Hash(uint64_t hashin) noexcept : hash(hashin) {}
+  explicit Hash(const void* buf, size_t len) noexcept : hash(XXH64((uint8_t*)buf, len, 0)) {}
+  explicit Hash(std::string_view str) noexcept : hash(XXH64((uint8_t*)str.data(), str.size(), 0)) {}
+  explicit Hash(std::wstring_view str) noexcept : hash(XXH64((uint8_t*)str.data(), str.size() * 2, 0)) {}
+
+  constexpr uint32_t val32() const noexcept { return uint32_t(hash) ^ uint32_t(hash >> 32); }
+  constexpr uint64_t val64() const noexcept { return uint64_t(hash); }
+  constexpr size_t valSizeT() const noexcept { return size_t(hash); }
   template <typename T>
-  constexpr T valT() const;
-
-  constexpr Hash& operator=(const Hash& other) = default;
+  constexpr T valT() const noexcept;
+
+  constexpr Hash& operator=(const Hash& other) noexcept = default;
   constexpr Hash& operator=(Hash&& other) noexcept = default;
-  constexpr bool operator==(const Hash& other) const { return hash == other.hash; }
-  constexpr bool operator!=(const Hash& other) const { return hash != other.hash; }
-  constexpr bool operator<(const Hash& other) const { return hash < other.hash; }
-  constexpr bool operator>(const Hash& other) const { return hash > other.hash; }
-  constexpr bool operator<=(const Hash& other) const { return hash <= other.hash; }
-  constexpr bool operator>=(const Hash& other) const { return hash >= other.hash; }
-  constexpr explicit operator bool() const { return hash != 0; }
+  constexpr bool operator==(const Hash& other) const noexcept { return hash == other.hash; }
+  constexpr bool operator!=(const Hash& other) const noexcept { return !operator==(other); }
+  constexpr bool operator<(const Hash& other) const noexcept { return hash < other.hash; }
+  constexpr bool operator>(const Hash& other) const noexcept { return hash > other.hash; }
+  constexpr bool operator<=(const Hash& other) const noexcept { return hash <= other.hash; }
+  constexpr bool operator>=(const Hash& other) const noexcept { return hash >= other.hash; }
+  constexpr explicit operator bool() const noexcept { return hash != 0; }
 };
 template <>
-constexpr uint32_t Hash::valT<uint32_t>() const {
+constexpr uint32_t Hash::valT<uint32_t>() const noexcept {
   return val32();
 }
 template <>
-constexpr uint64_t Hash::valT<uint64_t>() const {
+constexpr uint64_t Hash::valT<uint64_t>() const noexcept {
   return val64();
 }

@@ -619,9 +619,9 @@
    * @brief HECL-specific xxhash
    * @return unique hash value
    */
-  Hash hash() const { return m_hash; }
-  bool operator==(const ProjectRootPath& other) const { return m_hash == other.m_hash; }
-  bool operator!=(const ProjectRootPath& other) const { return m_hash != other.m_hash; }
+  Hash hash() const noexcept { return m_hash; }
+  bool operator==(const ProjectRootPath& other) const noexcept { return m_hash == other.m_hash; }
+  bool operator!=(const ProjectRootPath& other) const noexcept { return !operator==(other); }

   /**
    * @brief Obtain c-string of final path component
@@ -1052,9 +1052,9 @@
    * @brief HECL-specific xxhash
    * @return unique hash value
    */
-  Hash hash() const { return m_hash; }
-  bool operator==(const ProjectPath& other) const { return m_hash == other.m_hash; }
-  bool operator!=(const ProjectPath& other) const { return m_hash != other.m_hash; }
+  Hash hash() const noexcept { return m_hash; }
+  bool operator==(const ProjectPath& other) const noexcept { return m_hash == other.m_hash; }
+  bool operator!=(const ProjectPath& other) const noexcept { return !operator==(other); }
 };

 /**


Sequencer: Require click to start inside button

Fix dragging a ImSequencer track start over the remove button and
releasing deletes the track.
Fix clicking on ImSequencer duplicate and dragging off to cancel removes
the track if you released over the remove button.

Now SequencerAddDelButton behaves like ImGui:Button: requires the click
to start inside the button and end inside the button.

Test
Build imguizmo test app.
* Click drag track start and end.
* Click expand, add, duplicate, and remove buttons.
* Click drag off remove button.
* Click drag track start over remove button.

--- ImSequencer.cpp
+++ ImSequencer.cpp
@@ -40,14 +40,17 @@
       ImGuiIO& io = ImGui::GetIO();
       ImRect btnRect(pos, ImVec2(pos.x + 16, pos.y + 16));
       bool overBtn = btnRect.Contains(io.MousePos);
-      int btnColor = overBtn ? 0xFFAAAAAA : 0x77A3B2AA;
+      bool containedClick = overBtn && btnRect.Contains(io.MouseClickedPos[0]);
+      bool clickedBtn = containedClick && io.MouseReleased[0];
+      int btnColor = overBtn ? 0xAAEAFFAA : 0x77A3B2AA;
+
       float midy = pos.y + 16 / 2 - 0.5f;
       float midx = pos.x + 16 / 2 - 0.5f;
       draw_list->AddRect(btnRect.Min, btnRect.Max, btnColor, 4);
       draw_list->AddLine(ImVec2(btnRect.Min.x + 3, midy), ImVec2(btnRect.Max.x - 3, midy), btnColor, 2);
       if (add)
          draw_list->AddLine(ImVec2(midx, btnRect.Min.y + 3), ImVec2(midx, btnRect.Max.y - 3), btnColor, 2);
-      return overBtn;
+      return clickedBtn;
    }

    bool Sequencer(SequenceInterface* sequence, int* currentFrame, bool* expanded, int* selectedEntry, int* firstFrame, int sequenceOptions)
@@ -193,7 +196,7 @@
          draw_list->AddRectFilled(canvas_pos, ImVec2(canvas_size.x + canvas_pos.x, canvas_pos.y + ItemHeight), 0xFF3D3837, 0);
          if (sequenceOptions & SEQUENCER_ADD)
          {
-            if (SequencerAddDelButton(draw_list, ImVec2(canvas_pos.x + legendWidth - ItemHeight, canvas_pos.y + 2), true) && io.MouseReleased[0])
+            if (SequencerAddDelButton(draw_list, ImVec2(canvas_pos.x + legendWidth - ItemHeight, canvas_pos.y + 2), true))
                ImGui::OpenPopup("addEntry");

             if (ImGui::BeginPopup("addEntry"))
@@ -280,12 +283,10 @@

             if (sequenceOptions & SEQUENCER_DEL)
             {
-               bool overDel = SequencerAddDelButton(draw_list, ImVec2(contentMin.x + legendWidth - ItemHeight + 2 - 10, tpos.y + 2), false);
-               if (overDel && io.MouseReleased[0])
+               if (SequencerAddDelButton(draw_list, ImVec2(contentMin.x + legendWidth - ItemHeight + 2 - 10, tpos.y + 2), false))
                   delEntry = i;

-               bool overDup = SequencerAddDelButton(draw_list, ImVec2(contentMin.x + legendWidth - ItemHeight - ItemHeight + 2 - 10, tpos.y + 2), true);
-               if (overDup && io.MouseReleased[0])
+               if (SequencerAddDelButton(draw_list, ImVec2(contentMin.x + legendWidth - ItemHeight - ItemHeight + 2 - 10, tpos.y + 2), true))
                   dupEntry = i;
             }
             customHeight += sequence->GetCustomHeight(i);
@@ -675,8 +676,7 @@

       if (expanded)
       {
-         bool overExpanded = SequencerAddDelButton(draw_list, ImVec2(canvas_pos.x + 2, canvas_pos.y + 2), !*expanded);
-         if (overExpanded && io.MouseReleased[0])
+         if (SequencerAddDelButton(draw_list, ImVec2(canvas_pos.x + 2, canvas_pos.y + 2), !*expanded))
             *expanded = !*expanded;
       }


Fixing typo

Fixing typo

--- firmware/Components.cpp
+++ firmware/Components.cpp
@@ -1,4 +1,4 @@
-#include "COmponents.h"
+#include "Components.h"

 using namespace platypus;

@@ -64,7 +64,7 @@
   delay(500);
   disable();
   delay(500);
-
+
   velocity(1.0);
   enable();
   delay(3000);
@@ -77,7 +77,7 @@
 {
   disable();
   delay(500);
-
+
   velocity(1.0);
   enable();
   delay(5000);
@@ -145,7 +145,7 @@

 ServoSensor::~ServoSensor()
 {
-  servo_.detach();
+  servo_.detach();
 }

 void ServoSensor::position(float position)
@@ -217,14 +217,14 @@
   // Enable +12V output.
   pinMode(board::SENSOR[channel_].PWR_ENABLE, OUTPUT);
   digitalWrite(board::SENSOR[channel_].PWR_ENABLE, HIGH);
-
+
   // Read response from sensor.
   delay(250);
-
+
   // Turn off +12V output.
   pinMode(board::SENSOR[channel_].PWR_ENABLE, OUTPUT);
   digitalWrite(board::SENSOR[channel_].PWR_ENABLE, LOW);
-
+
   // Wait a while for next sensor reading.
   delay(1750);
 }
@@ -233,18 +233,18 @@
 {
   // TODO: verify checksum.
   char c = SERIAL_PORTS[channel_]->read();
-  if (c == '\0') {
+  if (c == '\0') {
     return;
-  }
+  }
   else if (c != '\r' && c != '\n' && recv_index_ < DEFAULT_BUFFER_SIZE)
   {
     recv_buffer_[recv_index_] = c;
     ++recv_index_;
   }
   else if (recv_index_ > 0)
-  {
+  {
     recv_buffer_[recv_index_] = '\0';
-
+
     if (recv_index_ > 6) // Only send data strings
     {
       char output_str[DEFAULT_BUFFER_SIZE+3];
@@ -271,7 +271,7 @@
 {
   // Start up serial port.
   SERIAL_PORTS[channel]->begin(38400);
-
+
   // Tell the sensor to output continuously.
   SERIAL_PORTS[channel_]->print("C\r");
 }
@@ -290,9 +290,9 @@
     ++recv_index_;
   }
   else if (recv_index_ > 0)
-  {
+  {
     recv_buffer_[recv_index_] = '\0';
-
+
     char output_str[DEFAULT_BUFFER_SIZE+3];
     snprintf(output_str, DEFAULT_BUFFER_SIZE,
       "{"
@@ -303,10 +303,10 @@
       "}",
       channel_,
       recv_buffer_
-    );
+    );
     send(output_str);

-    memset(recv_buffer_, 0, recv_index_);
+    memset(recv_buffer_, 0, recv_index_);
     recv_index_ = 0;
   }
 }
@@ -333,7 +333,7 @@
   // Select RS485 (deselect RS232)
   pinMode(board::SENSOR[channel].RS485_232, OUTPUT);
   digitalWrite(board::SENSOR[channel].RS485_232, HIGH);
-
+
   // Start up serial port
   SERIAL_PORTS[channel]->begin(4800);
 }
@@ -352,9 +352,9 @@
     ++recv_index_;
   }
   else if (recv_index_ > 0)
-  {
+  {
     recv_buffer_[recv_index_] = '\0';
-
+
     char output_str[DEFAULT_BUFFER_SIZE+3];
     snprintf(output_str, DEFAULT_BUFFER_SIZE,
       "{"
@@ -365,9 +365,9 @@
       "}",
       channel_,
       recv_buffer_
-    );
+    );
     send(output_str);
-
+
     memset(recv_buffer_, 0, recv_index_);
     recv_index_ = 0;
   }
@@ -380,14 +380,14 @@
 , desired_position_(0)
 , desired_velocity_(0)
 , desired_acceleration_(12000)
-{
+{
   // Enable +12V output.
   pinMode(board::SENSOR[channel].PWR_ENABLE, OUTPUT);
   digitalWrite(board::SENSOR[channel].PWR_ENABLE, HIGH);
-
+
   // TODO: specifically enable e-stop line.
   // (Right now it is just pulled up by default.)
-
+
   // Start up Roboclaw.
   roboclaw_.begin(38400);
 }
@@ -403,20 +403,20 @@
   if (!strncmp("p", param, 2))
   {
     uint32_t pos = atol(value);
-
+
     position(pos);
     return true;
   }
   else if (!strncmp("v", param, 2))
   {
     int32_t vel = atol(value);
-
+
     velocity(vel);
-    return true;
+    return true;
   }
   else if (!strncmp("reset", param, 6))
   {
-
+
     reset();
     return true;
   }
@@ -443,10 +443,10 @@
 {
   desired_velocity_ = vel;
   roboclaw_.SetM1VelocityPID(addr, Kd, Kp, Ki, Qpps);
-  roboclaw_.SpeedAccelDistanceM1(addr,
-                                 desired_acceleration_,
+  roboclaw_.SpeedAccelDistanceM1(addr,
+                                 desired_acceleration_,
                                  desired_velocity_,
-                                 desired_position_);
+                                 desired_position_);
 }

 uint32_t Winch::encoder(bool *valid)
@@ -458,7 +458,7 @@
 //Cosntruct RC "sensor" by calling RC_Controller
 RC::RC(int channel)
 : Sensor(channel),
-  RC_Controller(board::SENSOR[channel].GPIO[board::RX_NEG],
+  RC_Controller(board::SENSOR[channel].GPIO[board::RX_NEG],
                 board::SENSOR[channel].GPIO[board::TX_NEG],
                 board::SENSOR[channel].GPIO[board::RX_POS])
 {
@@ -470,7 +470,7 @@
   pinMode(board::SENSOR[channel].TX_ENABLE, OUTPUT);
   digitalWrite(board::SENSOR[channel].TX_ENABLE, LOW);

-
+
 }

 char * RC::name()


From Axel:
Surround operand with () for sign inversion. Fixes Savannah #68905.

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

--- hist/hist/src/TFormula.cxx
+++ hist/hist/src/TFormula.cxx
@@ -2995,7 +2995,7 @@

          //Sign inversion
          if (optype==kSignInv) { // -1) {
-            tab[spos-1]="-"+tab[spos-1];
+            tab[spos-1]="-("+tab[spos-1]+")";
             // i++;
             continue;
          }


When inputting particles, also include the "age" attribute

The "age" attribute needs to be explicitly included, because it's not
returned by the particle query command.

--- InputParticle.C
+++ InputParticle.C
@@ -233,6 +233,17 @@
             MStringArray attributeNames;
             MGlobal::executeCommand(getAttributesCommand, attributeNames);

+            // explicitly include some special per-particle attributes that
+            // aren't returned by the MEL command
+            switch(i)
+            {
+                case 0:
+                    break;
+                case 1:
+                    attributeNames.append("age");
+                    break;
+            }
+
             for(unsigned int j = 0; j < attributeNames.length(); j++)
             {
                 const MString attributeName = attributeNames[j];
@@ -245,7 +256,8 @@

                 // mimics "listAttr -v -w" from AEokayAttr
                 MFnAttribute attributeFn(attributeObj);
-                if(!(!attributeFn.isHidden() && attributeFn.isWritable()))
+                if(!(!attributeFn.isHidden() && attributeFn.isWritable())
+                        && attributeName != "age")
                 {
                     continue;
                 }


Changing affine estimation interface a bit to simplify the calling code.

git-svn-id: 9d271b02f21ef92375d53f3a729673c5fe5e0adf@2207 5fc10e88-4e10-11de-b850-9977aa68d080

--- cpl/tabletop_pushing/src/tabletop_pushing_perception_node.cpp
+++ cpl/tabletop_pushing/src/tabletop_pushing_perception_node.cpp
@@ -1133,6 +1133,7 @@
       return cluster_centers;
     }
     // TODO: Estimate affine transforms from the flow
+    // cv::Mat af = estimateAffineTransform(u, v, r, c, radius);
     int num_sample_elements = 6;
     cv::Mat samples(num_samples, num_sample_elements, CV_32FC1);
     cv::Mat sample_locs(num_samples, 1, CV_32FC2);
@@ -1256,9 +1257,12 @@
   }

   cv::Mat estimateAffineTransform(cv::Mat& u, cv::Mat& v,
-                                  const int r_min, const int r_max,
-                                  const int c_min, const int c_max)
-  {
+                                  const int r, const int c, const int radius)
+  {
+    const int r_min = max(r - radius, 0);
+    const int r_max = min(r - radius, u.rows-1);
+    const int c_min = max(c - radius, 0);
+    const int c_max = min(c - radius, u.cols-1);
     const int r_range = r_max-r_min+1;
     const int c_range = c_max-c_min+1;
     const int num_eqs = r_range*c_range*2;


WIP: save work.

WIP: save work.

--- cpp/examples/Sara/ImageProcessing/find_chessboard_corners.cpp
+++ cpp/examples/Sara/ImageProcessing/find_chessboard_corners.cpp
@@ -212,15 +212,21 @@
       const Eigen::Vector2d b = e.cast<double>() + s * delta * n;
       const Eigen::Vector2d d = e.cast<double>() - s * delta * n;

-      darks.push_back(sara::interpolate(color, d));
-      brights.push_back(sara::interpolate(color, b));
+      if (0 <= d.x() && d.x() < color.width() &&  //
+          0 <= d.y() && d.y() < color.height())
+        darks.push_back(sara::interpolate(color, d));
+
+      if (0 <= b.x() && b.x() < color.width() &&  //
+          0 <= b.y() && b.y() < color.height())
+        brights.push_back(sara::interpolate(color, b));
     }
   }

   Eigen::Vector2f mean_gradient = Eigen::Vector2f::Zero();
-  std::accumulate(
-      edge.begin(), edge.end(), mean_gradient,
-      [&gradients](const auto& g, const auto& e) { return g + gradients(e); });
+  mean_gradient = std::accumulate(edge.begin(), edge.end(), mean_gradient,
+                                  [&gradients](const auto& g, const auto& e) {
+                                    return g + gradients(e).normalized();  //
+                                  });
   mean_gradient /= edge.size();

   return std::make_tuple(darks, brights, mean_gradient);
@@ -239,7 +245,7 @@
   constexpr float high_threshold_ratio = static_cast<float>(10._percent);
   constexpr float low_threshold_ratio =
       static_cast<float>(high_threshold_ratio / 2.);
-  constexpr float angular_threshold = static_cast<float>((20._deg).value);
+  constexpr float angular_threshold = static_cast<float>((10._deg).value);

   const auto color_threshold = std::sqrt(std::pow(2, 2) * 3);
   const auto segment_min_size = 50;
@@ -278,25 +284,41 @@
       sara::set_antialiasing();
     }

-    // Watershed.
+    // Watershed to find the chessboard quadrangles.
     const auto regions = sara::color_watershed(image, color_threshold);

-    // Display the good regions.
-    const auto colors = mean_colors(regions, image);
-    auto partitioning = sara::Image<sara::Rgb8>{image.sizes()};
-    for (const auto& [label, points] : regions)
-    {
-      // Show big segments only.
-      for (const auto& p : points)
-        partitioning(p) = points.size() < segment_min_size  //
-                              ? sara::Black8
-                              : colors.at(label);
-    }
-
+    // Group segments.
     ed(image_blurred);
     const auto& edges = ed.pipeline.edges_as_list;

-    sara::display(partitioning);
+    auto darks = std::vector<std::vector<sara::Rgb64f>>{};
+    auto brights = std::vector<std::vector<sara::Rgb64f>>{};
+    auto mean_gradients = std::vector<Eigen::Vector2f>{};
+    for (const auto& edge : edges)
+    {
+      auto [dark, bright, g] = edge_signature(  //
+          image,                                //
+          ed.pipeline.gradient_cartesian,       //
+          edge);
+      darks.push_back(std::move(dark));
+      brights.push_back(std::move(bright));
+      mean_gradients.push_back(g);
+    }
+
+    // const auto colors = mean_colors(regions, image);
+    // auto partitioning = sara::Image<sara::Rgb8>{image.sizes()};
+    // for (const auto& [label, points] : regions)
+    // {
+    //   // Show big segments only.
+    //   for (const auto& p : points)
+    //     partitioning(p) = points.size() < segment_min_size  //
+    //                           ? sara::Black8
+    //                           : colors.at(label);
+    // }
+
+    // sara::display(partitioning);
+
+    sara::display(image);
     for (const auto& e : edges)
     {
       const auto color = sara::Rgb8(rand() % 255, rand() % 255, rand() % 255);
@@ -304,8 +326,29 @@
         sara::fill_circle(p.x(), p.y(), 2, color);
     }

-    for (const auto& p : saddle_points)
-      sara::draw_circle(p.p, 5, sara::Green8, 2);
+    for (auto i = 0u; i < edges.size(); ++i)
+    {
+      const auto& e = edges[i];
+
+      // Discard small edges.
+      if (e.size() < 2)
+        continue;
+
+      const auto& g = mean_gradients[i];
+      const Eigen::Vector2f a = std::accumulate(            //
+                                    e.begin(), e.end(),     //
+                                    Eigen::Vector2f{0, 0},  //
+                                    [](const auto& a, const auto& b) {
+                                      return a + b.template cast<float>();
+                                    }) /
+                                e.size();
+      const Eigen::Vector2f b = a + 20 * g;
+
+      sara::draw_arrow(a, b, sara::Magenta8, 2);
+    }
+
+    // for (const auto& p : saddle_points)
+    //   sara::draw_circle(p.p, 5, sara::Green8, 2);

     sara::get_key();
   }
@@ -320,4 +363,3 @@
   app.register_user_main(__main);
   return app.exec();
 }
-


Fixed typo in ImageView::GetNaturalSize().

Change-Id: I28621277e343e7159cf2ed023957965d830d586a

--- dali-toolkit/internal/controls/image-view/image-view-impl.cpp
+++ dali-toolkit/internal/controls/image-view/image-view-impl.cpp
@@ -173,7 +173,7 @@
   size.y = mImageSize.GetHeight();
   size.z = std::min(size.x, size.y);

-  if( size.x > 0 && size.x > 0 )
+  if( size.x > 0 && size.y > 0 )
   {
     return size;
   }


protection for module number against crash in QAMaker

--- PMD/AliPMDQADataMakerRec.cxx
+++ PMD/AliPMDQADataMakerRec.cxx
@@ -440,7 +440,11 @@
 	    Int_t col = pmdddl->GetColumn();
 	    Int_t sig = pmdddl->GetSignal();

-	    if (mcm == 0 || smn == -1) continue;
+	    if (mcm == 0) continue;
+	    if (det < 0 || det > 1)  continue;
+	    if (smn < 0 || smn > 23) continue;
+	    if (row < 0 || row > 47) continue;
+	    if (col < 0 || col > 95) continue;

 	    if (det == 0)
 	    {


correcting conenction of output container

--- PWG4/macros/AddTaskJetChem.C
+++ PWG4/macros/AddTaskJetChem.C
@@ -86,7 +86,7 @@
 							   Form("%s:PWG4_JetChem",AliAnalysisManager::GetCommonFileName()));

   mgr->ConnectInput(task,0,cinput );
-  mgr->ConnectOutput(task,0,coutput);
+  mgr->ConnectOutput(task,1,coutput);

   return task;
 }


Removed writing to gif from unit tests. It was never properly supported even on windows.

--- UnitTests/Src/TestImage.cpp
+++ UnitTests/Src/TestImage.cpp
@@ -114,13 +114,6 @@

 	pngPic.Save("TestData/WrittenXeyesJPG.jpg");
 	tRequire( tSystem::tFileExists("TestData/WrittenXeyesJPG.jpg"));
-
-	#ifdef PLATFORM_WINDOWS
-	pngPic.Save("TestData/WrittenXeyesGIF.gif");
-	tRequire( tSystem::tFileExists("TestData/WrittenXeyesGIF.gif"));
-	#else
-	tGoal(!"Write to gif not working on this platform.");
-	#endif
 }


testing some flush theories

testing some flush theories

--- W3CServer/src/w3cserver.cpp
+++ W3CServer/src/w3cserver.cpp
@@ -88,8 +88,8 @@

     const QString vssFile = "/etc/vss_rel_1.json";
     m_vsssInterface = QSharedPointer<VSSSignalInterfaceImpl>(new VSSSignalInterfaceImpl(vssFile));
-    m_openDSHandler = QSharedPointer<OpenDSHandler>(new OpenDSHandler());
-    connect(m_openDSHandler.data(), &OpenDSHandler::valueChanged, static_cast <VSSSignalInterfaceImpl*>(m_vsssInterface.data()), &VSSSignalInterfaceImpl::updateValue);
+    //m_openDSHandler = QSharedPointer<OpenDSHandler>(new OpenDSHandler());
+    //connect(m_openDSHandler.data(), &OpenDSHandler::valueChanged, static_cast <VSSSignalInterfaceImpl*>(m_vsssInterface.data()), &VSSSignalInterfaceImpl::updateValue);
 }

 W3CServer::~W3CServer()
@@ -145,7 +145,7 @@
     //remove from client list and delete from heap
     if (zeClient)
     {
-        m_clients.remove(zeClient);
+        m_clients.remove(zeClient); //TODO: do we need to call delete in mutex object here ?
         zeClient->deleteLater();
         W3CServer::m_nrOfClients--;
     }


Fix spelling

Fix spelling

--- WangscapeGui/mainwindow.cpp
+++ WangscapeGui/mainwindow.cpp
@@ -46,7 +46,7 @@
     if (mTilesetGenerator == nullptr)
     {
         QMessageBox error_message;
-        error_message.critical(this, "Error during tileset generation", QString("You have to select options file before clicking 'Generate...' button"));
+        error_message.critical(this, "Error during tileset generation", QString("You must select an options file before clicking the 'Generate...' button"));
         return;
     }

@@ -77,14 +77,14 @@
     }
     else
     {
-        QString chosen_path = QFileDialog::getExistingDirectory(this, tr("Select output dir"));
+        QString chosen_path = QFileDialog::getExistingDirectory(this, tr("Select output directory"));
         mOptions.relativeOutputDirectory = chosen_path.toLocal8Bit().constData();
     }

     if (mPreviewImages.empty())
     {
         QMessageBox warning_message;
-        warning_message.warning(this, "Warning", QString("You have to generate tileset before saving it"));
+        warning_message.warning(this, "Warning", QString("You must generate a tileset before saving it"));
         return;
     }


Use boost::filesystem to get filename

Use boost::filesystem to get filename

--- WangscapeGui/mainwindow.cpp
+++ WangscapeGui/mainwindow.cpp
@@ -55,14 +55,14 @@
     mUi->comboBox->clear();
     mPreviewImages.clear();

-    mTilesetGenerator->generate([this](const sf::Texture& output, std::string filename)
+    mTilesetGenerator->generate([this](const sf::Texture& output, std::string filepath)
     {
         const sf::Image source_image = output.copyToImage();

-        const auto basename = filename.substr(filename.rfind('/') + 1);
+        const auto filename = boost::filesystem::path(filepath).filename().string();
         const auto qimage = convertSfImageToQImage(source_image);
-        mPreviewImages.emplace(std::make_pair(basename,
-                                             std::make_pair(filename, std::move(qimage))));
+        mPreviewImages.emplace(std::make_pair(filename,
+                                             std::make_pair(filepath, std::move(qimage))));
     });

     initializePreviewArea();


Set maxLinkRate type to uint32_t so it gets read (#20)

--- WhateverGreen/kern_igfx.hpp
+++ WhateverGreen/kern_igfx.hpp
@@ -452,7 +452,7 @@
 	 *
 	 *  Default value is 0x14 (5.4 Gbps, HBR2) for 4K laptop display
 	 */
-	uint8_t maxLinkRate {0x14};
+	uint32_t maxLinkRate {0x14};

 	/**
 	 *  ReadAUX wrapper to modify the maximum link rate value in the DPCD buffer


add turn data

add turn data

--- DarkestTowerServer/DarkestTowerServer/GameManager.cpp
+++ DarkestTowerServer/DarkestTowerServer/GameManager.cpp
@@ -73,11 +73,14 @@

 		MatchStart start;
 		start.type = Type::MATCH_START;
+		start.turn = 0;

 		auto context = new PacketContext<MatchStart>();
 		context->packet = start;
 		context->session = player->getSession();
 		skylark::postContext(HmmoApplication::getInstance()->getIoPort(), context, 0);
+
+		start.turn = 1;

 		auto context2 = new PacketContext<MatchStart>();
 		context2->packet = start;


Minor cleanup of type bitwidth query functions

--- source/ast/types/Type.cpp
+++ source/ast/types/Type.cpp
@@ -107,8 +107,8 @@
         return width;

     // TODO: check for overflow
-    if (isUnpackedArray()) {
-        auto& ct = getCanonicalType();
+    auto& ct = getCanonicalType();
+    if (ct.isUnpackedArray()) {
         if (ct.kind != SymbolKind::FixedSizeUnpackedArrayType)
             return 0;

@@ -116,26 +116,26 @@
         return fsa.elementType.bitstreamWidth() * fsa.range.width();
     }

-    if (isUnpackedStruct()) {
-        auto& us = getCanonicalType().as<UnpackedStructType>();
+    if (ct.isUnpackedStruct()) {
+        auto& us = ct.as<UnpackedStructType>();
         for (const auto& field : us.membersOfType<FieldSymbol>())
             width += field.getType().bitstreamWidth();
     }

-    if (isUnpackedUnion()) {
+    if (ct.isUnpackedUnion()) {
         // Unpacked unions are not bitstream types but we support
         // getting a bit width out of them anyway.
-        auto& us = getCanonicalType().as<UnpackedUnionType>();
+        auto& us = ct.as<UnpackedUnionType>();
         for (const auto& field : us.membersOfType<FieldSymbol>())
             width = std::max(width, field.getType().bitstreamWidth());
     }

-    if (isClass()) {
-        auto& ct = getCanonicalType().as<ClassType>();
-        if (ct.isInterface)
+    if (ct.isClass()) {
+        auto& classType = ct.as<ClassType>();
+        if (classType.isInterface)
             return 0;

-        for (auto& prop : ct.membersOfType<ClassPropertySymbol>())
+        for (auto& prop : classType.membersOfType<ClassPropertySymbol>())
             width += prop.getType().bitstreamWidth();
     }

@@ -251,17 +251,18 @@
 }

 bool Type::isBitstreamType(bool destination) const {
-    if (isIntegral() || isString())
-        return true;
-
-    if (isUnpackedArray()) {
-        if (destination && getCanonicalType().kind == SymbolKind::AssociativeArrayType)
-            return false;
-        return getArrayElementType()->isBitstreamType(destination);
-    }
-
-    if (isUnpackedStruct()) {
-        auto& us = getCanonicalType().as<UnpackedStructType>();
+    auto& ct = getCanonicalType();
+    if (ct.isIntegral() || ct.isString())
+        return true;
+
+    if (ct.isUnpackedArray()) {
+        if (destination && ct.kind == SymbolKind::AssociativeArrayType)
+            return false;
+        return ct.getArrayElementType()->isBitstreamType(destination);
+    }
+
+    if (ct.isUnpackedStruct()) {
+        auto& us = ct.as<UnpackedStructType>();
         for (auto& field : us.membersOfType<FieldSymbol>()) {
             if (!field.getType().isBitstreamType(destination))
                 return false;
@@ -269,15 +270,15 @@
         return true;
     }

-    if (isClass()) {
+    if (ct.isClass()) {
         if (destination)
             return false;

-        auto& ct = getCanonicalType().as<ClassType>();
-        if (ct.isInterface)
-            return false;
-
-        for (auto& prop : ct.membersOfType<ClassPropertySymbol>()) {
+        auto& classType = ct.as<ClassType>();
+        if (classType.isInterface)
+            return false;
+
+        for (auto& prop : classType.membersOfType<ClassPropertySymbol>()) {
             if (!prop.getType().isBitstreamType(destination))
                 return false;
         }
@@ -288,19 +289,19 @@
 }

 bool Type::isFixedSize() const {
-    if (isIntegral() || isFloating())
-        return true;
-
-    if (isUnpackedArray()) {
-        const auto& ct = getCanonicalType();
+    auto& ct = getCanonicalType();
+    if (ct.isIntegral() || ct.isFloating())
+        return true;
+
+    if (ct.isUnpackedArray()) {
         if (ct.kind != SymbolKind::FixedSizeUnpackedArrayType)
             return false;

         return ct.as<FixedSizeUnpackedArrayType>().elementType.isFixedSize();
     }

-    if (isUnpackedStruct()) {
-        auto& us = getCanonicalType().as<UnpackedStructType>();
+    if (ct.isUnpackedStruct()) {
+        auto& us = ct.as<UnpackedStructType>();
         for (auto& field : us.membersOfType<FieldSymbol>()) {
             if (!field.getType().isFixedSize())
                 return false;
@@ -308,8 +309,8 @@
         return true;
     }

-    if (isUnpackedUnion()) {
-        auto& us = getCanonicalType().as<UnpackedUnionType>();
+    if (ct.isUnpackedUnion()) {
+        auto& us = ct.as<UnpackedUnionType>();
         for (auto& field : us.membersOfType<FieldSymbol>()) {
             if (!field.getType().isFixedSize())
                 return false;
@@ -317,12 +318,12 @@
         return true;
     }

-    if (isClass()) {
-        auto& ct = getCanonicalType().as<ClassType>();
-        if (ct.isInterface)
-            return false;
-
-        for (auto& prop : ct.membersOfType<ClassPropertySymbol>()) {
+    if (ct.isClass()) {
+        auto& classType = ct.as<ClassType>();
+        if (classType.isInterface)
+            return false;
+
+        for (auto& prop : classType.membersOfType<ClassPropertySymbol>()) {
             if (!prop.getType().isFixedSize())
                 return false;
         }


make SingleTextEdit a Q_OBJECT

make SingleTextEdit a Q_OBJECT

--- singletextedit.hh
+++ singletextedit.hh
@@ -11,23 +11,25 @@
 		setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
 		setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
  	}
-	void keyPressEvent(QKeyEvent *event) {
+	virtual void keyPressEvent(QKeyEvent *event) override {
 		if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return)
 			event->ignore();
 		else
 			QTextEdit::keyPressEvent(event);
 	}
-	virtual QSize minimumSizeHint () const {
+	virtual QSize minimumSizeHint () const override {
 		return sizeHint();
 	}
-	virtual QSize sizeHint() const {
+	virtual QSize sizeHint() const override {
 		QFontMetrics fm(font());
 		int h = qMax(fm.height(), 14) + 4;
 		return QSize{100,h};
 	}
-	void wheelEvent(QWheelEvent *e) {
+	virtual void wheelEvent(QWheelEvent *e) override {
 		e->ignore();
 	}
+private:
+	Q_OBJECT
 };

 #endif /* SINGLETEXTEDIT_HH */


comments

comments

--- source/bin/la/t_LACMD.cpp
+++ source/bin/la/t_LACMD.cpp
@@ -247,7 +247,7 @@
 			la::convertFull2HalfWidth(ustr);
 			string str;
 			ustr.convertString(str, UString::UTF_8);
-			cout << "==> Input converted full-with chars to half-with :" << str << endl;
+			cout << "Input (full-with chars are converted to half-with): " << str << endl;
         }

         {


INTEGRATION: CWS changefileheader (1.6.60); FILE MERGED 2008/03/28 16:44:22 rt 1.6.60.1: #i87441# Change license header to LPGL v3.

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


Fix command help for graphics broken by changes to set multiple strings function in revision C9863. Issue 2107.

--- source/command/parser.cpp
+++ source/command/parser.cpp
@@ -6110,6 +6110,7 @@
 		if (Parse_state_help_mode(state))
 		{
 			display_message(INFORMATION_MESSAGE, " %s", (char *)strings_description_void);
+			return return_code;
 		}
 		while (true)
 		{


DevTools: Allow using test shell apps for port forwarding

BUG=380356

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

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

--- chrome/browser/devtools/device/port_forwarding_controller.cc
+++ chrome/browser/devtools/device/port_forwarding_controller.cc
@@ -242,8 +242,7 @@
       browsers.begin(); it != browsers.end(); ++it) {
     scoped_refptr<DevToolsAndroidBridge::RemoteBrowser> browser = *it;
     ParsedVersion current_version = browser->GetParsedVersion();
-    if (browser->IsChrome() &&
-        IsPortForwardingSupported(current_version) &&
+    if (IsPortForwardingSupported(current_version) &&
         IsVersionLower(newest_version, current_version)) {
       best_browser = browser;
       newest_version = current_version;


Okay, changed to xoft's partial fix

Okay, changed to xoft's partial fix

--- source/Piston.cpp
+++ source/Piston.cpp
@@ -1,4 +1,3 @@
-
 #include "Globals.h"  // NOTE: MSVC stupidness requires this to be the same across all modules

 #include "Piston.h"
@@ -12,13 +11,6 @@
 #include "Server.h"
 #include "Blocks/BlockHandler.h"

-/*
-#ifdef _WIN32
-#include <windows.h>
-#else
-#include <unistd.h>
-#endif
-*/

@@ -133,16 +125,11 @@

 	AddDir(extx, exty, extz, pistonMeta & 7, 1)

-	/*
-	#ifdef _WIN32
+	// TODO: This code needs replacing
 	// Sleeping here will play the piston animation on the client; however, it will block the entire server
 	// for the 100 ms, effectively dropping 2 game ticks per piston. This is very bad
 		// This needs to be handled using delayed scheduled tasks instead
-	Sleep(100);
-	#else
-	usleep(static_cast<useconds_t>(100)*1000);
-	#endif
-	*/
+	cSleep::MilliSleep(100);

 	m_World->SetBlock(extx, exty, extz, E_BLOCK_PISTON_EXTENSION, isSticky + pistonMeta & 7);
 }
@@ -188,33 +175,23 @@
 			// These cannot be moved by the sticky piston, bail out
 			return;
 		}
-		/*
-		#ifdef _WIN32
+
 		// TODO: This code needs replacing
 		// Sleeping here will play the piston animation on the client; however, it will block the entire server
 		// for the 100 ms, effectively dropping 2 game ticks per piston. This is very bad
 		// This needs to be handled using delayed scheduled tasks instead
-		Sleep(100);
-		#else
-		usleep(static_cast<useconds_t>(100)*1000);
-		#endif
-		*/
+		cSleep::MilliSleep(100);

 		m_World->SetBlock(pistx, pisty, pistz, tempblock, tempmeta);
 		m_World->SetBlock(tempx, tempy, tempz, E_BLOCK_AIR, 0);
 	}
 	else
 	{
-		/*
-		#ifdef _WIN32
+		// TODO: This code needs replacing
 		// Sleeping here will play the piston animation on the client; however, it will block the entire server
 		// for the 100 ms, effectively dropping 2 game ticks per piston. This is very bad
 		// This needs to be handled using delayed scheduled tasks instead
-		Sleep(100);
-		#else
-		usleep(static_cast<useconds_t>(100)*1000);
-		#endif
-		*/
+		cSleep::MilliSleep(100);

 		m_World->SetBlock(pistx, pisty, pistz, E_BLOCK_AIR, 0);
 	}


Fix type for process identifiers

Fix type for process identifiers

--- elisp/exec.cc
+++ elisp/exec.cc
@@ -370,7 +370,7 @@
   const auto argv = Pointers(final_args);
   auto final_env = this->BuildEnv(env);
   const auto envp = Pointers(final_env);
-  int pid;
+  pid_t pid;
   const int error = posix_spawn(&pid, Pointer(binary), nullptr, nullptr,
                                 argv.data(), envp.data());
   if (error != 0) {
@@ -378,7 +378,7 @@
                        "posix_spawn", binary);
   }
   int wstatus;
-  const int status = waitpid(pid, &wstatus, 0);
+  const pid_t status = waitpid(pid, &wstatus, 0);
   if (status != pid) return ErrnoStatus("waitpid", pid);
   return WIFEXITED(wstatus) ? WEXITSTATUS(wstatus) : 0xFF;
 }


Finished renaming modules. After updating to this revision, delete 'modules' directory under 'bin' directory, otherwise certain modules will be loaded several times and the framework asserts!

git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@63 5b2332b8-efa3-11de-8684-7d64432d61a3

--- TestModule/TestModule.cpp
+++ TestModule/TestModule.cpp
@@ -87,6 +87,3 @@
 POCO_BEGIN_MANIFEST(Foundation::ModuleInterface)
    POCO_EXPORT_CLASS(TestModule)
 POCO_END_MANIFEST
-
-
-


Fixed some PROOF debug messages

Fixed some PROOF debug messages

--- proof/proof/src/TProof.cxx
+++ proof/proof/src/TProof.cxx
@@ -6876,7 +6876,8 @@
       // If worker is of an invalid type, break everything: it should not happen!
       if ((sl->GetSlaveType() != TSlave::kSlave) &&
           (sl->GetSlaveType() != TSlave::kMaster)) {
-         Error("GoMoreParallel", "TSlave is neither a Master nor a Slave!");
+         Error("GoMoreParallel", "TSlave is neither a Master nor a Slave: %s:%s",
+            sl->GetName(), sl->GetOrdinal());
          R__ASSERT(0);
       }

@@ -6891,7 +6892,7 @@

       // Worker is good but it is already active: skip it
       if (fActiveSlaves->FindObject(sl)) {
-         Warning("GoMoreParallel", "Worker %s:%s is already active: skipping",
+         Info("GoMoreParallel", "Worker %s:%s is already active: skipping",
             sl->GetName(), sl->GetOrdinal());
          continue;
       }
@@ -6906,6 +6907,9 @@
          fInactiveSlaves->Remove(sl);
          fActiveMonitor->Add(sl->GetSocket());
          nAddedWorkers++;
+         PDB(kGlobal, 2)
+            Info("GoMoreParallel", "Worker %s:%s marked as active!",
+               sl->GetName(), sl->GetOrdinal());
       }
       else {
          // Can't add masters dynamically: this should not happen!
@@ -6916,21 +6920,21 @@
    } // end loop over all slaves

    // Get slave status (will set the slaves fWorkDir correctly)
-   PDB(kGlobal, 2)
-      Info("GoMoreParallel", "Calling AskStatistics() -- implies a Collect()");
+   PDB(kGlobal, 3)
+      Info("GoMoreParallel", "Will invoke AskStatistics() -- implies a Collect()");
    AskStatistics();

    // Find active slaves with unique image
-   PDB(kGlobal, 2)
-      Info("GoMoreParallel", "Calling FindUniqueSlaves()");
+   PDB(kGlobal, 3)
+      Info("GoMoreParallel", "Will invoke FindUniqueSlaves()");
    FindUniqueSlaves();

    // Send new group-view to slaves
-   PDB(kGlobal, 2)
-      Info("GoMoreParallel", "Calling SendGroupView()");
+   PDB(kGlobal, 3)
+      Info("GoMoreParallel", "Will invoke SendGroupView()");
    SendGroupView();

-   PDB(kGlobal, 2)
+   PDB(kGlobal, 3)
       Info("GoMoreParallel", "Will invoke GetParallel()");
    Int_t nTotalWorkers = GetParallel();


Mark ExtensionDevToolsBrowserTest.TimelineApi flaky for debugging.

BUG=69369,52544
TEST=NONE

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

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

--- chrome/browser/extensions/extension_devtools_browsertests.cc
+++ chrome/browser/extensions/extension_devtools_browsertests.cc
@@ -50,7 +50,8 @@
 }

 // Tests for the experimental timeline extensions API.
-IN_PROC_BROWSER_TEST_F(ExtensionDevToolsBrowserTest, TimelineApi) {
+// http://crbug.com/69369  http://crbug.com/52544
+IN_PROC_BROWSER_TEST_F(ExtensionDevToolsBrowserTest, FLAKY_TimelineApi) {
   ASSERT_TRUE(LoadExtension(
       test_data_dir_.AppendASCII("devtools").AppendASCII("timeline_api")));


INTEGRATION: CWS aquavcl01 (1.2.44); FILE MERGED 2007/06/22 07:07:50 pl 1.2.44.1: #i77552# add: native window background

--- vcl/inc/vcl/salnativewidgets.hxx
+++ vcl/inc/vcl/salnativewidgets.hxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: salnativewidgets.hxx,v $
  *
- *  $Revision: 1.2 $
- *
- *  last change: $Author: vg $ $Date: 2007-04-11 18:07:38 $
+ *  $Revision: 1.3 $
+ *
+ *  last change: $Author: rt $ $Date: 2007-07-05 08:35:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -137,6 +137,9 @@

 // tool tips
 #define CTRL_TOOLTIP            140
+
+// to draw the implemented theme
+#define CTRL_WINDOW_BACKGROUND  150

 /* Control Parts:
  *
@@ -194,6 +197,9 @@
 // For scrollbars that have 3 buttons (most KDE themes)
 #define HAS_THREE_BUTTONS       5000

+#define PART_BACKGROUND_WINDOW  6000
+#define PART_BACKGROUND_DIALOG  6001
+
 /* Control State:
  *
  *   Specify how a particular part of the control


Add fallback for fiemap

Add fallback for fiemap

--- file_linux.cpp
+++ file_linux.cpp
@@ -64,7 +64,8 @@
 		unsigned int fm_reserved;
 		struct fiemap_extent fm_extents[0];
 	};
-#define FIEMAP_MAX_OFFSET       (~0ULL)
+#define FIEMAP_MAX_OFFSET (~0ULL)
+#define FIEMAP_EXTENT_LAST 0x00000001
 #define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap)
 }
 #endif


Functions list enumerates functions in order of their declaration.

--- source/exprcalculator.cpp
+++ source/exprcalculator.cpp
@@ -286,11 +286,10 @@
 {
 	QList<FunctionDescription> functionsList;

-	QHashIterator<QString, RpnFunction> i(m_functions);
-	while (i.hasNext()) {
-		i.next();
-		if (i.key() != RpnFunctionMain) {
-			FunctionDescription function = functionDescriptionFromCode(i.key(), i.value());
+	foreach (QString functionName, m_functionNames) {
+		if (functionName != RpnFunctionMain) {
+			FunctionDescription function = functionDescriptionFromCode(functionName,
+				m_functions.value(functionName));
 			functionsList << function;
 		}
 	}


Proof: fix protocol issue introduced by the last patch

Affects standard startups

--- proof/proof/src/TProof.cxx
+++ proof/proof/src/TProof.cxx
@@ -1530,7 +1530,7 @@
    dyn.ReplaceAll("\"", " ");
    PDB(kGlobal, 3)
       Info("SetupWorkersEnv", "will invoke AddDynamicPath() on selected workers");
-   AddDynamicPath(dyn, kFALSE, addedWorkers, !fDynamicStartup); // Do not Collect
+   AddDynamicPath(dyn, kFALSE, addedWorkers, kFALSE); // Do not Collect

    // Include path
    TString inc = gSystem->GetIncludePath();
@@ -1538,7 +1538,7 @@
    inc.ReplaceAll("\"", " ");
    PDB(kGlobal, 3)
       Info("SetupWorkersEnv", "will invoke AddIncludePath() on selected workers");
-   AddIncludePath(inc, kFALSE, addedWorkers, !fDynamicStartup);  // Do not Collect
+   AddIncludePath(inc, kFALSE, addedWorkers, kFALSE);  // Do not Collect

    // Done
    return;
@@ -9347,10 +9347,11 @@
    m << TString("lib") << (Bool_t)kTRUE;

    // Add paths
-   if (libpath && strlen(libpath))
+   if (libpath && strlen(libpath)) {
       m << TString(libpath);
-   else
+   } else {
       m << TString("-");
+   }

    // Tell the server to send back or not
    m << (Int_t)doCollect;
@@ -9360,8 +9361,7 @@
       Broadcast(m, wrks);
       if (doCollect)
          Collect(wrks, fCollectTimeout);
-   }
-   else {
+   } else {
       Broadcast(m);
       Collect(kActive, fCollectTimeout);
    }
@@ -9392,10 +9392,11 @@
    m << TString("inc") << (Bool_t)kTRUE;

    // Add paths
-   if (incpath && strlen(incpath))
+   if (incpath && strlen(incpath)) {
       m << TString(incpath);
-   else
+   } else {
       m << TString("-");
+   }

    // Tell the server to send back or not
    m << (Int_t)doCollect;
@@ -9405,8 +9406,7 @@
       Broadcast(m, wrks);
       if (doCollect)
          Collect(wrks, fCollectTimeout);
-   }
-   else {
+   } else {
       Broadcast(m);
       Collect(kActive, fCollectTimeout);
    }