reporting: coding style

reporting: coding style

--- src/bootstrap/libnanyc/details/reporting/message.cpp
+++ src/bootstrap/libnanyc/details/reporting/message.cpp
@@ -17,11 +17,212 @@
 namespace Logs
 {

+	namespace {
+
+
+	template<bool unify>
+	void printMessageRecursive(nyconsole_t& out, const Message& message, String& xx, uint32_t indent = 0)
+	{
+		Message::ThreadingPolicy::MutexLocker locker{message};
+
+		// which output ?
+		nyconsole_output_t omode = (unify or (message.level != Level::error and message.level != Level::warning))
+			? nycout : nycerr;
+		// function writer
+		auto wrfn = (omode == nycout) ? out.write_stdout : out.write_stderr;
+		// print method
+		auto print = [&](const AnyString& s) { wrfn(out.internal, s.c_str(), s.size()); };
+
+		if (message.level != Level::none)
+		{
+			switch (message.level)
+			{
+				case Level::error:
+				{
+					out.set_color(out.internal, omode, nyc_red);
+					print("   error" SEP);
+					out.set_color(out.internal, omode, nyc_none);
+					break;
+				}
+				case Level::warning:
+				{
+					out.set_color(out.internal, omode, nyc_yellow);
+					print(" warning" SEP);
+					out.set_color(out.internal, omode, nyc_none);
+					break;
+				}
+				case Level::info:
+				{
+					if (message.section.empty())
+					{
+						out.set_color(out.internal, omode, nyc_none);
+						print("        " SEP);
+					}
+					else
+					{
+						out.set_color(out.internal, omode, nyc_lightblue);
+						xx = "        ";
+						xx.overwriteRight(message.section);
+						xx << SEP;
+						print(xx);
+						out.set_color(out.internal, omode, nyc_none);
+					}
+					break;
+				}
+				case Level::hint:
+				case Level::suggest:
+				{
+					out.set_color(out.internal, omode, nyc_none);
+					print("        " SEP);
+					out.set_color(out.internal, omode, nyc_none);
+					break;
+				}
+				case Level::success:
+				{
+					out.set_color(out.internal, omode, nyc_green);
+					#ifndef YUNI_OS_WINDOWS
+					print("      \u2713 " SEP);
+					#else
+					print("      ok" SEP);
+					#endif
+					out.set_color(out.internal, omode, nyc_none);
+					break;
+				}
+				case Level::trace:
+				{
+					out.set_color(out.internal, omode, nyc_purple);
+					print("      ::");
+					out.set_color(out.internal, omode, nyc_none);
+					print(SEP);
+					break;
+				}
+				case Level::verbose:
+				{
+					out.set_color(out.internal, omode, nyc_green);
+					print("      ::");
+					out.set_color(out.internal, omode, nyc_none);
+					print(SEP);
+					break;
+				}
+				case Level::ICE:
+				{
+					out.set_color(out.internal, omode, nyc_red);
+					print("     ICE" SEP);
+					out.set_color(out.internal, omode, nyc_none);
+					break;
+				}
+				case Level::none:
+				{
+					// unreachable - cf condition above
+					break;
+				}
+			}
+
+			if (indent)
+			{
+				xx.clear();
+				for (uint32_t i = indent; i--; )
+					xx << "    ";
+				print(xx);
+			}
+
+			if (not message.prefix.empty())
+			{
+				out.set_color(out.internal, omode, nyc_white);
+				print(message.prefix);
+				out.set_color(out.internal, omode, nyc_none);
+			}
+
+			if (message.level == Level::suggest)
+			{
+				out.set_color(out.internal, omode, nyc_lightblue);
+				print("suggest: ");
+				out.set_color(out.internal, omode, nyc_none);
+			}
+			else if (message.level == Level::hint)
+			{
+				out.set_color(out.internal, omode, nyc_lightblue);
+				print("hint: ");
+				out.set_color(out.internal, omode, nyc_none);
+			}
+
+			if (not message.origins.location.target.empty())
+			{
+				print("{");
+				print(message.origins.location.target);
+				print("} ");
+			}
+
+			if (not message.origins.location.filename.empty())
+			{
+				out.set_color(out.internal, omode, nyc_white);
+				xx = message.origins.location.filename;
+
+				if (message.origins.location.pos.line > 0)
+				{
+					xx << ':';
+					xx << message.origins.location.pos.line;
+					if (message.origins.location.pos.offset != 0)
+					{
+						xx << ':';
+						xx << message.origins.location.pos.offset;
+						if (message.origins.location.pos.offsetEnd != 0)
+						{
+							xx << '-';
+							xx << message.origins.location.pos.offsetEnd;
+						}
+					}
+				}
+				xx << ": ";
+				print(xx);
+				out.set_color(out.internal, omode, nyc_none);
+			}
+
+			if (not message.message.empty())
+			{
+				String msg{message.message};
+				msg.trimRight(" \t\r\n");
+				msg.replace("\t", "    "); // tabs
+
+				auto firstLF = msg.find('\n');
+				if (not (firstLF < message.message.size()))
+				{
+					print(msg);
+				}
+				else
+				{
+					xx.clear() << "\n        " SEP;
+					for (uint i = indent; i--; )
+						xx.write("    ", 4);
+
+					bool addLF = false;
+					msg.words("\n", [&](const AnyString& word) -> bool {
+						if (addLF)
+							print(xx);
+						print(word);
+						addLF = true;
+						return true;
+					});
+				}
+			}
+
+			print("\n");
+			++indent;
+		}
+
+		for (auto& ptr: message.entries)
+			printMessageRecursive<unify>(out, *ptr, xx, indent);
+	}
+
+
+	} // anonymous namespace
+
+
+

 	Message& Message::createEntry(Level level)
 	{
 		Message* entry = new Message{level};
-
 		ThreadingPolicy::MutexLocker locker{*this};
 		entry->origins = origins;
 		entries.push_back(entry);
@@ -41,209 +242,6 @@
 			}
 		}
 	}
-
-
-	namespace // anonymous
-	{
-
-		template<bool unify>
-		static void printMessage(nyconsole_t& out, const Message& message, uint32_t indent, String& xx)
-		{
-			Message::ThreadingPolicy::MutexLocker locker{message};
-
-			// which output ?
-			nyconsole_output_t omode = (unify or (message.level != Level::error and message.level != Level::warning))
-				? nycout : nycerr;
-			// function writer
-			auto wrfn = (omode == nycout) ? out.write_stdout : out.write_stderr;
-			// print method
-			auto print = [&](const AnyString& s) { wrfn(out.internal, s.c_str(), s.size()); };
-
-			if (message.level != Level::none)
-			{
-				switch (message.level)
-				{
-					case Level::error:
-					{
-						out.set_color(out.internal, omode, nyc_red);
-						print("   error" SEP);
-						out.set_color(out.internal, omode, nyc_none);
-						break;
-					}
-					case Level::warning:
-					{
-						out.set_color(out.internal, omode, nyc_yellow);
-						print(" warning" SEP);
-						out.set_color(out.internal, omode, nyc_none);
-						break;
-					}
-					case Level::info:
-					{
-						if (message.section.empty())
-						{
-							out.set_color(out.internal, omode, nyc_none);
-							print("        " SEP);
-						}
-						else
-						{
-							out.set_color(out.internal, omode, nyc_lightblue);
-							xx = "        ";
-							xx.overwriteRight(message.section);
-							xx << SEP;
-							print(xx);
-							out.set_color(out.internal, omode, nyc_none);
-						}
-						break;
-					}
-					case Level::hint:
-					case Level::suggest:
-					{
-						out.set_color(out.internal, omode, nyc_none);
-						print("        " SEP);
-						out.set_color(out.internal, omode, nyc_none);
-						break;
-					}
-					case Level::success:
-					{
-						out.set_color(out.internal, omode, nyc_green);
-						#ifndef YUNI_OS_WINDOWS
-						print("      \u2713 " SEP);
-						#else
-						print("      ok" SEP);
-						#endif
-						out.set_color(out.internal, omode, nyc_none);
-						break;
-					}
-					case Level::trace:
-					{
-						out.set_color(out.internal, omode, nyc_purple);
-						print("      ::");
-						out.set_color(out.internal, omode, nyc_none);
-						print(SEP);
-						break;
-					}
-					case Level::verbose:
-					{
-						out.set_color(out.internal, omode, nyc_green);
-						print("      ::");
-						out.set_color(out.internal, omode, nyc_none);
-						print(SEP);
-						break;
-					}
-					case Level::ICE:
-					{
-						out.set_color(out.internal, omode, nyc_red);
-						print("     ICE" SEP);
-						out.set_color(out.internal, omode, nyc_none);
-						break;
-					}
-					case Level::none:
-					{
-						// unreachable - cf condition above
-						break;
-					}
-				}
-
-				if (indent)
-				{
-					xx.clear();
-					for (uint32_t i = indent; i--; )
-						xx << "    ";
-					print(xx);
-				}
-
-				if (not message.prefix.empty())
-				{
-					out.set_color(out.internal, omode, nyc_white);
-					print(message.prefix);
-					out.set_color(out.internal, omode, nyc_none);
-				}
-
-				if (message.level == Level::suggest)
-				{
-					out.set_color(out.internal, omode, nyc_lightblue);
-					print("suggest: ");
-					out.set_color(out.internal, omode, nyc_none);
-				}
-				else if (message.level == Level::hint)
-				{
-					out.set_color(out.internal, omode, nyc_lightblue);
-					print("hint: ");
-					out.set_color(out.internal, omode, nyc_none);
-				}
-
-				if (not message.origins.location.target.empty())
-				{
-					print("{");
-					print(message.origins.location.target);
-					print("} ");
-				}
-
-				if (not message.origins.location.filename.empty())
-				{
-					out.set_color(out.internal, omode, nyc_white);
-					xx = message.origins.location.filename;
-
-					if (message.origins.location.pos.line > 0)
-					{
-						xx << ':';
-						xx << message.origins.location.pos.line;
-						if (message.origins.location.pos.offset != 0)
-						{
-							xx << ':';
-							xx << message.origins.location.pos.offset;
-							if (message.origins.location.pos.offsetEnd != 0)
-							{
-								xx << '-';
-								xx << message.origins.location.pos.offsetEnd;
-							}
-						}
-					}
-					xx << ": ";
-					print(xx);
-					out.set_color(out.internal, omode, nyc_none);
-				}
-
-
-				if (not message.message.empty())
-				{
-					String msg{message.message};
-					msg.trimRight(" \t\r\n");
-					msg.replace("\t", "    "); // tabs
-
-					auto firstLF = msg.find('\n');
-					if (not (firstLF < message.message.size()))
-					{
-						print(msg);
-					}
-					else
-					{
-						xx.clear() << "\n        " SEP;
-						for (uint i = indent; i--; )
-							xx.write("    ", 4);
-
-						bool addLF = false;
-						msg.words("\n", [&](const AnyString& word) -> bool
-						{
-							if (addLF)
-								print(xx);
-							print(word);
-							addLF = true;
-							return true;
-						});
-					}
-				}
-
-				print("\n");
-				++indent;
-			}
-
-			for (auto& ptr: message.entries)
-				printMessage<unify>(out, *ptr, indent, xx);
-		}
-
-
-	} // anonymous namespace

 	void Message::print(nyconsole_t& out, bool unify)
@@ -254,9 +252,9 @@
 			String tmp;
 			tmp.reserve(1024);
 			if (unify)
-				printMessage<true>(out, *this, 0, tmp);
+				printMessageRecursive<true>(out, *this, tmp);
 			else
-				printMessage<false>(out, *this, 0, tmp);
+				printMessageRecursive<false>(out, *this, tmp);
 		}
 	}

@@ -271,6 +269,5 @@

-
 } // namespace Logs
 } // namespace Nany


Only import _Concurrency implicitly on Darwin and Windows for now.

--- lib/Frontend/Frontend.cpp
+++ lib/Frontend/Frontend.cpp
@@ -753,8 +753,18 @@
   return None;
 }

+/// Enable Swift concurrency on a per-target basis
+static bool shouldImportConcurrencyByDefault(const llvm::Triple &target) {
+  if (target.isOSDarwin())
+    return true;
+  if (target.isOSWindows())
+    return true;
+  return false;
+}
+
 bool CompilerInvocation::shouldImportSwiftConcurrency() const {
-  return !getLangOptions().DisableImplicitConcurrencyModuleImport &&
+  return shouldImportConcurrencyByDefault(getLangOptions().Target) &&
+      !getLangOptions().DisableImplicitConcurrencyModuleImport &&
       getFrontendOptions().InputMode !=
         FrontendOptions::ParseInputMode::SwiftModuleInterface;
 }


openvibe-application-designer :
 * corrected bug on input dialog that caused crash

git-svn-id: ed1ce8e5c168003d808aec37bc6fda77b178f7bb@865 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f

--- openvibe-applications/designer/trunc/src/ovdCInputDialog.cpp
+++ openvibe-applications/designer/trunc/src/ovdCInputDialog.cpp
@@ -13,8 +13,8 @@
 	//retrieve input dialog
 	::GladeXML* l_pInputDialogInterface = glade_xml_new(sGladeXML, "input_dialog", NULL);
 	m_pInputDialog = GTK_DIALOG(glade_xml_get_widget(l_pInputDialogInterface, "input_dialog"));
-	m_pInputDialogLabel = GTK_LABEL(glade_xml_get_widget(l_pInputDialogInterface, "sLabel"));
-	m_pInputDialogEntry = GTK_ENTRY(glade_xml_get_widget(l_pInputDialogInterface, "sEntry"));
+	m_pInputDialogLabel = GTK_LABEL(glade_xml_get_widget(l_pInputDialogInterface, "label"));
+	m_pInputDialogEntry = GTK_ENTRY(glade_xml_get_widget(l_pInputDialogInterface, "entry"));
 	m_pInputDialogOKButton = GTK_BUTTON(glade_xml_get_widget(l_pInputDialogInterface, "button_ok"));
 	m_pInputDialogCancelButton = GTK_BUTTON(glade_xml_get_widget(l_pInputDialogInterface, "button_cancel"));


Simply test for available locations in optimization remarks.

When emitting optimization remarks, we test for the presence of
instruction locations by testing for a valid llvm.dbg.cu annotation.
This is slightly inefficient because we can simply ask whether the
debug location we have is known or not.

Additionally, if my current plan works, I will need to remove the
llvm.dbg.cu annotation from the IL (or prevent it from being generated)
when -Rpass is used without -g.  In those cases, we'll want to generate
line tables but we will want to prevent code generation from emitting
DWARF code for them.

Tested on x86_64.

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

--- lib/IR/DiagnosticInfo.cpp
+++ lib/IR/DiagnosticInfo.cpp
@@ -128,7 +128,7 @@
 }

 bool DiagnosticInfoOptimizationRemarkBase::isLocationAvailable() const {
-  return getFunction().getParent()->getNamedMetadata("llvm.dbg.cu") != nullptr;
+  return getDebugLoc().isUnknown() == false;
 }

 void DiagnosticInfoOptimizationRemarkBase::getLocation(StringRef *Filename,


Initialize asm. inst. transform to identity when picking on empty space

--- src/appleseed/renderer/kernel/rendering/scenepicker.cpp
+++ src/appleseed/renderer/kernel/rendering/scenepicker.cpp
@@ -117,6 +117,7 @@

     result.m_camera = impl->m_project.get_uncached_active_camera();
     result.m_assembly_instance = nullptr;
+    result.m_assembly_instance_transform = Transformd::make_identity();
     result.m_assembly = nullptr;
     result.m_object_instance = nullptr;
     result.m_object = nullptr;


Replace an instance of custom atomics with standard ones.

Eventually I want to get rid of them entirely, but Statistic.h is still blocked
on MSVC bugs. No functionality change.

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

--- lib/IR/DiagnosticInfo.cpp
+++ lib/IR/DiagnosticInfo.cpp
@@ -22,9 +22,9 @@
 #include "llvm/IR/Instruction.h"
 #include "llvm/IR/Metadata.h"
 #include "llvm/IR/Module.h"
-#include "llvm/Support/Atomic.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Regex.h"
+#include <atomic>
 #include <string>

 using namespace llvm;
@@ -87,8 +87,8 @@
 }

 int llvm::getNextAvailablePluginDiagnosticKind() {
-  static sys::cas_flag PluginKindID = DK_FirstPluginKind;
-  return (int)sys::AtomicIncrement(&PluginKindID);
+  static std::atomic<int> PluginKindID(DK_FirstPluginKind);
+  return ++PluginKindID;
 }

 DiagnosticInfoInlineAsm::DiagnosticInfoInlineAsm(const Instruction &I,


addons/imguinodegrapheditor/imguinodegrapheditor.cpp: Minor changes to the demo code to make old saved files still usable.

--- addons/imguinodegrapheditor/imguinodegrapheditor.cpp
+++ addons/imguinodegrapheditor/imguinodegrapheditor.cpp
@@ -2494,10 +2494,10 @@
     MNT_COMBINE_NODE,
     MNT_COMMENT_NODE,
     MNT_COMPLEX_NODE,
-    MNT_OUTPUT_NODE,
 #   ifdef IMGUI_USE_AUTO_BINDING
     MNT_TEXTURE_NODE,
 #   endif
+    MNT_OUTPUT_NODE = 5,    // One problem here when adding new values is backward compatibility with old saved files: they rely on the previously used int values (it should be OK only if we append new values at the end).
     MNT_COUNT
 };
 // used in the "add Node" menu (and optionally as node title names)


fix rdar://15821990 - Don't emit default value for type var in instance init() body.

Swift SVN r12319

--- lib/SILGen/SILGenExpr.cpp
+++ lib/SILGen/SILGenExpr.cpp
@@ -2741,7 +2741,7 @@
   for (auto member : nominal->getMembers()) {
     // Find pattern binding declarations that have initializers.
     auto pbd = dyn_cast<PatternBindingDecl>(member);
-    if (!pbd) continue;
+    if (!pbd || pbd->isStatic()) continue;

     auto init = pbd->getInit();
     if (!init) continue;


[sil-arc-opts] Teach the optimizer that certain instructions whose memory behavior is MayHaveSideEffects do not decrement ref counts.

The relevant instructions are:

1. DeallocStackInst.
2. StrongRetainInst.
3. StrongRetainAutoreleasedInst.
4. StrongRetainUnownedInst.
5. UnownedRetainInst.
6. PartialApplyInst.
7. CondFailInst.
8. CopyAddrInst when initialized.

Swift SVN r12639

--- lib/SILPasses/ARCOpts.cpp
+++ lib/SILPasses/ARCOpts.cpp
@@ -37,6 +37,27 @@

 /// Could Inst decrement the ref count associated with target?
 static bool cannotDecrementRefCount(SILInstruction *Inst, SILValue Target) {
+  // Clear up some small cases where MayHaveSideEffects is too broad for our
+  // purposes and the instruction does not decrement ref counts.
+  switch (Inst->getKind()) {
+  case ValueKind::DeallocStackInst:
+  case ValueKind::StrongRetainInst:
+  case ValueKind::StrongRetainAutoreleasedInst:
+  case ValueKind::StrongRetainUnownedInst:
+  case ValueKind::UnownedRetainInst:
+  case ValueKind::PartialApplyInst:
+  case ValueKind::CondFailInst:
+    return true;
+  case ValueKind::CopyAddrInst: {
+    auto *CA = cast<CopyAddrInst>(Inst);
+    if (CA->isInitializationOfDest() == IsInitialization_t::IsInitialization)
+      return true;
+  }
+  SWIFT_FALLTHROUGH;
+  default:
+    break;
+  }
+
   // Just make sure that we do not have side effects.
   return Inst->getMemoryBehavior() !=
     SILInstruction::MemoryBehavior::MayHaveSideEffects;


Sema: Simplify away one-iteration loops.

No functionality change.

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

--- lib/Sema/SemaChecking.cpp
+++ lib/Sema/SemaChecking.cpp
@@ -4400,16 +4400,10 @@
   CheckReturnStackAddr(*this, RetValExp, lhsType, ReturnLoc);

   // Check if the return value is null but should not be.
-  if (Attrs)
-    for (specific_attr_iterator<ReturnsNonNullAttr>
-          I = specific_attr_iterator<ReturnsNonNullAttr>(Attrs->begin()),
-          E = specific_attr_iterator<ReturnsNonNullAttr>(Attrs->end());
-          I != E; ++I) {
-      if (CheckNonNullExpr(*this, RetValExp))
-        Diag(ReturnLoc, diag::warn_null_ret)
-          << (isObjCMethod ? 1 : 0) << RetValExp->getSourceRange();
-      break;
-    }
+  if (Attrs && hasSpecificAttr<ReturnsNonNullAttr>(*Attrs) &&
+      CheckNonNullExpr(*this, RetValExp))
+    Diag(ReturnLoc, diag::warn_null_ret)
+      << (isObjCMethod ? 1 : 0) << RetValExp->getSourceRange();

   // C++11 [basic.stc.dynamic.allocation]p4:
   //   If an allocation function declared with a non-throwing
@@ -7381,10 +7375,7 @@
     return false;

   if (VD) {
-    for (specific_attr_iterator<TypeTagForDatatypeAttr>
-             I = VD->specific_attr_begin<TypeTagForDatatypeAttr>(),
-             E = VD->specific_attr_end<TypeTagForDatatypeAttr>();
-         I != E; ++I) {
+    if (TypeTagForDatatypeAttr *I = VD->getAttr<TypeTagForDatatypeAttr>()) {
       if (I->getArgumentKind() != ArgumentKind) {
         FoundWrongKind = true;
         return false;


Remove dead code identified by Aaron Ballman.

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

--- lib/Sema/SemaDeclAttr.cpp
+++ lib/Sema/SemaDeclAttr.cpp
@@ -4545,15 +4545,11 @@
   DeclarationName Name = D->getDeclName();
   if (!Message.empty()) {
     S.Diag(Loc, diag_message) << Name << Message;
-//    S.Diag(D->getLocation(), diag::note_availability_specified_here)
-//      << D << available_here_select_kind;
     if (ObjCProperty)
       S.Diag(ObjCProperty->getLocation(), diag::note_property_attribute)
         << ObjCProperty->getDeclName() << property_note_select;
   } else if (!UnknownObjCClass) {
     S.Diag(Loc, diag) << Name;
-//    S.Diag(D->getLocation(), diag::note_availability_specified_here)
-//      << D << available_here_select_kind;
     if (ObjCProperty)
       S.Diag(ObjCProperty->getLocation(), diag::note_property_attribute)
         << ObjCProperty->getDeclName() << property_note_select;


Add an assert to further check the invariant that a null pointer
corresponds to another argument being valid.

This makes it clear that the code is correct despite the PVS-Studio
report that a pointer might be dereferenced prior to being checked for
whether it is null. It likely is also enough for static analyzers to not
flag the code.

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

--- lib/Sema/SemaExprObjC.cpp
+++ lib/Sema/SemaExprObjC.cpp
@@ -2539,6 +2539,10 @@
                                       SourceLocation RBracLoc,
                                       MultiExprArg ArgsIn,
                                       bool isImplicit) {
+  assert((Receiver || SuperLoc.isValid()) && "If the Receiver is null, the "
+                                             "SuperLoc must be valid so we can "
+                                             "use it instead.");
+
   // The location of the receiver.
   SourceLocation Loc = SuperLoc.isValid()? SuperLoc : Receiver->getLocStart();
   SourceRange RecRange =


remove whitespace from qbluetoothlocaldevice_symbian.cpp

--- src/connectivity/bluetooth/qbluetoothlocaldevice_symbian.cpp
+++ src/connectivity/bluetooth/qbluetoothlocaldevice_symbian.cpp
@@ -269,7 +269,7 @@
     BluetoothSymbianPairingAdapter *pairingAdapter = new BluetoothSymbianPairingAdapter(address,q);

     // After pairing has completed we emit pairingFinished signal in every case.
-    // earlier we checked pairing status from Symbian Bluetooth registry at this point but it
+    // earlier we checked pairing status from Symbian Bluetooth registry at this point but it
     // was not updated and the result was that we emitted wrong pairing status.
     QObject::connect(pairingAdapter, SIGNAL(pairingFinished(const QBluetoothAddress&,QBluetoothLocalDevice::Pairing)),
         q, SLOT(_q_pairingFinished(const QBluetoothAddress&,QBluetoothLocalDevice::Pairing)));


fixed memory leak in no-copy rule

fixed memory leak in no-copy rule

--- src/compiler/rewriter/tools/dataflow_annotations.cpp
+++ src/compiler/rewriter/tools/dataflow_annotations.cpp
@@ -949,7 +949,8 @@
         sources.push_back(node);

       std::vector<expr*>* varSources = new std::vector<expr*>;
-      theVarSourcesMap.insert(VarSourcesPair(e, varSources));
+      if (theVarSourcesMap.insert(VarSourcesPair(e, varSources)).second == false)
+        delete varSources;

       return;
     }


Don't think this is needed; disable

Don't think this is needed; disable

--- src/Dataflow/Engine/Controller/DynamicPortManager.cc
+++ src/Dataflow/Engine/Controller/DynamicPortManager.cc
@@ -86,10 +86,10 @@

 void DynamicPortManager::enable()
 {
-  enabled_ = true;
+  //enabled_ = true;
 }

 void DynamicPortManager::disable()
 {
-  enabled_ = false;
+  //enabled_ = false;
 }


Updating Unit Test because of /W4 turned ON.

--- modules/iothubhttp/tests/iothubhttp_unittests/iothubhttp_unittests.cpp
+++ modules/iothubhttp/tests/iothubhttp_unittests/iothubhttp_unittests.cpp
@@ -819,7 +819,7 @@
         STRICT_EXPECTED_CALL(mocks, STRING_construct("theAwesomeSuffix.com"))
             .IgnoreArgument(1);

-		STRICT_EXPECTED_CALL(mocks, IoTHubTransport_Create(HTTP_Protocol, "theIoTHub42", "theAwesomeSuffix.com"))
+		STRICT_EXPECTED_CALL(mocks, IoTHubTransport_Create((IOTHUB_CLIENT_TRANSPORT_PROVIDER)HTTP_Protocol, "theIoTHub42", "theAwesomeSuffix.com"))
 			.IgnoreAllArguments();

         ///act
@@ -849,7 +849,7 @@
         STRICT_EXPECTED_CALL(mocks, VECTOR_destroy(IGNORED_PTR_ARG))
             .IgnoreArgument(1);

-		STRICT_EXPECTED_CALL(mocks, IoTHubTransport_Create(HTTP_Protocol, "theIoTHub42", "theAwesomeSuffix.com"))
+		STRICT_EXPECTED_CALL(mocks, IoTHubTransport_Create((IOTHUB_CLIENT_TRANSPORT_PROVIDER)HTTP_Protocol, "theIoTHub42", "theAwesomeSuffix.com"))
 			.IgnoreAllArguments();
 		STRICT_EXPECTED_CALL(mocks, IoTHubTransport_Destroy(IGNORED_PTR_ARG))
 			.IgnoreArgument(1);
@@ -885,7 +885,7 @@
         STRICT_EXPECTED_CALL(mocks, gballoc_free(IGNORED_PTR_ARG))
             .IgnoreArgument(1);

-		STRICT_EXPECTED_CALL(mocks, IoTHubTransport_Create(HTTP_Protocol, "theIoTHub42", "theAwesomeSuffix.com"))
+		STRICT_EXPECTED_CALL(mocks, IoTHubTransport_Create((IOTHUB_CLIENT_TRANSPORT_PROVIDER)HTTP_Protocol, "theIoTHub42", "theAwesomeSuffix.com"))
 			.IgnoreAllArguments();
 		STRICT_EXPECTED_CALL(mocks, IoTHubTransport_Destroy(IGNORED_PTR_ARG))
 			.IgnoreArgument(1);
@@ -922,7 +922,7 @@
 		STRICT_EXPECTED_CALL(mocks, gballoc_free(IGNORED_PTR_ARG))
 			.IgnoreArgument(1);

-		STRICT_EXPECTED_CALL(mocks, IoTHubTransport_Create(HTTP_Protocol, "theIoTHub42", "theAwesomeSuffix.com"))
+		STRICT_EXPECTED_CALL(mocks, IoTHubTransport_Create((IOTHUB_CLIENT_TRANSPORT_PROVIDER)HTTP_Protocol, "theIoTHub42", "theAwesomeSuffix.com"))
 			.IgnoreAllArguments()
 			.SetFailReturn((TRANSPORT_HANDLE)NULL);


Codegen optimizations for hpack_parser on_hdr.

Currently, the log statements for on_hdr clobber some registers even if it is
disabled by default. Additionally, the no-error path is doing some unnecessary
jumps. This PR separates out and un-inlines the logging code, and marks the
no-error case as likely to occur.

This results in slightly faster hpack_parsing, e.g.:
BM_HpackParserParseHeader<IndexedSingleStaticElem, UnrefHeader>
23.8ns ± 0%             19.8ns ± 0%  -16.81%        (p=0.000 n=17+17)
BM_HpackParserParseHeader<AddIndexedSingleStaticElem, UnrefHeader>
160ns ± 0%              154ns ± 0%   -3.18%        (p=0.000 n=19+20)
BM_HpackParserParseHeader<KeyIndexedSingleStaticElem, UnrefHeader>
216ns ± 1%              214ns ± 2%   -0.70%        (p=0.004 n=18+18)
BM_HpackParserParseHeader<IndexedSingleInternedElem, UnrefHeader>
35.4ns ± 0%             34.4ns ± 0%   -2.93%        (p=0.000 n=16+16)
BM_HpackParserParseHeader<RepresentativeClientInitialMetadata, UnrefHeader>
140ns ± 0%              130ns ± 0%   -7.06%        (p=0.000 n=17+18)
BM_HpackParserParseHeader<MoreRepresentativeClientInitialMetadata, UnrefHeader>
644ns ± 1%              636ns ± 2%   -1.29%        (p=0.003 n=17+20)
BM_HpackParserParseHeader<RepresentativeServerInitialMetadata, UnrefHeader>
49.1ns ± 0%             38.7ns ± 0%  -21.13%        (p=0.000 n=19+18)
BM_HpackParserParseHeader<RepresentativeServerTrailingMetadata, UnrefHeader>
47.1ns ± 0%             43.2ns ± 0%   -8.17%        (p=0.000 n=20+19)
BM_HpackParserParseHeader<RepresentativeClientInitialMetadata, OnInitialHeader>
452ns ± 1%              417ns ± 1%   -7.86%        (p=0.000 n=20+20)
BM_HpackParserParseHeader<MoreRepresentativeClientInitialMetadata,
OnInitialHeader>
1.06µs ± 1%             1.02µs ± 2%   -3.42%        (p=0.000 n=19+20)
BM_HpackParserParseHeader<RepresentativeServerInitialMetadata, OnInitialHeader>
156ns ± 0%              142ns ± 1%   -9.08%        (p=0.000 n=17+19)
BM_HpackParserParseHeader<SameDeadline, OnHeaderTimeout>
117ns ± 0%              113ns ± 1%   -3.98%        (p=0.000 n=20+20)

--- src/core/ext/transport/chttp2/transport/hpack_parser.cc
+++ src/core/ext/transport/chttp2/transport/hpack_parser.cc
@@ -622,33 +622,37 @@
     255,
 };

+static void GPR_ATTRIBUTE_NOINLINE on_hdr_log(grpc_mdelem md) {
+  char* k = grpc_slice_to_c_string(GRPC_MDKEY(md));
+  char* v = nullptr;
+  if (grpc_is_binary_header_internal(GRPC_MDKEY(md))) {
+    v = grpc_dump_slice(GRPC_MDVALUE(md), GPR_DUMP_HEX);
+  } else {
+    v = grpc_slice_to_c_string(GRPC_MDVALUE(md));
+  }
+  gpr_log(
+      GPR_INFO,
+      "Decode: '%s: %s', elem_interned=%d [%d], k_interned=%d, v_interned=%d",
+      k, v, GRPC_MDELEM_IS_INTERNED(md), GRPC_MDELEM_STORAGE(md),
+      grpc_slice_is_interned(GRPC_MDKEY(md)),
+      grpc_slice_is_interned(GRPC_MDVALUE(md)));
+  gpr_free(k);
+  gpr_free(v);
+}
+
 /* emission helpers */
-static grpc_error* on_hdr(grpc_chttp2_hpack_parser* p, grpc_mdelem md,
-                          int add_to_table) {
+template <bool do_add>
+static grpc_error* on_hdr(grpc_chttp2_hpack_parser* p, grpc_mdelem md) {
   if (GRPC_TRACE_FLAG_ENABLED(grpc_http_trace)) {
-    char* k = grpc_slice_to_c_string(GRPC_MDKEY(md));
-    char* v = nullptr;
-    if (grpc_is_binary_header_internal(GRPC_MDKEY(md))) {
-      v = grpc_dump_slice(GRPC_MDVALUE(md), GPR_DUMP_HEX);
-    } else {
-      v = grpc_slice_to_c_string(GRPC_MDVALUE(md));
-    }
-    gpr_log(
-        GPR_INFO,
-        "Decode: '%s: %s', elem_interned=%d [%d], k_interned=%d, v_interned=%d",
-        k, v, GRPC_MDELEM_IS_INTERNED(md), GRPC_MDELEM_STORAGE(md),
-        grpc_slice_is_interned(GRPC_MDKEY(md)),
-        grpc_slice_is_interned(GRPC_MDVALUE(md)));
-    gpr_free(k);
-    gpr_free(v);
-  }
-  if (add_to_table) {
-    GPR_ASSERT(GRPC_MDELEM_STORAGE(md) == GRPC_MDELEM_STORAGE_INTERNED ||
-               GRPC_MDELEM_STORAGE(md) == GRPC_MDELEM_STORAGE_STATIC);
+    on_hdr_log(md);
+  }
+  if (do_add) {
+    GPR_DEBUG_ASSERT(GRPC_MDELEM_STORAGE(md) == GRPC_MDELEM_STORAGE_INTERNED ||
+                     GRPC_MDELEM_STORAGE(md) == GRPC_MDELEM_STORAGE_STATIC);
     grpc_error* err = grpc_chttp2_hptbl_add(&p->table, md);
-    if (err != GRPC_ERROR_NONE) return err;
-  }
-  if (p->on_header == nullptr) {
+    if (GPR_UNLIKELY(err != GRPC_ERROR_NONE)) return err;
+  }
+  if (GPR_UNLIKELY(p->on_header == nullptr)) {
     GRPC_MDELEM_UNREF(md);
     return GRPC_ERROR_CREATE_FROM_STATIC_STRING("on_header callback not set");
   }
@@ -765,7 +769,7 @@
   }
   GRPC_MDELEM_REF(md);
   GRPC_STATS_INC_HPACK_RECV_INDEXED();
-  grpc_error* err = on_hdr(p, md, 0);
+  grpc_error* err = on_hdr<false>(p, md);
   if (err != GRPC_ERROR_NONE) return err;
   return parse_begin(p, cur, end);
 }
@@ -798,11 +802,9 @@
   grpc_mdelem md = grpc_chttp2_hptbl_lookup(&p->table, p->index);
   GPR_ASSERT(!GRPC_MDISNULL(md)); /* handled in string parsing */
   GRPC_STATS_INC_HPACK_RECV_LITHDR_INCIDX();
-  grpc_error* err =
-      on_hdr(p,
-             grpc_mdelem_from_slices(grpc_slice_ref_internal(GRPC_MDKEY(md)),
-                                     take_string(p, &p->value, true)),
-             1);
+  grpc_error* err = on_hdr<true>(
+      p, grpc_mdelem_from_slices(grpc_slice_ref_internal(GRPC_MDKEY(md)),
+                                 take_string(p, &p->value, true)));
   if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
   return parse_begin(p, cur, end);
 }
@@ -813,10 +815,8 @@
                                           const uint8_t* end) {
   GRPC_STATS_INC_HPACK_RECV_LITHDR_INCIDX_V();
   grpc_error* err =
-      on_hdr(p,
-             grpc_mdelem_from_slices(take_string(p, &p->key, true),
-                                     take_string(p, &p->value, true)),
-             1);
+      on_hdr<true>(p, grpc_mdelem_from_slices(take_string(p, &p->key, true),
+                                              take_string(p, &p->value, true)));
   if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
   return parse_begin(p, cur, end);
 }
@@ -865,11 +865,9 @@
   grpc_mdelem md = grpc_chttp2_hptbl_lookup(&p->table, p->index);
   GPR_ASSERT(!GRPC_MDISNULL(md)); /* handled in string parsing */
   GRPC_STATS_INC_HPACK_RECV_LITHDR_NOTIDX();
-  grpc_error* err =
-      on_hdr(p,
-             grpc_mdelem_from_slices(grpc_slice_ref_internal(GRPC_MDKEY(md)),
-                                     take_string(p, &p->value, false)),
-             0);
+  grpc_error* err = on_hdr<false>(
+      p, grpc_mdelem_from_slices(grpc_slice_ref_internal(GRPC_MDKEY(md)),
+                                 take_string(p, &p->value, false)));
   if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
   return parse_begin(p, cur, end);
 }
@@ -879,11 +877,9 @@
                                           const uint8_t* cur,
                                           const uint8_t* end) {
   GRPC_STATS_INC_HPACK_RECV_LITHDR_NOTIDX_V();
-  grpc_error* err =
-      on_hdr(p,
-             grpc_mdelem_from_slices(take_string(p, &p->key, true),
-                                     take_string(p, &p->value, false)),
-             0);
+  grpc_error* err = on_hdr<false>(
+      p, grpc_mdelem_from_slices(take_string(p, &p->key, true),
+                                 take_string(p, &p->value, false)));
   if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
   return parse_begin(p, cur, end);
 }
@@ -932,11 +928,9 @@
   grpc_mdelem md = grpc_chttp2_hptbl_lookup(&p->table, p->index);
   GPR_ASSERT(!GRPC_MDISNULL(md)); /* handled in string parsing */
   GRPC_STATS_INC_HPACK_RECV_LITHDR_NVRIDX();
-  grpc_error* err =
-      on_hdr(p,
-             grpc_mdelem_from_slices(grpc_slice_ref_internal(GRPC_MDKEY(md)),
-                                     take_string(p, &p->value, false)),
-             0);
+  grpc_error* err = on_hdr<false>(
+      p, grpc_mdelem_from_slices(grpc_slice_ref_internal(GRPC_MDKEY(md)),
+                                 take_string(p, &p->value, false)));
   if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
   return parse_begin(p, cur, end);
 }
@@ -946,11 +940,9 @@
                                           const uint8_t* cur,
                                           const uint8_t* end) {
   GRPC_STATS_INC_HPACK_RECV_LITHDR_NVRIDX_V();
-  grpc_error* err =
-      on_hdr(p,
-             grpc_mdelem_from_slices(take_string(p, &p->key, true),
-                                     take_string(p, &p->value, false)),
-             0);
+  grpc_error* err = on_hdr<false>(
+      p, grpc_mdelem_from_slices(take_string(p, &p->key, true),
+                                 take_string(p, &p->value, false)));
   if (err != GRPC_ERROR_NONE) return parse_error(p, cur, end, err);
   return parse_begin(p, cur, end);
 }


Fix typo - symetric -> symmetric.

Fix typo - symetric -> symmetric.

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

--- lib/Sema/SemaOverload.cpp
+++ lib/Sema/SemaOverload.cpp
@@ -7527,7 +7527,7 @@
     llvm::SmallPtrSet<QualType, 8> AddedTypes;

     for (int Arg = 0; Arg < 2; ++Arg) {
-      QualType AsymetricParamTypes[2] = {
+      QualType AsymmetricParamTypes[2] = {
         S.Context.getPointerDiffType(),
         S.Context.getPointerDiffType(),
       };
@@ -7539,11 +7539,11 @@
         if (!PointeeTy->isObjectType())
           continue;

-        AsymetricParamTypes[Arg] = *Ptr;
+        AsymmetricParamTypes[Arg] = *Ptr;
         if (Arg == 0 || Op == OO_Plus) {
           // operator+(T*, ptrdiff_t) or operator-(T*, ptrdiff_t)
           // T* operator+(ptrdiff_t, T*);
-          S.AddBuiltinCandidate(*Ptr, AsymetricParamTypes, Args, CandidateSet);
+          S.AddBuiltinCandidate(*Ptr, AsymmetricParamTypes, Args, CandidateSet);
         }
         if (Op == OO_Minus) {
           // ptrdiff_t operator-(T, T);


const $ ++x

const $ ++x

--- modules/perception/obstacle/camera/visualizer/common/gl_raster_text.cc
+++ modules/perception/obstacle/camera/visualizer/common/gl_raster_text.cc
@@ -341,15 +341,15 @@

 void GLRasterText::print_multiline(
     const char *s,
-    int top_left_x,
-    int top_left_y) {
+    const int top_left_x,
+    const int top_left_y) {
   glPushAttrib(GL_LIST_BIT);
   int line_count = 1;
-  for (uint i = 0; i < strlen(s); i++) {
+  for (uint i = 0; i < strlen(s); ++i) {
     if (s[i] == '\n') {
       // 18: varies to font size
       glRasterPos2i(top_left_x, top_left_y+18*line_count);
-      line_count++;
+      ++line_count;
     }
     glCallList(s_font_offset_+s[i]);
   }


VFS-6630 Fixed ReplicaStatusChanged serialization

--- src/events/subscriptions/replicaStatusChangedSubscription.cc
+++ src/events/subscriptions/replicaStatusChangedSubscription.cc
@@ -53,7 +53,7 @@
 ProtoSubscriptionPtr ReplicaStatusChangedSubscription::serialize() const
 {
     auto subscriptionMsg = std::make_unique<clproto::Subscription>();
-    auto msg = subscriptionMsg->mutable_file_attr_changed();
+    auto msg = subscriptionMsg->mutable_replica_status_changed();
     msg->set_file_uuid(m_fileUuid);
     msg->set_time_threshold(m_remoteThreshold.count());


Fix bottom-up processing of tuple exprs in two ways:
1. Single-element tuples with names are not grouping parens.
2. Redo Sema of a tuple if we do propagate a type into it.

Also, remove the previous hack for trying to make:
  var e : ZeroOneTwoThree = :Three(1, 2, 3)

Unambiguous.  While it would be nice, it isn't essential and it clutters the model.

Swift SVN r308

--- lib/Sema/TypeChecking.cpp
+++ lib/Sema/TypeChecking.cpp
@@ -981,11 +981,20 @@
   // different cases.  If the tuple has a single element and the destination
   // type is not a tuple type, then this just recursively forces the scalar
   // type into the single element.
-  if (E->NumSubExprs == 1) {
+  if (E->NumSubExprs == 1 &&
+      // A tuple expr with a single subexpression and no name is just a grouping
+      // paren.
+      (E->SubExprNames == 0 || E->SubExprNames[0].empty())) {
+
     Expr *ERes = HandleConversionToType(E->SubExprs[0], DestTy, true, TC);
     if (ERes == 0) return 0;

     E->SubExprs[0] = ERes;
+
+    if (SemaTupleExpr(E->LParenLoc, E->SubExprs, E->SubExprNames,
+                      E->NumSubExprs, E->RParenLoc, E->Ty, TC))
+      return 0;
+
     return E;
   }

@@ -1445,27 +1454,18 @@
   // separately and independently of the var.  If the user really really wanted
   // something silly like this, then they should have used parens, as in:
   //  var x = (4 foo())
-  if (SequenceExpr *SE = dyn_cast<SequenceExpr>(E))
-#if 0
-    // FIXME: This is busted for something like this:
-    //   var e : ZeroOneTwoThree = :Three(1, 2, 3)      foo();
-    // We'll end up trying to convert foo() to be a ZeroOneTwoThree, which will
-    // fail, and then we get a UnresolvedTypes error.  This may be acceptable,
-    // but it is unfortunate that the ; placement has a semantic effect here.
-    // Disabling this so it continues to show a test failure.
-#endif
-    if (!isa<DependentType>(SE->Elements[0]->Ty) || 1) {
-      E = SE->Elements[0];
-      if (ExcessElements)
-        ExcessElements->append(SE->Elements+1, SE->Elements+SE->NumElements);
-      else {
-        // If this context doesn't want any extra expressions, reject them. This
-        // is not the best error message in the world :).
-        for (unsigned i = 1, e = SE->NumElements; i != e; ++i)
-          error(SE->Elements[i]->getLocStart(),
-                "expected a singular expression: this expression is unbound");
-      }
-    }
+  if (SequenceExpr *SE = dyn_cast<SequenceExpr>(E)) {
+    E = SE->Elements[0];
+    if (ExcessElements)
+      ExcessElements->append(SE->Elements+1, SE->Elements+SE->NumElements);
+    else {
+      // If this context doesn't want any extra expressions, reject them. This
+      // is not the best error message in the world :).
+      for (unsigned i = 1, e = SE->NumElements; i != e; ++i)
+        error(SE->Elements[i]->getLocStart(),
+              "expected a singular expression: this expression is unbound");
+    }
+  }

   if (DestTy)
     E = convertToType(E, DestTy, false, Res);


Perception: use default value

Perception: use default value

--- modules/perception/obstacle/lidar/tracker/hm_tracker/tracked_object.cc
+++ modules/perception/obstacle/lidar/tracker/hm_tracker/tracked_object.cc
@@ -35,7 +35,7 @@
     velocity = Eigen::Vector3f::Zero();
     acceleration = Eigen::Vector3f::Zero();
     type = object_ptr->type;
-    velocity_uncertainty = Eigen::Matrix3f::Identity() * FLT_EPSILON;
+    velocity_uncertainty = Eigen::Matrix3f::Identity() * 5;
   }
 }


fix filepath and image size

fix filepath and image size

--- src/Interface/Application/MainWindowCollaborators.cc
+++ src/Interface/Application/MainWindowCollaborators.cc
@@ -459,7 +459,11 @@
   "\n\n"
   "**The default path settings can be modified from Preferences > Paths**");

-  page->codeEdit->setPlainText("scirun_save_network(\"/YOUR/FILENAME/PATH\")");
+  auto dataDirString = Core::Preferences::Instance().dataDirectory().string();
+
+  page->codeEdit->setPlainText("scirun_save_network(\"" +
+  QString::fromStdString(dataDirString) +
+  "\")");

   connect(page->sendButton, &QPushButton::clicked, [this, page](){displayPython_(page->codeEdit->toPlainText());});
   return page;
@@ -637,6 +641,7 @@
   return page;
 }

+
 QWizardPage* PythonWizard::createLoadNetworkPage()
 {
   auto page = new PythonWizardCodePage;
@@ -645,9 +650,8 @@
     "\n\n"
     "Execute network with `scirun_execute_all()` command");

-  auto dataDirString = Core::Application::Instance().parameters()->dataDirectory().get().string();
-
-  qDebug() << "DataDir:" << dataDirString;
+  // TODO: direct path to a working example network
+  auto dataDirString = Core::Preferences::Instance().dataDirectory().string();
   page->codeEdit->setPlainText("scirun_load_network(\"" +
     QString::fromStdString(dataDirString) +
     "\")"
@@ -744,10 +748,11 @@
   page->setSubTitle("Remove the connection pipe between the CreateFieldData module and the ExtractIsosurface module "
     "and add an IntefaceWithPython module. Connect the output from the CreateFieldData module to the second input of InterfaceWithPython. "
     "Connect the fourth output of InterfaceWithPython first input of the ExtractIsosurface module."
-    "The network should look like the image to the right.");
+    "The network should look like the image below");
   auto layout = new QVBoxLayout;
   auto pic = new QLabel;
-  pic->setPixmap(QPixmap(":/general/Resources/Wizard/int_with_py_network.png"));
+  auto image = new QPixmap(":/general/Resources/Wizard/int_with_py_network.png");
+  pic->setPixmap(image->scaledToHeight(300, Qt::FastTransformation));
   layout->addWidget(pic);
   page->setLayout(layout);
   return page;


Add to factory

Add to factory

--- src/Interface/Modules/Factory/ModuleDialogFactory.cc
+++ src/Interface/Modules/Factory/ModuleDialogFactory.cc
@@ -37,6 +37,7 @@
 #include <Interface/Modules/DataIO/WriteFieldDialog.h>
 #include <Interface/Modules/Math/EvaluateLinearAlgebraUnaryDialog.h>
 #include <Interface/Modules/Math/EvaluateLinearAlgebraBinaryDialog.h>
+#include <Interface/Modules/Math/EvaluateLinearAlgebraGeneralDialog.h>
 #include <Interface/Modules/Math/ReportMatrixInfoDialog.h>
 #include <Interface/Modules/Math/CreateMatrixDialog.h>
 #include <Interface/Modules/Math/AppendMatrixDialog.h>
@@ -128,6 +129,7 @@
     ADD_MODULE_DIALOG(ReadBundle, ReadBundleDialog)
     ADD_MODULE_DIALOG(EvaluateLinearAlgebraUnary, EvaluateLinearAlgebraUnaryDialog)
     ADD_MODULE_DIALOG(EvaluateLinearAlgebraBinary, EvaluateLinearAlgebraBinaryDialog)
+    ADD_MODULE_DIALOG(EvaluateLinearAlgebraGeneral, EvaluateLinearAlgebraGeneralDialog)
     ADD_MODULE_DIALOG(ShowString, ShowStringDialog)
     ADD_MODULE_DIALOG(ShowField, ShowFieldDialog)
     ADD_MODULE_DIALOG(ShowFieldGlyphs, ShowFieldGlyphsDialog)


p10_cpu_set_frequency,p10_setup_evid -- update unlock report handling

after PLL frequency is moved
- clear sticky PLL unlock bits in ERROR_REG
- restore saved PLL unlock error mask in SLAVE_CONFIG_REG,
  rather than blindly clearing, to respect any masking applied by
  initfile/IPL (DD1 RCS filter PLL bits always need to remain
  masked, for example)

Change-Id: Idfe4cff1f23fc5ce6c514d48edd714718173573b
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/113237
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Tested-by: FSP CI Jenkins <aa9e4d9ac7cd25905e9c0dd36d4150516e73dd86@us.ibm.com>
Tested-by: HWSV CI <ae069ce3805842f4ed79e0ef7868baadb5df0a6b@us.ibm.com>
Tested-by: Hostboot CI <52521565bd8ea18a2b112942dce4f4220a97c2c8@us.ibm.com>
Reviewed-by: Dean Sanner <3b8f978f111a0718dcf88848e092ac780da17ab3@us.ibm.com>
Reviewed-by: Joseph J McGill <4a85c6614f9f065f63d8fd57cde15e48af07ea2a@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/114003
Tested-by: Jenkins OP Build CI <e610bd72261d3c0a48f1e8ae36832ab00774d426@us.ibm.com>
Tested-by: Jenkins OP HW <0eb0fff262f74a65a832afbcc7b153e391c9a3fd@us.ibm.com>
Tested-by: Jenkins Combined Simics CI <8312af3886dfc9bb930f549023677220805b137e@us.ibm.com>

--- src/import/chips/p10/procedures/hwp/pm/p10_setup_evid.C
+++ src/import/chips/p10/procedures/hwp/pm/p10_setup_evid.C
@@ -5,7 +5,7 @@
 /*                                                                        */
 /* OpenPOWER HostBoot Project                                             */
 /*                                                                        */
-/* Contributors Listed Below - COPYRIGHT 2019,2020                        */
+/* Contributors Listed Below - COPYRIGHT 2019,2021                        */
 /* [+] International Business Machines Corp.                              */
 /*                                                                        */
 /*                                                                        */
@@ -706,10 +706,24 @@

 {
     fapi2::buffer<uint64_t> l_data64;
+    uint8_t l_mask_restore = 0;
+    using namespace scomt::proc;

     // Only change the DPLL if the values are non-zero
     do
     {
+        // save original mask value, to be restored later
+        FAPI_TRY( fapi2::getScom( i_target, TP_TPCHIP_NET_PCBSLPERV_SLAVE_CONFIG_REG, l_data64 ),
+                  "Failed To Write PERV_SLAVE_CONFIG_REG" );
+
+        l_data64.extractToRight < P10_20_TP_TPCHIP_NET_PCBSLPERV_SLAVE_CONFIG_REG_CFG_MASK_PLL_ERRS,
+                                P10_20_TP_TPCHIP_NET_PCBSLPERV_SLAVE_CONFIG_REG_CFG_MASK_PLL_ERRS_LEN > ( l_mask_restore );
+
+        l_data64.insertFromRight < P10_20_TP_TPCHIP_NET_PCBSLPERV_SLAVE_CONFIG_REG_CFG_MASK_PLL_ERRS,
+                                 P10_20_TP_TPCHIP_NET_PCBSLPERV_SLAVE_CONFIG_REG_CFG_MASK_PLL_ERRS_LEN > ( l_mask_restore | 0x01 );
+
+        FAPI_TRY( fapi2::putScom( i_target, TP_TPCHIP_NET_PCBSLPERV_SLAVE_CONFIG_REG, l_data64 ),
+                  "Failed To Write PERV_SLAVE_CONFIG_REG" );

         FAPI_TRY(fapi2::getScom(i_target, NEST_DPLL_FREQ, l_data64),
                  "ERROR: Failed to read for EQ_QPPM_DPLL_FREQ");
@@ -734,6 +748,23 @@

         FAPI_TRY(fapi2::putScom(i_target, NEST_DPLL_FREQ, l_data64),
                  "ERROR: Failed to write for EQ_QPPM_DPLL_FREQ");
+
+        // clear sticky PLL unlock indicator before unmasking reporting
+        // register is WCLEAR
+        l_data64.flush<0>().insertFromRight< TP_TPCHIP_NET_PCBSLPERV_ERROR_REG_PLL_UNLOCK_ERROR,
+                       TP_TPCHIP_NET_PCBSLPERV_ERROR_REG_PLL_UNLOCK_ERROR_LEN > ( 0x01 );
+        FAPI_TRY( fapi2::putScom( i_target, TP_TPCHIP_NET_PCBSLPERV_ERROR_REG, l_data64 ),
+                  "Failed to Write PERV_ERROR_REG");
+
+        // re-enable error reporting
+        FAPI_TRY( fapi2::getScom( i_target, TP_TPCHIP_NET_PCBSLPERV_SLAVE_CONFIG_REG, l_data64 ),
+                  "Failed To Read PERV_SLAVE_CONFIG_REG" );
+
+        l_data64.insertFromRight< P10_20_TP_TPCHIP_NET_PCBSLPERV_SLAVE_CONFIG_REG_CFG_MASK_PLL_ERRS,
+                                  P10_20_TP_TPCHIP_NET_PCBSLPERV_SLAVE_CONFIG_REG_CFG_MASK_PLL_ERRS_LEN > ( l_mask_restore );
+
+        FAPI_TRY( fapi2::putScom( i_target, TP_TPCHIP_NET_PCBSLPERV_SLAVE_CONFIG_REG, l_data64 ),
+                  "Failed To Write PERV_SLAVE_CONFIG_REG" );
     }
     while (0);


INTEGRATION: CWS sdksample (1.3.124); FILE MERGED 2004/08/03 15:33:01 dbo 1.3.124.2: revised sample code Issue number: Submitted by: Reviewed by: 2004/06/30 09:10:25 jsc 1.3.124.1: #i29308# use of new UNO features

--- odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx
+++ odk/examples/DevelopersGuide/Components/CppComponent/service2_impl.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: service2_impl.cxx,v $
  *
- *  $Revision: 1.3 $
- *
- *  last change: $Author: hr $ $Date: 2003-06-30 15:13:19 $
+ *  $Revision: 1.4 $
+ *
+ *  last change: $Author: rt $ $Date: 2005-01-31 16:13:51 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  the BSD license.
@@ -59,54 +59,39 @@
 extern Sequence< OUString > SAL_CALL  getSupportedServiceNames_MyService1Impl();
 extern OUString SAL_CALL getImplementationName_MyService1Impl();
 extern Reference< XInterface > SAL_CALL create_MyService1Impl(
-                                        Reference< XComponentContext > const & xContext )
-                                            SAL_THROW( () );
+    Reference< XComponentContext > const & xContext )
+    SAL_THROW( () );

 static Sequence< OUString > getSupportedServiceNames_MyService2Impl()
 {
-    static Sequence < OUString > *pNames = 0;
-    if( ! pNames )
-    {
-//      MutexGuard guard( Mutex::getGlobalMutex() );
-        if( !pNames )
-        {
-            static Sequence< OUString > seqNames(1);
-            seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("my_module.MyService2"));
-            pNames = &seqNames;
-        }
-    }
-    return *pNames;
+    Sequence<OUString> names(1);
+    names[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("my_module.MyService2"));
+    return names;
 }

 static OUString getImplementationName_MyService2Impl()
 {
-    static OUString *pImplName = 0;
-    if( ! pImplName )
-    {
-//      MutexGuard guard( Mutex::getGlobalMutex() );
-        if( ! pImplName )
-        {
-            static OUString implName( RTL_CONSTASCII_USTRINGPARAM("my_module.my_sc_implementation.MyService2") );
-            pImplName = &implName;
-        }
-    }
-    return *pImplName;
+    return OUString( RTL_CONSTASCII_USTRINGPARAM(
+                         "my_module.my_sc_implementation.MyService2") );
 }

 class MyService2Impl : public ::cppu::WeakImplHelper3<
       ::my_module::XSomething, lang::XServiceInfo, lang::XInitialization >
 {
-    OUString m_arg;
+    OUString m_sData;
 public:
     // focus on three given interfaces,
     // no need to implement XInterface, XTypeProvider, XWeak

-    // XInitialization will be called upon createInstanceWithArguments[AndContext]()
+    // XInitialization will be called upon
+    // createInstanceWithArguments[AndContext]()
     virtual void SAL_CALL initialize( Sequence< Any > const & args )
         throw (Exception);
     // XSomething
     virtual OUString SAL_CALL methodOne( OUString const & str )
         throw (RuntimeException);
+    virtual OUString SAL_CALL methodTwo( )
+        throw (RuntimeException);
     // XServiceInfo
     virtual OUString SAL_CALL getImplementationName()
         throw (RuntimeException);
@@ -115,45 +100,64 @@
     virtual Sequence< OUString > SAL_CALL getSupportedServiceNames()
         throw (RuntimeException);
 };
+
 // XInitialization implemention
 void MyService2Impl::initialize( Sequence< Any > const & args )
     throw (Exception)
 {
-    if (1 != args.getLength())
+    if (args.getLength() != 1)
     {
         throw lang::IllegalArgumentException(
-            OUString( RTL_CONSTASCII_USTRINGPARAM("give a string instanciating this component!") ),
-            (::cppu::OWeakObject *)this, // resolve to XInterface reference
+            OUString( RTL_CONSTASCII_USTRINGPARAM(
+                          "give a string instanciating this component!") ),
+            // resolve to XInterface reference:
+            static_cast< ::cppu::OWeakObject * >(this),
             0 ); // argument pos
     }
-    if (! (args[ 0 ] >>= m_arg))
+    if (! (args[ 0 ] >>= m_sData))
     {
         throw lang::IllegalArgumentException(
-            OUString( RTL_CONSTASCII_USTRINGPARAM("no string given as argument!") ),
-            (::cppu::OWeakObject *)this, // resolve to XInterface reference
+            OUString( RTL_CONSTASCII_USTRINGPARAM(
+                          "no string given as argument!") ),
+            // resolve to XInterface reference:
+            static_cast< ::cppu::OWeakObject * >(this),
             0 ); // argument pos
     }
 }
+
 // XSomething implementation
 OUString MyService2Impl::methodOne( OUString const & str )
     throw (RuntimeException)
 {
-    return OUString( RTL_CONSTASCII_USTRINGPARAM(
-        "called methodOne() of MyService2 implementation: ") ) + m_arg + str;
-}
+    m_sData = str;
+    return OUString( RTL_CONSTASCII_USTRINGPARAM(
+        "called methodOne() of MyService2 implementation: ") ) + m_sData;
+}
+
+OUString MyService2Impl::methodTwo( )
+    throw (RuntimeException)
+{
+    return OUString( RTL_CONSTASCII_USTRINGPARAM(
+        "called methodTwo() of MyService2 implementation: ") ) + m_sData;
+}
+
 // XServiceInfo implementation
 OUString MyService2Impl::getImplementationName()
     throw (RuntimeException)
 {
     // unique implementation name
-    return OUString( RTL_CONSTASCII_USTRINGPARAM("my_module.my_sc_impl.MyService2") );
-}
+    return OUString( RTL_CONSTASCII_USTRINGPARAM(
+                         "my_module.my_sc_impl.MyService2") );
+}
+
 sal_Bool MyService2Impl::supportsService( OUString const & serviceName )
     throw (RuntimeException)
 {
     // this object only supports one service, so the test is simple
-    return serviceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("my_module.MyService2") );
-}
+    return serviceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(
+                                         "my_module.MyService2") );
+}
+
 Sequence< OUString > MyService2Impl::getSupportedServiceNames()
     throw (RuntimeException)
 {
@@ -164,7 +168,7 @@
     Reference< XComponentContext > const & xContext )
     SAL_THROW( () )
 {
-    return static_cast< lang::XTypeProvider * >( new MyService2Impl() );
+    return static_cast< ::cppu::OWeakObject * >( new MyService2Impl );
 }

 }
@@ -176,12 +180,14 @@
 {
     {
         create_MyService1Impl, getImplementationName_MyService1Impl,
-        getSupportedServiceNames_MyService1Impl, ::cppu::createSingleComponentFactory,
+        getSupportedServiceNames_MyService1Impl,
+        ::cppu::createSingleComponentFactory,
         0, 0
     },
     {
         create_MyService2Impl, getImplementationName_MyService2Impl,
-        getSupportedServiceNames_MyService2Impl, ::cppu::createSingleComponentFactory,
+        getSupportedServiceNames_MyService2Impl,
+        ::cppu::createSingleComponentFactory,
         0, 0
     },
     { 0, 0, 0, 0, 0, 0 }


Move MRS decode_helper call prior to the address_mirroring in mrs_engine

Zen:MST-1619
Change-Id: I5fff2dce6058ace9179cbde57a26cd6a76317922
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/137627
Reviewed-by: STEPHEN GLANCY <7301c4b00f53e5772c2576cd0c5f485155c2ece1@us.ibm.com>
Reviewed-by: Sneha Kadam <815590b4758df91a46c65f2e611b009647339656@ibm.com>
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Tested-by: FSP CI Jenkins <aa9e4d9ac7cd25905e9c0dd36d4150516e73dd86@us.ibm.com>
Reviewed-by: Geetha Pisapati <310b2685def1b8f2d2e149a444a58d402cd5e8f4@ibm.com>
Tested-by: Hostboot CI <52521565bd8ea18a2b112942dce4f4220a97c2c8@us.ibm.com>
Reviewed-by: Edgar Cordero <5d58db94b672b353c4d1fd75b5b35c7e02ea3071@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/137631
Tested-by: Jenkins OP Build CI <e610bd72261d3c0a48f1e8ae36832ab00774d426@us.ibm.com>
Tested-by: Jenkins Combined Simics CI <8312af3886dfc9bb930f549023677220805b137e@us.ibm.com>
Tested-by: Jenkins OP HW <0eb0fff262f74a65a832afbcc7b153e391c9a3fd@us.ibm.com>
Reviewed-by: Nick Bofferding <fb8db48116bc8a69e29dd8cdb037246f232f4af5@us.ibm.com>

--- src/import/generic/memory/lib/dimm/ddr4/mrs_load_ddr4.H
+++ src/import/generic/memory/lib/dimm/ddr4/mrs_load_ddr4.H
@@ -254,6 +254,11 @@
               "Failed to make CCS instruction for MR%d on %s",
               i_data.iv_mrs, mss::c_str(i_target) );

+    // Dump out the 'decoded' MRS and trace the CCS instructions.
+    FAPI_TRY(decode_helper(i_data, i_port_rank, l_inst_a_side),
+             "Failed to decode information for MR%d on %s",
+             i_data.iv_mrs, mss::c_str(i_target) );
+
     // Call traits mirroring to determine if necessary
     FAPI_TRY( mss::address_mirror<MC>(i_target, i_port_rank, l_inst_a_side),
               "Failed mirroring MR%d rank %d on %s",
@@ -269,10 +274,6 @@
     l_inst_a_side.iv_idles = i_delay_in_cycles;
     l_inst_b_side.iv_idles = i_delay_in_cycles;

-    // Dump out the 'decoded' MRS and trace the CCS instructions.
-    FAPI_TRY(decode_helper(i_data, i_port_rank, l_inst_a_side),
-             "Failed to decode information for MR%d on %s",
-             i_data.iv_mrs, mss::c_str(i_target) );

     FAPI_INF("MRS%02d (%d) 0x%016llx:0x%016llx %s:rank %d a-side", uint8_t(i_data.iv_mrs), i_delay_in_cycles,
              l_inst_a_side.arr0, l_inst_a_side.arr1, mss::c_str(i_target), i_port_rank);


Remove \r at the end of the temp report's line

--- src/Tools/Display/Terminal/Standard/Terminal_std.cpp
+++ src/Tools/Display/Terminal/Standard/Terminal_std.cpp
@@ -268,7 +268,7 @@
 	}
 	else
 	{
-		stream << rang::style::bold << rang::fg::green << (real_time_state++ < 2 ? " *" : "  ") << rang::style::reset << "\r";
+		stream << rang::style::bold << rang::fg::green << (real_time_state++ < 2 ? " *" : "  ") << rang::style::reset;
 		real_time_state %= (uint8_t)4;
 	}


UI: add FCVAR_ARCHIVE to asw_fast_reload_under_marine

--- src/game/client/swarm/vgui/asw_hud_3dmarinenames.cpp
+++ src/game/client/swarm/vgui/asw_hud_3dmarinenames.cpp
@@ -57,7 +57,7 @@
 ConVar asw_world_healthbars("asw_world_healthbars", "1", FCVAR_NONE, "Shows health bars in the game world");
 ConVar asw_world_usingbars("asw_world_usingbars", "1", FCVAR_NONE, "Shows using bars in the game world");
 ConVar asw_marine_labels_cursor_maxdist( "asw_marine_labels_cursor_maxdist", "70", FCVAR_NONE, "Only marines within this distance of the cursor will get their health bar drawn" );
-ConVar asw_fast_reload_under_marine( "asw_fast_reload_under_marine", "0", FCVAR_NONE, "Draw the active reload bar under the marine?" );
+ConVar asw_fast_reload_under_marine( "asw_fast_reload_under_marine", "0", FCVAR_ARCHIVE, "Draw the active reload bar under the marine?" );
 ConVar asw_world_healthbar_class_icon( "asw_world_healthbar_class_icon", "0", FCVAR_NONE, "Show class icon on mouse over" );

 #define ASW_MAX_MARINE_NAMES 8


Correction of edge contraction

Correction of edge contraction

--- src/lib/algorithm/graphoperation/AssociateSkeletons.cpp
+++ src/lib/algorithm/graphoperation/AssociateSkeletons.cpp
@@ -80,6 +80,7 @@

 	std::list<skeleton::GraphProjSkel::Ptr> listcomp = algorithm::graphoperation::SeparateComponents(skelcut);

+	set_edg = std::set<std::set<unsigned int> >();
 	for(std::list<skeleton::GraphProjSkel::Ptr>::iterator it = listcomp.begin(); it != listcomp.end(); it++)
 	{
 		std::list<unsigned int> node_ext;


Correct an issue that prevent compilation in windows.

--- src/libmv/reconstruction/euclidean_reconstruction.cc
+++ src/libmv/reconstruction/euclidean_reconstruction.cc
@@ -294,7 +294,8 @@
   bool do_bundle_adjustment = false;
   bool is_frame_in_current_recons = false;
   bool is_frame_in_next_recons = false;
-  std::set<Matches::ImageID>::iterator img_iter = matches.get_images().begin();
+  std::set<Matches::ImageID>::const_iterator img_iter =
+    matches.get_images().begin();
   std::list<Reconstruction *>::iterator recons_iter = reconstructions->begin();
   std::list<Reconstruction *>::iterator recons_iter_next = recons_iter;
   recons_iter_next++;


fix tabs in SoK

fix tabs in SoK

--- src/libzerocoin/SerialNumberSignatureOfKnowledge.cpp
+++ src/libzerocoin/SerialNumberSignatureOfKnowledge.cpp
@@ -38,33 +38,31 @@
 }

 SerialNumberSignatureOfKnowledge::SerialNumberSignatureOfKnowledge(const
-        ZerocoinParams* p, const PrivateCoin& coin, const Commitment& commitmentToCoin,
-        uint256 msghash):params(p),
-	s_notprime(p->zkp_iterations),
-	sprime(p->zkp_iterations) {
+        ZerocoinParams* p, const PrivateCoin& coin, const Commitment& commitmentToCoin, uint256 msghash):
+                params(p),
+                s_notprime(p->zkp_iterations),
+                sprime(p->zkp_iterations)
+{
+    // Sanity check: verify that the order of the "accumulatedValueCommitmentGroup" is
+    // equal to the modulus of "coinCommitmentGroup". Otherwise we will produce invalid proofs.
+    if (params->coinCommitmentGroup.modulus != params->serialNumberSoKCommitmentGroup.groupOrder)
+        throw std::runtime_error("Groups are not structured correctly.");

-	// Sanity check: verify that the order of the "accumulatedValueCommitmentGroup" is
-	// equal to the modulus of "coinCommitmentGroup". Otherwise we will produce invalid
-	// proofs.
-	if (params->coinCommitmentGroup.modulus != params->serialNumberSoKCommitmentGroup.groupOrder) {
-		throw std::runtime_error("Groups are not structured correctly.");
-	}
+    CBigNum a = params->coinCommitmentGroup.g;
+    CBigNum b = params->coinCommitmentGroup.h;
+    CBigNum g = params->serialNumberSoKCommitmentGroup.g;
+    CBigNum h = params->serialNumberSoKCommitmentGroup.h;

-	CBigNum a = params->coinCommitmentGroup.g;
-	CBigNum b = params->coinCommitmentGroup.h;
-	CBigNum g = params->serialNumberSoKCommitmentGroup.g;
-	CBigNum h = params->serialNumberSoKCommitmentGroup.h;
+    CHashWriter hasher(0,0);
+    hasher << *params << commitmentToCoin.getCommitmentValue() << coin.getSerialNumber() << msghash;

-	CHashWriter hasher(0,0);
-	hasher << *params << commitmentToCoin.getCommitmentValue() << coin.getSerialNumber() << msghash;
+    vector<CBigNum> r(params->zkp_iterations);
+    vector<CBigNum> v_seed(params->zkp_iterations);
+    vector<CBigNum> v_expanded(params->zkp_iterations);
+    vector<CBigNum> c(params->zkp_iterations);

-	vector<CBigNum> r(params->zkp_iterations);
-	vector<CBigNum> v_seed(params->zkp_iterations);
-    vector<CBigNum> v_expanded(params->zkp_iterations);
-	vector<CBigNum> c(params->zkp_iterations);
-
-	for(uint32_t i=0; i < params->zkp_iterations; i++) {
-		r[i] = CBigNum::randBignum(params->coinCommitmentGroup.groupOrder);
+    for(uint32_t i=0; i < params->zkp_iterations; i++) {
+        r[i] = CBigNum::randBignum(params->coinCommitmentGroup.groupOrder);

         //use a random 256 bit seed that expands to 1024 bit for v[i]
         while (true) {
@@ -78,58 +76,58 @@
             v_expanded[i] = bnExpanded;
             break;
         }
-	}
+    }

-	for(uint32_t i=0; i < params->zkp_iterations; i++) {
-		// compute g^{ {a^x b^r} h^v} mod p2
-		c[i] = challengeCalculation(coin.getSerialNumber(), r[i], v_expanded[i]);
-	}
+    for(uint32_t i=0; i < params->zkp_iterations; i++) {
+        // compute g^{ {a^x b^r} h^v} mod p2
+        c[i] = challengeCalculation(coin.getSerialNumber(), r[i], v_expanded[i]);
+    }

-	// We can't hash data in parallel either
-	// because OPENMP cannot not guarantee loops
-	// execute in order.
-	for(uint32_t i=0; i < params->zkp_iterations; i++) {
-		hasher << c[i];
-	}
-	this->hash = hasher.GetHash();
-	unsigned char *hashbytes =  (unsigned char*) &hash;
+    // We can't hash data in parallel either
+    // because OPENMP cannot not guarantee loops
+    // execute in order.
+    for(uint32_t i=0; i < params->zkp_iterations; i++)
+        hasher << c[i];

-	for(uint32_t i = 0; i < params->zkp_iterations; i++) {
-		int bit = i % 8;
-		int byte = i / 8;
+    this->hash = hasher.GetHash();
+    unsigned char *hashbytes =  (unsigned char*) &hash;

-		bool challenge_bit = ((hashbytes[byte] >> bit) & 0x01);
-		if (challenge_bit) {
-			s_notprime[i]       = r[i];
-			sprime[i]           = v_seed[i];
-		} else {
-			s_notprime[i]       = r[i] - coin.getRandomness();
-			sprime[i]           = v_expanded[i] - (commitmentToCoin.getRandomness() *
-			                              b.pow_mod(r[i] - coin.getRandomness(), params->serialNumberSoKCommitmentGroup.groupOrder));
-		}
-	}
+    for(uint32_t i = 0; i < params->zkp_iterations; i++) {
+        int bit = i % 8;
+        int byte = i / 8;
+
+        bool challenge_bit = ((hashbytes[byte] >> bit) & 0x01);
+        if (challenge_bit) {
+            s_notprime[i]       = r[i];
+            sprime[i]           = v_seed[i];
+        } else {
+            s_notprime[i]       = r[i] - coin.getRandomness();
+            sprime[i]           = v_expanded[i] - (commitmentToCoin.getRandomness() *
+                    b.pow_mod(r[i] - coin.getRandomness(), params->serialNumberSoKCommitmentGroup.groupOrder));
+        }
+    }
 }

 inline CBigNum SerialNumberSignatureOfKnowledge::challengeCalculation(const CBigNum& a_exp,const CBigNum& b_exp,
         const CBigNum& h_exp) const {

-	CBigNum a = params->coinCommitmentGroup.g;
-	CBigNum b = params->coinCommitmentGroup.h;
-	CBigNum g = params->serialNumberSoKCommitmentGroup.g;
-	CBigNum h = params->serialNumberSoKCommitmentGroup.h;
+    CBigNum a = params->coinCommitmentGroup.g;
+    CBigNum b = params->coinCommitmentGroup.h;
+    CBigNum g = params->serialNumberSoKCommitmentGroup.g;
+    CBigNum h = params->serialNumberSoKCommitmentGroup.h;

-	CBigNum exponent = (a.pow_mod(a_exp, params->serialNumberSoKCommitmentGroup.groupOrder)
-	                   * b.pow_mod(b_exp, params->serialNumberSoKCommitmentGroup.groupOrder)) % params->serialNumberSoKCommitmentGroup.groupOrder;
+    CBigNum exponent = (a.pow_mod(a_exp, params->serialNumberSoKCommitmentGroup.groupOrder) *
+            b.pow_mod(b_exp, params->serialNumberSoKCommitmentGroup.groupOrder)) % params->serialNumberSoKCommitmentGroup.groupOrder;

-	return (g.pow_mod(exponent, params->serialNumberSoKCommitmentGroup.modulus) * h.pow_mod(h_exp, params->serialNumberSoKCommitmentGroup.modulus)) % params->serialNumberSoKCommitmentGroup.modulus;
+    return (g.pow_mod(exponent, params->serialNumberSoKCommitmentGroup.modulus) * h.pow_mod(h_exp, params->serialNumberSoKCommitmentGroup.modulus)) % params->serialNumberSoKCommitmentGroup.modulus;
 }

 bool SerialNumberSignatureOfKnowledge::Verify(const CBigNum& coinSerialNumber, const CBigNum& valueOfCommitmentToCoin,
         const uint256 msghash, bool isInParamsValidationRange) const {
-	CBigNum a = params->coinCommitmentGroup.g;
-	CBigNum b = params->coinCommitmentGroup.h;
-	CBigNum g = params->serialNumberSoKCommitmentGroup.g;
-	CBigNum h = params->serialNumberSoKCommitmentGroup.h;
+    CBigNum a = params->coinCommitmentGroup.g;
+    CBigNum b = params->coinCommitmentGroup.h;
+    CBigNum g = params->serialNumberSoKCommitmentGroup.g;
+    CBigNum h = params->serialNumberSoKCommitmentGroup.h;

     //// Params validation.
     if(isInParamsValidationRange) {
@@ -144,18 +142,18 @@

     //// Verification
     CHashWriter hasher(0,0);
-	hasher << *params << valueOfCommitmentToCoin << coinSerialNumber << msghash;
+    hasher << *params << valueOfCommitmentToCoin << coinSerialNumber << msghash;

-	vector<CBigNum> tprime(params->zkp_iterations);
-	unsigned char *hashbytes = (unsigned char*) &this->hash;
+    vector<CBigNum> tprime(params->zkp_iterations);
+    unsigned char *hashbytes = (unsigned char*) &this->hash;

-	try {
-		for (uint32_t i = 0; i < params->zkp_iterations; i++) {
-			int bit = i % 8;
-			int byte = i / 8;
-			bool challenge_bit = ((hashbytes[byte] >> bit) & 0x01);
-			if (challenge_bit) {
-			    CBigNum bn = SeedTo1024(sprime[i].getuint256());
+    try {
+        for (uint32_t i = 0; i < params->zkp_iterations; i++) {
+            int bit = i % 8;
+            int byte = i / 8;
+            bool challenge_bit = ((hashbytes[byte] >> bit) & 0x01);
+            if (challenge_bit) {
+                CBigNum bn = SeedTo1024(sprime[i].getuint256());
                 if (bn > params->serialNumberSoKCommitmentGroup.groupOrder && isInParamsValidationRange)
                     return error("SoK Verify() :: sprime in pos %d not in valid range", i);
                 tprime[i] = challengeCalculation(coinSerialNumber, s_notprime[i], bn);


Changing from QQuickCanvas to QQuickWindow

Following Change Id34e2954

Change-Id: Ic0d0e860c954570408c39a8f0d9502183c624dd4
Reviewed-by: Robert Griebl <180c10942809d7c581dbfb9e28a75ed1d4cbb3b4@pelagicore.com>

--- src/compositor/compositor_api/waylandsurfaceitem.cpp
+++ src/compositor/compositor_api/waylandsurfaceitem.cpp
@@ -52,7 +52,7 @@
 #include <QtGui/QScreen>

 #include <QtQuick/QSGSimpleRectNode>
-#include <QtQuick/QQuickCanvas>
+#include <QtQuick/QQuickWindow>

 #include <QtCore/QMutexLocker>
 #include <QtCore/QMutex>
@@ -186,7 +186,7 @@
 {
     if (!m_provider) {
         m_provider = new WaylandSurfaceTextureProvider();
-        connect(canvas(), SIGNAL(sceneGraphInvalidated()), m_provider, SLOT(invalidate()), Qt::DirectConnection);
+        connect(window(), SIGNAL(sceneGraphInvalidated()), m_provider, SLOT(invalidate()), Qt::DirectConnection);
     }
 }

@@ -353,13 +353,13 @@
         QSGTexture *oldTexture = texture;
         if (m_surface->type() == WaylandSurface::Texture) {
             QOpenGLContext *context = QOpenGLContext::currentContext();
-            QQuickCanvas::CreateTextureOptions opt = 0;
+            QQuickWindow::CreateTextureOptions opt = 0;
             if (useTextureAlpha()) {
-                opt |= QQuickCanvas::TextureHasAlphaChannel;
+                opt |= QQuickWindow::TextureHasAlphaChannel;
             }
-            texture = canvas()->createTextureFromId(m_surface->texture(context), m_surface->size(), opt);
+            texture = window()->createTextureFromId(m_surface->texture(context), m_surface->size(), opt);
         } else {
-            texture = canvas()->createTextureFromImage(m_surface->image());
+            texture = window()->createTextureFromImage(m_surface->image());
         }
         texture->bind();
         delete oldTexture;


Fix G3 roll

Fix G3 roll

TBR=kjlubick@google.com
Change-Id: I38acafacaac1216a46bc2e92638dbf542fb0e74b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433181
Reviewed-by: Robert Phillips <95e8ac5504948c7bf91b22c16a8dbb7ae7c66bfd@google.com>
Commit-Queue: Robert Phillips <95e8ac5504948c7bf91b22c16a8dbb7ae7c66bfd@google.com>

--- src/effects/imagefilters/SkMorphologyImageFilter.cpp
+++ src/effects/imagefilters/SkMorphologyImageFilter.cpp
@@ -18,7 +18,7 @@
 #include "include/gpu/GrRecordingContext.h"
 #include "src/gpu/GrDirectContextPriv.h"
 #include "src/gpu/GrRecordingContextPriv.h"
-#include "src/gpu/GrSurfaceFillContext.h"
+#include "src/gpu/GrSurfaceDrawContext.h"
 #include "src/gpu/GrTexture.h"
 #include "src/gpu/GrTextureProxy.h"
 #include "src/gpu/SkGr.h"


i965/vec4: Fix copy propagation for non-register-aligned regions.

This prevents it from trying to propagate a copy through a
register-misaligned region.  MOV instructions with a misaligned
destination shouldn't be treated as a direct GRF copy, because they
only define the destination GRFs partially.  Also fix the interference
check implemented with is_channel_updated() to consider overlapping
regions with different register offset to interfere, since the
writemask check implemented in the function is only valid under the
assumption that the source and destination regions are aligned
component by component.

Reviewed-by: Iago Toral Quiroga <a847aabaac44184372f6b1cd1a59aa254daaeb0b@igalia.com>

--- src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
+++ src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
@@ -46,6 +46,7 @@
    return (inst->opcode == BRW_OPCODE_MOV &&
 	   !inst->predicate &&
 	   inst->dst.file == VGRF &&
+	   inst->dst.offset % REG_SIZE == 0 &&
 	   !inst->dst.reladdr &&
 	   !inst->src[0].reladdr &&
 	   (inst->dst.type == inst->src[0].type ||
@@ -73,7 +74,8 @@
       return false;

    return regions_overlap(*src, REG_SIZE, inst->dst, inst->size_written) &&
-          inst->dst.writemask & (1 << BRW_GET_SWZ(src->swizzle, ch));
+          (inst->dst.offset != src->offset ||
+           inst->dst.writemask & (1 << BRW_GET_SWZ(src->swizzle, ch)));
 }

 static bool
@@ -436,8 +438,9 @@
 	     inst->src[i].reladdr)
 	    continue;

-         /* We only handle single-register copies. */
-         if (inst->size_read(i) != REG_SIZE)
+         /* We only handle register-aligned single GRF copies. */
+         if (inst->size_read(i) != REG_SIZE ||
+             inst->src[i].offset % REG_SIZE)
             continue;

          const unsigned reg = (alloc.offsets[inst->src[i].nr] +


RunControl actions updated when project settings change

Reviewed-by: Kai Koehne

--- src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp
+++ src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp
@@ -336,11 +336,13 @@
 void QmlProjectRunConfiguration::useCppDebuggerToggled(bool toggled)
 {
     setUseCppDebugger(toggled);
+    updateEnabled();
 }

 void QmlProjectRunConfiguration::useQmlDebuggerToggled(bool toggled)
 {
     setUseQmlDebugger(toggled);
+    updateEnabled();
 }

 void QmlProjectRunConfiguration::qmlDebugServerPortChanged(uint port)


fixed gumbel dist includes

fixed gumbel dist includes

--- src/stan/prob/distributions/univariate/continuous/gumbel.hpp
+++ src/stan/prob/distributions/univariate/continuous/gumbel.hpp
@@ -6,7 +6,6 @@

 #include <stan/agrad.hpp>
 #include <stan/math/error_handling.hpp>
-#include <stan/math/special_functions.hpp>
 #include <stan/meta/traits.hpp>
 #include <stan/prob/constants.hpp>
 #include <stan/prob/traits.hpp>


QmlJS: Another compile fix for wrong rebase.

Change-Id: Ic46a72e3f9ad6689d260264c9f74dc4e17d01ee5
Reviewed-on: http://codereview.qt-project.org/6511
Sanity-Review: Christian Kamm <687e37a7866f5c6d83feb41198eb6d862161a68b@nokia.com>
Reviewed-by: Christian Kamm <687e37a7866f5c6d83feb41198eb6d862161a68b@nokia.com>

--- src/plugins/qmljseditor/qmljssemanticinfoupdater.cpp
+++ src/plugins/qmljseditor/qmljssemanticinfoupdater.cpp
@@ -150,6 +150,7 @@
         QmlJS::Check checker(doc, semanticInfo.context);
         foreach (const QmlJS::StaticAnalysis::Message &msg, checker()) {
             semanticInfo.semanticMessages += msg.toDiagnosticMessage();
+        }
     }

     return semanticInfo;


Fix memory error related to new SGVector API.

--- src/shogun/multiclass/MulticlassOneVsOneStrategy.cpp
+++ src/shogun/multiclass/MulticlassOneVsOneStrategy.cpp
@@ -35,7 +35,7 @@
 {
 	CMulticlassStrategy::train_prepare_next();

-	SGVector<int32_t> subset(m_orig_labels->get_num_labels());
+	SGVector<int32_t> subset(m_orig_labels->get_num_labels(), false);
 	int32_t tot=0;
 	for (int32_t k=0; k < m_orig_labels->get_num_labels(); ++k)
 	{
@@ -60,7 +60,7 @@
 		m_train_pair_idx_2=m_train_pair_idx_1+1;
 	}

-	return subset;
+	return SGVector<int32_t>(subset.vector, tot, true);
 }

 int32_t CMulticlassOneVsOneStrategy::decide_label(SGVector<float64_t> outputs)


Added gcr registry test.

Added gcr registry test.

Review: https://reviews.apache.org/r/70291

--- src/tests/containerizer/provisioner_docker_tests.cpp
+++ src/tests/containerizer/provisioner_docker_tests.cpp
@@ -639,15 +639,18 @@
 // when specifying the repository name (e.g., 'busybox'). The registry
 // puller normalize docker official images if necessary.
 INSTANTIATE_TEST_CASE_P(
-    ImageAlpine,
+    ContainerImage,
     ProvisionerDockerTest,
     ::testing::ValuesIn(vector<string>({
         "alpine", // Verifies the normalization of the Docker repository name.
         "library/alpine",
+        "gcr.io/google-containers/busybox:1.24", // manifest.v1+prettyjws
+        "gcr.io/google-containers/busybox:1.27", // manifest.v2+json
         // TODO(alexr): The registry below is unreliable and hence disabled.
         // Consider re-enabling shall it become more stable.
         // "registry.cn-hangzhou.aliyuncs.com/acs-sample/alpine",
-        "quay.io/coreos/alpine-sh"})));
+        "quay.io/coreos/alpine-sh" // manifest.v1+prettyjws
+      })));

 // TODO(jieyu): This is a ROOT test because of MESOS-4757. Remove the


Fix ASan report in tests.

Fix ASan report in tests.

R=bradnelson@google.com, bsy@google.com

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

git-svn-id: 721b910a23eff8a86f00c8fd261a7587cddf18f8@11433 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2

--- src/trusted/service_runtime/linux/mmap_test_check.cc
+++ src/trusted/service_runtime/linux/mmap_test_check.cc
@@ -20,7 +20,7 @@
   uint64_t start;
   uint64_t end;
   int64_t inode;
-  char flags[4];
+  char flags[5];
   int prot = 0;
   int type = 0;
   int num;


Optimize triangular solve by reducing amount of computation needed.

PiperOrigin-RevId: 265556593

--- tensorflow/compiler/xla/service/triangular_solve_expander.cc
+++ tensorflow/compiler/xla/service/triangular_solve_expander.cc
@@ -266,8 +266,12 @@
     int64 m_dim = (left_side) ? -1 : -2;
     int64 m = ShapeUtil::GetDimension(b_shape, m_dim);

+    std::vector<XlaOp> update_ops;
+    int bdims = b_shape.rank();
+    int64 block_dim = (left_side) ? bdims - 2 : bdims - 1;
+
     // Initialize the solution
-    auto x = ZerosLike(b);
+    XlaOp x;

     // This loop is unrolled for performance reasons, but it could be expressed
     // rolled as well since the matrices are of the same size each iteration
@@ -304,9 +308,9 @@
       if (i == 0) {
         remainder = b_row;
       } else {
-        // This matrix multiply involves a lot of multiplying with zero (namely,
-        // X[i * block_size:] = 0), but this is faster than slicing...
-        end = {k, n};
+        // This matrix multiply get rid of a lot of multiplying with zero
+        // (namely, X[i * block_size:] = 0), L[i, :i] @ X[:i]
+        end = {k, std::min(i * block_size, n)};
         if (!left_side) {
           std::swap(end[0], end[1]);
         }
@@ -335,7 +339,12 @@
             BatchDot(remainder, false, inv_block, transpose_a, precision);
         std::swap(update_starts[0], update_starts[1]);
       }
-      x = DynamicUpdateSliceInMinorDims(x, x_update, /*starts=*/update_starts);
+
+      if (i == 0) {
+        x = x_update;
+      } else {
+        x = ConcatInDim(builder, {x, x_update}, block_dim);
+      }
     }

     return x;


SWDEV-302654 - Fix cooperative_streams_half_capacity (#2376)

Fix random failure of cooperative_streams_half_capacity by adding HIPCHECK(hipSetDevice(dev))

Change-Id: Ic4baf10a2c69f981aa7134a999c4779642852f53

--- tests/src/runtimeApi/cooperativeGrps/cooperative_streams.cpp
+++ tests/src/runtimeApi/cooperativeGrps/cooperative_streams.cpp
@@ -238,6 +238,7 @@
   HIPCHECK(hipGetDeviceCount(&device_num));
   for (int dev = 0; dev < device_num; ++dev) {
     /*************************************************************************/
+    HIPCHECK(hipSetDevice(dev));
     hipDeviceProp_t device_properties;
     HIPCHECK(hipGetDeviceProperties(&device_properties, dev));


Change an unconditional log to a conditional one.

git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@131079 91177308-0d34-0410-b5e6-96231b3b80d8

--- tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
+++ tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
@@ -107,7 +107,7 @@
     if (force || m_state.GetError(e_regSetGPR, Read))
     {
         kern_return_t kret = ::thread_abort_safely(m_thread->ThreadID());
-        DNBLogThreaded("thread = 0x%4.4x calling thread_abort_safely (tid) => %u (GetGPRState() for stop_count = %u)", m_thread->ThreadID(), kret, m_thread->Process()->StopCount());
+        DNBLogThreadedIf (LOG_THREAD, "thread = 0x%4.4x calling thread_abort_safely (tid) => %u (GetGPRState() for stop_count = %u)", m_thread->ThreadID(), kret, m_thread->Process()->StopCount());

 #if DEBUG_GPR_VALUES
         m_state.context.gpr.__rax = ('a' << 8) + 'x';
@@ -395,7 +395,7 @@
 DNBArchImplX86_64::SetGPRState()
 {
     kern_return_t kret = ::thread_abort_safely(m_thread->ThreadID());
-    DNBLogThreaded("thread = 0x%4.4x calling thread_abort_safely (tid) => %u (SetGPRState() for stop_count = %u)", m_thread->ThreadID(), kret, m_thread->Process()->StopCount());
+    DNBLogThreadedIf (LOG_THREAD, "thread = 0x%4.4x calling thread_abort_safely (tid) => %u (SetGPRState() for stop_count = %u)", m_thread->ThreadID(), kret, m_thread->Process()->StopCount());

     m_state.SetError(e_regSetGPR, Write, ::thread_set_state(m_thread->ThreadID(), __x86_64_THREAD_STATE, (thread_state_t)&m_state.context.gpr, e_regSetWordSizeGPR));
     DNBLogThreadedIf (LOG_THREAD, "::thread_set_state (0x%4.4x, %u, &gpr, %u) => 0x%8.8x"


Fix reference counts on ddraw4 surfaces.

git-svn-id: 763a368b42d23a8c112339c16f7e9c1b0ab7c9a5@617 8a90861a-4eca-46d5-b744-240ff16d0c4d

--- ddraw/glDirectDrawSurface.cpp
+++ ddraw/glDirectDrawSurface.cpp
@@ -432,7 +432,7 @@
 	}
 	if(riid == IID_IDirectDrawSurface4)
 	{
-		glDirectDrawSurface7_AddRef(This);
+		glDirectDrawSurface7_AddRef4(This);
 		*ppvObj = This->dds4;
 		TRACE_VAR("*ppvObj",14,*ppvObj);
 		TRACE_EXIT(23,DD_OK);


Fix window mode Blt regression.

Fix window mode Blt regression.

git-svn-id: 763a368b42d23a8c112339c16f7e9c1b0ab7c9a5@472 8a90861a-4eca-46d5-b744-240ff16d0c4d

--- ddraw/glDirectDrawSurface.cpp
+++ ddraw/glDirectDrawSurface.cpp
@@ -667,8 +667,8 @@
 				glRenderer_UpdateClipper(ddInterface->renderer, this);
 				clipper->dirty = false;
 			}
-		}
-		dwFlags |= 0x10000000;
+			dwFlags |= 0x10000000;
+		}
 	}
 	if (this == src)
 	{


decoder/h265: don't use std::remove_if on std::set

The std::remove_if/erase is not supposed to work with a
std::set and is a bad idea.  GCC also produces an error
when an attempt to do so is made.  However, with GCC <= 4.9.2
the -fpermissive compiler flag allows you to disregard this
programming error.  And unfortunately this flag is currently
being used throughout this project.  GCC 5.1.1 correctly
treats this as a hard error (i.e. -fpermissive does not hide
the bug).

The correct way to remove from a std::set is through it's
std::set::erase member method.

Fixes #334

Signed-off-by: U. Artie Eoff <32aece0d55055227b44d04b7d0051cf3d04ee871@intel.com>

--- decoder/vaapidecoder_h265.cpp
+++ decoder/vaapidecoder_h265.cpp
@@ -275,10 +275,15 @@
 void VaapiDecoderH265::DPB::removeUnused()
 {
     forEach(clearReference);
+
     /* Remove unused pictures from DPB */
-    PictureList::iterator it =
-            remove_if(m_pictures.begin(), m_pictures.end(), isUnusedPicture);
-    m_pictures.erase(it, m_pictures.end());
+    PictureList::iterator it;
+    for (it = m_pictures.begin(); it != m_pictures.end();) {
+        if (isUnusedPicture(*it))
+            m_pictures.erase(it++);
+        else
+            ++it;
+    }
 }

 void VaapiDecoderH265::DPB::clearRefSet()


Remove assert implementation on non-stdlib builds, as the asserts use stdlib

--- deps/ox/src/ox/std/assert.cpp
+++ deps/ox/src/ox/std/assert.cpp
@@ -12,8 +12,10 @@
 #endif

 void oxAssert(const char *file, int line, bool pass, const char *msg) {
+#if defined(OX_USE_STDLIB)
 	if (!pass) {
 		std::cerr << '(' << file << ':' << line << "): " << msg << std::endl;
 		std::abort();
 	}
+#endif
 }


Add a robot Stop method. Only move when mouse position has changed.

--- RoboNeko/main.cpp
+++ RoboNeko/main.cpp
@@ -27,7 +27,8 @@
 int _startTime = SDL_GetTicks();
 int mouseX = 0;
 int mouseY = 0;
-
+int oldMouseX = 0;
+int oldMouseY = 0;

 class Robit
@@ -37,6 +38,7 @@
   static const int SPRITE_ANIMATION_LEN = 3;
   Robit();
   void doEvent();
+  void stop();
   SDL_Point p = {0, 200};
 private:
   double rad = M_PI_2;
@@ -78,8 +80,23 @@
   SDL_SetTextureColorMod( gRobitsTexture, 255, 25, 25 );
 }

+void Robit::stop()
+{
+  SDL_Rect robitLoc = { p.x, p.y, 32, 32 };
+  SDL_RenderCopy( _renderer, gRobitsTexture, &spriteClips[1], &robitLoc );
+}
+
 void Robit::doEvent()
 {
+
+  if(oldMouseX == mouseX && oldMouseY == mouseY) {
+    stop();
+    return;
+  }
+
+  oldMouseY = mouseY;
+  oldMouseX = mouseX;
+
   // Update |p| to new position
   rad = atan2((mouseY - p.y), (mouseX - p.x));
   xDelta += cos(rad);
@@ -165,15 +182,11 @@
   //    SDL_Texture* gTexture = SDL_CreateTextureFromSurface( gRenderer, gTextureImage );

-
-
   bool quit = false;

   // event handler
   SDL_Event e;

-
-
   Robit* r1 = new Robit();
   Robit* r2 = new Robit();
   r2->p = {0, 100};
@@ -198,7 +211,7 @@
     SDL_RenderClear( _renderer );

     r1->doEvent();
-    r2->doEvent();
+//    r2->doEvent();

     SDL_RenderPresent( _renderer );


fix 拖拽崩溃问题

fix 拖拽崩溃问题

--- DuiLib/Control/UIList.cpp
+++ DuiLib/Control/UIList.cpp
@@ -949,7 +949,11 @@
 	RECT rt;
 	rt.left = rt.right = rt.top = rt.bottom = 0;

-	if (m_pDragingCtrl == NULL || dstElement == NULL) return;
+	if (m_pDragingCtrl == NULL ) return;
+	if (dstElement == NULL) {
+		m_pDragingCtrl->SetVisible(false);
+		m_pNodeNeedMove = NULL;
+	}
 	if (m_pNodeNeedMove != NULL && _tcsicmp(dstElement->GetClass(), _T("TreeNodeUI")) == 0) {
 		CTreeNodeUI *pTreeDestNode = (CTreeNodeUI*)dstElement;
 		CTreeNodeUI *pTreeSrcNode = (CTreeNodeUI*)m_pNodeNeedMove;


r4145 and 4210 in private:
Don't go the ringing state until we really get the 180 response.
Log potetial re-INVITEs.

Simpler version of SIPEngine::sameINVITE just checks CSeq, on the assumption that CallID already matched when we searched the transaction table.

Faster and does not rely on string conversion.

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

--- SIP/SIPEngine.cpp
+++ SIP/SIPEngine.cpp
@@ -510,11 +510,14 @@
 	LOG(DEBUG) << "received status " << status;
 	saveResponse(msg);
 	switch (status) {
-		case 100:	// Trying - this means the proxy is up; don't need to reinvite
+		// class 1XX: Provisional messages
+		case 100:	// Trying
+		case 181:	// Call Is Being Forwarded
+		case 182:	// Queued
+		case 183:	// Session Progress FIXME we need to setup the sound channel (early media)
 			mState = Proceeding;
 			break;
 		case 180:	// Ringing
-		case 183:	// Progress -
 			mState = Ringing;
 			break;
 		case 200:	// OK
@@ -1266,26 +1269,34 @@
 bool SIPEngine::sameINVITE(osip_message_t * msg){
 	assert(mINVITE);
 	if (NULL == msg){
+		LOG(NOTICE) << "trying to compare empty message";
 		return false;
 	}
-	char* old_inv;
-	size_t old_len;
-	char* new_inv;
-	size_t new_len;
-	int res = 0; //does not match
-	//this sometimes fails even though mINVITE is real. No idea -k
-	osip_message_to_str(mINVITE, &old_inv, &old_len);
-	osip_message_to_str(msg, &new_inv, &new_len);
-	if (old_inv && new_inv){
-		res = !(strncmp(old_inv, new_inv, old_len));
-	}
-	if (old_inv){
-		free(old_inv);
-	}
-	if (new_inv){
-		free(new_inv);
-	}
-	return res;
+	// We are assuming that the callids match.
+	// Otherwise, this would not have been called.
+	// FIXME -- Check callids and assrt if they down match.
+	// So we just check the CSeq.
+	// FIXME -- Check all of the pointers along these chains and log ERR if anthing is missing.
+
+	const char *cn1 = msg->cseq->number;
+	if (!cn1) {
+		LOG(ERR) << "no cseq in msg";
+		return false;
+	}
+	int n1 = atoi(cn1);
+
+	const char *cn2 = mINVITE->cseq->number;
+	if (!cn2) {
+		LOG(ERR) << "no cseq in mINVITE";
+		return false;
+	}
+	int n2 = atoi(cn2);
+
+	if (n1!=n2) {
+		LOG(NOTICE) << "possible reinvite CSeq A " << cn1 << " (" << n1 << ") CSeq B " << cn2 << " (" << n2 << ")";
+	}
+
+	return n1==n2;
 }

 // vim: ts=4 sw=4


fixed Window::GetPosition() for unitialized curses windows

 * some Curses variants (reproduced with NetBSD's curses)
   will not handle getmaxx(NULL).
 * effectively, this fixes crashes on NetBSD's curses

--- ScintillaTerm.cxx
+++ ScintillaTerm.cxx
@@ -672,7 +672,8 @@
  * @return PRectangle with the window's boundaries.
  */
 PRectangle Window::GetPosition() {
-  return PRectangle(0, 0, getmaxx(_WINDOW(wid)), getmaxy(_WINDOW(wid)));
+  return PRectangle(0, 0, wid ? getmaxx(_WINDOW(wid)) : 0,
+                          wid ? getmaxy(_WINDOW(wid)) : 0);
 }
 /**
  * Sets the position of the window relative to its parent window.


updates

updates

--- Search/search.tcc
+++ Search/search.tcc
@@ -141,29 +141,6 @@
             worker_function = std::bind( worker_function_base, _1, _2, std::ref( rkfunction ) );
          }
          break;
-         case( KnuthMorrisPratt ):
-         {
-            auto kmpfunction = []( Line &line, std::vector< Hit > &hits )
-            {
-
-            };
-            worker_function =
-               std::bind( worker_function_base,
-                          _1,
-                          _2,
-                          std::ref( kmpfunction ) );
-         }
-         break;
-         case( Automata ):
-         {
-            auto atfunction = []( Line &line, std::vector< Hit > &hits )
-            {
-
-            };
-            worker_function =
-               std::bind( worker_function_base, _1, _2, std::ref( atfunction ) );
-         }
-         break;
          default:
             assert( false );
       }


Debugging debug messages

Debugging debug messages

--- C920VideoCap/C920Camera.cpp
+++ C920VideoCap/C920Camera.cpp
@@ -37,7 +37,8 @@
 		fprintf(stdout, "V4L2Camera INFO: Opening capture device %s.\n", __capture_file);
 		this->Close();
 		this->capture = this->CreateCapture(__capture_file);
-		fprintf(stdout, "V4L2Camera INFO: Opened capture device %s.\n", this->capture->DeviceName);
+		if (this->capture)
+			fprintf(stdout, "V4L2Camera INFO: Opened capture device %s.\n", this->capture->DeviceName);
 		return this->capture != 0;
 	}
 	void C920Camera::Close() {
@@ -290,7 +291,7 @@
 		fprintf(stdout, "C920Camera::InitilizeCapture INFO: Quering capture device capability %s.\n", capture->DeviceName);
 		CLEAR(capture->V4L2Capability);
 		if (-1 == xioctl(capture->DeviceHandle, VIDIOC_QUERYCAP, &capture->V4L2Capability)) {
-			fprintf(stderr, "C920Camera::InitilizeCapture ERROR: Unable query capability from %s.", capture->DeviceName);
+			fprintf(stderr, "C920Camera::InitilizeCapture ERROR: Unable to query capability from %s.\n", capture->DeviceName);
 			this->CloseCapture(capture);
 			return -2;
 		}


properly handle mesh files containing multiple meshes with identical names.

--- src/appleseed/renderer/modeling/object/meshobjectreader.cpp
+++ src/appleseed/renderer/modeling/object/meshobjectreader.cpp
@@ -49,6 +49,7 @@
 // Standard headers.
 #include <algorithm>
 #include <exception>
+#include <map>
 #include <vector>

 using namespace foundation;
@@ -107,13 +108,10 @@
             return m_total_triangle_count;
         }

-        virtual void begin_mesh(const string& name)
-        {
-            // If the mesh has no name, assign it a number (starting with 0).
-            const string mesh_name = name.empty() ? to_string(m_untitled_mesh_counter++) : name;
-
-            // Construct the final object name from the base object name and the mesh name.
-            const string object_name = m_base_object_name + "." + mesh_name;
+        virtual void begin_mesh(const string& mesh_name)
+        {
+            // Construct the object name.
+            const string object_name = m_base_object_name + "." + make_unique_mesh_name(mesh_name);

             // Create an empty mesh object.
             m_objects.push_back(
@@ -247,6 +245,8 @@
         const string            m_base_object_name;

         size_t                  m_untitled_mesh_counter;
+        map<string, size_t>     m_mesh_counters;
+
         MeshObjectVector        m_objects;

         size_t                  m_vertex_count;
@@ -264,6 +264,20 @@

         size_t                  m_total_vertex_count;
         size_t                  m_total_triangle_count;
+
+        string make_unique_mesh_name(string mesh_name)
+        {
+            if (mesh_name.empty())
+                mesh_name = to_string(m_untitled_mesh_counter++);
+
+            if (m_mesh_counters.find(mesh_name) == m_mesh_counters.end())
+            {
+                m_mesh_counters[mesh_name] = 0;
+                return mesh_name;
+            }
+
+            return mesh_name + "." + to_string(m_mesh_counters[mesh_name]++);
+        }

         void insert_triangle(
             const size_t        v0_index,


Fix bit count helper

Fix bit count helper


don't print -W option since ccons doesn't support these

--- Diagnostics.cpp
+++ Diagnostics.cpp
@@ -8,7 +8,7 @@

 DiagnosticsProvider::DiagnosticsProvider(llvm::raw_os_ostream& out,
                                          const clang::LangOptions& opts)
-	: _tdp(out, false, true, false)
+	: _tdp(out, false, true, false, true, false)
 	, _diag(this)
 {
 	_tdp.SetLangOpts(opts);


COFF: include relocation type in unsupported relocation message

Summary: When we encouter a relocation type we don't know how to handle, this change causes us to print out the hexadecimal value of the relocation type. This makes troubleshooting a little easier.

Reviewers: ruiu, zturner

Differential Revision: https://reviews.llvm.org/D28576

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

--- COFF/Chunks.cpp
+++ COFF/Chunks.cpp
@@ -11,6 +11,7 @@
 #include "Error.h"
 #include "InputFiles.h"
 #include "Symbols.h"
+#include "llvm/ADT/Twine.h"
 #include "llvm/Object/COFF.h"
 #include "llvm/Support/COFF.h"
 #include "llvm/Support/Debug.h"
@@ -61,7 +62,7 @@
   case IMAGE_REL_AMD64_SECTION:  add16(Off, Sym->getSectionIndex()); break;
   case IMAGE_REL_AMD64_SECREL:   add32(Off, Sym->getSecrel()); break;
   default:
-    fatal("unsupported relocation type");
+    fatal("unsupported relocation type 0x" + Twine::utohexstr(Type));
   }
 }

@@ -76,7 +77,7 @@
   case IMAGE_REL_I386_SECTION:  add16(Off, Sym->getSectionIndex()); break;
   case IMAGE_REL_I386_SECREL:   add32(Off, Sym->getSecrel()); break;
   default:
-    fatal("unsupported relocation type");
+    fatal("unsupported relocation type 0x" + Twine::utohexstr(Type));
   }
 }

@@ -136,7 +137,7 @@
   case IMAGE_REL_ARM_BLX23T:    applyBranch24T(Off, S - P - 4); break;
   case IMAGE_REL_ARM_SECREL:    add32(Off, Sym->getSecrel()); break;
   default:
-    fatal("unsupported relocation type");
+    fatal("unsupported relocation type 0x" + Twine::utohexstr(Type));
   }
 }


[clangd] Use Contents from inputs in codeComplete and signatureHelp

Summary:
ClangdServer::{codeComplete,signatureHelp} both use the Contents from
the draft manager.  Since we want to move the draft manager from
ClangdServer to ClangdLSPServer, this patch changes those methods to
find the file contents from InputsAndPreamble, which contains the source
passed in previously.

Subscribers: klimek, ilya-biryukov, jkorous-apple, ioeric, cfe-commits

Differential Revision: https://reviews.llvm.org/D44484

git-svn-id: a34e9779ed74578ad5922b3306b3d80a0c825546@327550 91177308-0d34-0410-b5e6-96231b3b80d8

--- clangd/ClangdServer.cpp
+++ clangd/ClangdServer.cpp
@@ -154,9 +154,9 @@
   // Copy PCHs to avoid accessing this->PCHs concurrently
   std::shared_ptr<PCHContainerOperations> PCHs = this->PCHs;
   auto FS = FSProvider.getFileSystem();
-  auto Task = [PCHs, Pos, FS, CodeCompleteOpts](
-                  std::string Contents, Path File, Callback<CompletionList> CB,
-                  llvm::Expected<InputsAndPreamble> IP) {
+  auto Task = [PCHs, Pos, FS,
+               CodeCompleteOpts](Path File, Callback<CompletionList> CB,
+                                 llvm::Expected<InputsAndPreamble> IP) {
     assert(IP && "error when trying to read preamble for codeComplete");
     auto PreambleData = IP->Preamble;

@@ -164,13 +164,12 @@
     // both the old and the new version in case only one of them matches.
     CompletionList Result = clangd::codeComplete(
         File, IP->Command, PreambleData ? &PreambleData->Preamble : nullptr,
-        Contents, Pos, FS, PCHs, CodeCompleteOpts);
+        IP->Contents, Pos, FS, PCHs, CodeCompleteOpts);
     CB(std::move(Result));
   };

-  WorkScheduler.runWithPreamble(
-      "CodeComplete", File,
-      Bind(Task, std::move(*Latest.Draft), File.str(), std::move(CB)));
+  WorkScheduler.runWithPreamble("CodeComplete", File,
+                                Bind(Task, File.str(), std::move(CB)));
 }

 void ClangdServer::signatureHelp(PathRef File, Position Pos,
@@ -183,8 +182,7 @@

   auto PCHs = this->PCHs;
   auto FS = FSProvider.getFileSystem();
-  auto Action = [Pos, FS, PCHs](std::string Contents, Path File,
-                                Callback<SignatureHelp> CB,
+  auto Action = [Pos, FS, PCHs](Path File, Callback<SignatureHelp> CB,
                                 llvm::Expected<InputsAndPreamble> IP) {
     if (!IP)
       return CB(IP.takeError());
@@ -192,12 +190,11 @@
     auto PreambleData = IP->Preamble;
     CB(clangd::signatureHelp(File, IP->Command,
                              PreambleData ? &PreambleData->Preamble : nullptr,
-                             Contents, Pos, FS, PCHs));
-  };
-
-  WorkScheduler.runWithPreamble(
-      "SignatureHelp", File,
-      Bind(Action, std::move(*Latest.Draft), File.str(), std::move(CB)));
+                             IP->Contents, Pos, FS, PCHs));
+  };
+
+  WorkScheduler.runWithPreamble("SignatureHelp", File,
+                                Bind(Action, File.str(), std::move(CB)));
 }

 llvm::Expected<tooling::Replacements>


[clangd] Second attempt to fix MSVC compilation breakage.

git-svn-id: a34e9779ed74578ad5922b3306b3d80a0c825546@323863 91177308-0d34-0410-b5e6-96231b3b80d8

--- clangd/ClangdServer.cpp
+++ clangd/ClangdServer.cpp
@@ -34,25 +34,31 @@
 // Issues an async read of AST and waits for results.
 template <class Ret, class Func>
 Ret blockingRunWithAST(TUScheduler &S, PathRef File, Func &&F) {
-  // Using Optional to workaround MSVC bug. It requires future<> arguments to
-  // have default ctor.
-  std::packaged_task<llvm::Optional<Ret>(llvm::Expected<InputsAndAST>)> Task(
-      std::forward<Func>(F));
+  // Using shared_ptr to workaround MSVC bug. It requires future<> arguments to
+  // have default and copy ctor.
+  auto SharedPtrFunc = [&](llvm::Expected<InputsAndAST> Arg) {
+    return std::make_shared<Ret>(F(std::move(Arg)));
+  };
+  std::packaged_task<std::shared_ptr<Ret>(llvm::Expected<InputsAndAST>)> Task(
+      SharedPtrFunc);
   auto Future = Task.get_future();
   S.runWithAST(File, std::move(Task));
-  return *Future.get();
+  return std::move(*Future.get());
 }

 // Issues an async read of preamble and waits for results.
 template <class Ret, class Func>
 Ret blockingRunWithPreamble(TUScheduler &S, PathRef File, Func &&F) {
-  // Using Optional to workaround MSVC bug. It requires future<> arguments to
-  // have default ctor.
-  std::packaged_task<llvm::Optional<Ret>(llvm::Expected<InputsAndPreamble>)>
-      Task(std::forward<Func>(F));
+  // Using shared_ptr to workaround MSVC bug. It requires future<> arguments to
+  // have default and copy ctor.
+  auto SharedPtrFunc = [&](llvm::Expected<InputsAndPreamble> Arg) {
+    return std::make_shared<Ret>(F(std::move(Arg)));
+  };
+  std::packaged_task<std::shared_ptr<Ret>(llvm::Expected<InputsAndPreamble>)>
+      Task(SharedPtrFunc);
   auto Future = Task.get_future();
   S.runWithPreamble(File, std::move(Task));
-  return *Future.get();
+  return std::move(*Future.get());
 }

 void ignoreError(llvm::Error Err) {