Remove leftover debug messages from cwop-particle.cpp

--- firmware/cwop-particle.cpp
+++ firmware/cwop-particle.cpp
@@ -19,9 +19,6 @@

 void CWOP_Particle::begin(Client &client)
 {
-#ifdef PRINT_DEBUG_MESSAGES
-  Serial.print("cwop::cwopBegin");
-#endif
   this->setClient(&client);
 }

@@ -74,9 +71,6 @@
   connectSuccess = this->client->connect(CWOP_SERVER, CWOP_PORTNUMBER);
   if (!connectSuccess)
   {
-#ifdef PRINT_DEBUG_MESSAGES
-    Serial.print("Failed. Try default IP...");
-#endif
     connectSuccess = this->client->connect(CWOP_IPADDRESS, CWOP_PORTNUMBER);
   }

@@ -247,7 +241,9 @@
   if (this->client->available() > 0)
   {
     String connect_msg = this->client->readStringUntil('\r');
-    Particle.publish(PARTICLE_PUBLISH_TOPIC, connect_msg, PARTICLE_PUBLISH_TTL, PRIVATE);
+#ifdef PRINT_DEBUG_MESSAGES
+    Particle.publish(PARTICLE_PUBLISH_TOPIC, String("received message: " + connect_msg), PARTICLE_PUBLISH_TTL, PRIVATE);
+#endif
   }

   this->client->stop();
@@ -262,4 +258,4 @@
   Particle.publish(PARTICLE_PUBLISH_TOPIC, "Aborted packet!", PARTICLE_PUBLISH_TTL, PRIVATE);
 #endif
   return ERR_UNEXPECTED_FAIL;
-}+}


[Diagnostics] Fix `missing argument` diagnostic to support closures with captures

--- lib/Sema/CSDiagnostics.cpp
+++ lib/Sema/CSDiagnostics.cpp
@@ -3504,7 +3504,11 @@
         path.back().getKind() == ConstraintLocator::ContextualType))
     return false;

-  if (auto *closure = dyn_cast<ClosureExpr>(getAnchor()))
+  auto *anchor = getAnchor();
+  if (auto *captureList = dyn_cast<CaptureListExpr>(anchor))
+    anchor = captureList->getClosureBody();
+
+  if (auto *closure = dyn_cast<ClosureExpr>(anchor))
     return diagnoseTrailingClosure(closure);

   return false;


Assert that a valid operator new/delete signature is always found by the coroutine body

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

--- lib/Sema/SemaCoroutine.cpp
+++ lib/Sema/SemaCoroutine.cpp
@@ -912,7 +912,9 @@
                               OperatorNew, UnusedResult);
   }

-  if (OperatorNew && RequiresNoThrowAlloc) {
+  assert(OperatorNew && "expected definition of operator new to be found");
+
+  if (RequiresNoThrowAlloc) {
     const auto *FT = OperatorNew->getType()->getAs<FunctionProtoType>();
     if (!FT->isNothrow(S.Context, /*ResultIfDependent*/ false)) {
       S.Diag(OperatorNew->getLocation(),
@@ -924,9 +926,6 @@
     }
   }

-  // FIXME: Diagnose and handle the case where no matching operator new is found
-  //  (ie OperatorNew == nullptr)
-
   if ((OperatorDelete = findDeleteForPromise(S, Loc, PromiseType)) == nullptr)
     return false;


Fixed bug HARMONY-4993
[drlvm][jvmti][regression] EUT v3.3 testStepping failed on r586707

When method is not yet resolved there is no way to find out what
invokevirtual calls. So nothing should be done until method is compiled

svn path=/harmony/; revision=587466

--- enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp
+++ enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp
@@ -541,9 +541,15 @@
             // Call through a register, it has to point to the address of a compiled method
             NativeCodePtr ip = disasm->get_target_address_from_context(&regs);
             CodeChunkInfo *cci = vm_env->vm_methods->find(ip);
-            assert(cci);
-            method = cci->get_method();
-            assert(method->get_state() == Method::ST_Compiled);
+            if (NULL != cci)
+            {
+                // Compiled method, set bytecode in it
+                method = cci->get_method();
+                assert(method->get_state() == Method::ST_Compiled);
+            }
+            else
+                // Method is not compiled, nothing to do
+                method = NULL;
         }
     }
     else if (bytecode == OPCODE_INVOKEINTERFACE)
@@ -584,7 +590,8 @@
     // The determined method is the one which is called by
     // invokevirtual or invokeinterface bytecodes. It should be
     // started to be single stepped from the beginning
-    jvmti_set_single_step_breakpoints_for_method(ti, jvmti_thread, method);
+    if (NULL != method)
+        jvmti_set_single_step_breakpoints_for_method(ti, jvmti_thread, method);
 #else
     NOT_IMPLEMENTED;
 #endif


Teach sema to synthesize the getter/setter for willSet/didSet properties,
we have basic functionality now.

Swift SVN r13054

--- lib/Sema/TypeCheckDecl.cpp
+++ lib/Sema/TypeCheckDecl.cpp
@@ -1193,7 +1193,6 @@
   VarDecl *SelfDecl = nullptr;

   auto *Get = createGetterPrototype(VD, SelfDecl);
-  Get->setIsObjC(true);

   // Create (return (member_ref_expr(decl_ref_expr(self), VD)))
   auto *DRE = new (Context) DeclRefExpr(SelfDecl, SourceLoc(),/*implicit*/true);
@@ -1207,9 +1206,6 @@
   VarDecl *ValueDecl = nullptr;

   auto *Set = createSetterPrototype(VD, SelfDecl, ValueDecl);
-
-  // Self comes in at +0 for this accessor.
-  Set->setIsObjC(true);

   // Create (assign (member_ref_expr(decl_ref_expr(self), VD)),
   //                decl_ref_expr(value))
@@ -1234,6 +1230,87 @@
   members.push_back(Set);
   CD->setMembers(Context.AllocateCopy(members), CD->getBraces());
 }
+
+/// Given a VarDecl with a willSet: and/or didSet: specifier, synthesize the
+/// (trivial) getter and the setter, which calls these.
+static void synthesizeWillSetDidSetAccessors(VarDecl *VD) {
+  assert(VD->getStorageKind() == VarDecl::WillSetDidSet);
+  assert(!VD->getGetter() && !VD->getSetter() &&
+         "willSet/didSet var already has a getter or setter");
+
+  auto &Ctx = VD->getASTContext();
+  SourceLoc Loc = VD->getLoc();
+
+  VarDecl *SelfDecl = nullptr;
+
+  /// The getter is always trivial: just perform a (direct!) load of storage.
+  auto *Get = createGetterPrototype(VD, SelfDecl);
+
+  // Create (return (member_ref_expr(decl_ref_expr(self), VD)))
+  auto *DRE = new (Ctx) DeclRefExpr(SelfDecl, SourceLoc(),/*implicit*/true);
+  auto *MRE = new (Ctx) MemberRefExpr(DRE, SourceLoc(), VD, SourceLoc(),
+                                      /*implicit*/true,/*direct ivar*/true);
+  ASTNode Return = new (Ctx) ReturnStmt(SourceLoc(), MRE, /*implicit*/true);
+  Get->setBody(BraceStmt::create(Ctx, Loc, Return, Loc));
+
+
+  // Okay, the getter is done, create the setter now.
+  VarDecl *ValueDecl = nullptr;
+  auto *Set = createSetterPrototype(VD, SelfDecl, ValueDecl);
+
+  // The setter invokes willSet with the incoming value, then does a direct
+  // store, then invokes didSet.
+  SmallVector<ASTNode, 3> SetterBody;
+
+  // Create: (call_expr (dot_syntax_call_expr (decl_ref_expr(willSet)),
+  //                                          (decl_ref_expr(self))),
+  //                    (declrefexpr(value)))
+  if (VD->getWillSetFunc()) {
+    auto *WillSetDRE = new (Ctx) DeclRefExpr(VD->getWillSetFunc(),
+                                             SourceLoc(), /*imp*/true);
+    auto *SelfDRE = new (Ctx) DeclRefExpr(SelfDecl, SourceLoc(), /*imp*/true);
+    auto *DSCE = new (Ctx) DotSyntaxCallExpr(WillSetDRE, SourceLoc(), SelfDRE);
+    auto *ValueDRE = new (Ctx) DeclRefExpr(ValueDecl, SourceLoc(), true);
+    SetterBody.push_back(new (Ctx) CallExpr(DSCE, ValueDRE, true));
+  }
+
+  // Create (assign (member_ref_expr(decl_ref_expr(self), VD)),
+  //                decl_ref_expr(value))
+  auto *SelfDRE = new (Ctx) DeclRefExpr(SelfDecl, SourceLoc(), /*imp*/true);
+  auto *ValueDRE = new (Ctx) DeclRefExpr(ValueDecl, SourceLoc(), true);
+  MRE = new (Ctx) MemberRefExpr(SelfDRE, SourceLoc(), VD, SourceLoc(),
+                                    /*implicit*/true, /*direct ivar*/true);
+  SetterBody.push_back(new (Ctx) AssignExpr(MRE, SourceLoc(),
+                                                ValueDRE, true));
+
+  // Create: (call_expr (dot_syntax_call_expr (decl_ref_expr(didSet)),
+  //                                          (decl_ref_expr(self))),
+  //                    (tuple_expr()))
+  if (VD->getDidSetFunc()) {
+    auto *DidSetDRE = new (Ctx) DeclRefExpr(VD->getDidSetFunc(),
+                                            SourceLoc(), /*imp*/true);
+    auto *SelfDRE = new (Ctx) DeclRefExpr(SelfDecl, SourceLoc(), /*imp*/true);
+    auto *DSCE = new (Ctx) DotSyntaxCallExpr(DidSetDRE, SourceLoc(), SelfDRE);
+    auto *Tuple = new (Ctx) TupleExpr(SourceLoc(), {}, nullptr, SourceLoc(),
+                                      /*trailing closure*/false, /*impl*/true);
+    SetterBody.push_back(new (Ctx) CallExpr(DSCE, Tuple, true));
+  }
+
+  Set->setBody(BraceStmt::create(Ctx, Loc, SetterBody, Loc));
+
+
+  VD->setDidSetWillSetAccessors(Get, Set);
+
+  // We've added some members to our containing class, add them to the members
+  // list.
+  auto *NTD = cast<NominalTypeDecl>(VD->getDeclContext());
+  SmallVector<Decl*, 4> members(NTD->getMembers().begin(),
+                                NTD->getMembers().end());
+  members.push_back(Get);
+  members.push_back(Set);
+  NTD->setMembers(Ctx.AllocateCopy(members), NTD->getBraces());
+}
+

 namespace {

@@ -1344,8 +1421,8 @@
         TC.typeCheckDecl(VD->getGetter(), true);
       }

-      // If this is a stored ObjC ivar and should have an objc getter and
-      // setter, then change its storage kind to reflect that.
+      // If this is a stored ObjC property and should have an objc getter and
+      // setter, then synthesize the accessors and change its storage kind.
       if (VD->getStorageKind() == VarDecl::Stored &&
           VD->usesObjCGetterAndSetter() &&
           // FIXME: properties in protocols should not be modeled as stored
@@ -1358,6 +1435,15 @@
         TC.typeCheckDecl(VD->getSetter(), true);
       }

+      // If this is a willSet/didSet property, synthesize the getter and setter
+      // decl.
+      if (VD->getStorageKind() == VarDecl::WillSetDidSet && !VD->getGetter()) {
+        synthesizeWillSetDidSetAccessors(VD);
+
+        // Type check the body of the getter and setter.
+        TC.typeCheckDecl(VD->getGetter(), true);
+        TC.typeCheckDecl(VD->getSetter(), true);
+      }
       return;
     }


improve our computation of 'let'ness of self decls to know that
'self' on a value type should be immutable when it isn't lowered
to an lvalue.  Right now, it is always lowered to an lvalue, so
NFC.

Swift SVN r11287

--- lib/Sema/TypeCheckDecl.cpp
+++ lib/Sema/TypeCheckDecl.cpp
@@ -1734,8 +1734,10 @@
     if (Type selfType = FD->computeSelfType(&outerGenericParams)) {
       auto SelfDecl = FD->getImplicitSelfDecl();
       SelfDecl->setType(selfType);
-      if (!selfType->hasReferenceSemantics())
-        SelfDecl->setLet(false);
+      // 'self' is let for reference types (i.e., classes) or when 'self' is
+      // lowered to the type itself.  It is mutable when lowered to an lvalue.
+      SelfDecl->setLet(selfType->hasReferenceSemantics() ||
+                       !selfType->is<LValueType>());

       TypedPattern *selfPattern =
           cast<TypedPattern>(FD->getArgParamPatterns()[0]);
@@ -1985,8 +1987,8 @@
     Type ResultTy = SelfTy->getRValueType();
     auto SelfDecl = CD->getImplicitSelfDecl();
     SelfDecl->setType(SelfTy);
-    if (!SelfTy->hasReferenceSemantics())
-      SelfDecl->setLet(false);
+    SelfDecl->setLet(SelfTy->hasReferenceSemantics() ||
+                     !SelfTy->is<LValueType>());

     Optional<ArchetypeBuilder> builder;
     if (auto gp = CD->getGenericParams()) {
@@ -2122,8 +2124,8 @@
     DD->setType(FnTy);
     auto SelfDecl = DD->getImplicitSelfDecl();
     SelfDecl->setType(SelfTy);
-    if (SelfTy->is<LValueType>())
-      SelfDecl->setLet(false);
+    SelfDecl->setLet(SelfTy->hasReferenceSemantics() ||
+                     !SelfTy->is<LValueType>());

     // Destructors are always @objc, because their Objective-C entry point is
     // -dealloc.


Put overhead adjustment before ticks_only, so it does not need to be adjusted anymore

Former-commit-id: b2ce53e63abeeca5ae636b139fb6b7bc1654c604

--- util/HalideProf.cpp
+++ util/HalideProf.cpp
@@ -130,8 +130,6 @@
   int64_t AdjustOverhead(OpInfo& op_info, ChildMap& child_map, double overhead_ticks_avg) {
     int64_t overhead_ticks = op_info.count * overhead_ticks_avg;

-    op_info.ticks_only -= overhead_ticks;
-
     std::string qual_name = qualified_name(op_info.op_type, op_info.op_name);
     const std::vector<OpInfo*>& children = child_map[qual_name];
     for (std::vector<OpInfo*>::const_iterator it = children.begin(); it != children.end(); ++it) {
@@ -172,6 +170,11 @@
       child_map[parent_qual_name].push_back(&op_info);
     }

+    if (adjust_for_overhead) {
+      // Adjust values to account for profiling overhead
+      AdjustOverhead(total, child_map, overhead_ticks_avg);
+    }
+
     for (OpInfoMap::iterator o = op_info_map.begin(); o != op_info_map.end(); ++o) {
       OpInfo& op_info = o->second;
       op_info.ticks_only = op_info.ticks;
@@ -180,11 +183,6 @@
         OpInfo* c = *it;
         op_info.ticks_only -= c->ticks;
       }
-    }
-
-    if (adjust_for_overhead) {
-      // Adjust values to account for profiling overhead
-      AdjustOverhead(total, child_map, overhead_ticks_avg);
     }

     // Calc the derived fields


Followup fix for off-by-one error inHalideProf.cpp

--- util/HalideProf.cpp
+++ util/HalideProf.cpp
@@ -89,7 +89,9 @@
     // for each line; just check all the words on the line.
     int first = -1;
     // We know v.size() >= 8 due to earlier check, so this will never underflow.
-    for (int i = 0; i < v.size() - 8; ++i) {
+    // This is size-7 (rather than size-8) since we expect 7 entries *after*
+    // we find the halide_profiler keyword.
+    for (int i = 0; i < v.size() - 7; ++i) {
       if (v[i] == "halide_profiler") {
         first = i;
         break;


ir_constant_folding: Look at instructions in functions.

This was broken in the ir_label -> ir_function rework.

--- ir_constant_folding.cpp
+++ ir_constant_folding.cpp
@@ -91,7 +91,10 @@
 void
 ir_constant_folding_visitor::visit(ir_function *ir)
 {
-   (void) ir;
+   foreach_iter(exec_list_iterator, iter, *ir) {
+      ir_function_signature *const sig = (ir_function_signature *) iter.get();
+      sig->accept(this);
+   }
 }

 void


Reduce test time for searchcore_attributeflush_test_app.

--- searchcore/src/tests/proton/attribute/attributeflush_test.cpp
+++ searchcore/src/tests/proton/attribute/attributeflush_test.cpp
@@ -532,12 +532,12 @@
         IFlushTarget::SP ft = am.getFlushable("a9");
         EXPECT_EQUAL(seconds(stat._modifiedTime), duration_cast<seconds>(ft->getLastFlushTime().time_since_epoch()));
         { // updated flush time after nothing to flush
-            std::this_thread::sleep_for(8000ms);
+            std::this_thread::sleep_for(1100ms);
             std::chrono::seconds now = duration_cast<seconds>(vespalib::system_clock::now().time_since_epoch());
             Executor::Task::UP task = ft->initFlush(200, std::make_shared<search::FlushToken>());
             EXPECT_FALSE(task);
             EXPECT_LESS(seconds(stat._modifiedTime), ft->getLastFlushTime().time_since_epoch());
-            EXPECT_APPROX(now.count(), duration_cast<seconds>(ft->getLastFlushTime().time_since_epoch()).count(), 8);
+            EXPECT_APPROX(now.count(), duration_cast<seconds>(ft->getLastFlushTime().time_since_epoch()).count(), 3);
         }
     }
 }


timestamp parsing - cleanup

timestamp parsing - cleanup

--- ext/result.cc
+++ ext/result.cc
@@ -182,10 +182,14 @@
     else if (*zone) {
       if (strncasecmp(zone, "UTC", 3) == 0 || strncasecmp(zone, "GMT", 3) == 0)
         offset = 0;
-      else if (sscanf(zone, "%03d%02d",  &tzhour, &tzmin) < 2 && sscanf(zone, "%03d:%02d", &tzhour, &tzmin) < 1)
+      else if (strcmp(zone, "+00:00") == 0 || strcmp(zone, "+0000") == 0)
+        offset = 0;
+      else if (sscanf(zone, "%c%02d%02d",  &tzsign, &tzhour, &tzmin) == 3)
+        offset = tzsign == '+' ? (time_t)tzhour*3600 + (time_t)tzmin*60 : -1*((time_t)tzhour*3600 + (time_t)tzmin*60);
+      else if (sscanf(zone, "%c%02d:%02d", &tzsign, &tzhour, &tzmin) >= 2)
+        offset = tzsign == '+' ? (time_t)tzhour*3600 + (time_t)tzmin*60 : -1*((time_t)tzhour*3600 + (time_t)tzmin*60);
+      else
         offset = server_tzoffset(&tm, zone);
-      else
-        offset = tzhour*3600 + tzmin*60*tzhour/abs(tzhour);
     }

     return rb_time_new(epoch+adjust-offset, (uint64_t)(sec_fraction*1000000L));


investigating crash (only in matlab mex, only in debug) related to notify_one call

git-svn-id: 767549f2a3626ae39d79f5348867a3ebb5082aca@2923 c7283977-0100-402a-a91a-fa70b306dbfe

--- software/perception/world_model/maps/src/ViewClient.cpp
+++ software/perception/world_model/maps/src/ViewClient.cpp
@@ -89,8 +89,8 @@
       return false;
     }
     mState = StateRunning;
+    lock.unlock();
     mCondition.notify_one();
-    lock.unlock();
     mOctreeSubscription = mBotWrapper->getLcm()->
       subscribe(mClient->mOctreeChannel, &Worker::onOctree, this);
     mCloudSubscription = mBotWrapper->getLcm()->


added NaN test for operator_unary_not

added NaN test for operator_unary_not

--- src/test/unit-agrad-rev/operators/operator_unary_not_test.cpp
+++ src/test/unit-agrad-rev/operators/operator_unary_not_test.cpp
@@ -8,3 +8,8 @@
   AVAR b(0.0);
   EXPECT_EQ(1, !b);
 }
+
+TEST(AgradRev,not_nan) {
+  stan::agrad::var nan = std::numeric_limits<double>::quiet_NaN();
+  EXPECT_FALSE(!nan);
+}


Throw an warning when the log is broken

Throw an warning when the log is broken

The log might be broken because the program did not exit normally. We
tolerate this situation by parsing as much log as possible.

--- lib/Utils/LogProcessor.cpp
+++ lib/Utils/LogProcessor.cpp
@@ -90,7 +90,14 @@
   }
   errs() << "\n";

-  assert(NumBytesRead == FileSize && "The file is not completely read.");
+  assert(NumBytesRead <= FileSize);
+  if (NumBytesRead < FileSize) {
+    errs().changeColor(raw_ostream::RED);
+    errs() << "The log file is broken, probably because ";
+    errs() << "the instrumented program might not exit normally. ";
+    errs() << "Try to process as much log as possible.\n";
+    errs().resetColor();
+  }

   fclose(LogFile);
 }


Beautify.

Beautify.

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

--- lib/VMCore/PassManager.cpp
+++ lib/VMCore/PassManager.cpp
@@ -2,7 +2,7 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
+// This file was developed by Devang Patel  and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
@@ -13,14 +13,13 @@

 #include "llvm/PassManager.h"
-#include "llvm/Function.h"
 #include "llvm/Module.h"

 using namespace llvm;

 // PassManagerAnalysisHelper implementation

-/// Return TRUE IFF pass P's required analysis set does not required new
+/// Return true IFF pass P's required analysis set does not required new
 /// manager.
 bool PassManagerAnalysisHelper::manageablePass(Pass *P) {

@@ -33,7 +32,7 @@
   return true;
 }

-/// Return TRUE iff AnalysisID AID is currently available.
+/// Return true IFF AnalysisID AID is currently available.
 bool PassManagerAnalysisHelper::analysisCurrentlyAvailable(AnalysisID AID) {

   // TODO
@@ -60,10 +59,10 @@

 /// BasicBlockPassManager implementation

-/// Add pass P into PassVector and return TRUE. If this pass is not
-/// manageable by this manager then return FALSE.
-bool
-BasicBlockPassManager_New::addPass (Pass *P) {
+/// Add pass P into PassVector and return true. If this pass is not
+/// manageable by this manager then return false.
+bool
+BasicBlockPassManager_New::addPass(Pass *P) {

   BasicBlockPass *BP = dynamic_cast<BasicBlockPass*>(P);
   if (!BP)
@@ -71,7 +70,7 @@

   // If this pass does not preserve anlysis that is used by other passes
   // managed by this manager than it is not a suiable pass for this manager.
-  if (!manageablePass (P))
+  if (!manageablePass(P))
     return false;

   // Take a note of analysis required by this pass.
@@ -101,14 +100,13 @@

 // FunctionPassManager_New implementation

-///////////////////////////////////////////////////////////////////////////////
 // FunctionPassManager

 /// Add pass P into the pass manager queue. If P is a BasicBlockPass then
 /// either use it into active basic block pass manager or create new basic
 /// block pass manager to handle pass P.
 bool
-FunctionPassManager_New::addPass (Pass *P) {
+FunctionPassManager_New::addPass(Pass *P) {

   // If P is a BasicBlockPass then use BasicBlockPassManager_New.
   if (BasicBlockPass *BP = dynamic_cast<BasicBlockPass*>(P)) {
@@ -119,8 +117,8 @@
       activeBBPassManager = new BasicBlockPassManager_New();

       PassVector.push_back(activeBBPassManager);
-      assert (!activeBBPassManager->addPass(BP) &&
-              "Unable to add Pass");
+      if (!activeBBPassManager->addPass(BP))
+        assert(0 && "Unable to add Pass");
     }
     return true;
   }
@@ -131,7 +129,7 @@

   // If this pass does not preserve anlysis that is used by other passes
   // managed by this manager than it is not a suiable pass for this manager.
-  if (!manageablePass (P))
+  if (!manageablePass(P))
     return false;

   // Take a note of analysis required by this pass.
@@ -163,10 +161,10 @@
 // ModulePassManager implementation

 /// Add P into pass vector if it is manageble. If P is a FunctionPass
-/// then use FunctionPassManager_New to manage it. Return FALSE if P
+/// then use FunctionPassManager_New to manage it. Return false if P
 /// is not manageable by this manager.
 bool
-ModulePassManager_New::addPass (Pass *P) {
+ModulePassManager_New::addPass(Pass *P) {

   // If P is FunctionPass then use function pass maanager.
   if (FunctionPass *FP = dynamic_cast<FunctionPass*>(P)) {
@@ -179,8 +177,8 @@
       activeFunctionPassManager = new FunctionPassManager_New();

       PassVector.push_back(activeFunctionPassManager);
-      assert (!activeFunctionPassManager->addPass(FP) &&
-              "Unable to add Pass");
+      if (!activeFunctionPassManager->addPass(FP))
+        assert(0 && "Unable to add pass");
     }
     return true;
   }
@@ -191,7 +189,7 @@

   // If this pass does not preserve anlysis that is used by other passes
   // managed by this manager than it is not a suiable pass for this manager.
-  if (!manageablePass (P))
+  if (!manageablePass(P))
     return false;

   // Take a note of analysis required by this pass.
@@ -235,7 +233,7 @@
 /// Add P into active pass manager or use new module pass manager to
 /// manage it.
 bool
-PassManager_New::addPass (Pass *P) {
+PassManager_New::addPass(Pass *P) {

   if (!activeManager) {
     activeManager = new ModulePassManager_New();


[exotica_core_task_maps] test_maps: Add collision links to the URDF

--- exotations/exotica_core_task_maps/test/test_maps.cpp
+++ exotations/exotica_core_task_maps/test/test_maps.cpp
@@ -78,7 +78,7 @@

 using namespace exotica;

-static const std::string urdf_string_ = "<robot name=\"test_robot\"><link name=\"base\"><visual><geometry><cylinder length=\"0.3\" radius=\"0.2\"/></geometry><origin xyz=\"0 0 0.15\"/></visual></link><link name=\"link1\"> <inertial><mass value=\"0.2\"/><origin xyz=\"0 0 0.1\"/><inertia ixx=\"0.00381666666667\" ixy=\"0\" ixz=\"0\" iyy=\"0.0036\" iyz=\"0\" izz=\"0.00381666666667\"/></inertial><visual><geometry><cylinder length=\"0.15\" radius=\"0.05\"/></geometry><origin xyz=\"0 0 0.075\"/></visual> </link><link name=\"link2\"><inertial><mass value=\"0.2\"/><origin xyz=\"0 0 0.1\"/><inertia ixx=\"0.00381666666667\" ixy=\"0\" ixz=\"0\" iyy=\"0.0036\" iyz=\"0\" izz=\"0.00381666666667\"/></inertial><visual><geometry><cylinder length=\"0.35\" radius=\"0.05\"/></geometry><origin xyz=\"0 0 0.175\"/></visual> </link><link name=\"link3\"><inertial><mass value=\"0.2\"/><origin xyz=\"0 0 0.1\"/><inertia ixx=\"0.00381666666667\" ixy=\"0\" ixz=\"0\" iyy=\"0.0036\" iyz=\"0\" izz=\"0.00381666666667\"/></inertial><visual><geometry><cylinder length=\"0.45\" radius=\"0.05\"/></geometry><origin xyz=\"0 0 0.225\"/></visual></link><link name=\"endeff\"><inertial><mass value=\"0.2\"/><origin xyz=\"0 0 0.1\"/><inertia ixx=\"0.00381666666667\" ixy=\"0\" ixz=\"0\" iyy=\"0.0036\" iyz=\"0\" izz=\"0.00381666666667\"/></inertial><visual><geometry><cylinder length=\"0.05\" radius=\"0.1\"/></geometry><origin xyz=\"0 0 -0.025\"/></visual></link><joint name=\"joint1\" type=\"revolute\"><parent link=\"base\"/><child link=\"link1\"/><origin xyz=\"0 0 0.3\" rpy=\"0 0 0\" /><axis xyz=\"0 0 1\" /><limit effort=\"200\"  velocity=\"1.0\" lower=\"-0.4\" upper=\"0.4\"/><safety_controller k_position=\"30\" k_velocity=\"30\" soft_lower_limit=\"-0.4\" soft_upper_limit=\"0.4\"/></joint><joint name=\"joint2\" type=\"revolute\"><parent link=\"link1\"/><child link=\"link2\"/><origin xyz=\"0 0 0.15\" rpy=\"0 0 0\" /><axis xyz=\"0 1 0\" /><limit effort=\"200\"  velocity=\"1.0\" lower=\"-0.4\" upper=\"0.4\"/><safety_controller k_position=\"30\" k_velocity=\"30\" soft_lower_limit=\"-0.4\" soft_upper_limit=\"0.4\"/></joint><joint name=\"joint3\" type=\"revolute\"><parent link=\"link2\"/><child link=\"link3\"/><origin xyz=\"0 0 0.35\" rpy=\"0 0 0\" /><axis xyz=\"0 1 0\" /><limit effort=\"200\"  velocity=\"1.0\" lower=\"-0.4\" upper=\"0.4\"/><safety_controller k_position=\"30\" k_velocity=\"30\" soft_lower_limit=\"-0.4\" soft_upper_limit=\"0.4\"/></joint><joint name=\"joint4\" type=\"fixed\"><parent link=\"link3\"/><child link=\"endeff\"/><origin xyz=\"0 0 0.45\" rpy=\"0 0 0\" /></joint></robot>";
+static const std::string urdf_string_ = "<robot name=\"test_robot\"><link name=\"base\"><visual><geometry><cylinder length=\"0.3\" radius=\"0.2\"/></geometry><origin xyz=\"0 0 0.15\"/></visual><collision><geometry><cylinder length=\"0.3\" radius=\"0.2\"/></geometry><origin xyz=\"0 0 0.15\"/></collision></link><link name=\"link1\"><inertial><mass value=\"0.2\"/><origin xyz=\"0 0 0.1\"/><inertia ixx=\"0.00381666666667\" ixy=\"0\" ixz=\"0\" iyy=\"0.0036\" iyz=\"0\" izz=\"0.00381666666667\"/></inertial><visual><geometry><cylinder length=\"0.15\" radius=\"0.05\"/></geometry><origin xyz=\"0 0 0.075\"/></visual><collision><geometry><cylinder length=\"0.15\" radius=\"0.05\"/></geometry><origin xyz=\"0 0 0.075\"/></collision></link><link name=\"link2\"><inertial><mass value=\"0.2\"/><origin xyz=\"0 0 0.1\"/><inertia ixx=\"0.00381666666667\" ixy=\"0\" ixz=\"0\" iyy=\"0.0036\" iyz=\"0\" izz=\"0.00381666666667\"/></inertial><visual><geometry><cylinder length=\"0.35\" radius=\"0.05\"/></geometry><origin xyz=\"0 0 0.175\"/></visual><collision><geometry><cylinder length=\"0.35\" radius=\"0.05\"/></geometry><origin xyz=\"0 0 0.175\"/></collision></link><link name=\"link3\"><inertial><mass value=\"0.2\"/><origin xyz=\"0 0 0.1\"/><inertia ixx=\"0.00381666666667\" ixy=\"0\" ixz=\"0\" iyy=\"0.0036\" iyz=\"0\" izz=\"0.00381666666667\"/></inertial><visual><geometry><cylinder length=\"0.45\" radius=\"0.05\"/></geometry><origin xyz=\"0 0 0.225\"/></visual><collision><geometry><cylinder length=\"0.45\" radius=\"0.05\"/></geometry><origin xyz=\"0 0 0.225\"/></collision></link><link name=\"endeff\"><inertial><mass value=\"0.2\"/><origin xyz=\"0 0 0.1\"/><inertia ixx=\"0.00381666666667\" ixy=\"0\" ixz=\"0\" iyy=\"0.0036\" iyz=\"0\" izz=\"0.00381666666667\"/></inertial><visual><geometry><cylinder length=\"0.05\" radius=\"0.1\"/></geometry><origin xyz=\"0 0 -0.025\"/></visual><collision><geometry><cylinder length=\"0.05\" radius=\"0.1\"/></geometry><origin xyz=\"0 0 -0.025\"/></collision></link><joint name=\"joint1\" type=\"revolute\"><parent link=\"base\"/><child link=\"link1\"/><origin xyz=\"0 0 0.3\" rpy=\"0 0 0\" /><axis xyz=\"0 0 1\" /><limit effort=\"200\" velocity=\"1.0\" lower=\"-0.4\" upper=\"0.4\"/><safety_controller k_position=\"30\" k_velocity=\"30\" soft_lower_limit=\"-0.4\" soft_upper_limit=\"0.4\"/></joint><joint name=\"joint2\" type=\"revolute\"><parent link=\"link1\"/><child link=\"link2\"/><origin xyz=\"0 0 0.15\" rpy=\"0 0 0\" /><axis xyz=\"0 1 0\" /><limit effort=\"200\" velocity=\"1.0\" lower=\"-0.4\" upper=\"0.4\"/><safety_controller k_position=\"30\" k_velocity=\"30\" soft_lower_limit=\"-0.4\" soft_upper_limit=\"0.4\"/></joint><joint name=\"joint3\" type=\"revolute\"><parent link=\"link2\"/><child link=\"link3\"/><origin xyz=\"0 0 0.35\" rpy=\"0 0 0\" /><axis xyz=\"0 1 0\" /><limit effort=\"200\" velocity=\"1.0\" lower=\"-0.4\" upper=\"0.4\"/><safety_controller k_position=\"30\" k_velocity=\"30\" soft_lower_limit=\"-0.4\" soft_upper_limit=\"0.4\"/></joint><joint name=\"joint4\" type=\"fixed\"><parent link=\"link3\"/><child link=\"endeff\"/><origin xyz=\"0 0 0.45\" rpy=\"0 0 0\" /></joint></robot>";
 static const std::string srdf_string_ = "<robot name=\"test_robot\"><group name=\"arm\"><chain base_link=\"base\" tip_link=\"endeff\" /></group><virtual_joint name=\"world_joint\" type=\"fixed\" parent_frame=\"world_frame\" child_link=\"base\" /><group_state name=\"zero\" group=\"arm\"><joint name=\"joint1\" value=\"0\" /><joint name=\"joint2\" value=\"0.3\" /><joint name=\"joint3\" value=\"0.55\" /></group_state><disable_collisions link1=\"base\" link2=\"link1\" reason=\"Adjacent\" /><disable_collisions link1=\"endeff\" link2=\"link3\" reason=\"Adjacent\" /><disable_collisions link1=\"link1\" link2=\"link2\" reason=\"Adjacent\" /><disable_collisions link1=\"link2\" link2=\"link3\" reason=\"Adjacent\" /></robot>";

 constexpr bool print_debug_information_ = false;


Use runtime interface in schur_complement

--- examples/schur_complement.cpp
+++ examples/schur_complement.cpp
@@ -10,7 +10,7 @@

 #include <amgcl/make_solver.hpp>
 #include <amgcl/runtime.hpp>
-#include <amgcl/relaxation/as_preconditioner.hpp>
+#include <amgcl/relaxation/runtime.hpp>
 #include <amgcl/preconditioner/schur_complement.hpp>
 #include <amgcl/adapter/crs_tuple.hpp>
 #include <amgcl/io/mm.hpp>
@@ -32,24 +32,18 @@
     typedef amgcl::backend::builtin<double> Backend;

     typedef amgcl::make_solver<
-        amgcl::relaxation::as_preconditioner<
-            Backend, amgcl::relaxation::ilu0
-            >,
-        amgcl::solver::bicgstab<Backend>
+        amgcl::runtime::relaxation::as_preconditioner<Backend>,
+        amgcl::runtime::iterative_solver<Backend>
         > USolver;

     typedef amgcl::make_solver<
-        amgcl::amg<
-            Backend,
-            amgcl::coarsening::smoothed_aggregation,
-            amgcl::relaxation::ilu0
-            >,
-        amgcl::solver::bicgstab<Backend>
+        amgcl::runtime::amg<Backend>,
+        amgcl::runtime::iterative_solver<Backend>
         > PSolver;

     amgcl::make_solver<
         amgcl::preconditioner::schur_complement<USolver, PSolver>,
-        amgcl::solver::bicgstab<Backend>
+        amgcl::runtime::iterative_solver<Backend>
         > solve(K, prm);

     tic t2(prof, "solve");


Initialize AnalysisImpls for ImmutablePass.

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

--- lib/VMCore/PassManager.cpp
+++ lib/VMCore/PassManager.cpp
@@ -399,7 +399,9 @@
       // top level manager. Set up analysis resolver to connect them.
       AnalysisResolver_New *AR = new AnalysisResolver_New(*this);
       P->setResolver(AR);
+      initializeAnalysisImpl(P);
       addImmutablePass(IP);
+      recordAvailableAnalysis(IP);
     }
     else
       addPass(P);
@@ -504,7 +506,9 @@
       // top level manager. Set up analysis resolver to connect them.
       AnalysisResolver_New *AR = new AnalysisResolver_New(*this);
       P->setResolver(AR);
+      initializeAnalysisImpl(P);
       addImmutablePass(IP);
+      recordAvailableAnalysis(IP);
     }
     else
       addPass(P);
@@ -634,7 +638,6 @@

     // Take a note of analysis required and made available by this pass.
     // Remove the analysis not preserved by this pass
-    initializeAnalysisImpl(P);
     removeNotPreservedAnalysis(P);
     recordAvailableAnalysis(P);
   }


Bring clang options in error messages up to date.

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

--- source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -1743,8 +1743,8 @@
                       "DWARF DW_TAG_array_type DIE at 0x%8.8x has a "
                       "class/union/struct element type DIE 0x%8.8x that is a "
                       "forward declaration, not a complete definition.\nTry "
-                      "compiling the source file with -fno-limit-debug-info or "
-                      "disable -gmodule",
+                      "compiling the source file with -fstandalone-debug or "
+                      "disable -gmodules",
                       die.GetOffset(), type_die_ref.die_offset);
                 else
                   module_sp->ReportError(
@@ -2255,7 +2255,7 @@
                 if (die.GetCU()->GetProducer() ==
                     DWARFCompileUnit::eProducerClang)
                   module->ReportError(":: Try compiling the source file with "
-                                      "-fno-limit-debug-info.");
+                                      "-fstandalone-debug.");

                 // We have no choice other than to pretend that the base class
                 // is complete. If we don't do this, clang will crash when we
@@ -3095,7 +3095,7 @@
                       "DWARF DIE at 0x%8.8x (class %s) has a member variable "
                       "0x%8.8x (%s) whose type is a forward declaration, not a "
                       "complete definition.\nTry compiling the source file "
-                      "with -fno-limit-debug-info",
+                      "with -fstandalone-debug",
                       parent_die.GetOffset(), parent_die.GetName(),
                       die.GetOffset(), name);
                 else


coverity#707771 coverity gold, Uninitialized m_refCount

Change-Id: I98398a3cd7a86a5f31c711f7f1cff0d467a1d2e5


Remove a needless 'error'...

Remove a needless 'error'...

Reported by Ryo Onodera. Thanks!!!

--- ha_mroonga.cpp
+++ ha_mroonga.cpp
@@ -10226,7 +10226,7 @@
 #ifdef MRN_HANDLER_AUTO_REPAIR_HAVE_ERROR
   crashed = wrap_handler->auto_repair(error);
 #else
-  crashed = wrap_handler->auto_repair(error);
+  crashed = wrap_handler->auto_repair();
 #endif
   MRN_SET_BASE_SHARE_KEY(share, table->s);
   MRN_SET_BASE_TABLE_KEY(this, table);


Fixed even more formated output.

Fixed even more formated output.

--- fable/bbn.cpp
+++ fable/bbn.cpp
@@ -484,14 +484,14 @@
     "'--- ----------- ---------- ---------',/,/,10x,"
     "' 1. CHANGE TIME-STEP LIMITING CONSTANT 1  FROM ',f5.3,/,10x,"
     "' 2. CHANGE TIME-STEP LIMITING CONSTANT 2  FROM ',f5.3,/,10x,"
-    "' 3. CHANGE INITIAL TIME-STEP              FROM ',1p,e8.2,' SECONDS',/,"
-    "' ',10x,' 4. CHANGE INITIAL TEMPERATURE            FROM ',1p,e8.2,"
-    "' (10**9 K)',/,10x,' 5. CHANGE FINAL TEMPERATURE              FROM ',"
-    "1p,e8.2,' (10**9 K)',/,10x,"
+    "' 3. CHANGE INITIAL TIME-STEP              FROM ',1p,e8.2,' SECONDS',/,10x,"
+	"' 4. CHANGE INITIAL TEMPERATURE            FROM ',1p,e8.2,' (10**9 K)',/,10x,"
+	"' 5. CHANGE FINAL TEMPERATURE              FROM ',1p,e8.2,' (10**9 K)',/,10x,"
     "' 6. CHANGE SMALLEST ABUNDANCES ALLOWED    FROM ',1p,e8.2,/,10x,"
-    "' 7. CHANGE ACCUMULATION INCREMENT         FROM ',1p,e8.2,' ITERATIONS',"
-    "/,10x,' 8. RESET ALL TO DEFAULT VALUES',/,10x,' 9. EXIT',5(/),"
-    "' ',10x,'Enter selection (1-9): ',$)"),
+    "' 7. CHANGE ACCUMULATION INCREMENT         FROM ',1p,e8.2,' ITERATIONS',/,10x,"
+	"' 8. RESET ALL TO DEFAULT VALUES',/,10x,"
+	"' 9. EXIT',5(/),10x,"
+	"'Enter selection (1-9): ',$)"),
     cy, ct, dt1, t9i, t9f, ytmin, fem::ffloat(inc);
   //..........READ IN SELECTION NUMBER.
   read(ir, "(i1)"), inum;


[FIXED] Matrix2D::Shear()

[FIXED] Matrix2D::Shear()


Simplify specification of pressure mask in two_step_precond

--- examples/two_step_precond.cpp
+++ examples/two_step_precond.cpp
@@ -52,7 +52,8 @@
         (
          "pmask,m",
          po::value<std::string>(&pm_file)->required(),
-         "The pressure mask in MatrixMarket format"
+         "The pressure mask in MatrixMarket format. Or, if the parameter has "
+         "the form '%n', then each n-th variable is treated as pressure."
         )
         (
          "rhs,b",
@@ -104,7 +105,11 @@
     boost::tie(rows, cols) = amgcl::io::mm_reader(A_file)(ptr, col, val);

     std::vector<char> pm;
-    {
+    if (pm_file[0] == '%') {
+        int stride = std::atoi(pm_file.substr(1).c_str());
+        pm.resize(rows, 0);
+        for(size_t i = 0; i < rows; i += stride) pm[i] = 1;
+    } else {
         size_t n, m;
         boost::tie(n, m) = amgcl::io::mm_reader(pm_file)(pm);
     }


Removed select()-specifc stuff and changed QEventDispatcherUNIX to QEventDispatcherEpoll in strings

--- qeventdispatcher_epoll.cpp
+++ qeventdispatcher_epoll.cpp
@@ -37,18 +37,16 @@
     epollFD = epoll_create(16384);
 //    qDebug() << "epollFD =" << epollFD;

-    //mainThread = (QThread::currentThread() == QCoreApplication::instance()->thread());
-    mainThread = true;
     bool pipefail = false;

     // initialize the common parts of the event loop
     if (qt_safe_pipe(thread_pipe, O_NONBLOCK) == -1) {
-        perror("QEventDispatcherUNIXPrivate(): Unable to create thread pipe");
+        perror("QEventDispatcherEpollPrivate(): Unable to create thread pipe");
         pipefail = true;
     }

     if (pipefail)
-        qFatal("QEventDispatcherUNIXPrivate(): Can not continue without a thread pipe");
+        qFatal("QEventDispatcherEpollPrivate(): Can not continue without a thread pipe");

     epoll_event ev;
     memset(&ev,0,sizeof(ev));
@@ -56,8 +54,6 @@
     ev.events = EPOLLIN;//| EPOLLOUT | EPOLLPRI;
     int rc = epoll_ctl(epollFD, EPOLL_CTL_ADD, thread_pipe[0], &ev);
     if( rc != 0 ) perror("QEventDispatcherEpollPrivate::doSelect(), epoll_ctl failed: ");
-
-    //sn_highest = -1;

     interrupt = false;
 }
@@ -98,16 +94,9 @@
     } while (nsel == -1 && (errno == EINTR || errno == EAGAIN));

     if (nsel == -1) {
-        if (errno == EBADF) {
-            // it seems a socket notifier has a bad fd... find out
-            // which one it is and disable it
-            qWarning("EBADF handling not implemented!");
-            // TODO
-        } else {
-            // EINVAL... shouldn't happen, so let's complain to stderr
-            // and hope someone sends us a bug report
-            perror("epoll_wait()");
-        }
+        // EINVAL... shouldn't happen, so let's complain to stderr
+        // and hope someone sends us a bug report
+        perror("epoll_wait()");
     }

     // some other thread woke us up... consume the data on the thread pipe so that
@@ -120,7 +109,7 @@
                 ;
             if (!wakeUps.testAndSetRelease(1, 0)) {
                 // hopefully, this is dead code
-                qWarning("QEventDispatcherUNIX: internal error, wakeUps.testAndSetRelease(1, 0) failed!");
+                qWarning("QEventDispatcherEpoll: internal error, wakeUps.testAndSetRelease(1, 0) failed!");
             }
             ++nevents;
             break;
@@ -155,7 +144,7 @@
 {
 #ifndef QT_NO_DEBUG
     if (timerId < 1 || interval < 0 || !obj) {
-        qWarning("QEventDispatcherUNIX::registerTimer: invalid arguments");
+        qWarning("QEventDispatcherEpoll::registerTimer: invalid arguments");
         return;
     } else if (obj->thread() != thread() || thread() != QThread::currentThread()) {
         qWarning("QObject::startTimer: timers cannot be started from another thread");
@@ -174,7 +163,7 @@
 {
 #ifndef QT_NO_DEBUG
     if (timerId < 1) {
-        qWarning("QEventDispatcherUNIX::unregisterTimer: invalid argument");
+        qWarning("QEventDispatcherEpoll::unregisterTimer: invalid argument");
         return false;
     } else if (thread() != QThread::currentThread()) {
         qWarning("QObject::killTimer: timers cannot be stopped from another thread");
@@ -193,7 +182,7 @@
 {
 #ifndef QT_NO_DEBUG
     if (!object) {
-        qWarning("QEventDispatcherUNIX::unregisterTimers: invalid argument");
+        qWarning("QEventDispatcherEpoll::unregisterTimers: invalid argument");
         return false;
     } else if (object->thread() != thread() || thread() != QThread::currentThread()) {
         qWarning("QObject::killTimers: timers cannot be stopped from another thread");
@@ -209,7 +198,7 @@
 QEventDispatcherEpoll::registeredTimers(QObject *object) const
 {
     if (!object) {
-        qWarning("QEventDispatcherUNIX:registeredTimers: invalid argument");
+        qWarning("QEventDispatcherEpoll::registeredTimers: invalid argument");
         return QList<TimerInfo>();
     }


Fix a typo

Fix a typo

--- ha_mroonga.cpp
+++ ha_mroonga.cpp
@@ -3522,7 +3522,7 @@
     if (!grn_table_ref) {
       error = ER_CANT_CREATE_TABLE;
       char err_msg[MRN_BUFFER_SIZE];
-      sprintf(err_msg, "refference table [%s.%s] is not mroonga table",
+      sprintf(err_msg, "reference table [%s.%s] is not mroonga table",
               table->s->db.str, ref_table_name.str);
       my_message(error, err_msg, MYF(0));
       DBUG_RETURN(false);
@@ -3541,7 +3541,7 @@
       grn_obj_unlink(ctx, grn_table_ref);
       error = ER_CANT_CREATE_TABLE;
       char err_msg[MRN_BUFFER_SIZE];
-      sprintf(err_msg, "refference table [%s.%s] is not found",
+      sprintf(err_msg, "reference table [%s.%s] is not found",
               table->s->db.str, ref_table_name.str);
       my_message(error, err_msg, MYF(0));
       DBUG_RETURN(false);
@@ -3554,7 +3554,7 @@
       grn_obj_unlink(ctx, grn_table_ref);
       error = ER_CANT_CREATE_TABLE;
       char err_msg[MRN_BUFFER_SIZE];
-      sprintf(err_msg, "refference table [%s.%s] has no primary key",
+      sprintf(err_msg, "reference table [%s.%s] has no primary key",
               table->s->db.str, ref_table_name.str);
       my_message(error, err_msg, MYF(0));
       DBUG_RETURN(false);
@@ -3569,7 +3569,7 @@
       error = ER_CANT_CREATE_TABLE;
       char err_msg[MRN_BUFFER_SIZE];
       sprintf(err_msg,
-              "refference table [%s.%s] primary key is multiple column",
+              "reference table [%s.%s] primary key is multiple column",
               table->s->db.str, ref_table_name.str);
       my_message(error, err_msg, MYF(0));
       DBUG_RETURN(false);
@@ -3583,7 +3583,7 @@
       error = ER_CANT_CREATE_TABLE;
       char err_msg[MRN_BUFFER_SIZE];
       sprintf(err_msg,
-              "refference column [%s.%s.%s] is not used for primary key",
+              "reference column [%s.%s.%s] is not used for primary key",
               table->s->db.str, ref_table_name.str, ref_field_name.str);
       my_message(error, err_msg, MYF(0));
       DBUG_RETURN(false);


Fixed a bug in writing GDAL files.  We weren't saving any datum information and this sometimes would lead to a missing GCS tag in geotiffs.

--- src/vw/Cartography/DiskImageResourceGeoReferenceHelperGDAL.cc
+++ src/vw/Cartography/DiskImageResourceGeoReferenceHelperGDAL.cc
@@ -175,8 +175,27 @@
     // without a string of Well Known Text (WKT), so we must conjure
     // up an OGRSpatialReference here and use it to convert from
     // proj.4 to WKT.
+    //
+    // However, we first set the datum parameters in the
+    // ORGSpatialReference object directly.
     OGRSpatialReference gdal_spatial_ref;
+//     gdal_spatial_ref.SetGeogCS( "Geographic Coordinate System",
+//                                 georef->datum().name().c_str(),
+//                                 georef->datum().spheroid_name().c_str(),
+//                                 georef->datum().semi_major_axis(),
+//                                 georef->datum().inverse_flattening(),
+//                                 georef->datum().meridian_name().c_str(),
+//                                 georef->datum().meridian_offset() );
     gdal_spatial_ref.importFromProj4(georef->proj4_str().c_str());
+    vw_out(0) << "Creating GeoCS!\n";
+    gdal_spatial_ref.SetGeogCS( "Geographic Coordinate System",
+                                georef->datum().name().c_str(),
+                                georef->datum().spheroid_name().c_str(),
+                                georef->datum().semi_major_axis(),
+                                georef->datum().inverse_flattening(),
+                                georef->datum().meridian_name().c_str(),
+                                georef->datum().meridian_offset() );
+
     char* wkt_str_tmp;
     gdal_spatial_ref.exportToWkt(&wkt_str_tmp);
     std::string wkt_str = wkt_str_tmp;


mroonga_enable_operations_recording: disable by default

It's not helpful... I didn't hear any auto-recovered case. (Normally,
users don't notice auto-recovered case.)

It's just troublesome... Mroonga can't be used with SELECT only after
MySQL crashed. Because auto-recover is blocked by remained lock on
crash. If we disable operation recording, INSERT/DELETE/UPDATE are
blocked but SELECT may work.

--- ha_mroonga.cpp
+++ ha_mroonga.cpp
@@ -806,7 +806,7 @@
 static mrn_bool mrn_libgroonga_support_zlib = false;
 static mrn_bool mrn_libgroonga_support_lz4 = false;
 static mrn_bool mrn_libgroonga_support_zstd = false;
-static mrn_bool mrn_enable_operations_recording = true;
+static mrn_bool mrn_enable_operations_recording = false;
 static const char *mrn_boolean_mode_sytnax_flag_names[] = {
   "DEFAULT",
   "SYNTAX_QUERY",


Do not copy header when realigning BAMs with ALT contigs. To fix later: Check if the contig's ALT status changes

--- SNAPLib/SAM.cpp
+++ SNAPLib/SAM.cpp
@@ -345,7 +345,11 @@
                 }
             }

-            if (InvalidGenomeLocation == contigBase) {
+            //
+            // If we have not seen the contig before we cannot copy over header.
+            // Also if we are running with ALT contigs, don't copy over header even if the contig name matches, since the contig's ALT status may have changed from the previous run
+            //
+            if (InvalidGenomeLocation == contigBase || (genome->isGenomeLocationALT(contigBase))) {
                 *o_headerMatchesIndex = false;
             }


comment

comment

--- extensions/DictionaryGlue.cpp
+++ extensions/DictionaryGlue.cpp
@@ -94,6 +94,9 @@
 		AvmAssert(MMgc::GC::Size(obj) >= sizeof(ScriptObject));
 		(void)obj;

+		// This commented-out code probably pertains to Bugzilla 507699:
+		// "Dictionary key of Xml type are not matching."
+		//
 		// FIXME: this doesn't work, need to convert back to an XMLObject
 		// on the way out or intern XMLObject's somehow
 		//if(AvmCore::isXML(key))


Some trivial modifications.

Some trivial modifications.

--- Metazion/Share/Collection/RBTree.hpp
+++ Metazion/Share/Collection/RBTree.hpp
@@ -9,7 +9,7 @@
 struct RBTreeNode {
     using Value_t = ValueType;

-    enum Color{
+    enum Color {
         RED = 0,
         BLACK,
     };


gui: Start paused if we've not got a ROM to run

TODO: Prevent unpause / auto-unpause via "Cancel" in the open dialogue.

--- Source/main.cpp
+++ Source/main.cpp
@@ -267,10 +267,13 @@

     SDL_PauseAudioDevice (audio_device_id, 0);

-    /* Initialise SMS */
-    sms_init (snepulator.bios_filename, snepulator.cart_filename);
-
-    snepulator.running = true;
+    /* If we have a valid ROM to run, start emulation */
+    /* TODO: Only allow unpause if we have a ROM to run */
+    if (snepulator.bios_filename || snepulator.cart_filename)
+    {
+        sms_init (snepulator.bios_filename, snepulator.cart_filename);
+        snepulator.running = true;
+    }

     /* Main loop */
     while (!snepulator.abort)


Add NS_LOG_FUNCTION and logging code

Add NS_LOG_FUNCTION and logging code

--- extensions/nnnSIM/model/fw/nnn-forwarding-strategy.cc
+++ extensions/nnnSIM/model/fw/nnn-forwarding-strategy.cc
@@ -937,6 +937,7 @@
     std::vector<Address>
     ForwardingStrategy::GetAllPoANames ()
     {
+      NS_LOG_FUNCTION (this);
       // Vector to save the PoA names
       std::vector<Address> poanames;
       // Get the total number of addresses we have
@@ -963,10 +964,12 @@
     void
     ForwardingStrategy::Enroll ()
     {
+      NS_LOG_FUNCTION (this);
       // Check whether this node has a 3N name
       if (!Has3NName ())
 	{
 	  std::vector<Address> poanames = GetAllPoANames ();
+	  bool ok = false;

 	  // Create the EN PDU to transmit
 	  Ptr<EN> en_o = Create<EN> ();
@@ -990,7 +993,10 @@
 	      if (!tmp->isAppFace ())
 		{
 		  // Send the EN throughout the Faces
-		  tmp->SendEN(en_o);
+		  ok = tmp->SendEN(en_o);
+
+		  if (ok)
+		    m_outENs (en_o, tmp);
 		}
 	    }
 	}
@@ -999,10 +1005,12 @@
     void
     ForwardingStrategy::Reenroll ()
     {
+      NS_LOG_FUNCTION (this);
       // Check whether this node has a 3N name
       if (Has3NName ())
 	{
 	  std::vector<Address> poanames = GetAllPoANames ();
+	  bool ok = false;

 	  // Create the REN PDU to transmit
 	  Ptr<REN> ren_o = Create<REN> ();
@@ -1030,7 +1038,10 @@
 	      if (!tmp->isAppFace ())
 		{
 		  // Send the REN throughout the Faces
-		  tmp->SendREN(ren_o);
+		  ok = tmp->SendREN(ren_o);
+
+		  if (ok)
+		    m_outRENs (ren_o, tmp);
 		}
 	    }
 	}
@@ -1039,10 +1050,12 @@
     void
     ForwardingStrategy::Disenroll ()
     {
+      NS_LOG_FUNCTION (this);
       // Check whether this node has a 3N name
       if (Has3NName ())
 	{
 	  std::vector<Address> poanames = GetAllPoANames ();
+	  bool ok = false;

 	  // Create the REN PDU to transmit
 	  Ptr<DEN> den_o = Create<DEN> ();
@@ -1068,7 +1081,10 @@
 	      if (!tmp->isAppFace ())
 		{
 		  // Send the REN throughout the Faces
-		  tmp->SendDEN(den_o);
+		  ok = tmp->SendDEN(den_o);
+
+		  if (ok)
+		    m_outDENs (den_o, tmp);
 		}
 	    }
 	}


Clean up

Clean up

--- src/Core/Algorithms/Legacy/Forward/BuildBEMatrixAlgo.cc
+++ src/Core/Algorithms/Legacy/Forward/BuildBEMatrixAlgo.cc
@@ -1091,15 +1091,12 @@
     {
       if (i == j)
       {
-        auto field = fields[i].field_;
         auto block = EE.blockRef(i, j);
-        std::cout << "EE block " << i << "," << j << " is size " << block.rows() << " x " << block.cols() /*<< " starting at " << blockStartsEE[i] << "," << blockStartsEE[i] */<< std::endl;
-        make_auto_P_compute(field->vmesh(), block, fields[i].insideconductivity, fields[i].outsideconductivity, op_cond);
+        make_auto_P_compute(fields[i].field_->vmesh(), block, fields[i].insideconductivity, fields[i].outsideconductivity, op_cond);
       }
       else
       {
         auto block = EE.blockRef(i, j);
-        std::cout << "EE block " << i << "," << j << " is size " << block.rows() << " x " << block.cols() /*<< " starting at " << blockStartsEE[i] << "," << blockStartsEE[i] */ << std::endl;
         make_cross_P_compute(fields[i].field_->vmesh(), fields[j].field_->vmesh(), block, fields[i].insideconductivity, fields[i].outsideconductivity, op_cond);
       }
     }
@@ -1151,6 +1148,8 @@
   const double deflationconstant = 1.0/EE.matrix().ncols();
   EE.matrix() = EE.matrix().array() + deflationconstant;

+  printInfo(EE.matrix(), "EE after deflation");
+
   std::vector<int> measurementNodeSize(measurementfieldindices.size());
   auto measFields = fields | boost::adaptors::filtered([](const bemfield& f) { return f.measurement; });
   //following doesn't compile in VS2010, but does in clang: enable it after upgrading to 2013
@@ -1234,14 +1233,14 @@

   // Compute T here (see math in comments above)
   // TransferMatrix = T = inv(Pmm - Gms*iGss*Psm)*(Gms*iGss*Pss - Pms) = inv(C)*D
-
+
   auto Y = Gms.matrix() * Gss.matrix().inverse();
   auto C = Pmm.matrix() - Y * Psm.matrix();
   auto D = Y * Pss.matrix() - Pms.matrix();

   auto T = C.inverse() * D; // T = inv(C)*D
   return boost::make_shared<DenseMatrix>(T);
-
+
   //This could be done on one line (see below), but Y (see above) would need to be calculated twice:
   //MatrixHandle TransferMatrix1 = inv(Pmm - Gms * Gss * Psm) * (Gms * Gss * Pss - Pms);
 }


fxied crash at startup

fxied crash at startup

--- NetDb.cpp
+++ NetDb.cpp
@@ -478,8 +478,8 @@
 			if (num > 0)
 			{
 				auto pool = i2p::tunnel::tunnels.GetExploratoryPool ();
-				auto outbound = pool->GetNextOutboundTunnel ();
-				auto inbound = pool->GetNextInboundTunnel ();
+				auto outbound = pool ? pool->GetNextOutboundTunnel () : nullptr;
+				auto inbound = pool ? pool->GetNextInboundTunnel () : nullptr;
 				std::vector<i2p::tunnel::TunnelMessageBlock> msgs;
 				if (!dest->IsExploratory ())
 				{


[mlir/tf importer] Remove unnecessary locking around unmodelled ops, change logging.

The cl primarily does the following:
- Keep the set of unmodelled ops per imported graph instead of globally
- Fixes the handling of ops that has resource operands/results. Previously it looked just on a single op for the given op type, now it looks all such ops and checks the resource usage.
- Change the logging level to 1. This logging is purely for debugging/investigations and hence it's optional with Level 1.

PiperOrigin-RevId: 430514667
Change-Id: Ib742c285b342cb3490b478f38a2b82b23061d862

--- tensorflow/compiler/mlir/tensorflow/translate/import_model.cc
+++ tensorflow/compiler/mlir/tensorflow/translate/import_model.cc
@@ -429,14 +429,6 @@
       const std::unordered_map<string, Node*>& node_name_map,
       std::unordered_set<const Node*>* nodes);

-  static bool AddUnmodelledOpName(llvm::StringRef op_name) {
-    static auto* mutex = new tensorflow::mutex();
-    // All the TF ops encountered that aren't modelled in dialect.
-    static auto* unmodelled_op_names = new llvm::StringSet<>();
-    tensorflow::mutex_lock lock(*mutex);
-    return unmodelled_op_names->insert(op_name).second;
-  }
-
   // The input graph with backedges removed. The removed backedges are stored
   // in the back_edge_helper.
   BackEdgeHelper back_edge_helper_;
@@ -469,6 +461,8 @@
   std::unique_ptr<ShapeRefiner> shape_refiner_ = nullptr;
   NameUniquifier* function_name_uniquifier_;
   mlir::StatusScopedDiagnosticHandler error_handler_;
+  // All the TF ops encountered that aren't modelled in dialect.
+  llvm::DenseSet<mlir::StringAttr> unmodelled_op_names_;

  protected:
   // Maps feed as TensorId to new Placeholder node name.
@@ -1968,40 +1962,44 @@
     }
   }

-  mlir::OperationName name = inner_op->getName();
-  if (!name.isRegistered() &&
-      // Skip unmodelled ops that are handled differently.
-      (node_type_name != "_Arg" && node_type_name != "_Retval") &&
-      // Skip if warning already reported.
-      AddUnmodelledOpName(name.getStringRef())) {
-    if (node.op_def().is_stateful()) {
-      LOG(INFO) << "[potentially conservative] Op type `" << node.type_string()
+  if (VLOG_IS_ON(1)) {
+    mlir::OperationName name = inner_op->getName();
+    if (!name.isRegistered() &&
+        // Skip unmodelled ops that are handled differently.
+        (node_type_name != "_Arg" && node_type_name != "_Retval") &&
+        !unmodelled_op_names_.count(name.getIdentifier())) {
+      if (node.op_def().is_stateful()) {
+        VLOG(1) << "[potentially conservative] Op type `" << node.type_string()
                 << "` is stateful but effects not modelled";
-    } else {
-      // See if any resource type is used.
-      bool resource = false;
-      std::function<bool(mlir::Type)> record_resource;
-      record_resource = [&](mlir::Type type) {
-        if (resource) return true;
-        if (type.isa<mlir::TF::ResourceType>()) {
-          resource = true;
-          return true;
-        }
-        if (auto with_subtype =
-                type.dyn_cast<mlir::SubElementTypeInterface>()) {
-          with_subtype.walkSubTypes([&](mlir::Type t) { record_resource(t); });
-        }
-        return resource;
-      };
-
-      for (mlir::Type t : inner_op->getResultTypes())
-        if (record_resource(t)) break;
-      for (mlir::Type t : inner_op->getOperandTypes())
-        if (record_resource(t)) break;
-      if (resource)
-        LOG(INFO) << "[potentially conservative] Op type `"
+      } else {
+        // See if any resource type is used.
+        bool resource = false;
+        std::function<bool(mlir::Type)> record_resource;
+        record_resource = [&](mlir::Type type) {
+          if (resource) return true;
+          if (type.isa<mlir::TF::ResourceType>()) {
+            resource = true;
+            return true;
+          }
+          if (auto with_subtype =
+                  type.dyn_cast<mlir::SubElementTypeInterface>()) {
+            with_subtype.walkSubTypes(
+                [&](mlir::Type t) { record_resource(t); });
+          }
+          return resource;
+        };
+
+        for (mlir::Type t : inner_op->getResultTypes())
+          if (record_resource(t)) break;
+        for (mlir::Type t : inner_op->getOperandTypes())
+          if (record_resource(t)) break;
+        if (resource) {
+          unmodelled_op_names_.insert(name.getIdentifier());
+          VLOG(1) << "[potentially conservative] Op type `"
                   << node.type_string()
                   << "` has resource operands/results but effects not modelled";
+        }
+      }
     }
   }


ha_innobase.cc	Test

ha_innobase.cc	Test

--- sql/ha_innobase.cc
+++ sql/ha_innobase.cc
@@ -21,7 +21,7 @@
   - Ask Monty if strings of different languages can exist in the same
     database. Answer: in near future yes, but not yet.
 */
-
+/* Dummy comment */
 #ifdef __GNUC__
 #pragma implementation				// gcc: Class implementation
 #endif


Default LUT for meshes attributes is now the default VTK LUT rather than B&W

--- src-plugins/vtkDataMesh/interactors/vtkDataMeshInteractor.cpp
+++ src-plugins/vtkDataMesh/interactors/vtkDataMeshInteractor.cpp
@@ -399,7 +399,10 @@

 void vtkDataMeshInteractor::setLut(const QString & lutName)
 {
-    vtkLookupTable * lut = vtkLookupTableManager::GetLookupTable(lutName.toStdString());
+    vtkLookupTable * lut = NULL;
+
+    if (lutName != "Default")
+        vtkLookupTableManager::GetLookupTable(lutName.toStdString());

     if ( ! d->attribute)
      return;
@@ -446,22 +449,22 @@
     {
         lut = d->attribute->GetLookupTable();
         d->lut = LutPair(lut, "Default");
-        // no ? then bail, nothing to do here.
-        if ( ! lut )
-            return;
     }

     // remove the alpha channel from the LUT, it messes up the mesh
-    double values[4];
-    for(int i = 0; i < lut->GetNumberOfTableValues(); i++)
-    {
-      lut->GetTableValue(i, values);
-      values[3] = 1.0;
-      lut->SetTableValue(i, values);
-    }
-
-    double * range = d->metaDataSet->GetCurrentScalarRange();
-    lut->SetRange(range);
+    if (lut)
+    {
+        double values[4];
+        for(int i = 0; i < lut->GetNumberOfTableValues(); i++)
+        {
+            lut->GetTableValue(i, values);
+            values[3] = 1.0;
+            lut->SetTableValue(i, values);
+        }
+
+        double * range = d->metaDataSet->GetCurrentScalarRange();
+        lut->SetRange(range);
+    }

     vtkMapper * mapper2d = d->actor2d->GetMapper();
     vtkMapper * mapper3d = d->actor3d->GetMapper();


[editor] Call Notes::Save from Notes::Upload.

--- editor/editor_notes.cpp
+++ editor/editor_notes.cpp
@@ -120,6 +120,7 @@

                    lock_guard<mutex> g(self->m_mu);
                    self->m_notes.insert(end(self->m_notes), begin(unuploaded), end(unuploaded));
+                   self->Save();
                  });
   };


Update to latest tuple implementation

Update to latest tuple implementation

--- agency/detail/tuple_impl.hpp
+++ agency/detail/tuple_impl.hpp
@@ -181,6 +181,10 @@
     __TUPLE_ANNOTATION
     tuple_leaf_base(U&& arg) : val_(std::forward<U>(arg)) {}

+    __TUPLE_EXEC_CHECK_DISABLE
+    __TUPLE_ANNOTATION
+    ~tuple_leaf_base() = default;
+
     __TUPLE_ANNOTATION
     const T& const_get() const
     {


fixed bug

fixed bug

--- Src/advance.cpp
+++ Src/advance.cpp
@@ -726,7 +726,7 @@
                         break;
                     case ';':
                         rollback();
-                        addToken(token_list_elem::SELECTOR_NAME);
+                        addToken(token_list_elem::FUNC_NAME);
                         nextchar();
                         addToken(token_list_elem::SEPARATOR);
                         s = BeginState;


GafferAppleseed: fix unused private member warning.

--- src/GafferAppleseed/IECoreAppleseedPreview/Renderer.cpp
+++ src/GafferAppleseed/IECoreAppleseedPreview/Renderer.cpp
@@ -1403,7 +1403,6 @@
 		}

 		asr::EnvironmentEDF *m_environment;
-		bool m_visibleInBackground;
 		asr::TransformSequence m_transformSequence;
 };


[TF:TRT] Fix an uninitialized access.

[TF:TRT] Fix an uninitialized access.

The third test that tests GetDeviceSet() returning nullptr actually accesses the
uninitialized device_set_ field.

PiperOrigin-RevId: 322148374
Change-Id: Ib84ba177bb000a8bb59c7e7ecc6a633a1c51464f

--- tensorflow/compiler/tf2tensorrt/convert/convert_graph_test.cc
+++ tensorflow/compiler/tf2tensorrt/convert/convert_graph_test.cc
@@ -71,7 +71,7 @@
   }

  private:
-  const DeviceSet* device_set_;
+  const DeviceSet* device_set_ = nullptr;
 };

 TEST(ConvertGraphTest, GetDeviceAndAllocator) {


Fixed whitespace

Fixed whitespace

--- sql/sql_trigger.cc
+++ sql/sql_trigger.cc
@@ -971,7 +971,7 @@
         Lex_input_stream lip(thd, trg_create_str->str, trg_create_str->length);
         thd->m_lip= &lip;
         lex_start(thd);
-	thd->spcont= NULL;
+        thd->spcont= NULL;
         int err= MYSQLparse((void *)thd);

         if (err || thd->is_fatal_error)


edk/gui2d/ViewGui2d:  - Remove the selection comparison when select the character because it was not selecting the character when click for the first time.

--- edk/gui2d/ViewGui2d.cpp
+++ edk/gui2d/ViewGui2d.cpp
@@ -117,14 +117,11 @@

         //test if have the second name
         if(size>1u){
-            //test if the object selected is the same
-            if(obj == this->objSelected
-                    ||
-                    !this->objSelected
-                    ){
                 //
                 this->idSelected = names->get(1u);
-            }
+        }
+        else{
+            this->idSelected = 0u;
         }
     }
 }
@@ -662,13 +659,9 @@
                         this->objSelected->deselect();
                         if(this->endSelect)
                             this->objSelected->clickEnd(this->idSelected,false);
-                        obj->select();
-                        obj->clickStart(this->idSelected);
-                    }
-                    else{
-                        obj->select();
-                        obj->clickStart(this->idSelected);
-                    }
+                    }
+                    obj->select();
+                    obj->clickStart(this->idSelected);
                     //select the object
                     this->objSelected = obj;
                     this->endSelect = true;


Fix asset loading on Windows.

Fix asset loading on Windows.

--- src/Interface/Modules/Render/SpireSCIRun/SRInterface.cc
+++ src/Interface/Modules/Render/SpireSCIRun/SRInterface.cc
@@ -40,6 +40,8 @@
 #include "SRCommonAttributes.h"
 #include "SRCommonUniforms.h"

+#include <Core/Application/Application.h>
+
 using namespace std::placeholders;

 namespace SCIRun {
@@ -74,10 +76,13 @@
   shaderFiles.push_back(std::make_pair("DirPhong.fsh", spire::Interface::FRAGMENT_SHADER));
   mSpire->addPersistentShader("DirPhong", shaderFiles);

-  // Load scirun5 arrow asset.
+  // Load scirun5 arrow asset this code needs to be update with file error
+  // checking in the entity system renderer.
+  auto baseAssetDirQT = SCIRun::Core::Application::Instance().executablePath() / "Assets";
+  std::string baseAssetDir = baseAssetDirQT.string();
   std::shared_ptr<std::vector<uint8_t>> rawVBO(new std::vector<uint8_t>());
   std::shared_ptr<std::vector<uint8_t>> rawIBO(new std::vector<uint8_t>());
-  std::fstream arrowFile("Assets/UnitArrow.sp");
+  std::ifstream arrowFile(baseAssetDir + "/UnitArrow.sp", std::ios::in | std::ios::binary);
   spire::Interface::loadProprietarySR5AssetFile(arrowFile, *rawVBO, *rawIBO);

   std::vector<std::string> attribNames;


Reduce number of allocations in EncodeTensorToByteBuffer by
hand-encoding the skeleton portion of the TensorProto (in particular,
encoding the TensorShapeProto was allocating one object per dimension
plus an allocation per Tensor).

Reduces total number of allocations for an RPC-intensive benchmark
from 77.4M to 70.9M (-8.4%).
Change: 130132140

--- tensorflow/core/distributed_runtime/rpc/grpc_tensor_coding.cc
+++ tensorflow/core/distributed_runtime/rpc/grpc_tensor_coding.cc
@@ -78,6 +78,66 @@
   return core::VarintLength(tag << 3) + core::VarintLength(bytes) + bytes;
 }

+// Returns an upper bound in bytes of the protocol buffer encoding of
+// the "skeleton" of "val" (all the data needed for dtype and the shape,
+// but not the actual contents of "val").
+static int SkeletonEncodingSizeUpperBound(const Tensor& val) {
+  static const int kVarintMax64 = 10;  // Max length of varint64 encoding
+  const int ndims = val.shape().dims();
+  return (2 * kVarintMax64) +           // dtype
+         (ndims * (4 * kVarintMax64));  // Shape: 4 varints per dim
+}
+
+// Encode the skeleton for "val" (the encoded TensorProto contents
+// (dtype and shape, but not the actual data) into "*e".  The backing
+// store for "*e" must be of appropriate size to hold this encoding.
+static void EncodeSkeleton(const Tensor& val, io::ProtoEncodeHelper* e) {
+  // Encode val.dtype()
+  e->WriteUint64(TensorProto::kDtypeFieldNumber, val.dtype());
+
+  // Compute length of val.shape() proto encoding
+  const int ndims = val.shape().dims();
+  int tensor_shape_bytes = 0;
+  for (int d = 0; d < ndims; d++) {
+    int64 dim_size = val.shape().dim_size(d);
+    tensor_shape_bytes +=
+        2 +  // TensorShapeProto dim tag + varintlength of submessage
+        1 +  // TensorShapeProto_Dim::kSizeFieldNumber
+        core::VarintLength(dim_size);
+  }
+
+  if (tensor_shape_bytes > 0) {
+    e->WriteVarlengthBeginning(TensorProto::kTensorShapeFieldNumber,
+                               tensor_shape_bytes);
+    // Encode val.shape()
+    for (int d = 0; d < ndims; d++) {
+      int64 dim_size = val.shape().dim_size(d);
+      int64 dim_varlen = 1 +  // TensorShapeProto_Dim::kSizeFieldNumber
+                         core::VarintLength(dim_size);
+      e->WriteVarlengthBeginning(TensorShapeProto::kDimFieldNumber, dim_varlen);
+      e->WriteUint64(TensorShapeProto_Dim::kSizeFieldNumber, dim_size);
+    }
+  }
+
+#ifndef NDEBUG
+  {
+    // Debug-mode only check to make sure the encoding above is
+    // identical to the auto-generated protocol buffer encoding.
+    TensorProto skeleton;
+    skeleton.set_dtype(val.dtype());
+    val.shape().AsProto(skeleton.mutable_tensor_shape());
+    string tensor_except_contents;  // tensor() field except contents
+    skeleton.AppendToString(&tensor_except_contents);
+    TensorProto skeleton2;
+    skeleton2.ParseFromString(string(e->data(), e->size()));
+    string out;
+    skeleton.AppendToString(&out);
+    DCHECK_EQ(tensor_except_contents, out) << skeleton.DebugString() << " vs\n"
+                                           << skeleton2.DebugString();
+  }
+#endif
+}
+
 void EncodeTensorToByteBuffer(bool is_dead, const Tensor& val,
                               ::grpc::ByteBuffer* result) {
   const int kLargeTensorBytes = 1024;
@@ -95,23 +155,19 @@
     // Encode full protocol buffer to a ByteBuffer
     EncodeRecvTensorResponseToByteBuffer(response, result);
   } else {
-    TensorProto skeleton;
-    skeleton.set_dtype(val.dtype());
-    // TODO(jeff): Encode val.shape() directly to protocol buffer rather than
-    // going through TensorShapeProto.
-    val.shape().AsProto(skeleton.mutable_tensor_shape());
+    // skeleton is the encoded TensorProto contents (dtype and shape), but
+    // not the actual data
+    gtl::InlinedVector<char, 128> skeleton(SkeletonEncodingSizeUpperBound(val));
+    io::ProtoEncodeHelper e_skeleton(skeleton.data(), skeleton.size());
+    EncodeSkeleton(val, &e_skeleton);

     StringPiece tdata = val.tensor_data();
     uint32 overall_tensor_proto_bytesize =
-        (skeleton.ByteSize() +
+        (e_skeleton.size() +
          VarLengthEncodingSize(TensorProto::kTensorContentFieldNumber,
                                tdata.size()));
-
     string header;  // All of RecvTensorRequest except the tensor() field
     response.AppendToString(&header);
-
-    string tensor_except_contents;  // tensor() field except contents
-    skeleton.AppendToString(&tensor_except_contents);

     size_t expected_size =
         (header.size() +
@@ -139,7 +195,7 @@
     e.WriteVarlengthBeginning(RecvTensorResponse::kTensorFieldNumber,
                               overall_tensor_proto_bytesize);
     // (C)
-    e.WriteRawBytes(tensor_except_contents);
+    e.WriteRawBytes(StringPiece(e_skeleton.data(), e_skeleton.size()));
     // (D1) & (D2)
     e.WriteVarlengthBeginning(TensorProto::kTensorContentFieldNumber,
                               tdata.size());


Cosmetics.

Cosmetics.

--- src/Module/Encoder/RSC/Encoder_RSC_generic_json_sys.cpp
+++ src/Module/Encoder/RSC/Encoder_RSC_generic_json_sys.cpp
@@ -32,7 +32,7 @@
 		trellis[1 + (occurrence[state] ? 3 : 0)][state] = +1;                // gamma coeff
 		trellis[2 + (occurrence[state] ? 3 : 0)][state] = bit_sys ^ bit_par; // gamma
 		trellis[6                              ][i    ] = state;             // final state, bit syst = 0
-		trellis[7                              ][i    ] = bit_sys ^ bit_par; // gamma      , bit syst = 1
+		trellis[7                              ][i    ] = bit_sys ^ bit_par; // gamma      , bit syst = 0

 		occurrence[state] = true;

@@ -44,7 +44,7 @@
 		trellis[0 + (occurrence[state] ? 3 : 0)][state] = i;                 // initial state
 		trellis[1 + (occurrence[state] ? 3 : 0)][state] = -1;                // gamma coeff
 		trellis[2 + (occurrence[state] ? 3 : 0)][state] = bit_sys ^ bit_par; // gamma
-		trellis[8                              ][i    ] = state;             // initial state, bit syst = 0
+		trellis[8                              ][i    ] = state;             // initial state, bit syst = 1
 		trellis[9                              ][i    ] = bit_sys ^ bit_par; // gamma        , bit syst = 1

 		occurrence[state] = true;
@@ -107,7 +107,7 @@
 			stream << "]," << std::endl;
 		else
 			stream << "]}"  << std::endl
-                   << "\t" << "},{" << std::endl;
+			       << "\t" << "},{" << std::endl;

 		bit_counter = 0;
 		natural_domain = !natural_domain;


ENH: Moved disabling of warnings to after kwsys includes.

--- SystemTools.cxx
+++ SystemTools.cxx
@@ -14,15 +14,17 @@
      PURPOSE.  See the above copyright notices for more information.

 =========================================================================*/
+#include <SystemTools.hxx>
+
+#include <RegularExpression.hxx>
+#include <Directory.hxx>
+
+#include <std/iostream>
+#include <std/fstream>
+
 #ifdef _MSC_VER
 # pragma warning (disable: 4786)
 #endif
-
-#include <SystemTools.hxx>
-#include <RegularExpression.hxx>
-#include <Directory.hxx>
-#include <std/iostream>
-#include <std/fstream>

 #include <stdio.h>
 #include <sys/stat.h>


ENH: Improved file modification time comparison on Windows to use GetFileAttributesEx instead of CreateFile/GetFileTime/CloseHandle to get file times.  This results in a 30% reduction in time to do a build system check.

--- SystemTools.cxx
+++ SystemTools.cxx
@@ -786,38 +786,20 @@
     }
 # endif
 #else
-  // Windows version.  Create file handles and get the modification times.
-  HANDLE hf1 = CreateFile(f1, GENERIC_READ, FILE_SHARE_READ,
-                          NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS,
-                          NULL);
-  if(hf1 == INVALID_HANDLE_VALUE)
-    {
-    return false;
-    }
-  FILETIME tf1;
-  if(!GetFileTime(hf1, 0, 0, &tf1))
-    {
-    CloseHandle(hf1);
-    return false;
-    }
-  CloseHandle(hf1);
-  HANDLE hf2 = CreateFile(f2, GENERIC_READ, FILE_SHARE_READ,
-                          NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS,
-                          NULL);
-  if(hf2 == INVALID_HANDLE_VALUE)
-    {
-    return false;
-    }
-  FILETIME tf2;
-  if(!GetFileTime(hf2, 0, 0, &tf2))
-    {
-    CloseHandle(hf2);
-    return false;
-    }
-  CloseHandle(hf2);
+  // Windows version.  Get the modification time from extended file attributes.
+  WIN32_FILE_ATTRIBUTE_DATA f1d;
+  WIN32_FILE_ATTRIBUTE_DATA f2d;
+  if(!GetFileAttributesEx(f1, GetFileExInfoStandard, &f1d))
+    {
+    return false;
+    }
+  if(!GetFileAttributesEx(f2, GetFileExInfoStandard, &f2d))
+    {
+    return false;
+    }

   // Compare the file times using resolution provided by system call.
-  *result = (int)CompareFileTime(&tf1, &tf2);
+  *result = (int)CompareFileTime(&f1d.ftLastWriteTime, &f2d.ftLastWriteTime);
 #endif
   return true;
 }


Provide ostream output operator for relaxation::as_preconditioner

--- amgcl/relaxation/runtime.hpp
+++ amgcl/relaxation/runtime.hpp
@@ -232,6 +232,14 @@
     private:
         runtime::relaxation::type relaxation;
         void * handle;
+
+        friend std::ostream& operator<<(std::ostream &os, const as_preconditioner &p)
+        {
+            os << "Using " << p.relaxation << " as preconditioner" << std::endl;
+            os << "  unknowns: " << backend::rows(p.system_matrix()) << std::endl;
+            os << "  nonzeros: " << backend::nonzeros(p.system_matrix()) << std::endl;
+            return os;
+        }
 };

 }


BUG: fixes for mingw and CMakesetup with spaces in the source directory

--- SystemTools.cxx
+++ SystemTools.cxx
@@ -708,7 +708,14 @@
   kwsys_stl::string::size_type pos = 0;
   while((pos = path.find('\\', pos)) != kwsys_stl::string::npos)
     {
-    path[pos] = '/';
+    // make sure we don't convert an escaped space to a unix slash
+    if(pos < path.size()-2)
+      {
+      if(path[pos+1] != ' ')
+        {
+        path[pos] = '/';
+        }
+      }
     pos++;
     }
   // Remove all // from the path just like most unix shells


TopCoder SRM647. Div2-250.

TopCoder SRM647. Div2-250.


Doc alignment improvements

Doc alignment improvements

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

--- eg/src/TParticlePDG.cxx
+++ eg/src/TParticlePDG.cxx
@@ -19,16 +19,16 @@
 //  Double_t         fCharge;           // charge in units of |e|/3
 //  Double_t         fLifetime;         // proper lifetime in nanoseconds
 //  Double_t         fWidth;            // total width in GeV
-//  Int_t            fParity;
-//  Double_t         fSpin;
+//  Int_t            fParity;           // parity
+//  Double_t         fSpin;             // spin
 //  Double_t         fIsospin;          // isospin
 //  Double_t         fI3;               // i3
 //  Int_t            fStrangeness;      // flavours are defined if i3 != -1
 //  Int_t            fCharm;            // 1 or -1 for C-particles,  0 for others
-//  Int_t            fBeauty;           //
-//  Int_t            fTop;              //
+//  Int_t            fBeauty;
+//  Int_t            fTop;
 //  Int_t            fY;                // X,Y: quantum numbers for the 4-th generation
-//  Int_t            fX;                //
+//  Int_t            fX;
 //  Int_t            fStable;           // 1 if stable, 0 otherwise
 //
 //  TObjArray*       fDecayList;        // array of decay channels


Handle hierarchy level change by sending a property messages to thw watcher saying what the new level is.

--- src/clients/watcherHierarchyClient/watcherHierarchyClient.cpp
+++ src/clients/watcherHierarchyClient/watcherHierarchyClient.cpp
@@ -59,6 +59,7 @@
 #include "edgeMessage.h"
 #include "gpsMessage.h"
 #include "colorMessage.h"
+#include "nodePropertiesMessage.h"
 #include "colors.h"
 #include "client.h"
 #include "logger.h"
@@ -92,23 +93,32 @@
 /* This is called by the API when this node's position in the hierarchy changes
  * It is defined using the API function idsPositionRegister().
  */
-static void myDetectorPositionUpdate(void *, IDSPositionType position, IDSPositionStatus status)
-{
+static void myDetectorPositionUpdate(void *d, IDSPositionType position, IDSPositionStatus status)
+{
+    detector *dt=((detector*)d);
+    NodePropertiesMessagePtr pm(new NodePropertiesMessage);
+    pm->fromNodeID=ip::address_v4(dt->cs->localid);
+
     switch(position)
     {
         case COORDINATOR_ROOT:
             LOG_DEBUG("Position change: root " << (status==IDSPOSITION_ACTIVE?"active":"inactive"));
+            pm->nodeProperties.push_back(status==IDSPOSITION_ACTIVE?NodePropertiesMessage::ROOT:NodePropertiesMessage::LEAFNODE);
                 break;
         case COORDINATOR_REGIONAL:
             LOG_DEBUG("Position change: regional " << (status==IDSPOSITION_ACTIVE?"active":"inactive"));
+            pm->nodeProperties.push_back(status==IDSPOSITION_ACTIVE?NodePropertiesMessage::REGIONAL:NodePropertiesMessage::LEAFNODE);
                 break;
         case COORDINATOR_NEIGHBORHOOD:
             LOG_DEBUG("Position change: regional " << (status==IDSPOSITION_ACTIVE?"active":"inactive"));
+            pm->nodeProperties.push_back(status==IDSPOSITION_ACTIVE?NodePropertiesMessage::NEIGHBORHOOD:NodePropertiesMessage::LEAFNODE);
             break;
         case COORDINATOR_ROOTGROUP:
             LOG_DEBUG("Position change: regional " << (status==IDSPOSITION_ACTIVE?"active":"inactive"));
+            pm->nodeProperties.push_back(status==IDSPOSITION_ACTIVE?NodePropertiesMessage::ROOT:NodePropertiesMessage::LEAFNODE);
             break;
     }
+    dt->client->sendMessage(pm);
 }

 void sendLabel(void *messageHandlerData, const struct MessageInfo *mi, bool addLabel)


Fix formatting.

Fix formatting.

--- eightball/eightball.cpp
+++ eightball/eightball.cpp
@@ -21,7 +21,8 @@
 using namespace std;
 using namespace std::chrono;

-namespace eightball {
+namespace eightball
+{
     wstring RetrieveQuestion()
     {
         wstring question;


Update Test1.cpp

Update Test1.cpp

--- Tests/Test1.cpp
+++ Tests/Test1.cpp
@@ -1,689 +1,3 @@
-
-
-#if 0
-#include <iostream>
-#include <set>
-#include <vector>
-#include <map>
-
-#include <StateMachine.h>
-using namespace std;
-using namespace STATEMACHINE;
-
-
-class Test1DataSource : public STATEMACHINE::DataSource
-{
-public:
-		Test1DataSource()
-		{}
-		virtual ~Test1DataSource()
-		{}
-		void ResetInputEvents(){}
-		void ResetInternalEvents(){}
-		 void ResetEvents()//reset input,output,internal event list
-		{}
-		 void ApplyAndResetInputEvents() // Resets current events. Apply input events as current event and reset input event list
-		{}
-		 void ApplyAndResetInternalEvents()//Resets current events. Apply internal events as current event and reset input event list
-		{}
-
-		void ResetOutputEvents(){} // Resets output event list
-
-		 bool IsInternalEventSet(){ return false;} // Checks if there are any internal events set
-		 void GetOutputEvents(set<Event>& events){events.clear();} // Gets the list of Output Events generated
-
-		 void performStateEntryAction(STATEID sid){}	//Execute state entry-action
-		 void performStateExitAction(STATEID sid){} //Execute state exit-action
-		 void performStateDuringAction(STATEID sid){}//Execute state during-action
-
-		 void performTransitionAction(TRANSID tid){} // Execute transaction -action
-		 bool evalTransitionGuard(TRANSID tid) //Evaluate transaction - guard
-		{
-			return true;
-		}
-		 bool evalTransitionEventTrigger(TRANSID tid) //Evaluate transaction - trigger
-		{
-			return true;
-		}
-
-};
-
-int mainTest1()
-{
-	Test1DataSource* ds = new Test1DataSource();
-
-	string smname("STest1");
-	StateMachine sm(smname, ds);
-
-	string smrname("RSTest1");
-	Region smr(smrname,0,&sm);
-	sm.addChildRegion(&smr);
-
-
-	string s1name("s1");
-	State s1(&smr, &sm, s1name, STATEMACHINE::OR,1);
-	smr.addState(&s1,true);
-
-	string s2name("s2");
-	State s2(&smr, &sm, s2name, STATEMACHINE::OR,2);
-	smr.addState(&s2,false);
-
-	Transition t1(&s1,&s2,1,1);
-	s1.addOutgoingTransition(&t1);
-
-	Transition t2(&s2,&s1,2,2);
-	s2.addOutgoingTransition(&t2);
-
-
-	s1.SetDataSource(ds);
-	s2.SetDataSource(ds);
-	t1.SetDataSource(ds);
-	t2.SetDataSource(ds);
-
-	sm.computePathToRoot();
-	s1.computePathToRoot();
-	s2.computePathToRoot();
-
-	t1.computeEntryAndExitPoints();
-	t2.computeEntryAndExitPoints();
-
-	sm.step();
-	cout <<"------------------------------------"<<endl;
-	sm.step();
-
-
-	return 0;
-}
-
-namespace MACHINE1
-{
-
-	Event TICK("TICK",1);
-	Event RESET("RESET",2);
-
-	class DataSource : public STATEMACHINE::DataSource
-	{
-	public:
-		DataSource()
-		{
-			m_inputEvents.clear();
-			m_outputEvents.clear();
-			m_internalEvents.clear();
-			m_currentEvents.clear();
-
-			counter = 0;
-
-		}
-		virtual ~DataSource()
-		{
-			m_inputEvents.clear();
-			m_outputEvents.clear();
-			m_internalEvents.clear();
-			m_currentEvents.clear();
-
-
-
-		}
-
-		 void ResetEvents()//reset input,output,internal event list
-		{
-			m_inputEvents.clear();
-			m_outputEvents.clear();
-			m_internalEvents.clear();
-			m_currentEvents.clear();
-
-		}
-		 void ApplyAndResetInputEvents() // Resets current events. Apply input events as current event and reset input event list
-		{
-			m_currentEvents.clear();
-			std::copy(m_inputEvents.begin(), m_inputEvents.end(), std::inserter(m_currentEvents,m_currentEvents.begin()));
-			m_inputEvents.clear();
-
-		}
-		 void ApplyAndResetInternalEvents()//Resets current events. Apply internal events as current event and reset input event list
-		{
-			m_currentEvents.clear();
-			std::copy(m_internalEvents.begin(), m_internalEvents.end(), std::inserter(m_currentEvents,m_currentEvents.begin()));
-			m_internalEvents.clear();
-
-		}
-
-		 void ResetOutputEvents() // Resets output event list
-		{
-			m_outputEvents.clear();
-
-		}
-
-		 bool IsInternalEventSet(){
-			return  !m_internalEvents.empty();
-		} // Checks if there are any internal events set
-
-		 void GetOutputEvents(set<Event>& events){
-			events.clear();
-			std::copy(m_outputEvents.begin(), m_outputEvents.end(), std::inserter(events,events.begin()));
-
-		} // Gets the list of Output Events generated
-
-		 void performStateEntryAction(STATEID sid){}	//Execute state entry-action
-		 void performStateExitAction(STATEID sid){} //Execute state exit-action
-		 void performStateDuringAction(STATEID sid){}//Execute state during-action
-
-		 void performTransitionAction(TRANSID tid)
-		{
-			switch(tid)
-			{
-				case 1:	return TA_T1();
-				case 2: return TA_T2();
-				default: return;
-			}
-			return;
-		} // Execute transaction -action
-
-		 bool evalTransitionGuard(TRANSID tid) //Evaluate transaction - guard
-		{
-			return true;
-
-		}
-
-		 bool evalTransitionEventTrigger(TRANSID tid) //Evaluate transaction - trigger
-		{
-			switch(tid)
-			{
-				case 1:	return ET_T1();
-				case 2: return ET_T2();
-				default: break;
-			}
-			return true;
-
-		}
-
-		bool ET_T1()
-		{
-			return (m_currentEvents.find(RESET) != m_currentEvents.end());
-		}
-
-		bool ET_T2()
-		{
-			return (m_currentEvents.find(TICK) != m_currentEvents.end());
-		}
-
-		void TA_T1()
-		{
-			counter = 0;
-		}
-
-		void TA_T2()
-		{
-			counter++;
-		}
-
-		void SetEvent(Event e)
-		{
-			m_inputEvents.insert(e);
-		}
-
-		void Send(Event e)
-		{
-			m_outputEvents.insert(e);
-		}
-
-		void Consume(Event e)
-		{
-			m_internalEvents.insert(e);
-		}
-
-		set<Event> m_inputEvents;
-		set<Event> m_outputEvents;
-		set<Event> m_internalEvents;
-		set<Event> m_currentEvents;
-
-		int counter;
-
-	};
-}
-
-int mainTest2()
-{
-	MACHINE1::DataSource* ds = new MACHINE1::DataSource();
-
-	string smname("Machine1");
-	StateMachine sm(smname, ds);
-
-	string smrname("RMachine1");
-	Region smr(smrname,0,&sm);
-	sm.addChildRegion(&smr);
-
-
-	string sNominalname("Nominal");
-	State sNominal(&smr, &sm, sNominalname, STATEMACHINE::OR,1);
-	smr.addState(&sNominal,true);
-
-
-	Transition t1(&sNominal,&sNominal,1,1);
-	sNominal.addOutgoingTransition(&t1);
-
-	Transition t2(&sNominal,&sNominal,2,2);
-	sNominal.addOutgoingTransition(&t2);
-
-
-	sNominal.SetDataSource(ds);
-	t1.SetDataSource(ds);
-	t2.SetDataSource(ds);
-
-	sm.computePathToRoot();
-	sNominal.computePathToRoot();
-
-
-	t1.computeEntryAndExitPoints();
-	t2.computeEntryAndExitPoints();
-
-
-cout<<"-----------------------------------------"<<endl;
-	ds->SetEvent(MACHINE1::TICK);
-	sm.step();
-	cout<<"after step1 counter "<<ds->counter<<endl;
-cout<<"-----------------------------------------"<<endl;
-	//ds->SetEvent(MACHINE1::TICK);
-	sm.step();
-	cout<<"after step 2 counter "<<ds->counter<<endl;
-cout<<"-----------------------------------------"<<endl;
-	ds->SetEvent(MACHINE1::TICK);
-	sm.step();
-	cout<<"after step 3 counter "<<ds->counter<<endl;
-cout<<"-----------------------------------------"<<endl;
-	ds->SetEvent(MACHINE1::TICK);
-	sm.step();
-	cout<<"after step 4 counter "<<ds->counter<<endl;
-	cout<<"-----------------------------------------"<<endl;
-
-	ds->SetEvent(MACHINE1::RESET);
-	sm.step();
-	cout<<"after step 5 counter "<<ds->counter<<endl;
-
-	cout<<"-----------------------------------------"<<endl;
-	//ds->SetEvent(MACHINE1::TICK);
-	sm.step();
-	cout<<"after step 6 counter "<<ds->counter<<endl;
-
-	cout<<"-----------------------------------------"<<endl;
-	ds->SetEvent(MACHINE1::TICK);
-	sm.step();
-	cout<<"after step 7 counter "<<ds->counter<<endl;
-
-	cout <<"------------------------------------"<<endl;
-	//sm.step();
-
-
-	return 0;
-}
-
-
-namespace MACHINE2
-{
-	Event TICK("TICK",1);
-	Event RESET("RESET",2);
-	Event STOP("STOP",3);
-	Event START("START",4);
-
-	class DataSource : public STATEMACHINE::DataSource
-	{
-	public:
-		DataSource()
-		{
-			m_inputEvents.clear();
-			m_outputEvents.clear();
-			m_internalEvents.clear();
-			m_currentEvents.clear();
-
-			counter = 0;
-
-		}
-
-		virtual ~DataSource()
-		{
-			m_inputEvents.clear();
-			m_outputEvents.clear();
-			m_internalEvents.clear();
-			m_currentEvents.clear();
-
-		}
-
-		virtual void ResetEvents()//reset input,output,internal event list
-		{
-			m_inputEvents.clear();
-			m_outputEvents.clear();
-			m_internalEvents.clear();
-			m_currentEvents.clear();
-
-		}
-
-		virtual void ApplyAndResetInputEvents() // Resets current events. Apply input events as current event and reset input event list
-		{
-			m_currentEvents.clear();
-			std::copy(m_inputEvents.begin(), m_inputEvents.end(), std::inserter(m_currentEvents,m_currentEvents.begin()));
-			m_inputEvents.clear();
-
-		}
-
-		virtual void ApplyAndResetInternalEvents()//Resets current events. Apply internal events as current event and reset input event list
-		{
-			m_currentEvents.clear();
-			std::copy(m_internalEvents.begin(), m_internalEvents.end(), std::inserter(m_currentEvents,m_currentEvents.begin()));
-			m_internalEvents.clear();
-
-		}
-
-		virtual void ResetOutputEvents() // Resets output event list
-		{
-			m_outputEvents.clear();
-
-		}
-
-		virtual bool IsInternalEventSet(){
-			return  !m_internalEvents.empty();
-		} // Checks if there are any internal events set
-
-
-		virtual void GetOutputEvents(set<Event>& events){
-			events.clear();
-			std::copy(m_outputEvents.begin(), m_outputEvents.end(), std::inserter(events,events.begin()));
-
-		} // Gets the list of Output Events generated
-
-		virtual void performStateEntryAction(STATEID sid){}	//Execute state entry-action
-		virtual void performStateExitAction(STATEID sid){} //Execute state exit-action
-		virtual void performStateDuringAction(STATEID sid){}//Execute state during-action
-
-		virtual void performTransitionAction(TRANSID tid)
-		{
-			switch(tid)
-			{
-				case 1:	return TA_T1();
-				case 3: return TA_T3();
-				case 4:	return TA_T4();
-				case 6:	return TA_T6();
-
-				default: return;
-			}
-			return;
-		} // Execute transaction -action
-
-		virtual bool evalTransitionGuard(TRANSID tid) //Evaluate transaction - guard
-		{
-			return true;
-
-		}
-
-		virtual bool evalTransitionEventTrigger(TRANSID tid) //Evaluate transaction - trigger
-		{
-			switch(tid)
-			{
-				case 1:	return ET_T1();
-				case 2: return ET_T2();
-				case 3:	return ET_T3();
-				case 4: return ET_T4();
-				case 5:	return ET_T5();
-				case 6: return ET_T6();
-				default: break;
-			}
-			return true;
-
-		}
-
-		bool ET_T1()
-		{
-			return (m_currentEvents.find(RESET) != m_currentEvents.end());
-		}
-
-		bool ET_T2()
-		{
-			return (m_currentEvents.find(STOP) != m_currentEvents.end());
-		}
-
-		bool ET_T3()
-		{
-			return (m_currentEvents.find(START) != m_currentEvents.end());
-		}
-
-		bool ET_T4()
-		{
-			return (m_currentEvents.find(TICK) != m_currentEvents.end());
-		}
-
-		bool ET_T5()
-		{
-			return (m_currentEvents.find(START) != m_currentEvents.end());
-		}
-
-		bool ET_T6()
-		{
-			return (m_currentEvents.find(TICK) != m_currentEvents.end());
-		}
-
-		void TA_T1()
-		{
-			counter = 0;
-		}
-
-		void TA_T3()
-		{
-			Produce(MACHINE2::START);
-		}
-
-		void TA_T4()
-		{
-			counter++;
-		}
-
-		void TA_T6()
-		{
-			counter++;
-		}
-
-
-
-		void SetEvent(Event e)
-		{
-			m_inputEvents.insert(e);
-		}
-
-		void Send(Event e)
-		{
-			m_outputEvents.insert(e);
-		}
-
-		void Produce(Event e)
-		{
-			m_internalEvents.insert(e);
-		}
-
-
-
-		set<Event> m_inputEvents;
-		set<Event> m_outputEvents;
-		set<Event> m_internalEvents;
-		set<Event> m_currentEvents;
-
-		int counter;
-
-	};
-}
-
-
-int mainTest3()
-{
-	MACHINE2::DataSource* ds = new MACHINE2::DataSource();
-
-	string smname("Machine2");
-	StateMachine sm(smname, ds);
-
-	string smrname("RMachine2");
-	Region smr(smrname,0,&sm);
-	sm.addChildRegion(&smr);
-
-
-	string sNominalname("Nominal");
-	State sNominal(&smr, &sm, sNominalname, STATEMACHINE::AND,1);
-	smr.addState(&sNominal,true);
-
-	Transition t1(&sNominal,&sNominal,1,1,true);
-	sNominal.addOutgoingTransition(&t1);
-
-	Transition t2(&sNominal,&sNominal,2,2);
-	sNominal.addOutgoingTransition(&t2);
-
-	string rNominal_Firstname("RNominal_First");
-	Region rNominal_First(rNominal_Firstname,0,&sNominal);
-	rNominal_First.EnableDeepHistory();
-	sNominal.addChildRegion(&rNominal_First);
-
-	string sFirstname("First");
-	State sFirst(&rNominal_First, &sNominal, sFirstname, STATEMACHINE::OR,2);
-	rNominal_First.addState(&sFirst,true);
-
-	string rNominal_Secondname("RSecond");
-	Region rNominal_Second(rNominal_Secondname,1,&sNominal);
-	rNominal_Second.EnableDeepHistory();
-	sNominal.addChildRegion(&rNominal_Second);
-	string sSecondname("Second");
-	State sSecond(&rNominal_Second, &sNominal, sSecondname, STATEMACHINE::OR,3);
-	rNominal_Second.addState(&sSecond,true);
-
-
-	string rFirstname("RFirst");
-	Region rFirst(rFirstname,0,&sFirst);
-	sFirst.addChildRegion(&rFirst);
-
-	string sOffname("Off");
-	State sOff(&rFirst, &sFirst, sOffname, STATEMACHINE::OR,4);
-	rFirst.addState(&sOff,true);
-
-	string sOnname("On");
-	State sOn(&rFirst, &sFirst, sOnname, STATEMACHINE::OR,5);
-	rFirst.addState(&sOn,false);
-
-
-	Transition t3(&sOff,&sOn,1,3);
-	sOff.addOutgoingTransition(&t3);
-
-	Transition t4(&sOn,&sOn,1,4);
-	sOn.addOutgoingTransition(&t4);
-
-
-
-	string rSecondname("RSecond");
-	Region rSecond(rSecondname,0,&sSecond);
-	sSecond.addChildRegion(&rSecond);
-
-
-	State sOff1(&rSecond, &sSecond, sOffname, STATEMACHINE::OR,6);
-	rSecond.addState(&sOff1,true);
-
-
-	State sOn1(&rSecond, &sSecond, sOnname, STATEMACHINE::OR,7);
-	rSecond.addState(&sOn1,false);
-
-
-	Transition t5(&sOff1,&sOn1,1,5);
-	sOff1.addOutgoingTransition(&t5);
-
-	Transition t6(&sOn,&sOn,1,6);
-	sOn1.addOutgoingTransition(&t6);
-
-	sm.SetDataSource(ds);
-	sNominal.SetDataSource(ds);
-	t1.SetDataSource(ds);
-	t2.SetDataSource(ds);
-
-	sFirst.SetDataSource(ds);
-	sOff.SetDataSource(ds);
-	sOn.SetDataSource(ds);
-	t3.SetDataSource(ds);
-	t4.SetDataSource(ds);
-
-
-	sSecond.SetDataSource(ds);
-	sOff1.SetDataSource(ds);
-	sOn1.SetDataSource(ds);
-	t5.SetDataSource(ds);
-	t6.SetDataSource(ds);
-
-
-
-	sm.computePathToRoot();
-	sNominal.computePathToRoot();
-	sFirst.computePathToRoot();
-	sSecond.computePathToRoot();
-	sOn.computePathToRoot();
-	sOff.computePathToRoot();
-	sOn1.computePathToRoot();
-	sOff1.computePathToRoot();
-
-
-	t1.computeEntryAndExitPoints();
-	t2.computeEntryAndExitPoints();
-	t3.computeEntryAndExitPoints();
-	t4.computeEntryAndExitPoints();
-	t5.computeEntryAndExitPoints();
-	t6.computeEntryAndExitPoints();
-
-	cout<<"-----------------------------------------"<<endl;
-	ds->SetEvent(MACHINE2::TICK);
-	sm.step();
-	cout<<"after step1 counter "<<ds->counter<<endl;
-	cout<<"-----------------------------------------"<<endl;
-
-
-	ds->SetEvent(MACHINE2::START);
-	sm.step();
-	cout<<"after step 2 counter "<<ds->counter<<endl;
-	cout<<"-----------------------------------------"<<endl;
-
-
-	ds->SetEvent(MACHINE2::TICK);
-	sm.step();
-	cout<<"after step 3 counter "<<ds->counter<<endl;
-	cout<<"-----------------------------------------"<<endl;
-
-
-	ds->SetEvent(MACHINE2::TICK);
-	sm.step();
-	cout<<"after step 4 counter "<<ds->counter<<endl;
-	cout<<"-----------------------------------------"<<endl;
-
-
-
-
-	ds->SetEvent(MACHINE2::RESET);
-	sm.step();
-	cout<<"after step 5 counter "<<ds->counter<<endl;
-	cout<<"-----------------------------------------"<<endl;
-
-
-	ds->SetEvent(MACHINE2::TICK);
-	sm.step();
-	cout<<"after step 6 counter "<<ds->counter<<endl;
-	cout <<"------------------------------------"<<endl;
-
-	ds->SetEvent(MACHINE2::TICK);
-	sm.step();
-	cout<<"after step 7 counter "<<ds->counter<<endl;
-
-	cout <<"------------------------------------"<<endl;
-	ds->SetEvent(MACHINE2::STOP);
-	sm.step();
-	cout<<"after step 8 counter "<<ds->counter<<endl;
-
-	cout <<"------------------------------------"<<endl;
-	ds->SetEvent(MACHINE2::TICK);
-	sm.step();
-	cout<<"after step 9 counter "<<ds->counter<<endl;
-
-
-	return 0;
-}
-
-#endif

 #include "SMTest.h"
 using namespace std;
@@ -721,4 +35,4 @@
 	//return mainTest1();
 	//return mainTest2();
 	return mainTest();
-}+}


fixed typo.

fixed typo.

--- src/appleseed.studio/mainwindow/rendering/rendertab.cpp
+++ src/appleseed.studio/mainwindow/rendering/rendertab.cpp
@@ -267,7 +267,8 @@

     m_toolbar->addSeparator();

-    // Create a labels to display RGBA values.
+    // Create labels to display RGBA values.
+
     m_r_label = new QLabel();
     m_r_label->setScaledContents(true);
     m_r_label->setObjectName(QString::fromUtf8("r_label"));


Remove unused version of machine_id_to_peer_id().

--- src/clustering/administration/machine_id_to_peer_id.hpp
+++ src/clustering/administration/machine_id_to_peer_id.hpp
@@ -3,17 +3,6 @@

 #include "clustering/administration/machine_metadata.hpp"
 #include "rpc/directory/read_view.hpp"
-
-inline peer_id_t machine_id_to_peer_id(const machine_id_t &input, const clone_ptr_t<directory_rview_t<machine_id_t> > &translation_table) {
-    std::set<peer_id_t> peers_list = translation_table->get_directory_service()->get_connectivity_service()->get_peers_list();
-    for (std::set<peer_id_t>::iterator it = peers_list.begin(); it != peers_list.end(); it++) {
-        machine_id_t machine_id = translation_table->get_value(*it).get();
-        if (machine_id == input) {
-            return *it;
-        }
-    }
-    return peer_id_t();
-}

 inline peer_id_t machine_id_to_peer_id(const machine_id_t &input, const std::map<peer_id_t, machine_id_t> &translation_table) {
     for (std::map<peer_id_t, machine_id_t>::const_iterator it = translation_table.begin(); it != translation_table.end(); it++) {


INTEGRATION: CWS aqua11y01 (1.8.76); FILE MERGED 2008/02/27 09:21:43 fne 1.8.76.2: #i82877# small fix 2008/02/26 10:47:55 fne 1.8.76.1: #i82877# fixed problem with getRelationByType

--- unotools/source/accessibility/accessiblerelationsethelper.cxx
+++ unotools/source/accessibility/accessiblerelationsethelper.cxx
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: accessiblerelationsethelper.cxx,v $
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -96,33 +96,25 @@
 sal_Bool AccessibleRelationSetHelperImpl::containsRelation( sal_Int16 aRelationType )
     throw (uno::RuntimeException)
 {
+    AccessibleRelation defaultRelation; // default is INVALID
+    AccessibleRelation relationByType = getRelationByType(aRelationType);
+    return relationByType.RelationType != defaultRelation.RelationType;
+}
+
+AccessibleRelation AccessibleRelationSetHelperImpl::getRelationByType( sal_Int16 aRelationType )
+    throw (uno::RuntimeException)
+{
     sal_Int32 nCount(getRelationCount());
     sal_Int32 i(0);
     sal_Bool bFound(sal_False);
     while ((i < nCount) && !bFound)
     {
         if (maRelations[i].RelationType == aRelationType)
-            bFound = sal_True;
+            return maRelations[i];
         else
             i++;
     }
-    return bFound;
-}
-
-AccessibleRelation AccessibleRelationSetHelperImpl::getRelationByType( sal_Int16 aRelationType )
-    throw (uno::RuntimeException)
-{
-    sal_Int32 nCount(getRelationCount());
-    sal_Int32 i(0);
-    sal_Bool bFound(sal_False);
-    while ((i < nCount) && !bFound)
-    {
-        if (maRelations[i].RelationType == aRelationType)
-            bFound = sal_True;
-        else
-            i++;
-    }
-    return maRelations[i];
+    return AccessibleRelation();
 }

 void AccessibleRelationSetHelperImpl::AddRelation(const AccessibleRelation& rRelation)


Always give the full list of devices to the chatroom when a device gets registered.

--- src/conference/participant-registration-subscription.cc
+++ src/conference/participant-registration-subscription.cc
@@ -30,13 +30,14 @@

 void ParticipantRegistrationSubscription::onContactRegistered (const string &key, const string &uid) {
 	url_t *url = url_make(mHome.home(), mParticipantAddress->asStringUriOnly().c_str());
-	RegistrarDb::get()->fetchForGruu(url, uid, shared_from_this());
+	RegistrarDb::get()->fetch(url, shared_from_this());
 }

 void ParticipantRegistrationSubscription::onRecordFound (Record *r) {
 	if (!r)
 		return;

+	list<shared_ptr<linphone::Address>> listDevices;
 	for (const shared_ptr<ExtendedContact> &ec : r->getExtendedContacts()) {
 		string uri = ExtendedContact::urlToString(ec->mSipContact->m_url);
 		shared_ptr<linphone::Address> addr = linphone::Factory::get()->createAddress(uri);
@@ -45,8 +46,10 @@
 		) {
 			shared_ptr<linphone::Address> deviceAddress = mParticipantAddress->clone();
 			deviceAddress->setUriParam("gr", addr->getUriParam("gr"));
+			listDevices.push_back(deviceAddress);
 			SLOGI << "Notify registration of " << deviceAddress->asString() << " to chatroom " << mChatRoom->getLocalAddress()->asString();
-			mChatRoom->addParticipantDevice(mParticipantAddress, deviceAddress);
 		}
 	}
+
+	mChatRoom->setParticipantDevices(mParticipantAddress, listDevices);
 }


Removed strncmp

Removed strncmp

--- features/cellular/framework/AT/AT_CellularNetwork.cpp
+++ features/cellular/framework/AT/AT_CellularNetwork.cpp
@@ -546,14 +546,12 @@

     if (!plmn) {
         tr_debug("Automatic network registration");
-        uint8_t len=8;
-        uint8_t buf[8];
         _at.cmd_start("AT+COPS?");
         _at.cmd_stop();
-        _at.resp_start();
-        _at.read_bytes(buf,len);
+        _at.resp_start("AT+COPS:");
+        int mode = _at.read_int();
         _at.resp_stop();
-        if (strncmp((char*)buf,"+COPS: 0",len) != 0) {
+        if (mode != 0) {
             _at.clear_error();
             _at.cmd_start("AT+COPS=0");
             _at.cmd_stop();