Make the boolean variable a bool

Make the boolean variable a bool

--- src/simulation/SerialSimulation.cpp
+++ src/simulation/SerialSimulation.cpp
@@ -15,7 +15,7 @@

     void SerialSimulation::simulate()
     {
-        bool_type running;  //MF only set, not used
+        bool running;
         size_type iterationCount = 0;
         const vector<shared_ptr<Solver::ISolver>>& solver = getSolver();
         std::vector<size_type> numSteps(solver.size(),15);


bug fix

bug fix

--- Solver.cpp
+++ Solver.cpp
@@ -68,7 +68,7 @@
     binary_push(lhs, rhs, res, v);

     tie(lhs, rhs) = binary_pop(v);
-    binary_process(s, c - 1, lhs * rhs > 3e4 ? 0 : lhs * rhs, '*', res, v);
+    binary_process(s, c - 1, abs((long long)lhs * rhs) > 1e9 ? 0 : lhs * rhs, '*', res, v);
     binary_push(lhs, rhs, res, v);

     tie(lhs, rhs) = binary_pop(v);
@@ -87,7 +87,7 @@
 }

 int main() {
-  N = 100000;
+  N = 1000;
   memo.assign(N+1, -1);
   memor.resize(N+1);
   int depth = 0;
@@ -110,7 +110,7 @@
         memor[n] = memor[n+2] + "2-";
       }
       else {
-        if (depth == 22) break;
+        if (depth == 23) break;
         cerr << "DEPTH : " << depth << endl;
         v.clear();
         res.clear();


fix base wizard size

fix base wizard size

if we are forced to fetch the theme early before the MiscSettings in svtools
sets it then don't cache the value so that when the MiscSettings kicks in that
the SettingsChanged signal is sent out and we get the right fontsize (or
something like that)

Change-Id: I0447c934ec184232591183c6c099a4d7217183fb

--- vcl/source/app/settings.cxx
+++ vcl/source/app/settings.cxx
@@ -3028,23 +3028,23 @@
 OUString
 StyleSettings::DetermineIconTheme() const
 {
-    if (mxData->mIconTheme.isEmpty())
+    OUString sTheme(mxData->mIconTheme);
+    if (sTheme.isEmpty())
     {
         // read from the configuration, or fallback to what the desktop wants
         uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext());
         if (xContext.is())
         {
-            mxData->mIconTheme = officecfg::Office::Common::Misc::SymbolStyle::get(xContext);
-
-            if (mxData->mIconTheme.isEmpty() || mxData->mIconTheme == "auto")
-                mxData->mIconTheme = GetAutomaticallyChosenIconTheme();
+            sTheme = officecfg::Office::Common::Misc::SymbolStyle::get(xContext);
+
+            if (sTheme.isEmpty() || sTheme == "auto")
+                sTheme = GetAutomaticallyChosenIconTheme();
         }
     }

     OUString r = mxData->mIconThemeSelector->SelectIconTheme(
                         mxData->mIconThemeScanner->GetFoundIconThemes(),
-                        mxData->mIconTheme
-                        );
+                        sTheme);
     return r;
 }


Added the error message for vbz compressed files

--- src/io/nanopolish_fast5_io.cpp
+++ src/io/nanopolish_fast5_io.cpp
@@ -145,10 +145,12 @@
     H5Sget_simple_extent_dims(space, &nsample, NULL);
     rawptr = (float*)calloc(nsample, sizeof(float));
     status = H5Dread(dset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rawptr);
-    fprintf(stdout, "Status: %d \t", status);
-    fprintf(stdout, "Return: %d \n", fast5_is_vbz_compressed(fh, read_id));

     if (status < 0) {
+	if(fast5_is_vbz_compressed(fh, read_id) == 1) {
+	    fprintf(stderr, "The fast5 file is compressed with VBZ but the required plugin is not loaded. Please read the instructions here: https://github.com/nanoporetech/vbz_compression/issues/5\n");
+	    exit(EXIT_FAILURE);
+	}
         free(rawptr);
 #ifdef DEBUG_FAST5_IO
         fprintf(stderr, "Failed to read raw data from dataset %s.\n", signal_path.c_str());


make transform::visit non-recursive

make transform::visit non-recursive

Summary:
It looks like transform::visit was overflowing the stack on a method with 329
blocks (but only with -O0). I don't want to break debug builds, but I don't
want to disallow recursion on the CFG either.

fix https://github.com/facebook/redex/issues/256

Reviewed By: minjang, arnaudvenet

Differential Revision: D5770823

fbshipit-source-id: 6ecf7849b93a9893942ad7078af4e3213d5aaf02

--- libredex/Transform.cpp
+++ libredex/Transform.cpp
@@ -8,6 +8,9 @@
  */

 #include "Transform.h"
+
+#include <stack>
+
 #include "ControlFlow.h"

 namespace {
@@ -90,13 +93,21 @@
   return insns_removed;
 }

-void visit(Block* b, std::unordered_set<Block*>& visited) {
-  if (visited.find(b) != visited.end()) {
-    return;
-  }
-  visited.emplace(b);
-  for (auto& s : b->succs()) {
-    visit(s, visited);
+void visit(Block* start, std::unordered_set<Block*>& visited) {
+  std::stack<Block*> to_visit;
+  to_visit.push(start);
+  while (!to_visit.empty()) {
+    Block* b = to_visit.top();
+    to_visit.pop();
+
+    if (visited.find(b) != visited.end()) {
+      continue;
+    }
+    visited.emplace(b);
+
+    for (auto& s : b->succs()) {
+      to_visit.push(s);
+    }
   }
 }


P4 to Git Change 1468181 by gandryey@gera-w8 on 2017/10/10 17:42:02

	SWDEV-133815 - PAL support for Linux Pro w/OpenCL 2.0 support
	- Fix the clear size in FillBuffer. It's in bytes.

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#61 edit

--- runtime/device/pal/palvirtual.cpp
+++ runtime/device/pal/palvirtual.cpp
@@ -654,7 +654,7 @@

   uint64_t pattern = 0;
   amd::Coord3D origin(0, 0, 0);
-  amd::Coord3D region((virtualQueue_->size() / sizeof(pattern)), 0, 0);
+  amd::Coord3D region(virtualQueue_->size(), 0, 0);
   if (!dev().xferMgr().fillBuffer(*virtualQueue_, &pattern, sizeof(pattern), origin, region)) {
     return false;
   }


サンプルコードを短くする

サンプルコードを短くする

--- Source.cpp
+++ Source.cpp
@@ -25,16 +25,13 @@
 	// 1次元配列で，0からスタートし，N個の長さを持っていて，それをN個ごとに区切る
 	auto settings = tcl::CLWorkGroupSettings(1, { 0 }, { N }, { N }).Optimize(device);

-	// 引数を設定する
-	exec.SetArg(x);
-
-	// 設定を渡して実行
-	exec.Run(settings);
+	// 引数を設定して実行
+	exec.SetArg(x).Run(settings);

 	// デバイスのメモリから，配列へ読み出す
 	x.Read(input);

-	// かくにん
+	// 中身が正しいかどうか確認する
 	for (int i = 0; i < N; ++i)
 		std::cout << i << "," << input[i] << std::endl;


Replace various assertions inside SPIR-V codegen with errors.

These assertions were all currently reachable simply by compiling the
test code in /tests/sksl/shared/. Presumably many of these will actually
require a better fix going forward.

Change-Id: If59e0bfa1b248a5db9a79def736d437a9e5f7ee4
Bug: skia:10694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/336676
Auto-Submit: John Stiles <f4fcf42d3bb5924557f1eeb3be66747535e585da@google.com>
Commit-Queue: Brian Osman <794c0b5534edf5601d88e1d41975d0262da12894@google.com>
Reviewed-by: Brian Osman <794c0b5534edf5601d88e1d41975d0262da12894@google.com>

--- src/sksl/SkSLSPIRVCodeGenerator.cpp
+++ src/sksl/SkSLSPIRVCodeGenerator.cpp
@@ -525,7 +525,8 @@
                                            (int32_t) layout.stride(type),
                                            fDecorationBuffer);
                 } else {
-                    SkASSERT(false); // we shouldn't have any runtime-sized arrays right now
+                    // We shouldn't have any runtime-sized arrays right now
+                    fErrors.error(type.fOffset, "runtime-sized arrays are not supported in SPIR-V");
                     this->writeInstruction(SpvOpTypeRuntimeArray, result,
                                            this->getType(type.componentType(), layout),
                                            fConstantBuffer);
@@ -1760,10 +1761,7 @@
             }
             auto entry = fVariableMap.find(&var);
             SkASSERT(entry != fVariableMap.end());
-            return std::unique_ptr<SPIRVCodeGenerator::LValue>(new PointerLValue(*this,
-                                                                                entry->second,
-                                                                                typeId,
-                                                                                precision));
+            return std::make_unique<PointerLValue>(*this, entry->second, typeId, precision);
         }
         case Expression::Kind::kIndex: // fall through
         case Expression::Kind::kFieldAccess: {
@@ -1775,17 +1773,15 @@
             for (SpvId idx : chain) {
                 this->writeWord(idx, out);
             }
-            return std::unique_ptr<SPIRVCodeGenerator::LValue>(new PointerLValue(
-                                                                                *this,
-                                                                                member,
-                                                                                this->getType(type),
-                                                                                precision));
+            return std::make_unique<PointerLValue>(*this, member, this->getType(type), precision);
         }
         case Expression::Kind::kSwizzle: {
             Swizzle& swizzle = (Swizzle&) expr;
             size_t count = swizzle.components().size();
             SpvId base = this->getLValue(*swizzle.base(), out)->getPointer();
-            SkASSERT(base);
+            if (!base) {
+                fErrors.error(swizzle.fOffset, "unable to retrieve lvalue from swizzle");
+            }
             if (count == 1) {
                 IntLiteral index(fContext, -1, swizzle.components()[0]);
                 SpvId member = this->nextId();
@@ -1796,19 +1792,11 @@
                                        base,
                                        this->writeIntLiteral(index),
                                        out);
-                return std::unique_ptr<SPIRVCodeGenerator::LValue>(new PointerLValue(
-                                                                                *this,
-                                                                                member,
-                                                                                this->getType(type),
-                                                                                precision));
+                return std::make_unique<PointerLValue>(*this, member, this->getType(type),
+                                                       precision);
             } else {
-                return std::unique_ptr<SPIRVCodeGenerator::LValue>(new SwizzleLValue(
-                                                                             *this,
-                                                                             base,
-                                                                             swizzle.components(),
-                                                                             swizzle.base()->type(),
-                                                                             type,
-                                                                             precision));
+                return std::make_unique<SwizzleLValue>(*this, base, swizzle.components(),
+                                                       swizzle.base()->type(), type, precision);
             }
         }
         case Expression::Kind::kTernary: {
@@ -1831,11 +1819,7 @@
             SpvId result = this->nextId();
             this->writeInstruction(SpvOpPhi, this->getType(*fContext.fBool_Type), result, ifTrue,
                        ifTrueLabel, ifFalse, ifFalseLabel, out);
-            return std::unique_ptr<SPIRVCodeGenerator::LValue>(new PointerLValue(
-                                                                                *this,
-                                                                                result,
-                                                                                this->getType(type),
-                                                                                precision));
+            return std::make_unique<PointerLValue>(*this, result, this->getType(type), precision);
         }
         default: {
             // expr isn't actually an lvalue, create a dummy variable for it. This case happens due
@@ -1847,11 +1831,7 @@
             this->writeInstruction(SpvOpVariable, pointerType, result, SpvStorageClassFunction,
                                    fVariableBuffer);
             this->writeInstruction(SpvOpStore, result, this->writeExpression(expr, out), out);
-            return std::unique_ptr<SPIRVCodeGenerator::LValue>(new PointerLValue(
-                                                                                *this,
-                                                                                result,
-                                                                                this->getType(type),
-                                                                                precision));
+            return std::make_unique<PointerLValue>(*this, result, this->getType(type), precision);
         }
     }
 }
@@ -1881,7 +1861,9 @@
                 // height variable hasn't been written yet
                 SkASSERT(fRTHeightFieldIndex == (SpvId)-1);
                 std::vector<Type::Field> fields;
-                SkASSERT(fProgram.fSettings.fRTHeightOffset >= 0);
+                if (fProgram.fSettings.fRTHeightOffset < 0) {
+                    fErrors.error(ref.fOffset, "RTHeightOffset is negative");
+                }
                 fields.emplace_back(
                         Modifiers(Layout(0, -1, fProgram.fSettings.fRTHeightOffset, -1, -1, -1, -1,
                                          -1, Layout::Format::kUnspecified,
@@ -1893,9 +1875,13 @@
                 Type intfStruct(-1, name, fields);

                 int binding = fProgram.fSettings.fRTHeightBinding;
+                if (binding == -1) {
+                    fErrors.error(ref.fOffset, "layout(binding=...) is required in SPIR-V");
+                }
                 int set = fProgram.fSettings.fRTHeightSet;
-                SkASSERT(binding != -1 && set != -1);
-
+                if (set == -1) {
+                    fErrors.error(ref.fOffset, "layout(set=...) is required in SPIR-V");
+                }
                 Layout layout(0, -1, -1, binding, -1, set, -1, -1, Layout::Format::kUnspecified,
                                 Layout::kUnspecified_Primitive, -1, -1, "", "", Layout::kNo_Key,
                                 Layout::CType::kDefault);
@@ -2327,7 +2313,7 @@
         case Token::Kind::TK_COMMA:
             return rhs;
         default:
-            SkASSERT(false);
+            fErrors.error(0, "unsupported token");
             return -1;
     }
 }


MAINT: remove unused variable.

MAINT: remove unused variable.

--- examples/Features/features_read_write_example.cpp
+++ examples/Features/features_read_write_example.cpp
@@ -18,7 +18,6 @@
 using namespace std;

-const bool draw_feature_center_only = false;
 const Rgb8& c = Cyan8;


Verify `$HOME` is owned by current user in `getHome()`, if it exists.

Useful because a default `sudo` on darwin doesn't clear `$HOME`, so things like `sudo nix-channel --list`
will surprisingly return the USER'S channels, rather than `root`'s.

Other counterintuitive outcomes can be seen in this PR description:
  https://github.com/NixOS/nix/pull/6622

--- src/libutil/util.cc
+++ src/libutil/util.cc
@@ -574,6 +574,20 @@
     static Path homeDir = []()
     {
         auto homeDir = getEnv("HOME");
+        if (homeDir) {
+            // Only use $HOME if doesn't exist or is owned by the current user.
+            struct stat st;
+            int result = stat(homeDir->c_str(), &st);
+            if (result != 0) {
+                if (errno != ENOENT) {
+                    warn("Couldn't stat $HOME ('%s') for reason other than not existing ('%d'), falling back to the one defined in the 'passwd' file", *homeDir, errno);
+                    homeDir.reset();
+                }
+            } else if (st.st_uid != geteuid()) {
+                warn("$HOME ('%s') is not owned by you, falling back to the one defined in the 'passwd' file", *homeDir);
+                homeDir.reset();
+            }
+        }
         if (!homeDir) {
             std::vector<char> buf(16384);
             struct passwd pwbuf;


INTEGRATION: CWS uno4 (1.56.40); FILE MERGED 2003/05/06 15:57:06 tbe 1.56.40.1: #i13677# no CARET_CHANGED event is fired when the caret position is changing

--- vcl/source/control/edit.cxx
+++ vcl/source/control/edit.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: edit.cxx,v $
  *
- *  $Revision: 1.56 $
+ *  $Revision: 1.57 $
  *
- *  last change: $Author: hr $ $Date: 2003-03-27 17:57:52 $
+ *  last change: $Author: vg $ $Date: 2003-05-22 09:38:48 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -2052,6 +2052,9 @@

         ImplCallEventListeners( VCLEVENT_EDIT_MODIFY );
         maModifyHdl.Call( this );
+
+        // #i13677# notify edit listeners about caret position change
+        ImplCallEventListeners( VCLEVENT_EDIT_SELECTIONCHANGED );
     }
 }


P4 to Git Change 1473269 by lmoriche@lmoriche_opencl_dev2 on 2017/10/20 18:19:58

	SWDEV-102726 - [OCL-LC-ROCm] Open source OpenCL Runtime
	- Initialize spirVersions_ even if we do not report the extension.

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#72 edit

--- runtime/device/rocm/rocdevice.cpp
+++ runtime/device/rocm/rocdevice.cpp
@@ -113,6 +113,7 @@
   info_.maxWorkGroupSize_ = hsaSettings->maxWorkGroupSize_;
   ::strcpy(info_.vendor_, "Advanced Micro Devices, Inc.");
   info_.oclcVersion_ = "OpenCL C " IF(IS_LIGHTNING, OPENCL_C_VERSION_STR, "1.2") " ";
+  info_.spirVersions_ = "";
   strcpy(info_.driverVersion_, "1.0 Provisional (hsa)");
   info_.version_ = "OpenCL " OPENCL_VERSION_STR " ";
   return true;
@@ -954,6 +955,7 @@
   info_.maxSamplers_ = 16;
   info_.bufferFromImageSupport_ = CL_FALSE;
   info_.oclcVersion_ = "OpenCL C " IF(IS_LIGHTNING, OPENCL_C_VERSION_STR, "1.2") " ";
+  info_.spirVersions_ = "";

   uint16_t major, minor;
   if (hsa_agent_get_info(_bkendDevice, HSA_AGENT_INFO_VERSION_MAJOR, &major) !=


[jancy] force simple GC safe points if we compile with address sanitizer

hitting GC guard page does not make address sanitizer happy. so just use
simple GC safe point call if we make a sanitized build

--- src/jnc_core/jnc_ct_Module.cpp
+++ src/jnc_core/jnc_ct_Module.cpp
@@ -75,6 +75,11 @@
 {
 	clear ();

+#ifdef _AXL_ASAN
+	// GC guard page safe points do not work with address sanitizer
+	compileFlags |= ModuleCompileFlag_SimpleGcSafePoint;
+#endif
+
 	m_name = name;
 	m_compileFlags = compileFlags;
 	m_compileState = ModuleCompileState_Idle;


Prediction done, and apparently working. bam!

--- predict_random_forest.cpp
+++ predict_random_forest.cpp
@@ -4,9 +4,28 @@
 #define PRINT_INPUTS

 void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) {
-    ASSERT_NUM_LHS_ARGS_EQ(1);
-    ASSERT_NUM_
+    ASSERT_NUM_LHS_ARGS_EQUALS(1);
+    ASSERT_NUM_RHS_ARGS_EQUALS(2);

+    //retrieve the pointer to the random forest
+    CvRTrees *forest = (CvRTrees *)unpack_pointer(prhs[0]);

+    //get the data which we need to predict on into opencv format
+    CvMat* dataMtx = matlab_matrix_to_opencv_matrix(prhs[1]);
+    CvMat sample; //this is used to point to each row, one at a time

+    int numSamples = dataMtx->rows;
+    mexPrintf("predicting on %d samples\n", numSamples);
+
+    mxArray* output = mxCreateDoubleMatrix(numSamples, 1, mxREAL);
+    double *outputData = (double *)mxGetPr(output);
+
+    //
+    for (unsigned int i=0; i<numSamples; i++) {
+        cvGetRow(dataMtx, &sample, i);
+        outputData[i] = (double)forest->predict(&sample);
+    }
+
+    plhs[0] = output;
+    cvReleaseMat(&dataMtx);
 }


Again, forgot to save before uploading/comitting (just added a comment)
Review URL: https://chromiumcodereview.appspot.com//9836128

git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@5899 260f80e4-7a28-3924-810f-c04153c831b5

--- runtime/vm/code_generator_ia32.cc
+++ runtime/vm/code_generator_ia32.cc
@@ -1545,6 +1545,8 @@
         TestClassAndJump(dst_type_class, &done);  // Uses ECX.
         // Check superclass
         __ movl(ECX, FieldAddress(ECX, Class::super_type_offset()));
+        // Note that supertypes can't be NULL as every Dart instance has
+        // as supertype class Object.
         __ movl(ECX, FieldAddress(ECX, Type::type_class_offset()));
         TestClassAndJump(dst_type_class, &done);  // Uses ECX.
       } else {


Use sdp.schur_block_sizes to setup SDP::dual_residues

--- src/solve/SDP_Solver/SDP_Solver.cxx
+++ src/solve/SDP_Solver/SDP_Solver.cxx
@@ -5,10 +5,8 @@
 SDP_Solver::SDP_Solver(const std::vector<boost::filesystem::path> &sdp_files,
                        const SDP_Solver_Parameters &parameters)
     : sdp(sdp_files), parameters(parameters), x(sdp.schur_block_sizes),
-      X(sdp.psd_matrix_block_sizes), y(sdp.dual_objective_b.Height(), 1),
-      Y(X), primal_residues(X),
-      // FIXME: Maybe we can use schur_block_sizes() instead of making a copy?
-      dual_residues(x)
+      X(sdp.psd_matrix_block_sizes), y(sdp.dual_objective_b.Height(), 1), Y(X),
+      primal_residues(X), dual_residues(sdp.schur_block_sizes)
 {
   X.set_zero();
   Y.set_zero();


Simplify by using range-based for loops

Simplify by using range-based for loops

Change-Id: I716d8b190aa4b65b878559a4e5e88a126a56bf99

--- vcl/source/edit/texteng.cxx
+++ vcl/source/edit/texteng.cxx
@@ -1759,8 +1759,8 @@
     aPositions.insert( pNode->GetText().getLength() );

     const std::vector<TEWritingDirectionInfo>& rWritingDirections = pTEParaPortion->GetWritingDirectionInfos();
-    for ( std::vector<TEWritingDirectionInfo>::const_iterator it = rWritingDirections.begin(); it != rWritingDirections.end(); ++it )
-        aPositions.insert( (*it).nStartPos );
+    for ( const auto& rWritingDirection : rWritingDirections )
+        aPositions.insert( rWritingDirection.nStartPos );

     if ( mpIMEInfos && mpIMEInfos->pAttribs && ( mpIMEInfos->aPos.GetPara() == nPara ) )
     {
@@ -2945,15 +2945,15 @@
             ImpInitWritingDirections( nPara );

         std::vector<TEWritingDirectionInfo>& rDirInfos = pParaPortion->GetWritingDirectionInfos();
-        for ( std::vector<TEWritingDirectionInfo>::const_iterator rDirInfosIt = rDirInfos.begin(); rDirInfosIt != rDirInfos.end(); ++rDirInfosIt )
-        {
-            if ( ( (*rDirInfosIt).nStartPos <= nPos ) && ( (*rDirInfosIt).nEndPos >= nPos ) )
-               {
-                nRightToLeft = (*rDirInfosIt).nType;
+        for ( const auto& rWritingDirectionInfo : rDirInfos )
+        {
+            if ( rWritingDirectionInfo.nStartPos <= nPos && rWritingDirectionInfo.nEndPos >= nPos )
+            {
+                nRightToLeft = rWritingDirectionInfo.nType;
                 if ( pStart )
-                    *pStart = (*rDirInfosIt).nStartPos;
+                    *pStart = rWritingDirectionInfo.nStartPos;
                 if ( pEnd )
-                    *pEnd = (*rDirInfosIt).nEndPos;
+                    *pEnd = rWritingDirectionInfo.nEndPos;
                 break;
             }
         }


MAX_WINNER_NODES back to 40.

MAX_WINNER_NODES back to 40.

--- Spider.cpp
+++ Spider.cpp
@@ -29,7 +29,7 @@
 // . i'd like to set back to 10 for speed... maybe even 5 or less
 #define SPIDER_DONE_TIMER 20

-#define MAX_WINNER_NODES 400
+#define MAX_WINNER_NODES 40

 Doledb g_doledb;


Use raw string

Use raw string

--- primitiv/opencl_device.cc
+++ primitiv/opencl_device.cc
@@ -14,128 +14,134 @@

 std::string OpenCL::kernel_code_generator() {
   std::ostringstream ss;
-  for(std::uint32_t block_size = 1; block_size <= 1024; block_size <<= 1) {
-    ss << "__kernel void sum_fw_kernel_" << block_size <<
-          "(__constant float *px, __constant unsigned *skip_p, __constant unsigned *n_p, __global float *py) {\n"
-          "#define BLOCK_SIZE " << block_size << "\n"
-          "  unsigned bid = get_group_id(0);"
-          "  unsigned tid = get_local_id(0);"
-          "  unsigned skip = skip_p[0];"
-          "  unsigned n = n_p[0];"
-          "  __local float temp[BLOCK_SIZE];"
-          "  px += bid % skip + (bid / skip) * skip * n;"
-          "  temp[tid] = 0;"
-          "  for (unsigned i = tid; i < n; i += BLOCK_SIZE) temp[tid] += px[i * skip];"
-          "  work_group_barrier(CLK_LOCAL_MEM_FENCE);\n"
-          "#define REDUCE(k)"
-          "  if (BLOCK_SIZE >= k << 1) {"
-          "    if (tid < k) temp[tid] += temp[tid + k];"
-          "    work_group_barrier(CLK_LOCAL_MEM_FENCE);"
-          "  }\n"
-          "  REDUCE(512)"
-          "  REDUCE(256)"
-          "  REDUCE(128)"
-          "  REDUCE(64)"
-          "  REDUCE(32)"
-          "  REDUCE(16)"
-          "  REDUCE(8)"
-          "  REDUCE(4)"
-          "  REDUCE(2)"
-          "  REDUCE(1)\n"
-          "#undef REDUCE\n"
-          "  if (tid == 0) py[bid] = temp[0];\n"
-          "#undef BLOCK_SIZE\n"
-          "}\n";
-  }
-  for(std::uint32_t block_size = 1; block_size <= 1024; block_size <<= 1) {
-    ss << "__kernel void argmax_kernel_" << block_size <<
-          "(__constant float *px, __constant unsigned *skip_p, __constant unsigned *n_p, __global unsigned *py) {\n"
-          "#define BLOCK_SIZE " << block_size << "\n"
-          "  unsigned bid = get_group_id(0);"
-          "  unsigned tid = get_local_id(0);"
-          "  unsigned skip = skip_p[0];"
-          "  unsigned n = n_p[0];"
-          "  __local float max_val[BLOCK_SIZE];"
-          "  __local unsigned argmax_val[BLOCK_SIZE];"
-          "  px += bid % skip + (bid / skip) * skip * n;"
-          "  max_val[tid] = -1e38;"
-          "  for (unsigned i = tid; i < n; i += BLOCK_SIZE) {"
-          "    float val = px[i * skip];"
-          "    if (val > max_val[tid]) {"
-          "      max_val[tid] = val;"
-          "      argmax_val[tid] = i;"
-          "    }"
-          "  }"
-          "  work_group_barrier(CLK_LOCAL_MEM_FENCE);\n"
-          "#define REDUCE(k)"
-          "  if (BLOCK_SIZE >= k << 1) {"
-          "    if (tid < k) {"
-          "      if (max_val[tid + k] > max_val[tid]) {"
-          "        max_val[tid] = max_val[tid + k];"
-          "        argmax_val[tid] = argmax_val[tid + k];"
-          "      }"
-          "    }"
-          "    work_group_barrier(CLK_LOCAL_MEM_FENCE);"
-          "  }\n"
-          "  REDUCE(512)"
-          "  REDUCE(256)"
-          "  REDUCE(128)"
-          "  REDUCE(64)"
-          "  REDUCE(32)"
-          "  REDUCE(16)"
-          "  REDUCE(8)"
-          "  REDUCE(4)"
-          "  REDUCE(2)"
-          "  REDUCE(1)\n"
-          "#undef REDUCE\n"
-          "  if (tid == 0) py[bid] = argmax_val[0];\n"
-          "#undef BLOCK_SIZE\n"
-          "}\n";
-  }
-  for(std::uint32_t block_size = 1; block_size <= 1024; block_size <<= 1) {
-    ss << "__kernel void argmin_kernel_" << block_size <<
-          "(__constant float *px, __constant unsigned *skip_p, __constant unsigned *n_p, __global unsigned *py) {\n"
-          "#define BLOCK_SIZE " << block_size << "\n"
-          "  unsigned bid = get_group_id(0);"
-          "  unsigned tid = get_local_id(0);"
-          "  unsigned skip = skip_p[0];"
-          "  unsigned n = n_p[0];"
-          "  __local float max_val[BLOCK_SIZE];"
-          "  __local unsigned argmax_val[BLOCK_SIZE];"
-          "  px += bid % skip + (bid / skip) * skip * n;"
-          "  max_val[tid] = 1e38;"
-          "  for (unsigned i = tid; i < n; i += BLOCK_SIZE) {"
-          "    float val = px[i * skip];"
-          "    if (val < max_val[tid]) {"
-          "      max_val[tid] = val;"
-          "      argmax_val[tid] = i;"
-          "    }"
-          "  }"
-          "  work_group_barrier(CLK_LOCAL_MEM_FENCE);\n"
-          "#define REDUCE(k)"
-          "  if (BLOCK_SIZE >= k << 1) {"
-          "    if (tid < k) {"
-          "      if (max_val[tid + k] < max_val[tid]) {"
-          "        max_val[tid] = max_val[tid + k];"
-          "        argmax_val[tid] = argmax_val[tid + k];"
-          "      }"
-          "    }"
-          "    work_group_barrier(CLK_LOCAL_MEM_FENCE);"
-          "  }\n"
-          "  REDUCE(512)"
-          "  REDUCE(256)"
-          "  REDUCE(128)"
-          "  REDUCE(64)"
-          "  REDUCE(32)"
-          "  REDUCE(16)"
-          "  REDUCE(8)"
-          "  REDUCE(4)"
-          "  REDUCE(2)"
-          "  REDUCE(1)\n"
-          "#undef REDUCE\n"
-          "  if (tid == 0) py[bid] = argmax_val[0];\n"
-          "#undef BLOCK_SIZE\n"
-          "}\n";
+  for(std::uint32_t group_size = 1; group_size <= 1024; group_size <<= 1) {
+    ss <<
+"kernel void sum_fw_kernel_" << group_size <<
+"(constant float *px, constant unsigned *skip_p, constant unsigned *n_p, global float *py) {\n"
+"#define GROUP_SIZE " << group_size << R"EOS(
+  unsigned bid = get_group_id(0);
+  unsigned tid = get_local_id(0);
+  unsigned skip = skip_p[0];
+  unsigned n = n_p[0];
+  local float temp[GROUP_SIZE];
+  px += bid % skip + (bid / skip) * skip * n;
+  temp[tid] = 0;
+  for (unsigned i = tid; i < n; i += GROUP_SIZE) temp[tid] += px[i * skip];
+  work_group_barrier(CLK_LOCAL_MEM_FENCE);
+#define REDUCE(k) \
+  if (GROUP_SIZE >= k << 1) { \
+    if (tid < k) temp[tid] += temp[tid + k]; \
+    work_group_barrier(CLK_LOCAL_MEM_FENCE); \
+  }
+  REDUCE(512)
+  REDUCE(256)
+  REDUCE(128)
+  REDUCE(64)
+  REDUCE(32)
+  REDUCE(16)
+  REDUCE(8)
+  REDUCE(4)
+  REDUCE(2)
+  REDUCE(1)
+#undef REDUCE
+  if (tid == 0) py[bid] = temp[0];
+#undef GROUP_SIZE
+}
+)EOS";
+  }
+  for(std::uint32_t group_size = 1; group_size <= 1024; group_size <<= 1) {
+    ss <<
+"kernel void argmax_kernel_" << group_size <<
+"(constant float *px, constant unsigned *skip_p, constant unsigned *n_p, global unsigned *py) {\n"
+"#define GROUP_SIZE " << group_size << R"EOS(
+  unsigned bid = get_group_id(0);
+  unsigned tid = get_local_id(0);
+  unsigned skip = skip_p[0];
+  unsigned n = n_p[0];
+  local float max_val[GROUP_SIZE];
+  local unsigned argmax_val[GROUP_SIZE];
+  px += bid % skip + (bid / skip) * skip * n;
+  max_val[tid] = -1e38;
+  for (unsigned i = tid; i < n; i += GROUP_SIZE) {
+    float val = px[i * skip];
+    if (val > max_val[tid]) {
+      max_val[tid] = val;
+      argmax_val[tid] = i;
+    }
+  }
+  work_group_barrier(CLK_LOCAL_MEM_FENCE);
+#define REDUCE(k) \
+  if (GROUP_SIZE >= k << 1) { \
+    if (tid < k) { \
+      if (max_val[tid + k] > max_val[tid]) { \
+        max_val[tid] = max_val[tid + k]; \
+        argmax_val[tid] = argmax_val[tid + k]; \
+      } \
+    } \
+    work_group_barrier(CLK_LOCAL_MEM_FENCE); \
+  }
+  REDUCE(512)
+  REDUCE(256)
+  REDUCE(128)
+  REDUCE(64)
+  REDUCE(32)
+  REDUCE(16)
+  REDUCE(8)
+  REDUCE(4)
+  REDUCE(2)
+  REDUCE(1)
+#undef REDUCE
+  if (tid == 0) py[bid] = argmax_val[0];
+#undef GROUP_SIZE
+}
+)EOS";
+  }
+  for(std::uint32_t group_size = 1; group_size <= 1024; group_size <<= 1) {
+    ss <<
+"kernel void argmin_kernel_" << group_size <<
+"(constant float *px, constant unsigned *skip_p, constant unsigned *n_p, global unsigned *py) {\n"
+"#define GROUP_SIZE " << group_size << R"EOS(
+  unsigned bid = get_group_id(0);
+  unsigned tid = get_local_id(0);
+  unsigned skip = skip_p[0];
+  unsigned n = n_p[0];
+  local float max_val[GROUP_SIZE];
+  local unsigned argmax_val[GROUP_SIZE];
+  px += bid % skip + (bid / skip) * skip * n;
+  max_val[tid] = 1e38;
+  for (unsigned i = tid; i < n; i += GROUP_SIZE) {
+    float val = px[i * skip];
+    if (val < max_val[tid]) {
+      max_val[tid] = val;
+      argmax_val[tid] = i;
+    }
+  }
+  work_group_barrier(CLK_LOCAL_MEM_FENCE);
+#define REDUCE(k) \
+  if (GROUP_SIZE >= k << 1) { \
+    if (tid < k) { \
+      if (max_val[tid + k] < max_val[tid]) { \
+        max_val[tid] = max_val[tid + k]; \
+        argmax_val[tid] = argmax_val[tid + k]; \
+      } \
+    } \
+    work_group_barrier(CLK_LOCAL_MEM_FENCE); \
+  }
+  REDUCE(512)
+  REDUCE(256)
+  REDUCE(128)
+  REDUCE(64)
+  REDUCE(32)
+  REDUCE(16)
+  REDUCE(8)
+  REDUCE(4)
+  REDUCE(2)
+  REDUCE(1)
+#undef REDUCE
+  if (tid == 0) py[bid] = argmax_val[0];
+#undef GROUP_SIZE
+}
+)EOS";
   }
   return ss.str();
 }
@@ -250,9 +256,9 @@
   std::uint32_t n = shape[dim];
   const std::uint32_t r = shape.size() / n;
   std::uint32_t s = shape.lower_volume(dim);
-  std::uint32_t block_size = argmax_kernel_[0].getWorkGroupInfo<CL_KERNEL_WORK_GROUP_SIZE>(device_);
-  cl_int error = CL_SUCCESS;
-  while (block_size >> 1 >= n) block_size >>= 1;
+  std::uint32_t group_size = argmax_kernel_[0].getWorkGroupInfo<CL_KERNEL_WORK_GROUP_SIZE>(device_);
+  cl_int error = CL_SUCCESS;
+  while (group_size >> 1 >= n) group_size >>= 1;
   cl::CommandQueue queue(context_, device_, 0, &error);
   cl::Buffer mem_s = cl::Buffer(context_,
       CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR,
@@ -263,7 +269,7 @@
   cl::Buffer py = cl::Buffer(context_,
       CL_MEM_WRITE_ONLY,
       sizeof(cl_uint) * r, NULL, &error);
-  switch (block_size) {
+  switch (group_size) {
 #define CASE(k, m) \
     case k: \
       argmax_kernel_[m].setArg(0, DATA(x)); \
@@ -296,9 +302,9 @@
   std::uint32_t n = shape[dim];
   const std::uint32_t r = shape.size() / n;
   std::uint32_t s = shape.lower_volume(dim);
-  std::uint32_t block_size = argmin_kernel_[0].getWorkGroupInfo<CL_KERNEL_WORK_GROUP_SIZE>(device_);
-  cl_int error = CL_SUCCESS;
-  while (block_size >> 1 >= n) block_size >>= 1;
+  std::uint32_t group_size = argmin_kernel_[0].getWorkGroupInfo<CL_KERNEL_WORK_GROUP_SIZE>(device_);
+  cl_int error = CL_SUCCESS;
+  while (group_size >> 1 >= n) group_size >>= 1;
   cl::CommandQueue queue(context_, device_, 0, &error);
   cl::Buffer mem_s = cl::Buffer(context_,
       CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR,
@@ -309,7 +315,7 @@
   cl::Buffer py = cl::Buffer(context_,
       CL_MEM_WRITE_ONLY,
       sizeof(cl_uint) * r, NULL, &error);
-  switch (block_size) {
+  switch (group_size) {
 #define CASE(k, m) \
     case k: \
       argmin_kernel_[m].setArg(0, DATA(x)); \
@@ -341,9 +347,9 @@
   std::uint32_t n = x.shape()[dim];
   const std::uint32_t r = y.shape().size();
   std::uint32_t s = y.shape().lower_volume(dim);
-  std::uint32_t block_size = sum_fw_kernel_[0].getWorkGroupInfo<CL_KERNEL_WORK_GROUP_SIZE>(device_);
-  cl_int error = CL_SUCCESS;
-  while (block_size >> 1 >= n) block_size >>= 1;
+  std::uint32_t group_size = sum_fw_kernel_[0].getWorkGroupInfo<CL_KERNEL_WORK_GROUP_SIZE>(device_);
+  cl_int error = CL_SUCCESS;
+  while (group_size >> 1 >= n) group_size >>= 1;
   cl::CommandQueue queue(context_, device_, 0, &error);
   cl::Buffer mem_s = cl::Buffer(context_,
       CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR,
@@ -351,7 +357,7 @@
   cl::Buffer mem_n = cl::Buffer(context_,
       CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR,
       sizeof(cl_uint), &n, &error);
-  switch (block_size) {
+  switch (group_size) {
 #define CASE(k, m) \
     case k: \
       sum_fw_kernel_[m].setArg(0, DATA(x)); \


VM: Correctly intrinsify implicit getters/setters when using field guards

The unoptimized code cannot depend on guarded cid when using code collection
since it may be lazily regenerated and has to match the original version.

BUG=dartbug.com/25771
R=vegorov@google.com

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

--- runtime/vm/flow_graph_compiler.cc
+++ runtime/vm/flow_graph_compiler.cc
@@ -1096,7 +1096,7 @@
       // Reading from a mutable double box requires allocating a fresh double.
       if (load_node.field().guarded_cid() == kDynamicCid) {
         GenerateInlinedGetter(load_node.field().Offset());
-        return true;
+        return !FLAG_use_field_guards;
       }
       return false;
     }
@@ -1111,7 +1111,7 @@
           *sequence_node.NodeAt(0)->AsStoreInstanceFieldNode();
       if (store_node.field().guarded_cid() == kDynamicCid) {
         GenerateInlinedSetter(store_node.field().Offset());
-        return true;
+        return !FLAG_use_field_guards;
       }
     }
   }


INTEGRATION: CWS atkbridge6 (1.32.6); FILE MERGED 2007/06/07 14:15:50 obr 1.32.6.2: RESYNC: (1.32-1.33); FILE MERGED 2007/03/16 10:51:21 obr 1.32.6.1: #i70338# use GetAppName to initialize glib prgname

--- vcl/unx/gtk/app/gtkdata.cxx
+++ vcl/unx/gtk/app/gtkdata.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: gtkdata.cxx,v $
  *
- *  $Revision: 1.33 $
- *
- *  last change: $Author: rt $ $Date: 2007-04-26 10:39:17 $
+ *  $Revision: 1.34 $
+ *
+ *  last change: $Author: hr $ $Date: 2007-06-27 12:27:01 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -85,6 +85,8 @@
 #endif

 #include "../../unx/source/inc/salcursors.h"
+
+#include <svapp.hxx>

 using namespace rtl;
 using namespace vcl_sal;
@@ -544,6 +546,14 @@

     g_set_application_name(X11SalData::getFrameClassName());

+    // Set consistant name of the root accessible
+    rtl::OUString aAppName = Application::GetAppName();
+    if( aAppName.getLength() > 0 )
+    {
+        rtl::OString aPrgName = rtl::OUStringToOString(aAppName, aEnc);
+        g_set_prgname(aPrgName);
+    }
+
     // init gtk/gdk
     gtk_init_check( &nParams, &pCmdLineAry );


Change filterbit 8 to 7

Change filterbit 8 to 7

--- PWGCF/FEMTOSCOPY/macros/Train/NonIdParticleFemto/5020GeV/FilterBit8/PionKaonFemto/ConfigFemtoAnalysis.C
+++ PWGCF/FEMTOSCOPY/macros/Train/NonIdParticleFemto/5020GeV/FilterBit8/PionKaonFemto/ConfigFemtoAnalysis.C
@@ -93,7 +93,7 @@

   //AliFemtoEventReaderAODChain *Reader = new AliFemtoEventReaderAODChain();
   AliFemtoEventReaderAODMultSelection *Reader = new AliFemtoEventReaderAODMultSelection();
-  Reader->SetFilterBit(8);
+  Reader->SetFilterBit(7);
   //Reader->SetCentralityPreSelection(0.001, 950);

   AliFemtoManager* Manager=new AliFemtoManager();


Fixed pub_head problems.

Fixed pub_head problems.

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

--- hrl/hrl_experiments/hrl_phri_2011/src/pub_head.cpp
+++ hrl/hrl_experiments/hrl_phri_2011/src/pub_head.cpp
@@ -11,7 +11,7 @@
     // Load bag
     rosbag::Bag bag;
     bag.open(std::string(argv[1]), rosbag::bagmode::Read);
-    rosbag::View view(bag, rosbag::TopicQuery("/stitched_head"));
+    rosbag::View view(bag);

     PCRGB::Ptr pc_head(new PCRGB());
     BOOST_FOREACH(rosbag::MessageInstance const m, view) {
@@ -19,14 +19,18 @@
         pcl::fromROSMsg(*pc2, *pc_head);
         break;
     }
-    if(argc >= 4)
-        pc_head->header.frame_id = argv[3];
     if(argc == 2)
         pubLoop(*pc_head, "/stitched_head");
     else if(argc == 3)
-        pubLoop(*pc_head, argv[2]);
-    else if(argc == 5)
-        pubLoop(*pc_head, argv[2], atof(argv[4]));
+        pubLoop(*pc_head, std::string(argv[2]));
+    else if(argc == 4) {
+        pc_head->header.frame_id = std::string(argv[3]);
+        pubLoop(*pc_head, std::string(argv[2]));
+    }
+    else if(argc == 5) {
+        pc_head->header.frame_id = std::string(argv[3]);
+        pubLoop(*pc_head, std::string(argv[2]), atof(argv[4]));
+    }

     return 0;
 }


I have added some general damping to the force feedback coming from the robot.  This is easier to do on the phantom end since we have the phantom velocity.  Since we are not attempting to do serious impedance matching anyway, this at least adds some amount of safety for the user.

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

--- hrl/hrl_hardware_drivers/phantom_omni/src/omni.cpp
+++ hrl/hrl_hardware_drivers/phantom_omni/src/omni.cpp
@@ -122,9 +122,14 @@
   //    void force_callback(const geometry_msgs::WrenchConstPtr& wrench)
     void force_callback(const phantom_omni::OmniFeedbackConstPtr& omnifeed)
     {
-        state->force[0] = omnifeed->force.x;
-        state->force[1] = omnifeed->force.y;
-        state->force[2] = omnifeed->force.z;
+      ////////////////////Some people might not like this extra damping, but it
+      ////////////////////helps to stabilize the overall force feedback. It isn't
+      ////////////////////like we are getting direct impedance matching from the
+      ////////////////////omni anyway
+        state->force[0] = omnifeed->force.x - 0.001*state->velocity[0];
+	state->force[1] = omnifeed->force.y - 0.001*state->velocity[1];
+	state->force[2] = omnifeed->force.z - 0.001*state->velocity[2];
+
 	state->lock_pos[0] = omnifeed->position.x;
 	state->lock_pos[1] = omnifeed->position.y;
 	state->lock_pos[2] = omnifeed->position.z;


修正相机中的float类型为Float类型

修正相机中的float类型为Float类型

--- src/core/camera.cpp
+++ src/core/camera.cpp
@@ -15,14 +15,14 @@
 }

-float Camera::GenerateRayDifferential(const CameraSample &sample,
+Float Camera::GenerateRayDifferential(const CameraSample &sample,
 		RayDifferential *rd) const {
-	float wt = GenerateRay(sample, rd);
+	Float wt = GenerateRay(sample, rd);
 	//生成x偏移射线
 	CameraSample sshift = sample;
 	++sshift.pFilm.x;
 	Ray rx;
-	float wtx = GenerateRay(sshift, &rx);
+	Float wtx = GenerateRay(sshift, &rx);
 	if (wtx == 0) {
 		return 0;
 	}
@@ -32,7 +32,7 @@
 	--sshift.pFilm.x;
 	++sshift.pFilm.y;
 	Ray ry;
-	float wty = GenerateRay(sshift, &ry);
+	Float wty = GenerateRay(sshift, &ry);
 	if (wty == 0) {
 		return 0;
 	}


Update MLX90640_I2C_Driver.cpp (#117)

Update MLX90640_I2C_Driver.cpp (#117)

Wire.endTransmission(false) will return 0 not 7. (ESP32 core v1.0.1)

--- examples/Unit/MLX90640/MLX90640_I2C_Driver.cpp
+++ examples/Unit/MLX90640/MLX90640_I2C_Driver.cpp
@@ -43,7 +43,7 @@
     Wire.beginTransmission(_deviceAddress);
     Wire.write(startAddress >> 8); //MSB
     Wire.write(startAddress & 0xFF); //LSB
-    if (Wire.endTransmission(false) != 7) //Do not release bus
+    if (Wire.endTransmission(false) != 0) //Do not release bus
     {
       Serial.println("No ack read");
       return (0); //Sensor did not ACK


remove redundant unique_ptr usage for local variable

--- plugins/input/shape/shape_datasource.cpp
+++ plugins/input/shape/shape_datasource.cpp
@@ -98,11 +98,11 @@
         mapnik::progress_timer __stats2__(std::clog, "shape_datasource::init(get_column_description)");
 #endif

-        std::unique_ptr<shape_io> shape_ref = std::make_unique<shape_io>(shape_name_);
-        init(*shape_ref);
-        for (int i=0;i<shape_ref->dbf().num_fields();++i)
+        shape_io shape(shape_name_);
+        init(shape);
+        for (int i = 0; i < shape.dbf().num_fields(); ++i)
         {
-            field_descriptor const& fd = shape_ref->dbf().descriptor(i);
+            field_descriptor const& fd = shape.dbf().descriptor(i);
             std::string fld_name=fd.name_;
             switch (fd.type_)
             {


posix: fork() now yields control to the newly created process before returning to the parent.

--- src/subsys/posix/system-syscalls.cc
+++ src/subsys/posix/system-syscalls.cc
@@ -196,6 +196,9 @@
     // Create a new thread for the new process.
     new Thread(pProcess, state);

+    // Kick off the new thread immediately.
+    Scheduler::instance().yield();
+
     // Parent returns child ID.
     return pProcess->getId();
 }


small fix

small fix

git-svn-id: 28d9401aa571d5108e51b194aae6f24ca5964c06@11407 8cc4aa7f-3514-0410-904f-f2cc9021211c

--- plugins/mesh/cloth/object/cloth_geom.cpp
+++ plugins/mesh/cloth/object/cloth_geom.cpp
@@ -5,7 +5,7 @@
 #include "csgeom/math2d.h"
 #include "csgeom/math3d.h"
 #include "csgeom/tesselat.h"
-#include "csutil/bitarray.h"
+#include "csutil/bitarray.h"
 #include "imesh/object.h"
 #include "imesh/clothmesh.h"
 #include "iutil/eventh.h"


ISSUE #7 add a fix me on aiscene destruction

It could be to do with my weirdl dll that's copied from jozef, it could
be an assimp problem?

--- src/repo/manipulator/modelconvertor/export/repo_model_export_assimp.cpp
+++ src/repo/manipulator/modelconvertor/export/repo_model_export_assimp.cpp
@@ -654,6 +654,8 @@
 		success = writeSceneToFile(assimpScene, filePath);
 		writeTexturesToFiles(textureNodes, filePath);

+		//FIXME: this is breaking on my assimp.dll but works on assimpd.dll...?
+		//problem seems to be related to meshes/materials
 		delete assimpScene;

 	}


kernel: fix panic() so it doesn't break halt() due to an interrupt arriving and return.

--- src/system/kernel/debugger/panic.cc
+++ src/system/kernel/debugger/panic.cc
@@ -113,6 +113,8 @@

 void panic( const char* msg )
 {
+  Processor::setInterrupts(false);
+
   // Drop out of whatever graphics mode we were in
   GraphicsService::GraphicsProvider provider;
   memset(&provider, 0, sizeof(provider));
@@ -164,5 +166,6 @@
     _panic( msg, pInterfaces[nIFace] );

   // Halt the processor
-  Processor::halt();
+  while(1)
+    Processor::halt();
 }


FPA bugfix

FPA bugfix

Signed-off-by: Christoph M. Wintersteiger <df906fa73c281118b7012d85069f1a6194ecf7a3@microsoft.com>

--- src/tactic/fpa/fpa2bv_converter.cpp
+++ src/tactic/fpa/fpa2bv_converter.cpp
@@ -1641,7 +1641,7 @@
         SASSERT(is_well_sorted(m, is_sig_zero));
         SASSERT(is_well_sorted(m, lz));
         SASSERT(is_well_sorted(m, shift));
-        if (ebits > sbits) {
+        if (ebits < sbits) {
             expr_ref q(m);
             q = m_bv_util.mk_zero_extend(sbits-ebits, shift);
             denormal_sig = m_bv_util.mk_bv_shl(denormal_sig, q);


stupid coding error fixed

stupid coding error fixed

git-svn-id: 022cbda3fda3a7578cc26521706f6286af8c0840@246 8215d0b1-3b2f-4a13-8d91-4b3e73067666

--- Stride.cpp
+++ Stride.cpp
@@ -2466,8 +2466,8 @@
 		return ( FAILURE );
 	}
 	else {
-		DONOR *Dnr[*dc] = ( DONOR * ) ckalloc ( sizeof ( DONOR ) );
-		memcpy(Dnr[*dc], tempDonor, sizeof(DONOR));
+		Dnr[*dc] = ( DONOR * ) ckalloc ( sizeof ( DONOR ) );
+		memcpy(Dnr[*dc], &tempDonor, sizeof(DONOR));
 		( *dc ) ++;
 	}
 	return ( SUCCESS );


:( didnt include it in last commit

:( didnt include it in last commit


Implement the final UI for the CAPS LOCK indicator (part 2 of 3)

Call OnCapsLock() only when Caps Lock status is actually changed. Currently, OnCapsLock() is called when other modifier keys (e.g. Ctrl) or mouse buttons are pressed while Caps Lock is on.

BUG=chromium-os:11690
TEST=ran browser_tests

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

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

--- chrome/browser/chromeos/system_key_event_listener.cc
+++ chrome/browser/chromeos/system_key_event_listener.cc
@@ -282,8 +282,11 @@
   if (xevent->type == xkb_event_base_) {
     XkbEvent* xkey_event = reinterpret_cast<XkbEvent*>(xevent);
     if (xkey_event->any.xkb_type == XkbStateNotify) {
-      caps_lock_is_on_ = (xkey_event->state.locked_mods) & LockMask;
-      OnCapsLock(caps_lock_is_on_);
+      const bool new_lock_state = (xkey_event->state.locked_mods) & LockMask;
+      if (caps_lock_is_on_ != new_lock_state) {
+        caps_lock_is_on_ = new_lock_state;
+        OnCapsLock(caps_lock_is_on_);
+      }
       return true;
     }
   } else if (xevent->type == KeyPress) {


Make "Clear Browser Data" dialog wider for ja.

The fix is to use the size constraint as min size and let Gtk make us wider when necessary.

BUG=chromium-os:3763
TEST=Verify no button truncation in "Clear Browser Data" as in chromium-os:3763.

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

git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@48946 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

--- chrome/browser/gtk/clear_browsing_data_dialog_gtk.cc
+++ chrome/browser/gtk/clear_browsing_data_dialog_gtk.cc
@@ -177,10 +177,8 @@

   UpdateDialogButtons();

-  gtk_util::ShowDialogWithLocalizedSize(dialog_,
-                                        IDS_CLEARDATA_DIALOG_WIDTH_CHARS,
-                                        -1,
-                                        false);
+  gtk_util::ShowModalDialogWithMinLocalizedWidth(dialog_,
+      IDS_CLEARDATA_DIALOG_WIDTH_CHARS);
 }

 ClearBrowsingDataDialogGtk::~ClearBrowsingDataDialogGtk() {


Valgrind reports memory leak in unit test.  This is true since we had re-used the XmlReader object for each test.  This CL changes this to use a new XmlReader object per test.
Review URL: http://codereview.chromium.org/79049

git-svn-id: http://src.chromium.org/svn/trunk/src@13961 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

Former-commit-id: 03667dff4844df2be49f5933d2022ac50a0d647b

--- chrome/browser/importer/toolbar_importer_unittest.cc
+++ chrome/browser/importer/toolbar_importer_unittest.cc
@@ -309,7 +309,6 @@
 // The parsing tests for Toolbar5Importer use the string above.  For a
 // description of all the tests run please see the comments immediately before
 // the string constants above.
-//
 // Failing Valgrind/Purify, refer to http://crbug.com/10679
 TEST(Toolbar5ImporterTest, DISABLED_BookmarkParse) {
   XmlReader reader;
@@ -322,8 +321,9 @@
   // Test case 1 is parsing a basic bookmark with a single label.
   bookmark_xml = toolbar_importer_unittest::kGoodBookmark;
   bookmarks.clear();
-  EXPECT_TRUE(reader.Load(bookmark_xml));
-  EXPECT_TRUE(Toolbar5Importer::ParseBookmarksFromReader(&reader, &bookmarks));
+  XmlReader reader1;
+  EXPECT_TRUE(reader1.Load(bookmark_xml));
+  EXPECT_TRUE(Toolbar5Importer::ParseBookmarksFromReader(&reader1, &bookmarks));

   EXPECT_EQ(bookmarks.size(), (size_t) 1);
   EXPECT_FALSE(bookmarks[0].in_toolbar);
@@ -335,8 +335,9 @@
   // Test case 2 is parsing a single bookmark with no label.
   bookmark_xml = toolbar_importer_unittest::kGoodBookmarkNoLabel;
   bookmarks.clear();
-  EXPECT_TRUE(reader.Load(bookmark_xml));
-  EXPECT_TRUE(Toolbar5Importer::ParseBookmarksFromReader(&reader, &bookmarks));
+  XmlReader reader2;
+  EXPECT_TRUE(reader2.Load(bookmark_xml));
+  EXPECT_TRUE(Toolbar5Importer::ParseBookmarksFromReader(&reader2, &bookmarks));

   EXPECT_EQ(bookmarks.size(), (size_t) 1);
   EXPECT_FALSE(bookmarks[0].in_toolbar);
@@ -347,8 +348,9 @@
   // Test case 3 is parsing a single bookmark with two labels.
   bookmark_xml = toolbar_importer_unittest::kGoodBookmarkTwoLabels;
   bookmarks.clear();
-  EXPECT_TRUE(reader.Load(bookmark_xml));
-  EXPECT_TRUE(Toolbar5Importer::ParseBookmarksFromReader(&reader, &bookmarks));
+  XmlReader reader3;
+  EXPECT_TRUE(reader3.Load(bookmark_xml));
+  EXPECT_TRUE(Toolbar5Importer::ParseBookmarksFromReader(&reader3, &bookmarks));

   EXPECT_EQ(bookmarks.size(), (size_t) 2);
   EXPECT_FALSE(bookmarks[0].in_toolbar);
@@ -364,8 +366,9 @@
   // this test file name translation between Toolbar and Chrome.
   bookmark_xml = toolbar_importer_unittest::kGoodBookmarkFolderLabel;
   bookmarks.clear();
-  EXPECT_TRUE(reader.Load(bookmark_xml));
-  EXPECT_TRUE(Toolbar5Importer::ParseBookmarksFromReader(&reader, &bookmarks));
+  XmlReader reader4;
+  EXPECT_TRUE(reader4.Load(bookmark_xml));
+  EXPECT_TRUE(Toolbar5Importer::ParseBookmarksFromReader(&reader4, &bookmarks));

   EXPECT_EQ(bookmarks.size(), (size_t) 1);
   EXPECT_FALSE(bookmarks[0].in_toolbar);
@@ -382,8 +385,9 @@
   // Test case 5 is parsing a single bookmark without a favicon URL.
   bookmark_xml = toolbar_importer_unittest::kGoodBookmarkNoFavicon;
   bookmarks.clear();
-  EXPECT_TRUE(reader.Load(bookmark_xml));
-  EXPECT_TRUE(Toolbar5Importer::ParseBookmarksFromReader(&reader, &bookmarks));
+  XmlReader reader5;
+  EXPECT_TRUE(reader5.Load(bookmark_xml));
+  EXPECT_TRUE(Toolbar5Importer::ParseBookmarksFromReader(&reader5, &bookmarks));

   EXPECT_EQ(bookmarks.size(), (size_t) 1);
   EXPECT_FALSE(bookmarks[0].in_toolbar);
@@ -395,8 +399,9 @@
   // Test case 6 is parsing two bookmarks.
   bookmark_xml = toolbar_importer_unittest::kGoodBookmark2Items;
   bookmarks.clear();
-  EXPECT_TRUE(reader.Load(bookmark_xml));
-  EXPECT_TRUE(Toolbar5Importer::ParseBookmarksFromReader(&reader, &bookmarks));
+  XmlReader reader6;
+  EXPECT_TRUE(reader6.Load(bookmark_xml));
+  EXPECT_TRUE(Toolbar5Importer::ParseBookmarksFromReader(&reader6, &bookmarks));

   EXPECT_EQ(bookmarks.size(), (size_t) 2);
   EXPECT_FALSE(bookmarks[0].in_toolbar);
@@ -413,43 +418,50 @@
   // Test case 7 is parsing an empty string for bookmarks.
   bookmark_xml = toolbar_importer_unittest::kEmptyString;
   bookmarks.clear();
-  EXPECT_FALSE(reader.Load(bookmark_xml));
+  XmlReader reader7;
+  EXPECT_FALSE(reader7.Load(bookmark_xml));

   // Test case 8 is testing the error when no <bookmarks> section is present.
   bookmark_xml = toolbar_importer_unittest::kBadBookmarkNoBookmarks;
   bookmarks.clear();
-  EXPECT_TRUE(reader.Load(bookmark_xml));
-  EXPECT_FALSE(Toolbar5Importer::ParseBookmarksFromReader(&reader, &bookmarks));
+  XmlReader reader8;
+  EXPECT_TRUE(reader8.Load(bookmark_xml));
+  EXPECT_FALSE(Toolbar5Importer::ParseBookmarksFromReader(&reader8, &bookmarks));

   // Test case 9 tests when no <bookmark> section is present.
   bookmark_xml = toolbar_importer_unittest::kBadBookmarkNoBookmark;
   bookmarks.clear();
-  EXPECT_TRUE(reader.Load(bookmark_xml));
-  EXPECT_FALSE(Toolbar5Importer::ParseBookmarksFromReader(&reader, &bookmarks));
+  XmlReader reader9;
+  EXPECT_TRUE(reader9.Load(bookmark_xml));
+  EXPECT_FALSE(Toolbar5Importer::ParseBookmarksFromReader(&reader9, &bookmarks));

   // Test case 10 tests when a bookmark has no <title> section.
   bookmark_xml = toolbar_importer_unittest::kBadBookmarkNoTitle;
   bookmarks.clear();
-  EXPECT_TRUE(reader.Load(bookmark_xml));
-  EXPECT_FALSE(Toolbar5Importer::ParseBookmarksFromReader(&reader, &bookmarks));
+  XmlReader reader10;
+  EXPECT_TRUE(reader10.Load(bookmark_xml));
+  EXPECT_FALSE(Toolbar5Importer::ParseBookmarksFromReader(&reader10, &bookmarks));

   // Test case 11 tests when a bookmark has no <url> section.
   bookmark_xml = toolbar_importer_unittest::kBadBookmarkNoUrl;
   bookmarks.clear();
-  EXPECT_TRUE(reader.Load(bookmark_xml));
-  EXPECT_FALSE(Toolbar5Importer::ParseBookmarksFromReader(&reader, &bookmarks));
+  XmlReader reader11;
+  EXPECT_TRUE(reader11.Load(bookmark_xml));
+  EXPECT_FALSE(Toolbar5Importer::ParseBookmarksFromReader(&reader11, &bookmarks));

   // Test case 12 tests when a bookmark has no <timestamp> section.
   bookmark_xml = toolbar_importer_unittest::kBadBookmarkNoTimestamp;
   bookmarks.clear();
-  EXPECT_TRUE(reader.Load(bookmark_xml));
-  EXPECT_FALSE(Toolbar5Importer::ParseBookmarksFromReader(&reader, &bookmarks));
+  XmlReader reader12;
+  EXPECT_TRUE(reader12.Load(bookmark_xml));
+  EXPECT_FALSE(Toolbar5Importer::ParseBookmarksFromReader(&reader12, &bookmarks));

   // Test case 13 tests when a bookmark has no <labels> section.
   bookmark_xml = toolbar_importer_unittest::kBadBookmarkNoLabels;
   bookmarks.clear();
-  EXPECT_TRUE(reader.Load(bookmark_xml));
-  EXPECT_FALSE(Toolbar5Importer::ParseBookmarksFromReader(&reader, &bookmarks));
+  XmlReader reader13;
+  EXPECT_TRUE(reader13.Load(bookmark_xml));
+  EXPECT_FALSE(Toolbar5Importer::ParseBookmarksFromReader(&reader13, &bookmarks));
 }


thrift: cpp2: don't sign extend MessageType in compact

Summary:
In compact protocol, the message type is a 3 bit field. Treat it as
unsigned so that shifting after masking doesn't result in sign extension.
Without this, OneWay messages are decoded as -4 instead of 4.

It is implementation-defined whether right-shift of a signed value is
sign-extending, so this may work as expected sometimes.

It turns out in practice this change is moot, because OneWay is never used.
However this change will be necessary if messagetypes >= 4 are ever used.

Reviewed By: yfeldblum, Imxset21

Differential Revision: D6337572

fbshipit-source-id: baaf408af8bd0b09655bc2dc80f0e804186410dc

--- thrift/lib/cpp2/protocol/CompactProtocol.tcc
+++ thrift/lib/cpp2/protocol/CompactProtocol.tcc
@@ -502,7 +502,7 @@
   }

   messageType = (MessageType)
-    ((versionAndType & detail::compact::TYPE_MASK) >>
+    ((uint8_t)(versionAndType & detail::compact::TYPE_MASK) >>
      detail::compact::TYPE_SHIFT_AMOUNT);
   rsize += apache::thrift::util::readVarint(in_, seqid);
   rsize += readString(name);


Disable ProfileSyncServiceTest_ServerChangeProcessing due to purify error.

BUG=27630
TEST=n/a
TBR=nick

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

git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@31917 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

--- chrome/browser/sync/profile_sync_service_unittest.cc
+++ chrome/browser/sync/profile_sync_service_unittest.cc
@@ -528,7 +528,8 @@
   ExpectModelMatch();
 }

-TEST_F(ProfileSyncServiceTest, ServerChangeProcessing) {
+// TODO(ncarter): fix free memory access error, refer to http://crbug.com/27631
+TEST_F(ProfileSyncServiceTest, DISABLED_ServerChangeProcessing) {
   LoadBookmarkModel(DELETE_EXISTING_STORAGE, DONT_SAVE_TO_STORAGE);
   StartSyncService();


Increase the severity of the warning that is logged on extension load failure. This doesn't fix the bug, but might help with debugging until we have an alert box.

BUG=21109
TEST=no

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

git-svn-id: http://src.chromium.org/svn/trunk/src@25479 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

Former-commit-id: 4b0866089f36cc069a8bbe53acd609856a264dcb

--- chrome/common/extensions/extension_error_reporter.cc
+++ chrome/common/extensions/extension_error_reporter.cc
@@ -59,7 +59,7 @@

   // TODO(aa): Print the error message out somewhere better. I think we are
   // going to need some sort of 'extension inspector'.
-  LOG(WARNING) << message;
+  LOG(ERROR) << "Extension error: " << message;

   if (enable_noisy_errors_ && be_noisy) {
 #if defined(OS_WIN)


build fix

build fix

git-svn-id: 4f0141143c3c635d33f1b9f02fcb2b6c73e45c89@4195 a83610d8-ad2a-0410-a6ab-fc0612d85776

--- src/kademlia/routing_table.cpp
+++ src/kademlia/routing_table.cpp
@@ -94,7 +94,7 @@
 	return (2 << m_buckets.size()) * num_nodes;
 }

-#if defined TORRENT_DHT_VERBOSE_LOGGING || defined TORRENT_DEBUG
+#if (defined TORRENT_DHT_VERBOSE_LOGGING || defined TORRENT_DEBUG) && TORRENT_USE_IOSTREAM

 void routing_table::print_state(std::ostream& os) const
 {


Adding internal message to read and write again a preset file

--- implementations/MaxMSP/jcom.preset/jcom.preset.cpp
+++ implementations/MaxMSP/jcom.preset/jcom.preset.cpp
@@ -75,6 +75,9 @@

 	class_addmethod(c->maxClass, (method)preset_read,					"preset_read",			A_CANT, 0);
 	class_addmethod(c->maxClass, (method)preset_write,					"preset_write",			A_CANT, 0);
+
+    class_addmethod(c->maxClass, (method)preset_read_again,				"preset_read_again",	A_CANT, 0);
+	class_addmethod(c->maxClass, (method)preset_write_again,			"preset_write_again",	A_CANT, 0);

 	class_addmethod(c->maxClass, (method)preset_edit,					"dblclick",				A_CANT, 0);
 	class_addmethod(c->maxClass, (method)preset_edclose,				"edclose",				A_CANT, 0);
@@ -241,7 +244,6 @@
 		aData->setAttributeValue(kTTSym_tag, kTTSym_generic);
 		aData->setAttributeValue(kTTSym_description, TTSymbol("Write a xml preset file"));

-		/*
 		makeInternals_data(self, absoluteAddress, TTSymbol("preset/read/again"), gensym("preset_read_again"), x->patcherPtr, kTTSym_message, (TTObjectPtr*)&aData);
 		aData->setAttributeValue(kTTSym_type, kTTSym_none);
 		aData->setAttributeValue(kTTSym_tag, kTTSym_generic);
@@ -251,9 +253,6 @@
 		aData->setAttributeValue(kTTSym_type, kTTSym_none);
 		aData->setAttributeValue(kTTSym_tag, kTTSym_generic);
 		aData->setAttributeValue(kTTSym_description, TTSymbol("Write into the last xml preset file"));
-		*/
-
-		// TODO : display in Max edition window

 		// if desired, load default modelClass.patcherContext.xml file preset
 		if (EXTRA->attr_load_default)


Add the missing header for `errno` variable in `checks.cc`

Variable `LAST_SYSTEM_ERROR` was introduced in https://webrtc-review.googlesource.com/c/src/+/32780.
It seems to be the same codeblock in `physicalsocketserver.cc`, only difference is it did not
include the header <errno.h>.

Also, probably a good idea to make the include conditional.

Bug: None
Change-Id: I3241dd83be4a248c6c1db2fab8f924a185e354cb
Reviewed-on: https://webrtc-review.googlesource.com/45864
Reviewed-by: Niels Moller <0057859e47d61d90529d0f66d9ef692cefedb46a@webrtc.org>
Reviewed-by: Tommi <74a97831ec830b6e3846c6faa50560947ae01c68@webrtc.org>
Commit-Queue: Niels Moller <0057859e47d61d90529d0f66d9ef692cefedb46a@webrtc.org>
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#21841}

--- rtc_base/checks.cc
+++ rtc_base/checks.cc
@@ -29,6 +29,7 @@
 #elif defined(__native_client__) && __native_client__
 #define LAST_SYSTEM_ERROR (0)
 #elif defined(WEBRTC_POSIX)
+#include <errno.h>
 #define LAST_SYSTEM_ERROR (errno)
 #endif  // WEBRTC_WIN


default empty input/output sequences if corresponding alphabets are empty

--- target/bossmachine.cpp
+++ target/bossmachine.cpp
@@ -426,6 +426,10 @@
     }

     // if inputs/outputs specified individually, create all input-output pairs
+    if (inSeqs.empty() && !outSeqs.empty() && machine.inputAlphabet().empty())
+      inSeqs.push_back (FastSeq());
+    else if (outSeqs.empty() && !inSeqs.empty() && machine.outputAlphabet().empty())
+      outSeqs.push_back (FastSeq());
     for (const auto& inSeq: inSeqs)
       for (const auto& outSeq: outSeqs)
 	data.seqPairs.push_back (SeqPair ({ NamedInputSeq ({ inSeq.name, splitToChars (inSeq.seq) }), NamedOutputSeq ({ outSeq.name, splitToChars (outSeq.seq) }) }));


ThreadControlBlock::State: add new value - ThreadControlBlock::State::BlockedOnOnceFlag

--- include/distortos/scheduler/ThreadControlBlock.hpp
+++ include/distortos/scheduler/ThreadControlBlock.hpp
@@ -8,7 +8,7 @@
  * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
  * distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
  *
- * \date 2015-06-30
+ * \date 2015-07-09
  */

 #ifndef INCLUDE_DISTORTOS_SCHEDULER_THREADCONTROLBLOCK_HPP_
@@ -68,6 +68,8 @@
 		BlockedOnConditionVariable,
 		/// thread is waiting for signal
 		WaitingForSignal,
+		/// thread is blocked on OnceFlag
+		BlockedOnOnceFlag
 	};

 	/// reason of thread unblocking


fixed predict_observation call

fixed predict_observation call

--- include/fl/filter/gaussian/gaussian_filter_ukf.hpp
+++ include/fl/filter/gaussian/gaussian_filter_ukf.hpp
@@ -353,7 +353,8 @@
         for (size_t i = 0; i < point_count; ++i)
         {
             X_y.point(i, obsrv_model_->predict_observation(X_r.point(i),
-                                                           X_R.point(i)));
+                                                           X_R.point(i),
+                                                           0 /* delta time */));
         }

         auto W = X_r.covariance_weights_vector();


create/delete methods

create/delete methods

--- interface/plane_bind.cpp
+++ interface/plane_bind.cpp
@@ -38,3 +38,16 @@

 #include <OgreRoot.h>
 #include <OgrePlane.h>
+
+PlaneHandle create_plane()
+{
+    Ogre::Plane* plane = new Ogre::Plane;
+    return reinterpret_cast<PlaneHandle>(plane);
+
+}
+
+void destroy_plane(PlaneHandle handle)
+{
+    Ogre::Plane* plane = reinterpret_cast<Ogre::Plane*>(handle);
+    delete plane;
+}


fix typo in comment

fix typo in comment

--- base/executive_test.cc
+++ base/executive_test.cc
@@ -61,7 +61,7 @@
   const int input_value = 42;

   // Create an Executive with default options; pass NULL to use execute
-  // everything on the curren thread. The boolean parameter indicates
+  // everything on the current thread. The boolean parameter indicates
   // that Executive should own the 'Execution' object, however when
   // NULL is passed, the current thread executive is used, and the
   // Executive *always* owns that.


just a test...

just a test...

git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@628 4ff67af0-8c30-449e-8e8b-ad334ec8d88c


fix name clash with gcc macro

fix name clash with gcc macro

/home/chris/build/Vulkan/base/vulkanVersion.hpp:19:13: warning: In the GNU C Library, "major" is defined
 by <sys/sysmacros.h>. For historical compatibility, it is
 currently defined by <sys/types.h> as well, but we plan to
 remove this soon. To use "major", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "major", you should undefine it after including <sys/types.h>.
         Version() : major(0), minor(0), patch(0) {
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

--- base/vulkanVersion.hpp
+++ base/vulkanVersion.hpp
@@ -16,7 +16,7 @@
     // The maximum possible major and minor version is 512 (look out nVidia)
     // while the maximum possible patch version is 2048
     struct Version {
-        Version() : major(0), minor(0), patch(0) {
+        Version() : vulkan_major(0), vulkan_minor(0), vulkan_patch(0) {
         }
         Version(uint32_t version) : Version() {
             *this = version;
@@ -34,13 +34,13 @@

         std::string toString() const {
             std::stringstream buffer;
-            buffer << major << "." << minor << "." << patch;
+            buffer << vulkan_major << "." << vulkan_minor << "." << vulkan_patch;
             return buffer.str();
         }

-        const uint32_t patch : 12;
-        const uint32_t minor : 10;
-        const uint32_t major : 10;
+        const uint32_t vulkan_patch : 12;
+        const uint32_t vulkan_minor : 10;
+        const uint32_t vulkan_major : 10;

     };
-}+}


INTEGRATION: CWS dbgmacros1 (1.3.46); FILE MERGED 2003/04/09 11:54:43 kso 1.3.46.1: #108413# - debug macro unification.

--- i18npool/source/collator/chaptercollator.cxx
+++ i18npool/source/collator/chaptercollator.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: chaptercollator.cxx,v $
  *
- *  $Revision: 1.5 $
+ *  $Revision: 1.6 $
  *
- *  last change: $Author: hr $ $Date: 2003-03-26 10:54:38 $
+ *  last change: $Author: vg $ $Date: 2003-04-15 17:07:52 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -58,8 +58,6 @@
  *
  *
  ************************************************************************/
-
-#include <assert.h>

 // prevent internal compiler error with MSVC6SP3
 #include <stl/utility>


Crowdin: sort projects and languages in UI

Sort the list of projects as well as languages alphabetically in Crowdin
picker UI, instead of keeping the (somewhat arbitrary) server-returned
order.

--- src/crowdin_gui.cpp
+++ src/crowdin_gui.cpp
@@ -28,6 +28,8 @@

 #include "crowdin_client.h"

+#include <unicode/coll.h>
+
 #include "catalog.h"
 #include "cloud_sync.h"
 #include "colorscheme.h"
@@ -69,6 +71,40 @@
 #include <boost/algorithm/string.hpp>

+namespace
+{
+
+template<typename T, typename Key>
+void SortAlphabetically(std::vector<T>& items, Key func)
+{
+    UErrorCode err = U_ZERO_ERROR;
+    std::unique_ptr<icu::Collator> coll(icu::Collator::createInstance(err));
+    if (coll)
+        coll->setStrength(icu::Collator::SECONDARY); // case insensitive
+
+    std::sort
+    (
+        items.begin(), items.end(),
+        [&coll,&func](const T& a, const T& b)
+        {
+            auto ka = func(a);
+            auto kb = func(b);
+            if (coll)
+            {
+                UErrorCode e = U_ZERO_ERROR;
+                return coll->compare(str::to_icu(ka), str::to_icu(kb), e) == UCOL_LESS;
+            }
+            else
+            {
+                return ka < kb;
+            }
+        }
+    );
+}
+
+} // anonymous namespace
+
+
 CrowdinLoginPanel::CrowdinLoginPanel(wxWindow *parent, int flags)
     : wxPanel(parent, wxID_ANY),
       m_state(State::Uninitialized),
@@ -516,17 +552,19 @@
     void OnFetchedProjects(std::vector<CrowdinClient::ProjectListing> prjs)
     {
         m_projects = prjs;
+        SortAlphabetically(m_projects, [](const auto& p){ return p.name; });
+
         m_project->Append("");
-        for (auto& p: prjs)
+        for (auto& p: m_projects)
             m_project->Append(p.name);
-        m_project->Enable(!prjs.empty());
-
-        if (prjs.empty())
+        m_project->Enable(!m_projects.empty());
+
+        if (m_projects.empty())
             m_activity->StopWithError(_("No translation projects listed in your Crowdin account."));
         else
             m_activity->Stop();

-        if (prjs.size() == 1)
+        if (m_projects.size() == 1)
         {
             m_project->SetSelection(1);
             OnProjectSelected();
@@ -553,6 +591,8 @@
     void OnFetchedProjectInfo(CrowdinClient::ProjectInfo prj)
     {
         m_info = prj;
+        SortAlphabetically(m_info.languages, [](const auto& l){ return l.DisplayName(); });
+
         m_language->Clear();
         m_language->Append("");
         for (auto& i: m_info.languages)


fix: Fix sync command params to avoid deprecated build warning (#99)

--- src/cs_transmog.cpp
+++ src/cs_transmog.cpp
@@ -52,7 +52,7 @@
         return commandTable;
     }

-    static bool HandleSyncTransMogCommand(ChatHandler* handler, char const* /*args*/)
+    static bool HandleSyncTransMogCommand(ChatHandler* handler)
     {
         Player* player = handler->GetPlayer();
         uint32 accountId = player->GetSession()->GetAccountId();


Avoid redundant SkMatrix44::reset() call in gfx::Transform constructor

gfx::Transform has an SkMatrix44 member and calls reset() in the constructor,
but SkMatrix44's default constructor does the same thing.

Saves 1.6% on cc_perftests

BUG=

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

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

--- ui/gfx/transform.cc
+++ ui/gfx/transform.cc
@@ -32,7 +32,6 @@
 }  // namespace

 Transform::Transform() {
-  matrix_.reset();
 }

 Transform::~Transform() {}


Disable the load time condition to enable Travis CI to pass consistently.

--- OpenSim/Common/Test/testC3DFileAdapter.cpp
+++ OpenSim/Common/Test/testC3DFileAdapter.cpp
@@ -89,12 +89,15 @@
     cout << "\tC3DFileAdapter '" << filename << "' loaded in "
         << loadTime << "ms" << endl;

+/*  Disabled performance test because Travis CI is consistently unable to
+    meet this timing requirement. Consider PR#2221 to address this issue
+    longer term.
     #ifdef NDEBUG
     ASSERT(loadTime < MaximumLoadTimeInMS, __FILE__, __LINE__,
         "Unable to load '" + filename + "' within " +
         to_string(MaximumLoadTimeInMS) + "ms.");
     #endif
-
+*/
     auto& marker_table = tables.at("markers");
     auto&  force_table = tables.at("forces");
     downsample_table(*marker_table, 10);


Correction: use the QAM texture for colours.

--- Outputs/OpenGL/ScanTargetGLSLFragments.cpp
+++ Outputs/OpenGL/ScanTargetGLSLFragments.cpp
@@ -421,15 +421,12 @@

 				// Split and average chrominance.
 				"vec2 chrominances[4] = vec2[4]("
-					"textureLod(textureName, qamTextureCoordinates[0], 0).gb,"
-					"textureLod(textureName, qamTextureCoordinates[1], 0).gb,"
-					"textureLod(textureName, qamTextureCoordinates[2], 0).gb,"
-					"textureLod(textureName, qamTextureCoordinates[3], 0).gb"
+					"textureLod(qamTextureName, qamTextureCoordinates[0], 0).gb,"
+					"textureLod(qamTextureName, qamTextureCoordinates[1], 0).gb,"
+					"textureLod(qamTextureName, qamTextureCoordinates[2], 0).gb,"
+					"textureLod(qamTextureName, qamTextureCoordinates[3], 0).gb"
 				");"
-				"vec2 channels = vec2("
-					"dot(vec4(chrominances[0].x, chrominances[1].x, chrominances[2].x, chrominances[3].x), vec4(0.25))*2.0 - 1.0,"
-					"dot(vec4(chrominances[0].y, chrominances[1].y, chrominances[2].y, chrominances[3].y), vec4(0.25))*2.0 - 1.0"
-				");"
+				"vec2 channels = (chrominances[0] + chrominances[1] + chrominances[2] + chrominances[3])*0.5 - vec2(1.0);"

 				// Apply a colour space conversion to get RGB.
 				"fragColour3 = mix("


iox-#25: Add history to mq message

iox-#25: Add history to mq message

Signed-off-by: Hintz Martin (CC-AD/ESW1) <cfa934f6a18d8fc1b7e02e9604aec5d1a5fb6d87@de.bosch.com>

--- iceoryx_posh/source/runtime/posh_runtime.cpp
+++ iceoryx_posh/source/runtime/posh_runtime.cpp
@@ -255,7 +255,7 @@
 {
     MqMessage sendBuffer;
     sendBuffer << mqMessageTypeToString(MqMessageType::CREATE_PUBLISHER) << m_appName
-               << static_cast<cxx::Serialization>(service).toString() << runnableName
+               << static_cast<cxx::Serialization>(service).toString() << std::to_string(historyCapacity) << runnableName
                << static_cast<cxx::Serialization>(portConfigInfo).toString();

     auto requestedPublisherPort = requestPublisherFromRoudi(sendBuffer);
@@ -339,7 +339,7 @@
 {
     MqMessage sendBuffer;
     sendBuffer << mqMessageTypeToString(MqMessageType::CREATE_SUBSCRIBER) << m_appName
-               << static_cast<cxx::Serialization>(service).toString() << runnableName
+               << static_cast<cxx::Serialization>(service).toString() << std::to_string(historyRequest) << runnableName
                << static_cast<cxx::Serialization>(portConfigInfo).toString();

     return requestSubscriberFromRoudi(sendBuffer);


Optimized version now works correctly

Optimized version now works correctly

It can however me optimized more.

--- image_processor/Optimize/image_processor.cpp
+++ image_processor/Optimize/image_processor.cpp
@@ -61,26 +61,32 @@

     std::vector<unsigned int> line_buffer(width * 3);

+    // TODO: Some variables might not have to be calculated for each iteration (e.g. index). Increment instead.
+
     // Fill the line buffer
     for (int y = 0; y < (int)filterSize - 1; ++y) {
-        for (int x = 0; x < (int)line_buffer.size(); x += 3) {
-            const int i = (y * width + x) * 3;
-            line_buffer[x] += imageIn[i];
-            line_buffer[x + 1] += imageIn[i + 1];
-            line_buffer[x + 2] += imageIn[i + 2];
+        for (int x = 0; x < (int)width; ++x) {
+            const int index = (y * width + x) * 3;
+            const int lb_index = x * 3;
+            line_buffer[lb_index] += imageIn[index];
+            line_buffer[lb_index + 1] += imageIn[index + 1];
+            line_buffer[lb_index + 2] += imageIn[index + 2];
         }
     }

     // Iterate all pixels, one line of pixels at a time
     for (int y = start_coordinate; y < end_y; ++y) {
+        // Add new row to line buffer
+        for (int lb_x = 0; lb_x < (int)width; ++lb_x) {
+            const int lb_index = lb_x * 3;
+            const int index = ((y + filterSize / 2) * width + lb_x) * 3;
+            line_buffer[lb_index] += imageIn[index];
+            line_buffer[lb_index + 1] += imageIn[index + 1];
+            line_buffer[lb_index + 2] += imageIn[index + 2];
+        }
+
+        // Iterate along row of pixels, sum up and calculate averages
         for (int x = start_coordinate; x < end_x; ++x) {
-            // Add new row to line buffer
-            for (int lb_index = 0; lb_index < (int)line_buffer.size(); lb_index += 3) {
-                const int i = ((y + filterSize / 2) * width + x) * 3;
-                line_buffer[lb_index] += imageIn[i];
-                line_buffer[lb_index + 1] += imageIn[i + 1];
-                line_buffer[lb_index + 2] += imageIn[i + 2];
-            }
             unsigned int blur_sum_r = 0;
             unsigned int blur_sum_g = 0;
             unsigned int blur_sum_b = 0;
@@ -101,13 +107,15 @@
             imageOut[index + 1] = blur_sum_g / (filterSize * filterSize);
             imageOut[index + 2] = blur_sum_b / (filterSize * filterSize);

-            // Remove last row from line buffer
-            for (int idx = 0; idx < (int)line_buffer.size(); idx += 3) {
-                const int i = ((y - filterSize / 2) * width + x) * 3;
-                line_buffer[idx] -= imageIn[i];
-                line_buffer[idx + 1] -= imageIn[i + 1];
-                line_buffer[idx + 2] -= imageIn[i + 2];
-            }
+        }
+
+        // Remove last row from line buffer
+        for (int lb_x = 0; lb_x < (int)width; ++lb_x) {
+            const int lb_index = lb_x * 3;
+            const int index = ((y - filterSize / 2) * width + lb_x) * 3;
+            line_buffer[lb_index] -= imageIn[index];
+            line_buffer[lb_index + 1] -= imageIn[index + 1];
+            line_buffer[lb_index + 2] -= imageIn[index + 2];
         }
     }


Adding pragma marks for easier navigation in Xcode

--- implementations/MaxMSP/jcom.map/jcom.map.cpp
+++ implementations/MaxMSP/jcom.map/jcom.map.cpp
@@ -51,6 +51,8 @@
 t_class		*map_class;			// Required. Global pointing to this class

+#pragma mark -
+#pragma mark main
 /************************************************************************************/
 // Main() Function

@@ -104,6 +106,8 @@
 }

+#pragma mark -
+#pragma mark life cycle
 /************************************************************************************/
 // Object Life

@@ -141,6 +145,8 @@
 }

+#pragma mark -
+#pragma mark methods
 /************************************************************************************/
 // Methods bound to input/inlets

@@ -330,12 +336,17 @@
 }

-// ATTRIBUTE:
+#pragma mark -
+#pragma mark attributes
+/************************************************************************************/
+// Attributes
+
+
 void map_doSetFunction(t_map *obj, t_symbol *newFunctionName)
 {
 	obj->attr_function = newFunctionName;
 	FunctionLib::createUnit(TT(obj->attr_function->s_name), (TTObject **)&obj->functionUnit);
-
+
 	if (obj->functionUnit) {
 		long		n;
 		TTValue		names;
@@ -351,10 +362,10 @@

 			if (aName == TT("Bypass") || aName == TT("Mute") || aName == TT("MaxNumChannels") || aName == TT("SampleRate"))
 				continue;										// don't publish these parameters
-
+
 			if (nameString[0] > 64 && nameString[0] < 91) {		// ignore all params not starting with upper-case
 				nameString[0] += 32;							// convert first letter to lower-case for Max
-
+
 				TTValuePtr v = new TTValue(aName);
 				obj->parameterNames->append(TT(nameString.c_str()), *v);
 			}
@@ -363,6 +374,8 @@
 	obj->valid = true;
 }

+
+// ATTRIBUTE: Set function
 t_max_err map_setFunction(t_map *obj, void *attr, long argc, t_atom *argv)
 {
 	obj->valid = false;	// prevent values from being processed by the function while it is in a state of flux


make all field names lower case without spaces when we hash them to make the prefixhash. since json names often have mixed case field names and spaces.

--- XmlDoc.cpp
+++ XmlDoc.cpp
@@ -29760,7 +29760,10 @@
 	long plen = 0;
 	if ( hi->m_prefix ) plen = gbstrlen ( hi->m_prefix );
 	if ( hi->m_prefix && plen ) {
-		prefixHash = hash64 ( hi->m_prefix , plen );
+		// we gotta make this case insensitive, and skip spaces
+		// because if it is 'focal length' we can't search
+		// 'focal length:10' because that comes across as TWO terms.
+		prefixHash = hash64Lower_utf8_nospaces ( hi->m_prefix , plen );
 		// . sanity test, make sure it is in supported list
 		// . hashing diffbot json output of course fails this so
 		//   skip in that case if diffbot
@@ -30331,7 +30334,7 @@
 	long nameLen = 0;
 	if ( hi->m_prefix ) nameLen = gbstrlen ( hi->m_prefix );
 	if ( hi->m_prefix && nameLen )
-		nameHash = hash64Lower_utf8 ( hi->m_prefix , nameLen );
+		nameHash = hash64Lower_utf8_nospaces( hi->m_prefix , nameLen );
 	// need a prefix for hashing numbers... for now
 	else { char *xx=NULL; *xx=0; }

@@ -30436,7 +30439,7 @@
 	long nameLen = 0;
 	if ( hi->m_prefix ) nameLen = gbstrlen ( hi->m_prefix );
 	if ( hi->m_prefix && nameLen )
-		nameHash = hash64Lower_utf8 ( hi->m_prefix , nameLen );
+		nameHash = hash64Lower_utf8_nospaces( hi->m_prefix , nameLen );
 	// need a prefix for hashing numbers... for now
 	else { char *xx=NULL; *xx=0; }


Allow negative error for Sk4f::sqrt() test.

BUG=skia:

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

--- tests/Sk4xTest.cpp
+++ tests/Sk4xTest.cpp
@@ -93,13 +93,13 @@
            roots(2,  4,  5,  11);
     // .sqrt() should be pretty precise.
     Sk4f error = roots.subtract(squares.sqrt());
-    REPORTER_ASSERT(r, error.greaterThanEqual(Sk4f(0.0f)).allTrue());
-    REPORTER_ASSERT(r, error.lessThan(Sk4f(0.000001f)).allTrue());
+    REPORTER_ASSERT(r, (error > Sk4f(-0.000001f)).allTrue());
+    REPORTER_ASSERT(r, (error < Sk4f(+0.000001f)).allTrue());

     // .rsqrt() isn't so precise (for SSE), but should be pretty close.
     error = roots.subtract(squares.multiply(squares.rsqrt()));
-    REPORTER_ASSERT(r, error.greaterThanEqual(Sk4f(0.0f)).allTrue());
-    REPORTER_ASSERT(r, error.lessThan(Sk4f(0.01f)).allTrue());
+    REPORTER_ASSERT(r, (error > Sk4f(-0.01f)).allTrue());
+    REPORTER_ASSERT(r, (error < Sk4f(+0.01f)).allTrue());
 }

 DEF_TEST(Sk4x_Comparison, r) {


Tweak a bit the logic in BlockVector::Update().

--- linalg/blockvector.cpp
+++ linalg/blockvector.cpp
@@ -79,24 +79,18 @@

 void BlockVector::Update(const Array<int> &bOffsets)
 {
+   blockOffsets = bOffsets.GetData();
    if (OwnsData())
    {
       // check if 'bOffsets' agree with the 'blocks'
       if (bOffsets.Size() == numBlocks+1)
       {
-         if (numBlocks == 0) { return; }
          for (int i = 0; true; i++)
          {
-            if (blocks[i].GetData() - data != bOffsets[i]) { break; }
-            if (i == numBlocks - 1)
-               if (blocks[numBlocks - 1].Size() ==
-                   bOffsets[numBlocks] - bOffsets[numBlocks - 1])
-               {
-                  blockOffsets = bOffsets.GetData();
-                  return;
-               }
-               else
-               { break; }
+            if (i >= numBlocks) { return; }
+            if (blocks[i].Size() != bOffsets[i+1] - bOffsets[i]) { break; }
+            MFEM_ASSERT(blocks[i].GetData() == data + bOffsets[i],
+                        "invalid blocks[" << i << ']');
          }
       }
    }
@@ -105,7 +99,6 @@
       Destroy();
    }
    SetSize(bOffsets.Last());
-   blockOffsets = bOffsets.GetData();
    if (numBlocks != bOffsets.Size()-1)
    {
       delete [] blocks;


removed unused variable

removed unused variable

--- source/imex_stepper.cc
+++ source/imex_stepper.cc
@@ -115,11 +115,6 @@

   unsigned int step_number = 0;

-  int status;
-
-  // The solution is stored in
-  // solution. Here we take only a
-  // view of it.

   auto previous_solution = interface.create_new_vector();
   auto solution_dot = interface.create_new_vector();


Fix dangling pointer bug when transitioning to background.

Dangling pointer left behind from the old rosalloc / dlmalloc
spaces. We now avoid using this pointer by using main_space_
and non_moving_space_ as well as clear the pointer when we remove
the space.

Bug: 16567203

(cherry picked from commit 00b5915828f89daaefd9e8fb215658360f76762c)

Change-Id: I5962929e4a0bb4db6f531d25ee322da7ab3f5dd4

--- runtime/gc/heap.cc
+++ runtime/gc/heap.cc
@@ -670,18 +670,11 @@
 }

 void Heap::MarkAllocStackAsLive(accounting::ObjectStack* stack) {
-  space::ContinuousSpace* space1 = rosalloc_space_ != nullptr ? rosalloc_space_ : non_moving_space_;
-  space::ContinuousSpace* space2 = dlmalloc_space_ != nullptr ? dlmalloc_space_ : non_moving_space_;
-  // This is just logic to handle a case of either not having a rosalloc or dlmalloc space.
+  space::ContinuousSpace* space1 = main_space_ != nullptr ? main_space_ : non_moving_space_;
+  space::ContinuousSpace* space2 = non_moving_space_;
   // TODO: Generalize this to n bitmaps?
-  if (space1 == nullptr) {
-    DCHECK(space2 != nullptr);
-    space1 = space2;
-  }
-  if (space2 == nullptr) {
-    DCHECK(space1 != nullptr);
-    space2 = space1;
-  }
+  CHECK(space1 != nullptr);
+  CHECK(space2 != nullptr);
   MarkAllocStack(space1->GetLiveBitmap(), space2->GetLiveBitmap(),
                  large_object_space_->GetLiveBitmap(), stack);
 }
@@ -1609,6 +1602,12 @@
         // Remove the main space so that we don't try to trim it, this doens't work for debug
         // builds since RosAlloc attempts to read the magic number from a protected page.
         RemoveSpace(main_space_);
+        // Unset the pointers just in case.
+        if (dlmalloc_space_ == main_space_) {
+          dlmalloc_space_ = nullptr;
+        } else if (rosalloc_space_ == main_space_) {
+          rosalloc_space_ = nullptr;
+        }
         RemoveRememberedSet(main_space_);
         RemoveRememberedSet(main_space_backup_.get());
         main_space_backup_.reset(nullptr);


Fixed missing overload for adjacency matrix reader

--- include/aleph/topology/io/AdjacencyMatrix.hh
+++ include/aleph/topology/io/AdjacencyMatrix.hh
@@ -92,6 +92,21 @@
       in,
       K,
       f
+    );
+  }
+
+  /** @overload operator()( const std::string&, SimplicialComplex& ) */
+  template <class SimplicialComplex> void operator()( std::istream& in, SimplicialComplex& K )
+  {
+    using Simplex    = typename SimplicialComplex::ValueType;
+    using DataType   = typename Simplex::DataType;
+
+    this->operator()(
+      in,
+      K,
+      // Use the identity functor so that weights are not changed at all
+      // and just stored as-is.
+      [] ( DataType /* a */, DataType /* b */, DataType x ) { return x; }
     );
   }


uncomment witness profile intialize

uncomment witness profile intialize

--- src/lib/database/data_base.cpp
+++ src/lib/database/data_base.cpp
@@ -228,11 +228,11 @@
         return false;
     }

-    // if (!initialize_witness_profiles(prefix)) {
-    //     log::error(LOG_DATABASE)
-    //         << "Failed to upgrade witness profile database.";
-    //     return false;
-    // }
+    if (!initialize_witness_profiles(prefix)) {
+        log::error(LOG_DATABASE)
+            << "Failed to upgrade witness profile database.";
+        return false;
+    }

     if (metadata.version_ != db_metadata::current_version) {
         // write new db version to metadata
@@ -627,8 +627,8 @@
         /* end database for account, asset, address_asset relationship */
         mits.create() &&
         address_mits.create() &&
-        mit_history.create()
-        // && witness_profiles.create()
+        mit_history.create() &&
+        witness_profiles.create()
         ;
 }


Всякие мелочи

Всякие мелочи

--- searchdialog.cpp
+++ searchdialog.cpp
@@ -444,7 +444,7 @@

     columns->resize(columns->size()-1);     // Убираем запятую в конце
     from->resize(from->size()-1);           // Убираем запятую в конце FROM
-    query->append("SELECT" + *columns + " FROM" + *from);
+    query->append("SELECT DISTINCT" + *columns + " FROM" + *from);

     if (!where->isEmpty())
         query->append(" WHERE " + *where);


changed the name

changed the name

--- src/lobby/pkcs5.cpp
+++ src/lobby/pkcs5.cpp
@@ -445,7 +445,7 @@
 {
 	char szHdrs[512];
 	sprintf(szHdrs,"USER: %s\r\n",szUser);
-	ZString Response = UTL::DoHTTP(szHdrs,"allegiancezone.com","GET","/lobbylogon.ashx","",0,true);
+	ZString Response = UTL::DoHTTP(szHdrs,"allegiancezone.com","GET","/lobbylogin.ashx","",0,true);
 	char * szToken;
 	char * szRes = (char*)_alloca(512);
 	Strcpy(szRes,(PCC)Response);


trace_processor: fix null vs 0 bug in thread table am: 1aa852a0ca
am: b0a6e82b0e

Change-Id: If8581356524df0c1936ffa689b65731422b06bf7

--- src/trace_processor/thread_table.cc
+++ src/trace_processor/thread_table.cc
@@ -108,7 +108,11 @@
       break;
     }
     case Column::kUpid: {
-      sqlite3_result_int64(context, thread.upid.value_or(0));
+      if (thread.upid.has_value()) {
+        sqlite3_result_int64(context, thread.upid.value());
+      } else {
+        sqlite3_result_null(context);
+      }
       break;
     }
     case Column::kName: {


Fix warning so Android ipc_tests builds again. (-Werror turned on in http://codereview.chromium.org/9288008)

BUG=None
TEST=

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

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

--- ipc/ipc_channel_posix.cc
+++ ipc/ipc_channel_posix.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.

@@ -968,7 +968,7 @@
     PLOG(ERROR) << "getsockopt " << pipe_;
     return false;
   }
-  if (cred_len < sizeof(cred)) {
+  if (static_cast<unsigned>(cred_len) < sizeof(cred)) {
     NOTREACHED() << "Truncated ucred from SO_PEERCRED?";
     return false;
   }


Added a TODO for unchecked delete_queue_errors in fsck.

--- src/fsck/checker.cc
+++ src/fsck/checker.cc
@@ -1175,6 +1175,11 @@
     bool dq_block_bad_magic;
     largebuf_error timestamp_buf;
     largebuf_error keys_buf;
+
+    // TODO: We don't do the timestamp key alignment checks below.
+    // The timestamps' offsets (after subtracting the primal_offset)
+    // must be aligned to key boundaries.  These next two variables
+    // are unused.
     std::vector<repli_timestamp> timestamp_key_alignment;
     int64_t bad_keysize_offset;
     int64_t primal_offset;    // Just for the fyi.


cycle tabcompletion, patch from Mathias Gumz

--- util/fbrun/FbRun.cc
+++ util/fbrun/FbRun.cc
@@ -19,7 +19,7 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.

-// $Id: FbRun.cc,v 1.23 2003/12/31 01:34:33 fluxgen Exp $
+// $Id: FbRun.cc,v 1.24 2004/02/25 18:37:47 fluxgen Exp $

 #include "FbRun.hh"

@@ -208,6 +208,7 @@
     // strip numlock, capslock and scrolllock mask
     ke.state = FbTk::KeyUtil::instance().cleanMods(ke.state);

+    int cp= cursorPosition();
     FbTk::TextBox::keyPressEvent(ke);
     KeySym ks;
     char keychar[1];
@@ -253,6 +254,7 @@
             break;
         case XK_Tab:
             tabCompleteHistory();
+            setCursorPosition(cp);
             break;
         }
     }
@@ -317,7 +319,9 @@
     } else {
         int history_item = m_current_history_item - 1;
         string prefix = text().substr(0, cursorPosition());
-        while (history_item > - 1) {
+        while (history_item != m_current_history_item ) {
+            if (history_item == -1 )
+                history_item+= m_history.size();
             if (m_history[history_item].find(prefix) == 0) {
                 m_current_history_item = history_item;
                 setText(m_history[m_current_history_item]);
@@ -325,7 +329,7 @@
             }
             history_item--;
         }
-        if (history_item == -1) XBell(m_display, 0);
+        if (history_item == m_current_history_item) XBell(m_display, 0);
     }
 }


Fixed a namespace scoping serialization bug (cyt instead of cyv) in array comprehensions.

--- Output.cpp
+++ Output.cpp
@@ -80,14 +80,14 @@
         if (const char *name = comprehension->Name())
             out << ',' << name;
     out << "){";
-    out << "$cyt=[];";
+    out << "$cyv=[];";
     comprehensions_->Output(out);
-    out << "$cyt.push(";
+    out << "$cyv.push(";
     expression_->Output(out, CYPA, CYNoFlags);
     out << ");";
     for (CYComprehension *comprehension(comprehensions_); comprehension != NULL; comprehension = comprehension->next_)
         comprehension->End_(out);
-    out << "return $cyt;";
+    out << "return $cyv;";
     out << "}())";
 }


More wrapper functions...

More wrapper functions...

--- linalg/lapack_wrap.hpp
+++ linalg/lapack_wrap.hpp
@@ -3,6 +3,7 @@

 #include "mkl.h"

+#include <functional>
 #include <stdexcept>

 extern "C" {
@@ -32,8 +33,26 @@

 // These are wrappers around lapack routines.
-
 namespace lapack {
+  // This is a wrapper around workspace queries.  The query function takes
+  // the work, lwork, and info variables and performs a workspace query.
+  // After the query, the work array is allocated.
+  template <typename Scalar>
+  void WorkspaceQueryAndAlloc(std::function<void (Scalar* &, int&, int&)> query_func,
+							  Scalar* &work, int& lwork, int& info) {
+	work = new Scalar[1];
+	lwork = -1;
+	query_func(work, lwork, info);
+	if (info != 0) {
+	  throw std::runtime_error("Bad workspace query");
+	}
+
+	// Now allocate the work array.
+	lwork = static_cast<int>(work[0]);
+	delete [] work;
+	work = new Scalar[lwork];
+  }
+

   void Trmm(char side, char uplo, char transt, char diag, int m, int n,
 			double alpha, double *T, int ldt, double *B, int ldb) {
@@ -61,18 +80,15 @@

   void Geqrf(int m, int n, float *A, int lda, float *tau) {
 	// First perform the workspace query.
-	float *work = new float[1];
-	int lwork = -1;
-	int info;
-	sgeqrf_(&m, &n, A, &lda, tau, work, &lwork, &info);
-	if (info != 0) {
-	  throw std::runtime_error("Bad sgeqrf_ call");
-	}
-
-	// Now allocate the work array.
-	lwork = static_cast<int>(work[0]);
-	delete [] work;
-	work = new float[lwork];
+	std::function<void (float* &, int&, int&)> query = [&] (float *work,
+															int& lwork,
+															int& info) {
+	  sgeqrf_(&m, &n, A, &lda, tau, work, &lwork, &info);
+	};
+	float *work;
+	int lwork;
+	int info;
+	WorkspaceQueryAndAlloc(query, work, lwork, info);

 	// QR routine that does the work.
 	sgeqrf_(&m, &n, A, &lda, tau, work, &lwork, &info);
@@ -85,18 +101,15 @@

   void Geqrf(int m, int n, double *A, int lda, double *tau) {
 	// First perform the workspace query.
-	double *work = new double[1];
-	int lwork = -1;
-	int info;
-	dgeqrf_(&m, &n, A, &lda, tau, work, &lwork, &info);
-	if (info != 0) {
-	  throw std::runtime_error("Bad dgeqrf_ call");
-	}
-
-	// Now allocate the work array.
-	lwork = static_cast<int>(work[0]);
-	delete [] work;
-	work = new double[lwork];
+	std::function<void (double* &, int&, int&)> query = [&] (double *work,
+															 int& lwork,
+															 int& info) {
+	  dgeqrf_(&m, &n, A, &lda, tau, work, &lwork, &info);
+	};
+	double *work;
+	int lwork;
+	int info;
+	WorkspaceQueryAndAlloc(query, work, lwork, info);

 	// QR routine that does the work.
 	dgeqrf_(&m, &n, A, &lda, tau, work, &lwork, &info);
@@ -157,6 +170,7 @@
 	}
   }

+
   void Getrs(char trans, int n, int nrhs, float *A, int lda, int *ipiv, float *b, int ldb) {
 	int info;
 	sgetrs_(&trans, &n, &nrhs, A, &lda, ipiv, b, &ldb, &info);
@@ -165,6 +179,49 @@
 	}
   }

+
+  void Ormqr(char side, char trans, int m, int n, int k, double *A, int lda,
+			 double *tau, double *C, int ldc) {
+	std::function<void (double* &, int&, int&)> query = [&] (double *work,
+															 int& lwork,
+															 int& info) {
+	  dormqr_(&side, &trans, &m, &n, &k, A, &lda, tau, C, &ldc,
+			  work, &lwork, &info);
+	};
+	double *work;
+	int lwork;
+	int info;
+	WorkspaceQueryAndAlloc(query, work, lwork, info);
+
+	dormqr_(&side, &trans, &m, &n, &k, A, &lda, tau, C, &ldc,
+			work, &lwork, &info);
+	if (info != 0) {
+	  throw std::runtime_error("Bad dormqr_ call");
+	}
+	delete [] work;
+  }
+
+
+  void Ormqr(char side, char trans, int m, int n, int k, float *A, int lda,
+			 float *tau, float *C, int ldc) {
+	std::function<void (float* &, int&, int&)> query = [&] (float *work,
+															 int& lwork,
+															 int& info) {
+	  sormqr_(&side, &trans, &m, &n, &k, A, &lda, tau, C, &ldc,
+			  work, &lwork, &info);
+	};
+	float *work;
+	int lwork;
+	int info;
+	WorkspaceQueryAndAlloc(query, work, lwork, info);
+
+	sormqr_(&side, &trans, &m, &n, &k, A, &lda, tau, C, &ldc,
+			work, &lwork, &info);
+	if (info != 0) {
+	  throw std::runtime_error("Bad dormqr_ call");
+	}
+	delete [] work;
+  }
 }  // end namespace lapack


Added missing include file.

Added missing include file.

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

--- samples/ThreadSafe/ThreadSafe.cpp
+++ samples/ThreadSafe/ThreadSafe.cpp
@@ -4,6 +4,7 @@

 #include <cassert>
+#include <ctime>
 #include <fstream>
 #include <iostream>
 #include <strstream>


Add extra logging for lock contention

Add extra logging for lock contention

When we get contention which is longer than kLongWaitMs (= 100ms) we
log to logcat.

Example output:
W/art     ( 9960): Long monitor contention event with owner method=void com.android.server.am.BroadcastQueue.processNextBroadcast(boolean) from BroadcastQueue.java:542 waiters=1 for 243ms

Bug: 17787391
Change-Id: Id1f92d9c41ec909d221871ecc2ff6181dcec2ed4

--- runtime/monitor.cc
+++ runtime/monitor.cc
@@ -35,6 +35,8 @@
 #include "well_known_classes.h"

 namespace art {
+
+static constexpr uint64_t kLongWaitMs = 100;

 /*
  * Every Object has a monitor associated with it, but not every Object is actually locked.  Even
@@ -250,6 +252,7 @@
     mirror::ArtMethod* owners_method = locking_method_;
     uint32_t owners_dex_pc = locking_dex_pc_;
     // Do this before releasing the lock so that we don't get deflated.
+    size_t num_waiters = num_waiters_;
     ++num_waiters_;
     monitor_lock_.Unlock(self);  // Let go of locks in order.
     self->SetMonitorEnterObject(GetObject());
@@ -271,6 +274,12 @@
             const char* owners_filename;
             uint32_t owners_line_number;
             TranslateLocation(owners_method, owners_dex_pc, &owners_filename, &owners_line_number);
+            if (wait_ms > kLongWaitMs && owners_method != nullptr) {
+              LOG(WARNING) << "Long monitor contention event with owner method="
+                  << PrettyMethod(owners_method) << " from " << owners_filename << ":"
+                  << owners_line_number << " waiters=" << num_waiters << " for "
+                  << PrettyDuration(MsToNs(wait_ms));
+            }
             LogContentionEvent(self, wait_ms, sample_percent, owners_filename, owners_line_number);
           }
         }


changed fov to float

changed fov to float

--- include/depthai-shared/common/CameraInfo.hpp
+++ include/depthai-shared/common/CameraInfo.hpp
@@ -9,7 +9,7 @@
     std::vector<std::vector<float>> intrinsicMatrix;
     std::vector<float> distortionCoeff;
     Extrinsics extrinsics;
-    double measuredFovDeg;  // fov in deg
+    float measuredFovDeg;  // fov in deg
     // TODO(sachin): Should I add type of distortion model here ?
     NLOHMANN_DEFINE_TYPE_INTRUSIVE(CameraInfo, intrinsicMatrix, width, height, distortionCoeff, extrinsics, measuredFovDeg);
 };


Fixed bug that broke base only planning

Fixed bug that broke base only planning

--- src/trajopt/configuration_space.cpp
+++ src/trajopt/configuration_space.cpp
@@ -14,7 +14,8 @@
     OR::Transform T;
     OR::RaveGetTransformFromAffineDOFValues(T, dofs.begin()+joint_inds.size(), affinedofs, rotationaxis, true);
     robot->SetTransform(T);
-    robot->SetDOFValues(dofs, false, joint_inds);
+    if (joint_inds.size() > 0)
+      robot->SetDOFValues(dofs, false, joint_inds);
   }
   else {
     robot->SetDOFValues(dofs, false, joint_inds);
@@ -23,7 +24,8 @@

 DblVec RobotAndDOF::GetDOFValues() {
   DblVec out;
-  robot->GetDOFValues(out, joint_inds);
+  if (joint_inds.size() > 0):
+    robot->GetDOFValues(out, joint_inds);
   if (affinedofs != 0) {
     out.resize(GetDOF());
     OR::Transform T = robot->GetTransform();
@@ -40,7 +42,8 @@
 }

 void RobotAndDOF::GetDOFLimits(DblVec& lower, DblVec& upper) const {
-  robot->GetDOFLimits(lower, upper, joint_inds);
+  if (joint_inds.size() > 0)
+    robot->GetDOFLimits(lower, upper, joint_inds);
   const int translation_dofs[3] = {DOF_X, DOF_Y, DOF_Z};
   for (int i=0; i < 3; ++i) {
     if (affinedofs & translation_dofs[i]) {


Fix crash on saving recursive patches (don't load yet though).

git-svn-id: 0c12d7dd8c1ea2d70f3066f15e3a34dd5ccac610@432 a436a847-0d15-0410-975c-d299462d15a1

--- src/libs/client/Serializer.cpp
+++ src/libs/client/Serializer.cpp
@@ -219,7 +219,11 @@

 	for (NodeModelMap::const_iterator n = patch->nodes().begin(); n != patch->nodes().end(); ++n) {
 		_writer.write(patch_id, NS_INGEN("node"), path_to_node_id(n->second->path()));
-		serialize_node(n->second, depth+1);
+		SharedPtr<PatchModel> patch = PtrCast<PatchModel>(n->second);
+		if (patch)
+			serialize_patch(patch, depth+1);
+		else
+			serialize_node(n->second, depth+1);
 	}

 	for (PortModelList::const_iterator p = patch->ports().begin(); p != patch->ports().end(); ++p) {