Made DBCS work with changes to Pango character position calculation. Experimental calculation of DBCS character width using iconv rather than mblen.

--- gtk/PlatGTK.cxx
+++ gtk/PlatGTK.cxx
@@ -1048,6 +1048,21 @@
 	return 0;
 }

+static size_t MultiByteLenFromIconv(iconv_t iconvh, const char *s, size_t len) {
+	for (size_t lenMB=1; (lenMB<4) && (lenMB <= len); lenMB++) {
+		char wcForm[2];
+		char *pin = const_cast<char *>(s);
+		size_t inLeft = lenMB;
+		char *pout = wcForm;
+		size_t outLeft = 2;
+		size_t conversions = iconv(iconvh, &pin, &inLeft, &pout, &outLeft);
+		if (conversions != ((size_t)(-1))) {
+			return lenMB;
+		}
+	}
+	return 1;
+}
+
 static char *UTF8FromLatin1(const char *s, int len) {
 	char *utfForm = new char[len*2+1];
 	size_t lenU = 0;
@@ -1100,6 +1115,18 @@
 	return utfForm;
 }

+static size_t UTF8CharLength(const char *s) {
+	const unsigned char *us = reinterpret_cast<const unsigned char *>(s);
+	unsigned char ch = *us;
+	if (ch < 0x80) {
+		return 1;
+	} else if (ch < 0x80 + 0x40 + 0x20) {
+		return 2;
+	} else {
+		return 3;
+	}
+}
+
 #endif

 // On GTK+, wchar_t is 4 bytes
@@ -1118,20 +1145,17 @@
 			if (et == UTF8) {
 				pango_layout_set_text(layout, s, len);
 			} else {
-				if (et == dbcs) {
-					// Convert to utf8
-					utfForm = UTF8FromDBCS(s, len);
-				}
-				if (!utfForm) {	// DBCS failed so treat as iconv
+				if (!utfForm) {
 					SetIconv(PFont(font_)->characterSet);
 					utfForm = UTF8FromIconv(iconvh, s, len);
 				}
-				//~ if (!utfForm) {	// DBCS failed so treat as locale
-					//~ gsize w; // stub
-					//~ utfForm = g_locale_to_utf8(s, len, NULL, &w, NULL);
-					//~ useGFree = static_cast<bool>(utfForm);
-				//~ };
-				if (!utfForm) {	// g_locale_to_utf8 failed so treat as Latin1
+				if (!utfForm) {	// iconv failed so try DBCS if DBCS mode
+					if (et == dbcs) {
+						// Convert to utf8
+						utfForm = UTF8FromDBCS(s, len);
+					}
+				}
+				if (!utfForm) {	// iconv and DBCS failed so treat as Latin1
 					utfForm = UTF8FromLatin1(s, len);
 				}
 				pango_layout_set_text(layout, utfForm, strlen(utfForm));
@@ -1245,36 +1269,40 @@
 				}
 				pango_layout_iter_free (iter);
 			} else {
-				int wclen = 0;
+				int positionsCalculated = 0;
 				if (et == dbcs) {
-					GdkWChar *wctext = new GdkWChar[len + 1];
-					GdkWChar *wcp = wctext;
-					wclen = gdk_mbstowcs(wcp, s, len);
-					if (wclen >= 1 ) {
+					SetIconv(PFont(font_)->characterSet);
+					char *utfForm = UTF8FromIconv(iconvh, s, len);
+					if (utfForm) {
 						// Convert to UTF-8 so can ask Pango for widths, then
 						// Loop through UTF-8 and DBCS forms, taking account of different
 						// character byte lengths.
-						char *utfForm = UTF8FromGdkWChar(wctext, wclen);
+						iconv_t iconvhMeasure =
+							iconv_open("UCS-2", CharacterSetID(characterSet));
 						pango_layout_set_text(layout, utfForm, strlen(utfForm));
 						int i = 0;
+						int utfIndex = 0;
 						PangoLayoutIter *iter = pango_layout_get_iter (layout);
 						while (pango_layout_iter_next_cluster (iter)) {
-							size_t lenChar = mblen(s+i, MB_CUR_MAX);
 							pango_layout_iter_get_cluster_extents (iter, NULL, &pos);
 							int position = PANGO_PIXELS(pos.x);
-							// TODO: measure number of bytes of the DBCS input
-							// in the cluster just measured and set that number of elements
-							// of positions.
-							while (lenChar--) {
-								positions[i++] = position;
+							int utfIndexNext = pango_layout_iter_get_index (iter);
+							while (utfIndex < utfIndexNext) {
+								size_t lenChar = MultiByteLenFromIconv(iconvhMeasure, s+i, len-i);
+								//size_t lenChar = mblen(s+i, MB_CUR_MAX);
+								while (lenChar--) {
+									positions[i++] = position;
+									positionsCalculated++;
+								}
+								utfIndex += UTF8CharLength(utfForm+utfIndex);
 							}
 						}
 						pango_layout_iter_free (iter);
 						delete []utfForm;
+						iconv_close(iconvhMeasure);
 					}
-					delete []wctext;
 				}
-				if (wclen < 1 ) {
+				if (positionsCalculated < 1 ) {
 					// Either Latin1 or DBCS conversion failed so treat as Latin1.
 					bool useGFree = false;
 					SetIconv(PFont(font_)->characterSet);
@@ -1373,11 +1401,6 @@
 					SetIconv(PFont(font_)->characterSet);
 					utfForm = UTF8FromIconv(iconvh, s, len);
 				}
-				//~ if (!utfForm) {	// iconv failed so treat as locale
-					//~ gsize w;
-					//~ utfForm = g_locale_to_utf8(s, len, NULL, &w, NULL);
-					//~ useGFree = static_cast<bool>(utfForm);
-				//~ };
 				if (!utfForm) {	// g_locale_to_utf8 failed so treat as Latin1
 					utfForm = UTF8FromLatin1(s, len);
 				}
@@ -1534,7 +1557,7 @@
 }

 void SurfaceImpl::SetDBCSMode(int codePage) {
-	if (codePage == SC_CP_DBCS)
+	if (codePage && (codePage != SC_CP_UTF8))
 		et = dbcs;
 }

@@ -2171,20 +2194,32 @@
 	                              reinterpret_cast<sptr_t>(lParam));
 }

-bool Platform::IsDBCSLeadByte(int /*codePage*/, char /*ch*/) {
+bool Platform::IsDBCSLeadByte(int /* codePage */, char /* ch */) {
 	return false;
 }

-int Platform::DBCSCharLength(int /*codePage*/, const char *s) {
-	int bytes = mblen(s, MB_CUR_MAX);
-	if (bytes >= 1)
-		return bytes;
-	else
-		return 1;
+int Platform::DBCSCharLength(int codePage, const char *s) {
+	if (codePage == 999932) {
+		// Experimental and disabled code - change 999932 to 932 above to
+		// enable locale avoiding but expensive character length determination.
+		// Avoid locale with explicit use of iconv
+		iconv_t iconvhMeasure =
+			iconv_open("UCS-2", CharacterSetID(SC_CHARSET_SHIFTJIS));
+		size_t lenChar = MultiByteLenFromIconv(iconvhMeasure, s, strlen(s));
+		iconv_close(iconvhMeasure);
+		return lenChar;
+	} else {
+		int bytes = mblen(s, MB_CUR_MAX);
+		if (bytes >= 1)
+			return bytes;
+		else
+			return 1;
+	}
 }

 int Platform::DBCSCharMaxLength() {
 	return MB_CUR_MAX;
+	//return 2;
 }

 // These are utility functions not really tied to a platform


fix c++11 compile error

fix c++11 compile error

--- tests/unit/mathematics/logdet/DenseMatrixOperator_unittest.cc
+++ tests/unit/mathematics/logdet/DenseMatrixOperator_unittest.cc
@@ -93,7 +93,13 @@
 	CDenseMatrixOperator<complex64_t, float64_t> op(m);
 	SGVector<complex64_t> diag=op.get_diagonal();
 	for (index_t i=0; i<diag.vlen; ++i)
+	{
+#ifdef HAVE_CXX11
+		diag[i].imag(diag[i].imag()-0.75);
+#else
 		diag[i].imag()-=0.75;
+#endif
+	}
 	op.set_diagonal(diag);

 	SGVector<complex64_t> r1=op.apply(b);
@@ -102,7 +108,13 @@
 	// shifting the diagonal directly via matrix
 	m.set_const(complex64_t(0.5, 0.0));
 	for (index_t i=0; i<size; ++i)
+	{
+#ifdef HAVE_CXX11
+		m(i,i).imag(m(i,i).imag()-0.75);
+#else
 		m(i,i).imag()-=0.75;
+#endif
+	}

 	SGVector<complex64_t> r2=op.apply(b);
 	Map<VectorXcd> map_r2(r2.vector, r2.vlen);


Nothing...

Nothing...

--- AG/drivers/shell/proc-handler.cpp
+++ AG/drivers/shell/proc-handler.cpp
@@ -18,11 +18,13 @@
 pthread_mutex_t pid_map_lock = PTHREAD_MUTEX_INITIALIZER;

 void invalidate_entry(void* cls) {
+    cout<<"ENTR >>>>>>>>>>>>>>>>>>>>>>>>>. INVALIDATING ENTRY"<<endl;
     proc_table_entry *entry = (proc_table_entry*)cls;
     if (entry == NULL)
 	return;
     //Acquire the pte lock
     pthread_mutex_lock(&entry->pte_lock);
+    cout<<">>>>>>>>>>>>>>>>>>>>>>>>>. INVALIDATING ENTRY"<<endl;
     if (!(entry->is_read_complete)) {
 	if (kill(entry->proc_id, 9) < 0)
 	    perror("kill(9)");
@@ -50,6 +52,7 @@
     if (pte) {
 	if (pte->block_file)
 	    free(pte->block_file);
+	pthread_mutex_destroy(&pte->pte_lock);
 	free (pte);
 	pte = NULL;
     }


Changes: Fixing ut_duilistmulticolumn test.

RevBy: TrustMe

--- tests/ut_duilistviewmulticolumn/ut_duilistviewmulticolumn.cpp
+++ tests/ut_duilistviewmulticolumn/ut_duilistviewmulticolumn.cpp
@@ -84,8 +84,12 @@
 {
     listViewPrivate = new DuiMultiColumnListViewPrivate;
     listViewPrivate->model = phoneBookModel;
-    listViewPrivate->separator = new DuiWidget;
-    listViewPrivate->separator->setGeometry(0, 0, 300, 2);
+
+    DuiWidget * separator = new DuiWidget;
+    separator->setGeometry(0, 0, 300, 2);
+    separator->setPreferredHeight(2);
+    listViewPrivate->setSeparator(separator);
+
     listViewPrivate->hseparator = new DuiWidget;
     listViewPrivate->hseparator->setGeometry(0, 0, 2, 100);
     listViewPrivate->itemHeight = 100;


balst_stacktraceresolver_filehelper: add include file

--- groups/bal/balst/balst_stacktraceresolver_filehelper.cpp
+++ groups/bal/balst/balst_stacktraceresolver_filehelper.cpp
@@ -20,6 +20,7 @@
 #include <bslma_allocator.h>
 #include <bsls_assert.h>

+#include <bsl_cstddef.h>
 #include <bsl_cstring.h>

 #if defined(BALST_OBJECTFILEFORMAT_RESOLVER_ELF) || \


[CSSimplify] Detect missing optional unwraps in operator/call arguments

--- lib/Sema/CSSimplify.cpp
+++ lib/Sema/CSSimplify.cpp
@@ -1925,6 +1925,16 @@

   auto &elt = path.back();
   switch (elt.getKind()) {
+  case ConstraintLocator::LValueConversion:
+  case ConstraintLocator::ApplyArgToParam: {
+    if (lhs->getOptionalObjectType() && !rhs->getOptionalObjectType()) {
+      conversionsOrFixes.push_back(
+          ForceOptional::create(cs, lhs, lhs->getOptionalObjectType(),
+                                cs.getConstraintLocator(locator)));
+    }
+    break;
+  }
+
   case ConstraintLocator::FunctionArgument: {
     auto *argLoc = cs.getConstraintLocator(
         locator.withPathElement(LocatorPathElt::getSynthesizedArgument(0)));


Switching some iterator-based for loops to use range-based for loops. No functional changes intended.

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

--- lib/Sema/SemaLookup.cpp
+++ lib/Sema/SemaLookup.cpp
@@ -1767,9 +1767,7 @@

   // Lookup in a base class succeeded; return these results.

-  DeclContext::lookup_result DR = Paths.front().Decls;
-  for (DeclContext::lookup_iterator I = DR.begin(), E = DR.end(); I != E; ++I) {
-    NamedDecl *D = *I;
+  for (auto *D : Paths.front().Decls) {
     AccessSpecifier AS = CXXRecordDecl::MergeAccess(SubobjectAccess,
                                                     D->getAccess());
     R.addDecl(D, AS);
@@ -1877,16 +1875,15 @@

     llvm::SmallPtrSet<NamedDecl*,8> TagDecls;

-    LookupResult::iterator DI, DE = Result.end();
-    for (DI = Result.begin(); DI != DE; ++DI)
-      if (TagDecl *TD = dyn_cast<TagDecl>(*DI)) {
+    for (auto *D : Result)
+      if (TagDecl *TD = dyn_cast<TagDecl>(D)) {
         TagDecls.insert(TD);
         Diag(TD->getLocation(), diag::note_hidden_tag);
       }

-    for (DI = Result.begin(); DI != DE; ++DI)
-      if (!isa<TagDecl>(*DI))
-        Diag((*DI)->getLocation(), diag::note_hiding_object);
+    for (auto *D : Result)
+      if (!isa<TagDecl>(D))
+        Diag(D->getLocation(), diag::note_hiding_object);

     // For recovery purposes, go ahead and implement the hiding.
     LookupResult::Filter F = Result.makeFilter();
@@ -1901,9 +1898,8 @@
   case LookupResult::AmbiguousReference: {
     Diag(NameLoc, diag::err_ambiguous_reference) << Name << LookupRange;

-    LookupResult::iterator DI = Result.begin(), DE = Result.end();
-    for (; DI != DE; ++DI)
-      Diag((*DI)->getLocation(), diag::note_ambiguous_candidate) << *DI;
+    for (auto *D : Result)
+      Diag(D->getLocation(), diag::note_ambiguous_candidate) << D;
     break;
   }
   }
@@ -2298,10 +2294,9 @@
     UnresolvedLookupExpr *ULE = dyn_cast<UnresolvedLookupExpr>(Arg);
     if (!ULE) continue;

-    for (UnresolvedSetIterator I = ULE->decls_begin(), E = ULE->decls_end();
-           I != E; ++I) {
+    for (const auto *D : ULE->decls()) {
       // Look through any using declarations to find the underlying function.
-      FunctionDecl *FDecl = (*I)->getUnderlyingDecl()->getAsFunction();
+      const FunctionDecl *FDecl = D->getUnderlyingDecl()->getAsFunction();

       // Add the classes and namespaces associated with the parameter
       // types and return type of this function.
@@ -2472,11 +2467,7 @@
   // from an external source and invalidate lookup_result.
   SmallVector<NamedDecl *, 8> Candidates(R.begin(), R.end());

-  for (SmallVectorImpl<NamedDecl *>::iterator I = Candidates.begin(),
-                                              E = Candidates.end();
-       I != E; ++I) {
-    NamedDecl *Cand = *I;
-
+  for (auto *Cand : Candidates) {
     if (Cand->isInvalidDecl())
       continue;

@@ -2804,9 +2795,7 @@
   //
   // Here, we compute Y and add its members to the overloaded
   // candidate set.
-  for (AssociatedNamespaceSet::iterator NS = AssociatedNamespaces.begin(),
-                                     NSEnd = AssociatedNamespaces.end();
-       NS != NSEnd; ++NS) {
+  for (auto *NS : AssociatedNamespaces) {
     //   When considering an associated namespace, the lookup is the
     //   same as the lookup performed when the associated namespace is
     //   used as a qualifier (3.4.3.2) except that:
@@ -2818,10 +2807,8 @@
     //        associated classes are visible within their respective
     //        namespaces even if they are not visible during an ordinary
     //        lookup (11.4).
-    DeclContext::lookup_result R = (*NS)->lookup(Name);
-    for (DeclContext::lookup_iterator I = R.begin(), E = R.end(); I != E;
-         ++I) {
-      NamedDecl *D = *I;
+    DeclContext::lookup_result R = NS->lookup(Name);
+    for (auto *D : R) {
       // If the only declaration here is an ordinary friend, consider
       // it only if it was declared in an associated classes.
       if ((D->getIdentifierNamespace() & Decl::IDNS_Ordinary) == 0) {
@@ -2938,31 +2925,29 @@
     if (Pos == SM->end())
       continue;

-    for (ShadowMapEntry::iterator I = Pos->second.begin(),
-                               IEnd = Pos->second.end();
-         I != IEnd; ++I) {
+    for (auto *D : Pos->second) {
       // A tag declaration does not hide a non-tag declaration.
-      if ((*I)->hasTagIdentifierNamespace() &&
+      if (D->hasTagIdentifierNamespace() &&
           (IDNS & (Decl::IDNS_Member | Decl::IDNS_Ordinary |
                    Decl::IDNS_ObjCProtocol)))
         continue;

       // Protocols are in distinct namespaces from everything else.
-      if ((((*I)->getIdentifierNamespace() & Decl::IDNS_ObjCProtocol)
+      if (((D->getIdentifierNamespace() & Decl::IDNS_ObjCProtocol)
            || (IDNS & Decl::IDNS_ObjCProtocol)) &&
-          (*I)->getIdentifierNamespace() != IDNS)
+          D->getIdentifierNamespace() != IDNS)
         continue;

       // Functions and function templates in the same scope overload
       // rather than hide.  FIXME: Look for hiding based on function
       // signatures!
-      if ((*I)->getUnderlyingDecl()->isFunctionOrFunctionTemplate() &&
+      if (D->getUnderlyingDecl()->isFunctionOrFunctionTemplate() &&
           ND->getUnderlyingDecl()->isFunctionOrFunctionTemplate() &&
           SM == ShadowMaps.rbegin())
         continue;

       // We've found a declaration that hides this one.
-      return *I;
+      return D;
     }
   }

@@ -3787,10 +3772,8 @@
     std::sort(sortedDistances.begin(), sortedDistances.end());

   Specifiers.clear();
-  for (SmallVectorImpl<unsigned>::iterator DI = sortedDistances.begin(),
-                                        DIEnd = sortedDistances.end();
-       DI != DIEnd; ++DI) {
-    SpecifierInfoList &SpecList = DistanceMap[*DI];
+  for (auto D : sortedDistances) {
+    SpecifierInfoList &SpecList = DistanceMap[D];
     Specifiers.append(SpecList.begin(), SpecList.end());
   }

@@ -4302,10 +4285,8 @@
     // For unqualified lookup, look through all of the names that we have
     // seen in this translation unit.
     // FIXME: Re-add the ability to skip very unlikely potential corrections.
-    for (IdentifierTable::iterator I = Context.Idents.begin(),
-                                IEnd = Context.Idents.end();
-         I != IEnd; ++I)
-      Consumer.FoundName(I->getKey());
+    for (const auto &I : Context.Idents)
+      Consumer.FoundName(I.getKey());

     // Walk through identifiers in external identifier sources.
     // FIXME: Re-add the ability to skip very unlikely potential corrections.
@@ -4344,8 +4325,8 @@
       SmallVector<NamespaceDecl *, 4> ExternalKnownNamespaces;
       LoadedExternalKnownNamespaces = true;
       ExternalSource->ReadKnownNamespaces(ExternalKnownNamespaces);
-      for (unsigned I = 0, N = ExternalKnownNamespaces.size(); I != N; ++I)
-        KnownNamespaces[ExternalKnownNamespaces[I]] = true;
+      for (auto *N : ExternalKnownNamespaces)
+        KnownNamespaces[N] = true;
     }

     Consumer.addNamespaces(KnownNamespaces);
@@ -4488,11 +4469,9 @@
   if (!candidate.getCorrectionDecl())
     return candidate.isKeyword();

-  for (TypoCorrection::const_decl_iterator DI = candidate.begin(),
-                                           DIEnd = candidate.end();
-       DI != DIEnd; ++DI) {
+  for (auto *C : candidate) {
     FunctionDecl *FD = nullptr;
-    NamedDecl *ND = (*DI)->getUnderlyingDecl();
+    NamedDecl *ND = C->getUnderlyingDecl();
     if (FunctionTemplateDecl *FTD = dyn_cast<FunctionTemplateDecl>(ND))
       FD = FTD->getTemplatedDecl();
     if (!HasExplicitTemplateArgs && !FD) {


change unix check to gcc check

change unix check to gcc check

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

--- AssetModule/HttpAssetProvider.cpp
+++ AssetModule/HttpAssetProvider.cpp
@@ -217,7 +217,7 @@
             transfer.AssembleData(&data[0]);

-#ifdef unix
+#if defined(__GNUC__)
 	    RexAssetMetadata* m = dynamic_cast<RexAssetMetadata*>(new_asset->GetMetadata());
 #else
 	    Foundation::AssetMetadataInterface* metadata = new_asset->GetMetadata();
@@ -244,7 +244,7 @@

 	std::string HttpAssetProvider::SerializeToJSON(Foundation::AssetPtr asset) const
 	{
-#ifdef unix
+#if defined(__GNUC__)
 		RexAssetMetadata* metadata = dynamic_cast<RexAssetMetadata*>(asset->GetMetadata());
 #else
 		RexAssetMetadata* metadata = static_cast<RexAssetMetadata*>(asset->GetMetadata());


Splitting list compartment tests for @type array and generic, as @type array converts all ints and symbols to floats.

--- implementations/MaxMSP/jcom.parameter/jcom.parameter.cpp
+++ implementations/MaxMSP/jcom.parameter/jcom.parameter.cpp
@@ -1087,8 +1087,9 @@
 	if (param_clip_list(x) && x->ramper)
 		x->ramper->stop();							// stop the ramp

+	int newListDiffers = param_list_compare(x, x->atom_listTemp, x->listTemp_size, x->atom_list, x->list_size);
 	// Test for repetitions before outputting
-	if (!x->isInitialised || x->common.attr_repetitions || param_list_compare(x, x->atom_listTemp, x->listTemp_size, x->atom_list, x->list_size)) {
+	if ( !x->isInitialised || x->common.attr_repetitions || (newListDiffers==0) ) {

 		// Update stored values
 		x->list_size = x->listTemp_size;
@@ -1812,8 +1813,9 @@
 // Returns true if lists are identical
 int param_list_compare(t_param* x, AtomPtr a, long lengthA, AtomPtr b, long lengthB)
 {
-	long length1 = lengthA;
-	long length2 = lengthB;
+	long	length1 = lengthA;
+	long	length2 = lengthB;
+	int		i;

 	// Dedicated test for @type integer, disregards all list members but first
 	if (x->common.attr_type == jps_integer) {
@@ -1855,8 +1857,23 @@
 	else if (x->common.attr_type==jps_none)
 		return 0;

-	// Dedicated test for @type generic and array
-	// If we spot a difference, we return 0
+	// Dedicated test for @type array. If we spot a difference, we return 0.
+	else if (x->common.attr_type== jps_array) {
+		// If length differs => the lists  differs
+		if (length1 != length2)
+			return 0;
+		else {
+			// Values are compared as floats
+			for (i = 0; i < length1; i++, a++, b++) {
+				if (atom_getfloat(a) != atom_getfloat(b))
+					return 0;
+			}
+			// Did not find any differences => the two lists are identical
+			return 1;
+		}
+	}
+
+	// Dedicated test for @type generic. If we spot a difference, we return 0.
 	else {
 		// If length differs => the lists  differs
 		if (length1 != length2)
@@ -1865,7 +1882,7 @@
 			short type;

 			// Compare item by item
-			for (int i = 0; i < length1; i++, a++, b++) {
+			for (i = 0; i < length1; i++, a++, b++) {

 				// If type differs => the lists differs
 				type = a->a_type;


Removed rad2deg and deg2rad, since they live in angles.cpp now.


Manually fix some overly-long line(s).

Manually fix some overly-long line(s).

--- drake/systems/plants/test/compareRigidBodySystems.cpp
+++ drake/systems/plants/test/compareRigidBodySystems.cpp
@@ -26,7 +26,8 @@
   r1->addRobotFromFile(model_file_1, DrakeJoint::QUATERNION);

   auto r2 = make_shared<RigidBodySystem>();
-  r2->addRobotFromFile(model_file_2, DrakeJoint::QUATERNION, model_pose_in_world);
+  r2->addRobotFromFile(model_file_2, DrakeJoint::QUATERNION,
+                       model_pose_in_world);

   // for debugging:
   // r1->getRigidBodyTree()->drawKinematicTree("/tmp/r1.dot");


Use array_type instead of raw vector type.

--- include/mdds/mixed_type_matrix_storage_filled_linear.inl
+++ include/mdds/mixed_type_matrix_storage_filled_linear.inl
@@ -581,7 +581,7 @@
             // empty matrix - nothing to do.
             return;

-        ::std::vector<element> trans_array(m_rows*m_cols, element(0.0));
+        array_type trans_array(m_rows*m_cols, element(0.0));
         for (size_t i = 0; i < m_rows; ++i)
             for (size_t j = 0; j < m_cols; ++j)
                 trans_array[m_rows*j+i] = m_array[get_pos(i,j)];
@@ -612,7 +612,7 @@
             return;
         }

-        ::std::vector<element> new_array(new_size, element(0.0));
+        array_type new_array(new_size, element(0.0));
         size_t min_rows = ::std::min(row, m_rows);
         size_t min_cols = ::std::min(col, m_cols);
         for (size_t i = 0; i < min_rows; ++i)


fix Android typeid_test.cc build error

fix Android typeid_test.cc build error

Summary:
Fix typeid_test when running android C2 tests

Previously it says:
    Build failed: Command failed with exit code 1.
    stderr: caffe2/caffe2/core/typeid_test.cc: In member function 'virtual void caffe2::{anonymous}::TypeMetaTest_Names_Test::TestBody()':
    caffe2/caffe2/core/typeid_test.cc:49:12: error: variable 'string_meta' set but not used [-Werror=unused-but-set-variable]
       TypeMeta string_meta = TypeMeta::Make<string>();

Reviewed By: Yangqing

Differential Revision: D6869192

fbshipit-source-id: ccbc30d53d04a8ece98de0a99598c176e6aaf4dc

--- caffe2/core/typeid_test.cc
+++ caffe2/core/typeid_test.cc
@@ -46,9 +46,9 @@
   TypeMeta null_meta;
   EXPECT_TRUE(string(null_meta.name()) == "nullptr (uninitialized)");
   TypeMeta int_meta = TypeMeta::Make<int>();
-  TypeMeta string_meta = TypeMeta::Make<string>();
   EXPECT_TRUE(string(int_meta.name()) == "int");
 #ifdef __GXX_RTTI
+  TypeMeta string_meta = TypeMeta::Make<string>();
   // For string, we should have a demangled name.
   EXPECT_TRUE(
       string(string_meta.name()) != typeid(string).name());


Fix PR 1688.  See comments there.

Fix PR 1688.  See comments there.

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

--- lib/Support/APFloat.cpp
+++ lib/Support/APFloat.cpp
@@ -47,7 +47,7 @@
   const fltSemantics APFloat::IEEEdouble = { 1023, -1022, 53, true };
   const fltSemantics APFloat::IEEEquad = { 16383, -16382, 113, true };
   const fltSemantics APFloat::x87DoubleExtended = { 16383, -16382, 64, false };
-  const fltSemantics APFloat::Bogus = { 0, 0, 0, true };
+  const fltSemantics APFloat::Bogus = { 0, 0, 0, false };
 }

 /* Put a bunch of private, handy routines in an anonymous namespace.  */
@@ -339,8 +339,7 @@
 unsigned int
 APFloat::partCount() const
 {
-  return partCountForBits(semantics->precision +
-                          semantics->implicitIntegerBit ? 1 : 0);
+  return partCountForBits(semantics->precision + 1);
 }

 unsigned int
@@ -1324,7 +1323,11 @@
   newPartCount = partCountForBits(toSemantics.precision + 1);

   /* If our new form is wider, re-allocate our bit pattern into wider
-     storage.  */
+     storage.
+     If we're narrowing from multiple words to 1 words, copy to the single
+     word.  If we are losing information by doing this, we would have to
+     worry about rounding; right now the only case is f80 -> shorter
+     conversion, and we are keeping all 64 significant bits, so it's OK. */
   if(newPartCount > partCount()) {
     integerPart *newParts;

@@ -1333,6 +1336,13 @@
     APInt::tcAssign(newParts, significandParts(), partCount());
     freeSignificand();
     significand.parts = newParts;
+  } else if (newPartCount==1 && newPartCount < partCount()) {
+    integerPart newPart;
+
+    APInt::tcSet(&newPart, 0, newPartCount);
+    APInt::tcAssign(&newPart, significandParts(), partCount());
+    freeSignificand();
+    significand.part = newPart;
   }

   if(category == fcNormal) {
@@ -1588,22 +1598,22 @@
 // Conversion from APFloat to/from host float/double.  It may eventually be
 // possible to eliminate these and have everybody deal with APFloats, but that
 // will take a while.  This approach will not easily extend to long double.
-// Current implementation requires partCount()==1, which is correct at the
-// moment but could be made more general.
+// Current implementation requires integerPartWidth==64, which is correct at
+// the moment but could be made more general.

 // Denormals have exponent minExponent in APFloat, but minExponent-1 in
-// the actual IEEE respresentation.  We compensate for that here.
+// the actual IEEE respresentations.  We compensate for that here.

 APInt
 APFloat::convertF80LongDoubleAPFloatToAPInt() const {
   assert(semantics == (const llvm::fltSemantics* const)&x87DoubleExtended);
-  assert (partCount()==1);
+  assert (partCount()==2);

   uint64_t myexponent, mysignificand;

   if (category==fcNormal) {
     myexponent = exponent+16383; //bias
-    mysignificand = *significandParts();
+    mysignificand = significandParts()[0];
     if (myexponent==1 && !(mysignificand & 0x8000000000000000ULL))
       myexponent = 0;   // denormal
   } else if (category==fcZero) {
@@ -1614,7 +1624,7 @@
     mysignificand = 0x8000000000000000ULL;
   } else if (category==fcNaN) {
     myexponent = 0x7fff;
-    mysignificand = *significandParts();
+    mysignificand = significandParts()[0];
   } else
     assert(0);

@@ -1727,7 +1737,7 @@
                           (i2 & 0xffff);

   initialize(&APFloat::x87DoubleExtended);
-  assert(partCount()==1);
+  assert(partCount()==2);

   sign = i1>>63;
   if (myexponent==0 && mysignificand==0) {
@@ -1739,11 +1749,13 @@
   } else if (myexponent==0x7fff && mysignificand!=0x8000000000000000ULL) {
     // exponent meaningless
     category = fcNaN;
-    *significandParts() = mysignificand;
+    significandParts()[0] = mysignificand;
+    significandParts()[1] = 0;
   } else {
     category = fcNormal;
     exponent = myexponent - 16383;
-    *significandParts() = mysignificand;
+    significandParts()[0] = mysignificand;
+    significandParts()[1] = 0;
     if (myexponent==0)          // denormal
       exponent = -16382;
  }


remove commented out debug code

remove commented out debug code

--- industrial_extrinsic_cal/src/ros_transform_interface.cpp
+++ industrial_extrinsic_cal/src/ros_transform_interface.cpp
@@ -242,16 +242,10 @@

   bool   ROSCameraHousingBroadcastTInterface::pushTransform(Pose6d & pose)
   {
-    //std::cout << ">>>>>>>>>>>>>>>>>" << std::endl;
-    //std::cout << "ROSCameraHousingBroadcastTInterface::pushTransform()" << std::endl;
     Pose6d mountingMVoptical = pose.getInverse();
     Pose6d opticalMVhousing = getPoseFromTF(transform_frame_, housing_frame_, tf_listener_);
     Pose6d mountingMVhousing = mountingMVoptical * opticalMVhousing;
-    //mountingMVoptical.show("mountingMVoptical = pose");
-    //opticalMVhousing.show("opticalMVhousing");
-    //mountingMVhousing.show("stored: mountingMVhousing");
     pose_ = mountingMVhousing;
-    //std::cout << "<<<<<<<<<<<<<<<<<" << std::endl;
     if(!ref_frame_initialized_){
       return(false);		// timer won't start publishing until ref_frame_ is defined
     }
@@ -298,25 +292,11 @@
   void  ROSCameraHousingBroadcastTInterface::timerCallback(const ros::TimerEvent & timer_event)
   { // broadcast current value of pose.inverse() as a transform each time called

-    // Camer optical frame to ref is estimated by bundle adjustment  pose_ = optical2ref
-    // Camer housing to camera optical frame is specified by urdf   optical2housing
-    // Desired ref2housing = optical2ref^-1 * optical2housing
-    //std::cout << ">>>>>>>>>>>>>>>>>" << std::endl;
-    //std::cout << "ROSCameraHousingBroadcastTInterface::timerCallback()" << std::endl;
-    //std::cout << "ref_frame_: " << ref_frame_ << std::endl;
-    //std::cout << "transform_frame_: " << transform_frame_ << std::endl;
-    //std::cout << "housing_frame_: " << housing_frame_ << std::endl;
-    //std::cout << "mounting_frame_: " << mounting_frame_ << std::endl;
-    //pose_.show("pose_");
-
     Pose6d ref2housing = pose_;
-
-    //ref2housing.show("ref2housing");

     transform_.setBasis(ref2housing.getBasis());
     transform_.setOrigin(ref2housing.getOrigin());
     tf_broadcaster_.sendTransform(tf::StampedTransform(transform_, ros::Time::now(), ref_frame_, housing_frame_));
-    //std::cout << "<<<<<<<<<<<<<<<<<" << std::endl;
   }

   Pose6d ROSCameraHousingBroadcastTInterface::pullTransform()
@@ -327,18 +307,10 @@
       return(pose);
     }

-    //std::cout << ">>>>>>>>>>>>>>>>>" << std::endl;
-    //std::cout << "ROSCameraHousingBroadcastTInterface::pullTransform()" << std::endl;
-
     Pose6d opticalMVhousing = getPoseFromTF(transform_frame_, housing_frame_, tf_listener_);
     Pose6d mountingMVhousing = pose_;
     Pose6d housingMVmounting = mountingMVhousing.getInverse();
     Pose6d opticalMVmounting = opticalMVhousing * housingMVmounting;
-    //opticalMVhousing.show("opticalMVhousing");
-    //mountingMVhousing.show("mountingMVhousing");
-    //housingMVmounting.show("housingMVmounting");
-    //opticalMVmounting.show("res: opticalMVmounting");
-    //std::cout << "<<<<<<<<<<<<<<<<<" << std::endl;
     return(opticalMVmounting);
   }


Connection: Initialize accountBalance private member.

--- TelepathyQt4/connection.cpp
+++ TelepathyQt4/connection.cpp
@@ -217,6 +217,9 @@
       maxPresenceStatusMessageLength(0),
       handleContext(0)
 {
+    accountBalance.amount = 0;
+    accountBalance.scale = 0;
+
     Q_ASSERT(properties != 0);

     if (chanFactory->dbusConnection().name() != parent->dbusConnection().name()) {


Fix include of config.h that was incorrectly changed in r331184

The RWMutex implementation depends on config.h macros (specifically
HAVE_PTHREAD_H and HAVE_PTHREAD_RWLOCK_INIT), so we need to be
including it and not just llvm-config.h here or we fall back to a much
slower implementation.

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

--- lib/Support/RWMutex.cpp
+++ lib/Support/RWMutex.cpp
@@ -13,7 +13,7 @@

 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/RWMutex.h"
-#include "llvm/Config/llvm-config.h"
+#include "llvm/Config/config.h"

 //===----------------------------------------------------------------------===//
 //=== WARNING: Implementation here must contain only TRULY operating system


ClangTool output cleanup

ClangTool output cleanup

Information messages sent to stdout by ClangTool now only happen when the -debug
flag is set.

Error messages that used to go to stdout now go to stderr.

Author: Ariel J Bernal <ariel.j.bernal@intel.com>

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

--- lib/Tooling/Tooling.cpp
+++ lib/Tooling/Tooling.cpp
@@ -25,6 +25,7 @@
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Host.h"
 #include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/Debug.h"

 // For chdir, see the comment in ClangTool::run for more information.
 #ifdef _WIN32
@@ -295,14 +296,16 @@
       ArgsAdjuster->Adjust(CompileCommands[I].second.CommandLine);
     assert(!CommandLine.empty());
     CommandLine[0] = MainExecutable;
-    llvm::outs() << "Processing: " << File << ".\n";
+    DEBUG({
+      llvm::dbgs() << "Processing: " << File << ".\n";
+    });
     ToolInvocation Invocation(CommandLine, ActionFactory->create(), &Files);
     for (int I = 0, E = MappedFileContents.size(); I != E; ++I) {
       Invocation.mapVirtualFile(MappedFileContents[I].first,
                                 MappedFileContents[I].second);
     }
     if (!Invocation.run()) {
-      llvm::outs() << "Error while processing " << File << ".\n";
+      llvm::errs() << "Error while processing " << File << ".\n";
       ProcessingFailed = true;
     }
   }


Allow verifier to be run on partially materialized modules.

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

--- lib/VMCore/Verifier.cpp
+++ lib/VMCore/Verifier.cpp
@@ -332,6 +332,7 @@
           GV.hasExternalLinkage() ||
           GV.hasDLLImportLinkage() ||
           GV.hasExternalWeakLinkage() ||
+          GV.hasGhostLinkage() ||
           (isa<GlobalAlias>(GV) &&
            (GV.hasInternalLinkage() || GV.hasWeakLinkage())),
   "Global is external, but doesn't have external or dllimport or weak linkage!",
@@ -510,7 +511,7 @@

   if (F.isDeclaration()) {
     Assert1(F.hasExternalLinkage() || F.hasDLLImportLinkage() ||
-            F.hasExternalWeakLinkage(),
+            F.hasExternalWeakLinkage() || F.hasGhostLinkage(),
             "invalid linkage type for function declaration", &F);
   } else {
     // Verify that this function (which has a body) is not named "llvm.*".  It


In ForwardDeclPrinter records both the top level header and the directly accessible lower level header (when different).

This allows to catch the case where the user generate the dictionary with the top level header (which was the only one recorded before)
and the user #include the lower level header first.

--- interpreter/cling/lib/Interpreter/ForwardDeclPrinter.cpp
+++ interpreter/cling/lib/Interpreter/ForwardDeclPrinter.cpp
@@ -175,38 +175,101 @@
       }
     }

+     auto &smgr = m_SMgr;
+     auto getIncludeFileName = [&smgr](PresumedLoc loc) {
+        clang::SourceLocation includeLoc = smgr.getSpellingLoc(loc.getIncludeLoc());
+        bool invalid = true;
+        const char* includeText = smgr.getCharacterData(includeLoc, &invalid);
+        assert(!invalid && "Invalid source data");
+        assert(includeText && "Cannot find #include location");
+        assert((includeText[0] == '<' || includeText[0] == '"')
+               && "Unexpected #include delimiter");
+        char endMarker = includeText[0] == '<' ? '>' : '"';
+        ++includeText;
+        const char* includeEnd = includeText;
+        while (*includeEnd != endMarker && *includeEnd) {
+           ++includeEnd;
+        }
+        assert(includeEnd && "Cannot find end of #include file name");
+        return llvm::StringRef(includeText, includeEnd - includeText);
+    };
+
+    auto &PP = m_PP;
+    auto isDirectlyReacheable = [&PP](llvm::StringRef FileName) {
+      const FileEntry* FE = nullptr;
+      SourceLocation fileNameLoc;
+      bool isAngled = false;
+      const DirectoryLookup* FromDir = nullptr;
+      const FileEntry* FromFile = nullptr;
+      const DirectoryLookup* CurDir = nullptr;
+
+      FE = PP.LookupFile(fileNameLoc, FileName, isAngled,
+                          FromDir, FromFile, CurDir, /*SearchPath*/0,
+                          /*RelativePath*/ 0, /*suggestedModule*/0,
+                          /*SkipCache*/ false, /*OpenFile*/ false,
+                          /*CacheFail*/ true);
+      // Return true if we can '#include' the given filename
+      return FE != nullptr;
+    };
+
     SourceLocation spellingLoc = m_SMgr.getSpellingLoc(D->getLocStart());
     // Walk up the include chain.
     PresumedLoc PLoc = m_SMgr.getPresumedLoc(spellingLoc);
     llvm::SmallVector<PresumedLoc, 16> PLocs;
+    llvm::SmallVector<StringRef, 16> PLocNames;
     while (!m_IgnoreFile(PLoc)) {
       if (!m_SMgr.getPresumedLoc(PLoc.getIncludeLoc()).isValid())
         break;
       PLocs.push_back(PLoc);
+      StringRef name( getIncludeFileName(PLoc) );
+
+      // We record in PLocNames only the include file names that can be
+      // reached directly.  Whenever a #include is parsed in addition to
+      // the record include path, the directory where the file containing
+      // the #include is located is also added implicitly and temporarily
+      // to the include path.  So if the include path is empty and a file
+      // is include via a full pathname it can still #include file in its
+      // (sub)directory using their relative path.
+      // Similarly a file included via a sub-directory of the include path
+      // (eg. #include "Product/mainheader.h") can include header files in
+      // the same subdirectory without mentioning it
+      // (eg. #include "otherheader_in_Product.h")
+      // Since we do not (want to) record the actual directory in which is
+      // located the header with the #include we are looking at, if the
+      // #include is relative to that directory we will not be able to find
+      // it back and thus there is no point in recording it.
+      if (isDirectlyReacheable(name)) {
+        PLocNames.push_back(name);
+      }
       PLoc = m_SMgr.getPresumedLoc(PLoc.getIncludeLoc());
     }

     if (PLocs.empty() /* declared in dictionary payload*/)
        return;
-
-    clang::SourceLocation includeLoc = m_SMgr.getSpellingLoc(PLocs[PLocs.size() - 1].getIncludeLoc());
-    bool invalid = true;
-    const char* includeText = m_SMgr.getCharacterData(includeLoc, &invalid);
-    assert(!invalid && "Invalid source data");
-    assert(includeText && "Cannot find #include location");
-    assert((includeText[0] == '<' || includeText[0] == '"')
-           && "Unexpected #include delimiter");
-    char endMarker = includeText[0] == '<' ? '>' : '"';
-    ++includeText;
-    const char* includeEnd = includeText;
-    while (*includeEnd != endMarker && *includeEnd) {
-      ++includeEnd;
-    }
-    assert(includeEnd && "Cannot find end of #include file name");
-
-//    assert ( file.length() != 0 && "Filename Should not be blank");
-    Out() << " __attribute__((annotate(\"$clingAutoload$"
-          << llvm::StringRef(includeText, includeEnd - includeText);
+    else if (PLocNames.empty()) {
+      // In this case, all the header file name are of the 'unreacheable' type,
+      // most likely because the first one was related to the linkdef file and
+      // the linkdef file was pass using a full path name.
+      // We are not (easy) to find it back, nonetheless record it as is, just
+      // in case the user add the missing include path at run-time.
+      if (PLocs.size() > 1) {
+        Out() << " __attribute__((annotate(\"$clingAutoload$";
+        Out() << getIncludeFileName(PLocs[0]);
+        Out() << "\"))) ";
+      }
+      Out() << " __attribute__((annotate(\"$clingAutoload$";
+      Out() << getIncludeFileName(PLocs[PLocs.size() - 1]);
+      Out() << "\"))) ";
+      return;
+    }
+
+    if (PLocNames.size() > 1) {
+      Out() << " __attribute__((annotate(\"$clingAutoload$";
+      Out() << PLocNames[0];
+      Out() << "\"))) ";
+    }
+    Out() << " __attribute__((annotate(\"$clingAutoload$";
+    Out() << PLocNames[PLocNames.size()-1];
     Out() << "\"))) ";
   }


Expose the verifier to opt

Expose the verifier to opt

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

--- lib/VMCore/Verifier.cpp
+++ lib/VMCore/Verifier.cpp
@@ -169,7 +169,7 @@
     }
   };

-  RegisterPass<Verifier> X("verify", "Module Verifier");
+  RegisterOpt<Verifier> X("verify", "Module Verifier");

 // Assert - We know that cond should be true, if not print an error message.
 #define Assert(C, M) \


Introducing the QA flag in the steering macro

--- PWG2/SPECTRA/macros/runProtonAnalysis.C
+++ PWG2/SPECTRA/macros/runProtonAnalysis.C
@@ -34,14 +34,15 @@
   timer.Start();

   /*runLocal("ESD",
-	   kAnalyzeMC,
-	   esdAnalysisType,
-	   pidMode, kUseOnlineTrigger,kUseOfflineTrigger,
-	   "/home/pchrist/ALICE/Baryons/Data/104070");*/
-  //runInteractive("ESD", kAnalyzeMC, esdAnalysisType, pidMode, kUseOnlineTrigger, kUseOfflineTrigger, "tag.xml");
-  //runBatch("ESD", kAnalyzeMC, esdAnalysisType, pidMode, kUseOnlineTrigger, kUseOfflineTrigger, "wn.xml");
+    kAnalyzeMC,
+    esdAnalysisType,
+    pidMode, kUseOnlineTrigger,kUseOfflineTrigger,
+    kRunQA,
+    "/home/pchrist/ALICE/Baryons/Data/104070");*/
+  //runInteractive("ESD", kAnalyzeMC, esdAnalysisType, pidMode, kUseOnlineTrigger, kUseOfflineTrigger, kRunQA, "tag.xml");
+  //runBatch("ESD", kAnalyzeMC, esdAnalysisType, pidMode, kUseOnlineTrigger, kUseOfflineTrigger, kRunQA, "wn.xml");
   runProof("ESD", kAnalyzeMC, esdAnalysisType, pidMode, kUseOnlineTrigger,
-	   kUseOfflineTrigger,
+	   kUseOfflineTrigger, kRunQA,
 	   500000,0,"/COMMON/COMMON/LHC10a8_run104867_8#esdTree");

   timer.Stop();
@@ -55,6 +56,7 @@
 	      const char* pidMode = 0x0,
 	      Bool_t kUseOnlineTrigger = kTRUE,
 	      Bool_t kUseOfflineTrigger = kTRUE,
+	      Bool_t kRunQA = kFALSE,
 	      const char* path = "/home/pchrist/ALICE/Alien/Tutorial/November2007/Tags") {
   TString smode = mode;
   TString cutFilename = "ListOfCuts."; cutFilename += mode;
@@ -159,6 +161,7 @@
 		    const char* pidMode = 0x0,
 		    Bool_t kUseOnlineTrigger = kTRUE,
 		    Bool_t kUseOfflineTrigger = kTRUE,
+		    Bool_t kRunQA = kFALSE,
 		    const char* collectionName = "tag.xml") {
   gSystem->Load("libProofPlayer.so");

@@ -272,6 +275,7 @@
 	      const char* pidMode = 0x0,
 	      Bool_t kUseOnlineTrigger = kTRUE,
 	      Bool_t kUseOfflineTrigger = kTRUE,
+	      Bool_t kRunQA = kFALSE,
 	      const char *collectionfile = "wn.xml") {
   TString smode = mode;
   TString cutFilename = "ListOfCuts."; cutFilename += mode;
@@ -375,6 +379,7 @@
 	      const char* pidMode = 0x0,
 	      Bool_t kUseOnlineTrigger = kTRUE,
 	      Bool_t kUseOfflineTrigger = kTRUE,
+	      Bool_t kRunQA = kFALSE,
 	      Int_t stats = 0, Int_t startingPoint = 0,
 	      const char* dataset = 0x0) {
   TString smode = mode;


Update AliAnalysisMultPt.cxx

Update AliAnalysisMultPt.cxx

--- PWGCF/EBYE/MultPt/AliAnalysisMultPt.cxx
+++ PWGCF/EBYE/MultPt/AliAnalysisMultPt.cxx
@@ -87,14 +87,14 @@
     fOutputList = new TList();
     fOutputList->SetOwner(kTRUE);

-    fHistMult = new TH1D("fHistMult", "Mult", 3000, 0, 3000);
+    fHistMult = new TH1D("fHistMult", "Mult", 4000, 0, 4000);
     fOutputList->Add(fHistMult);
     fHistMult->SetStats(0);
     fHistMult->SetTitle("Multiplicity");
     fHistMult->SetXTitle("Multiplicity");
     fHistMult->SetMarkerSize(1.2);

-    fHistMultPt = new TH2D("fHistMultPt", "MultpT", 3000, 0, 3000, 50, 0, 5);
+    fHistMultPt = new TH2D("fHistMultPt", "MultpT", 4000, 0, 4000, 50, 0, 5);
     fOutputList->Add(fHistMultPt);
     fHistMultPt->SetStats(0);
     fHistMultPt->SetTitle("pT vs Multiplicity");
@@ -103,7 +103,7 @@
     fHistMultPt->SetLineColor(2);
     fHistMultPt->SetMarkerSize(1.2);

-    fHistMultPtMC = new TH2D("fHistMultPtMC", "MultPt-MC", 3000, 0, 3000, 50, 0, 5);
+    fHistMultPtMC = new TH2D("fHistMultPtMC", "MultPt-MC", 4000, 0, 4000, 50, 0, 5);
     fOutputList->Add(fHistMultPtMC);
     fHistMultPtMC->SetStats(0);
     fHistMultPtMC->SetTitle("pT vs Generated Multiplicity");
@@ -113,7 +113,7 @@
     fHistMultPtMC->SetMarkerSize(1.2);

-    fHistMultRatio = new TH2D("fHistMultRatio", "Ratio",  3000, 0, 3000, 3000, 0, 3000);
+    fHistMultRatio = new TH2D("fHistMultRatio", "Ratio",  4000, 0, 4000, 4000, 0, 4000);
     fOutputList->Add(fHistMultRatio);
     fHistMultRatio->SetStats(0);
     fHistMultRatio->SetTitle("Generated Multiplicity vs Reconstructed");
@@ -175,8 +175,8 @@
                  fHistMultPt->Fill(Mult, track->Pt());
              }
          }
-    }
-
+
+    }
 /////////////////////////////////////////////////////////////////////////////////// Generated part:
     if(fIsMC){
         TClonesArray *stack = 0;
@@ -191,7 +191,6 @@
         for ( Int_t i(0); i < nMCTracks; i++) {
             AliAODMCParticle *p1=(AliAODMCParticle*)stack->UncheckedAt(i);
             if (!p1) continue;
-            if(!p1->IsPrimary()) continue;
             if(!p1->IsPhysicalPrimary()) continue;
             Int_t charge = p1->Charge();
             if(TMath :: Abs(charge)>0) {
@@ -206,18 +205,18 @@
         for ( Int_t i(0); i < nMCTracks; i++) {
             AliAODMCParticle *p1=(AliAODMCParticle*)stack->UncheckedAt(i);
             if (!p1) continue;
-            if(!p1->IsPrimary()) continue;
             if(!p1->IsPhysicalPrimary()) continue;
             Int_t charge = p1->Charge();
             if(TMath :: Abs(charge)>0) {
-                if(p1->Pt() < 0.2|| p1->Pt() > 5) continue;
-                if(fabs(p1->Eta()) > 0.8 ) continue;
+                if(p1->Pt() < fPtmin|| p1->Pt() > fPtmax) continue;
+                if(fabs(p1->Eta()) > fEta ) continue;
                 fHistMultPtMC->Fill(mNMC, p1->Pt());
             }
         }
         //Generated Mult vs Reconstructed Mult
         fHistMultRatio->Fill(Mult, mNMC);
     }
+
     PostData(1, fOutputList);
 }


updated on HFe jet task

updated on HFe jet task

--- PWGHF/jetsHF/AliAnalysisHFjetTagHFE.cxx
+++ PWGHF/jetsHF/AliAnalysisHFjetTagHFE.cxx
@@ -1382,14 +1382,32 @@
                       {
                        fHistHFjet->Fill(pt,corrPt);
                        fHistHFjetOrder->Fill(corrPt,Njet);
-                       if(Njet==0)
+                       if(Njet==0 || Njet==1)
                          {
-                          Double_t dPhiHFjet_tmp = Phi_eJet - ExJetPhi[1];
+                          Double_t dPhiHFjet_tmp = 0.0;
+                          if(Njet==0)
+                             {
+                              dPhiHFjet_tmp = Phi_eJet - ExJetPhi[1];
+                             }
+                          else
+                             {
+                              dPhiHFjet_tmp = Phi_eJet - ExJetPhi[0];
+                             }
+
                           Double_t dPhiHFjet = atan2(sin(dPhiHFjet_tmp),cos(dPhiHFjet_tmp));
+
                           if(ExJetPt[1]>10.0)
                              {
                               fHistDiJetPhi->Fill(corrPt,dPhiHFjet);
-                              Double_t MomBalance = (corrPt-ExJetPt[1])/(corrPt+ExJetPt[1]);
+                              Double_t MomBalance = -1.0;
+                               if(Njet==0)
+                                  {
+                                   MomBalance = (corrPt-ExJetPt[1])/(corrPt+ExJetPt[1]);
+                                  }
+                               else
+                                  {
+                                   MomBalance = (ExJetPt[0]-corrPt)/(ExJetPt[0]+corrPt);
+                                  }
                               fHistDiJetMomBalance->Fill(corrPt,MomBalance);
                              }
                          }


fix merge failure

fix merge failure

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

Former-commit-id: fb5e754139d6952f16a8b03c871e220dfcfc2264

--- base/file_path_unittest.cc
+++ base/file_path_unittest.cc
@@ -6,7 +6,6 @@
 #include "base/file_path.h"
 #include "base/file_util.h"
 #include "base/path_service.h"
-#include "chrome/common/chrome_paths.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "testing/platform_test.h"


fixed typo

fixed typo

--- livesupport/modules/storage/src/WebStorageClient.cxx
+++ livesupport/modules/storage/src/WebStorageClient.cxx
@@ -22,7 +22,7 @@

     Author   : $Author: fgerlits $
-    Version  : $Revision: 1.46 $
+    Version  : $Revision: 1.47 $
     Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storage/src/WebStorageClient.cxx,v $

 ------------------------------------------------------------------------------*/
@@ -1204,7 +1204,7 @@
  *  Revert a playlist to its pre-editing state.
  *----------------------------------------------------------------------------*/
 void
-WebStorageClient :: revertPlaylist(Ptr<const Glib::ustring>::Ref playlistToken)
+WebStorageClient :: revertPlaylist(Ptr<const std::string>::Ref playlistToken)
                                                 throw (XmlRpcException)
 {
     if (!playlistToken) {


Compilation with C++11

Compilation with C++11

--- PWGHF/jetsHF/AliAnalysisHFjetTagHFE.cxx
+++ PWGHF/jetsHF/AliAnalysisHFjetTagHFE.cxx
@@ -391,7 +391,7 @@
   int jetpTMax = 300;
   Int_t nBine[7] =  { 50, 50, jetpTMax, jetpTMax, jetpTMax, 100, jetpTMax};
   Double_t mimHFj[7] = {  0,   0,   0,   0,  0, 0, 0 };
-  Double_t maxHFj[7] = {50, 50, jetpTMax, jetpTMax, jetpTMax, 1, jetpTMax};
+  Double_t maxHFj[7] = {50, 50, (Double_t)jetpTMax, (Double_t)jetpTMax, (Double_t)jetpTMax, 1, (Double_t)jetpTMax};

   HFjetCorr0 = new THnSparseD("HFjetCorr0","HF MC Corr;p_{T}^{reco}; p_{T}^{MC}; jet_{reco}; jet_{MC}; jet_{particle}; R match; pThaed;", 7, nBine, mimHFj, maxHFj);
   HFjetCorr0->Sumw2();


showCorespondences now works

showCorespondences now works

git-svn-id: e7ea667a1d39a4453c4efcc4ba7bca3d620c3f19@6819 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- visualization/include/pcl/visualization/impl/image_viewer.hpp
+++ visualization/include/pcl/visualization/impl/image_viewer.hpp
@@ -40,6 +40,7 @@
 #ifndef PCL_VISUALIZATION_IMAGE_VISUALIZER_HPP_
 #define	PCL_VISUALIZATION_IMAGE_VISUALIZER_HPP_

+#include <pcl/visualization/common/common.h>
 #include <pcl/search/organized.h>

 ///////////////////////////////////////////////////////////////////////////////////////////
@@ -607,21 +608,58 @@
     }
   }

+  void* data = const_cast<void*> (reinterpret_cast<const void*> (data_.get ()));
+
   vtkSmartPointer<vtkImageData> image = vtkSmartPointer<vtkImageData>::New ();
   image->SetDimensions (source_img.width + target_img.width, std::max (source_img.height, target_img.height), 1);
   image->SetScalarTypeToUnsignedChar ();
   image->SetNumberOfScalarComponents (3);
   image->AllocateScalars ();
-  void* data = const_cast<void*> (reinterpret_cast<const void*> (data_.get ()));
   image->GetPointData ()->GetScalars ()->SetVoidArray (data, data_size_, 1);
-
+#if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION < 10))
+  // Now create filter and set previously created transformation
+  algo_->SetInput (image);
+  algo_->Update ();
+#  if (VTK_MINOR_VERSION <= 6)
+    image_viewer_->SetInput (algo_->GetOutput ());
+#  else
+    am_it->canvas->SetNumberOfScalarComponents (3);
+    am_it->canvas->DrawImage (algo_->GetOutput ());
+
+    blend_->ReplaceNthInputConnection (int (am_it - layer_map_.begin ()), am_it->canvas->GetOutputPort ());
+    image_viewer_->SetInputConnection (blend_->GetOutputPort ());
+#  endif
+#else
   am_it->canvas->SetNumberOfScalarComponents (3);
   am_it->canvas->DrawImage (image);

   blend_->ReplaceNthInputConnection (int (am_it - layer_map_.begin ()), am_it->canvas->GetOutputPort ());
-  //slice_->GetMapper ()->SetInput (blend_->GetOutput ());
+  slice_->GetMapper ()->SetInput (blend_->GetOutput ());

   interactor_style_->adjustCamera (image, ren_);
+#endif
+
+  double r = 1.0 , g, b;
+  // Draw lines between the best corresponding points
+  for (size_t i = 0; i < correspondences.size (); i += nth)
+  {
+    int v_src = correspondences[i].index_query / source_img.width,
+        u_src = correspondences[i].index_query % source_img.width,
+        v_tgt = correspondences[i].index_match / target_img.width,
+        u_tgt = correspondences[i].index_match % target_img.width;
+    getRandomColors (r, g, b);
+    am_it->canvas->SetDrawColor (r * 255.0, g * 255.0, b * 255.0, 255.0);
+#if ((VTK_MAJOR_VERSION == 5) && (VTK_MINOR_VERSION >= 10))
+    am_it->canvas->DrawSegment (u_src, v_src, source_img.width + u_tgt, v_tgt);
+    am_it->canvas->DrawCircle (u_src, v_src, 3);
+    am_it->canvas->DrawCircle (source_img.width + u_tgt, v_tgt, 3);
+#else
+    am_it->canvas->DrawSegment (u_src, getSize ()[1] - v_src, source_img.width + u_tgt, getSize ()[1] - v_tgt);
+    am_it->canvas->DrawCircle (u_src, getSize ()[1] - v_src, 3);
+    am_it->canvas->DrawCircle (source_img.width + u_tgt, getSize ()[1] - v_tgt, 3);
+#endif
+  }
+
   return (true);
 }


AddTask adapted to updated D+ task (Giacomo)

--- PWGHF/vertexingHF/macros/AddTaskDplus.C
+++ PWGHF/vertexingHF/macros/AddTaskDplus.C
@@ -4,7 +4,7 @@
 				     Bool_t readMC=kFALSE,
 				     TString finDirname="Loose",
 				     TString filename="",
-				     TString finAnObjname="AnalysisCuts", TString finProdObjname="ProdCuts")
+				     TString finAnObjname="AnalysisCuts", TString finProdObjname="ProduCuts")
 {
   //
   // Test macro for the AliAnalysisTaskSE for D+ candidates
@@ -46,25 +46,8 @@
     }
   }
   else analysiscuts = (AliRDHFCutsDplustoKpipi*)filecuts->Get(finAnObjname);
-
-  AliRDHFCutsDplustoKpipi* prodcuts=new AliRDHFCutsDplustoKpipi();
-  if(stdcuts)  {
-    if(system==0) prodcuts->SetStandardCutsPP2010();
-    else if(system==1) {
-      prodcuts->SetStandardCutsPbPb2010();
-      prodcuts->SetMinCentrality(minC);
-      prodcuts->SetMaxCentrality(maxC);
-      //      prodcuts->SetUseAOD049(kTRUE);
-      prodcuts->SetUseCentrality(AliRDHFCuts::kCentV0M);
-    }
-  }
-  else prodcuts = (AliRDHFCutsDplustoKpipi*)filecuts->Get(finProdObjname);

-  //AliRDHFCutsDplustoKpipi *prodcuts = (AliRDHFCutsDplustoKpipi*)fileCuts->Get("ProdCuts");
-  //AliRDHFCutsDplustoKpipi *analysiscuts = (AliRDHFCutsDplustoKpipi*)fileCuts->Get("AnalysisCuts");
-
-
-  AliAnalysisTaskSEDplus *dplusTask = new AliAnalysisTaskSEDplus("DplusAnalysis",analysiscuts,prodcuts,storeNtuple);
+  AliAnalysisTaskSEDplus *dplusTask = new AliAnalysisTaskSEDplus("DplusAnalysis",analysiscuts,storeNtuple);
   dplusTask->SetReadMC(readMC);
   dplusTask->SetDoLikeSign(kFALSE);
   //  dplusTask->SetUseTPCpid(kTRUE);
@@ -116,7 +99,7 @@
   if(storeNtuple){
     AliAnalysisDataContainer *coutputDplus2 = mgr->CreateContainer(ntuplename,TNtuple::Class(),
 								   AliAnalysisManager::kOutputContainer,
-								   outputfile.Data());
+								   "InvMassDplus_nt1.root");

     coutputDplus2->SetSpecialOutput();
   }


Move tts-player.h from devel-api to public-api

Change-Id: I0853e2be097fe530a692857d196f4bf60dc3b29f

--- dali-toolkit/internal/focus-manager/accessibility-focus-manager-impl.cpp
+++ dali-toolkit/internal/focus-manager/accessibility-focus-manager-impl.cpp
@@ -23,7 +23,7 @@
 #include <dali/public-api/actors/layer.h>
 #include <dali/devel-api/adaptor-framework/accessibility-manager.h>
 #include <dali/devel-api/adaptor-framework/sound-player.h>
-#include <dali/devel-api/adaptor-framework/tts-player.h>
+#include <dali/public-api/adaptor-framework/tts-player.h>
 #include <dali/public-api/animation/constraints.h>
 #include <dali/devel-api/events/hit-test-algorithm.h>
 #include <dali/public-api/images/resource-image.h>


Update ddDrakeModel for changes in drake

--- software/ddapp/src/app/ddDrakeModel.cpp
+++ software/ddapp/src/app/ddDrakeModel.cpp
@@ -450,14 +450,8 @@

   ddPtrMacro(URDFRigidBodyManipulatorVTK);

-  URDFRigidBodyManipulatorVTK() : RigidBodyManipulator(0,0,1,0)
-  {
-    bodies[0]->linkname = "world";
-    bodies[0]->robotnum = 0;
-    bodies[0]->body_index = 0;
-
-    //use_new_kinsol = true;
-  }
+  URDFRigidBodyManipulatorVTK() : RigidBodyManipulator()
+  {}

   void computeDofMap()
   {
@@ -619,7 +613,7 @@
   void loadVisuals(const std::string& root_dir=".")
   {

-    printf("load visuals...\n");
+    //printf("load visuals...\n");
     RigidBodyManipulator* model = this;

     for (size_t bodyIndex = 0; bodyIndex < model->bodies.size(); ++bodyIndex)
@@ -627,17 +621,17 @@

       std::shared_ptr<RigidBody> body = model->bodies[bodyIndex];

-      printf("body: %s\n", body->linkname.c_str());
+      //printf("body: %s\n", body->linkname.c_str());

       for (size_t visualIndex = 0 ; visualIndex < body->visual_elements.size(); ++visualIndex)
       {
-        printf("vi %d\n", visualIndex);
+        //printf("vi %d\n", visualIndex);

         const DrakeShapes::VisualElement& visual = body->visual_elements[visualIndex];

         const DrakeShapes::Shape visualType = visual.getShape();

-        printf("shape: %d\n", visualType);
+        //printf("shape: %d\n", visualType);

         std::vector<ddMeshVisual::Ptr> loadedVisuals;

@@ -645,37 +639,37 @@
         if (visualType == DrakeShapes::MESH)
         {

-          const DrakeShapes::Mesh* mesh = static_cast<const DrakeShapes::Mesh*>(visual.getGeometry());
-
-          std::string filename = locateMeshFile(mesh->filename, root_dir);
+          const DrakeShapes::Mesh& mesh = static_cast<const DrakeShapes::Mesh&>(visual.getGeometry());
+
+          std::string filename = locateMeshFile(mesh.filename, root_dir);
           if (filename.size())
           {
-            printf("loading mesh: %s\n", filename.c_str());
+            //printf("loading mesh: %s\n", filename.c_str());
             loadedVisuals = loadMeshVisuals(filename);
           }

         }
         else if (visualType == DrakeShapes::SPHERE)
         {
-          const DrakeShapes::Sphere* sphere = static_cast<const DrakeShapes::Sphere*>(visual.getGeometry());
-          double radius = sphere->radius;
+          const DrakeShapes::Sphere& sphere = static_cast<const DrakeShapes::Sphere&>(visual.getGeometry());
+          double radius = sphere.radius;
           loadedVisuals.push_back(makeSphereVisual(radius));
         }
         else if (visualType == DrakeShapes::BOX)
         {
-          const DrakeShapes::Box* box = static_cast<const DrakeShapes::Box*>(visual.getGeometry());
-
-          loadedVisuals.push_back(makeBoxVisual(box->size[0], box->size[1], box->size[2]));
+          const DrakeShapes::Box& box = static_cast<const DrakeShapes::Box&>(visual.getGeometry());
+
+          loadedVisuals.push_back(makeBoxVisual(box.size[0], box.size[1], box.size[2]));
         }
         else if (visualType == DrakeShapes::CYLINDER)
         {
-          const DrakeShapes::Cylinder* cyl = static_cast<const DrakeShapes::Cylinder*>(visual.getGeometry());
-          loadedVisuals.push_back(makeCylinderVisual(cyl->radius, cyl->length));
+          const DrakeShapes::Cylinder& cyl = static_cast<const DrakeShapes::Cylinder&>(visual.getGeometry());
+          loadedVisuals.push_back(makeCylinderVisual(cyl.radius, cyl.length));
         }
         else if (visualType == DrakeShapes::CAPSULE)
         {
-          const DrakeShapes::Capsule* cyl = static_cast<const DrakeShapes::Capsule*>(visual.getGeometry());
-          loadedVisuals.push_back(makeCylinderVisual(cyl->radius, cyl->length));
+          const DrakeShapes::Capsule& cyl = static_cast<const DrakeShapes::Capsule&>(visual.getGeometry());
+          loadedVisuals.push_back(makeCylinderVisual(cyl.radius, cyl.length));
         }

         for (size_t mvi = 0; mvi < loadedVisuals.size(); ++mvi)
@@ -695,7 +689,7 @@
       }
     }

-    printf("done\n");
+    //printf("done\n");

   }

@@ -722,7 +716,11 @@
         continue;
       }

-      model->forwardKin(body->body_index, zero, 2, pose);
+      //model->forwardKin(body->body_index, zero, 2, pose);
+      //auto pt = model->forwardKinNew(Vector3d::Zero().eval(), body->body_index, 0, 2, 0);
+      //pose = pt.value();
+
+      pose = model->forwardKinNew(Vector3d::Zero().eval(), body->body_index, 0, 2, 0).value();

       double* posedata = pose.data();

@@ -734,7 +732,7 @@
       linkToWorld->RotateWXYZ(angleAxis[0], angleAxis[1], angleAxis[2], angleAxis[3]);
       linkToWorld->Translate(pose(0), pose(1), pose(2));

-      printf("%s to world: %f %f %f\n", body->linkname.c_str(), pose(0), pose(1), pose(2));
+      //printf("%s to world: %f %f %f\n", body->linkname.c_str(), pose(0), pose(1), pose(2));

       for (size_t visualIndex = 0; visualIndex < itr->second.size(); ++visualIndex)
       {
@@ -743,7 +741,7 @@

         vtkSmartPointer<vtkTransform> visualToWorld = vtkSmartPointer<vtkTransform>::New();
         visualToWorld->PostMultiply();
-        //visualToWorld->Concatenate(meshVisual->VisualToLink);
+        visualToWorld->Concatenate(meshVisual->VisualToLink);
         visualToWorld->Concatenate(linkToWorld);
         meshVisual->Transform->SetMatrix(visualToWorld->GetMatrix());

@@ -955,7 +953,7 @@
     int dofId = itr->second;
     this->Internal->JointPositions[dofId] = jointPositions[i];

-    printf("setJoint %s --> %d, %f\n", qPrintable(dofName), dofId, jointPositions[i]);
+    //printf("setJoint %s --> %d, %f\n", qPrintable(dofName), dofId, jointPositions[i]);
   }

   this->setJointPositions(this->Internal->JointPositions);
@@ -980,13 +978,14 @@
   }

   VectorXd q = VectorXd::Zero(model->num_positions);
+  VectorXd v = VectorXd::Zero(model->num_velocities);
   for (int i = 0; i < jointPositions.size(); ++i)
   {
     q(i) = jointPositions[i];
   }

   this->Internal->JointPositions = jointPositions;
-  model->doKinematics(q);
+  model->doKinematicsNew(q, v, false, false);
   model->updateModel();
   emit this->modelChanged();
 }


[FIX] Mokka: Expanding an analog view sets the range of the axis X out of the boundaries.

git-svn-id: ed06c97986a68fa016311908f99ed1538fbb9b5d@1315 93be6e1e-6fcc-11de-baec-69240fdc299a

--- Tools/Mokka/ChartWidget.cpp
+++ Tools/Mokka/ChartWidget.cpp
@@ -666,7 +666,7 @@
   for (int i = 0 ; i < static_cast<int>(analogChartData->chartNumber()) ; ++i)
   {
     btk::VTKChartTimeSeries* chart = analogChartData->chart(i);
-    // chart->RecalculateBounds();
+    chart->RecalculateBounds();
     int roi[2]; this->mp_Acquisition->regionOfInterest(roi[0], roi[1]);
     this->updateAxisX(chart, roi[0], roi[1]);
   }


main: use logging API to print SIMD info instead of printf()

Otherwise these logging lines end up in the automatically generated
XML VTY reference (stdout), so this breaks further XML processing.

Change-Id: I8e0fd728d406e2452c9c0ddad5bce5f6b17fab42
Related: SYS#4937, SYS#4910

--- Transceiver52M/osmo-trx.cpp
+++ Transceiver52M/osmo-trx.cpp
@@ -476,6 +476,38 @@
 		return -1;
 	}
 	return 0;
+}
+
+static void print_simd_info(void)
+{
+#ifdef HAVE_SSE3
+	LOGP(DMAIN, LOGL_INFO, "SSE3 support compiled in");
+#ifdef HAVE___BUILTIN_CPU_SUPPORTS
+	if (__builtin_cpu_supports("sse3"))
+		LOGPC(DMAIN, LOGL_INFO, " and supported by CPU\n");
+	else
+		LOGPC(DMAIN, LOGL_INFO, ", but not supported by CPU\n");
+#else
+	LOGPC(DMAIN, LOGL_INFO, ", but runtime SIMD detection disabled\n");
+#endif
+#endif
+
+#ifdef HAVE_SSE4_1
+	LOGP(DMAIN, LOGL_INFO, "SSE4.1 support compiled in");
+#ifdef HAVE___BUILTIN_CPU_SUPPORTS
+	if (__builtin_cpu_supports("sse4.1"))
+		LOGPC(DMAIN, LOGL_INFO, " and supported by CPU\n");
+	else
+		LOGPC(DMAIN, LOGL_INFO, ", but not supported by CPU\n");
+#else
+	LOGPC(DMAIN, LOGL_INFO, ", but runtime SIMD detection disabled\n");
+#endif
+#endif
+
+#ifndef HAVE_ATOMIC_OPS
+#pragma message ("Built without atomic operation support. Using Mutex, it may affect performance!")
+	LOG(NOTICE) << "Built without atomic operation support. Using Mutex, it may affect performance!";
+#endif
 }

 static void print_config(struct trx_ctx *trx)
@@ -585,35 +617,6 @@

 	g_trx_ctx = vty_trx_ctx_alloc(tall_trx_ctx);

-#ifdef HAVE_SSE3
-	printf("Info: SSE3 support compiled in");
-#ifdef HAVE___BUILTIN_CPU_SUPPORTS
-	if (__builtin_cpu_supports("sse3"))
-		printf(" and supported by CPU\n");
-	else
-		printf(", but not supported by CPU\n");
-#else
-	printf(", but runtime SIMD detection disabled\n");
-#endif
-#endif
-
-#ifdef HAVE_SSE4_1
-	printf("Info: SSE4.1 support compiled in");
-#ifdef HAVE___BUILTIN_CPU_SUPPORTS
-	if (__builtin_cpu_supports("sse4.1"))
-		printf(" and supported by CPU\n");
-	else
-		printf(", but not supported by CPU\n");
-#else
-	printf(", but runtime SIMD detection disabled\n");
-#endif
-#endif
-
-#ifndef HAVE_ATOMIC_OPS
-#pragma message ("Built without atomic operation support. Using Mutex, it may affect performance!")
-	printf("Built without atomic operation support. Using Mutex, it may affect performance!\n");
-#endif
-
 	convolve_init();
 	convert_init();

@@ -660,6 +663,7 @@
 			" but expect your config to break in the future.";
 	}

+	print_simd_info();
 	print_config(g_trx_ctx);

 	if (trx_validate_config(g_trx_ctx) < 0) {


Remove custom TimePoint-formatting code

Remove custom TimePoint-formatting code

This was a temporary thing, until llvm has proper support for formatting
time. That time has come, so we can remove the relevant code. There
should be no change in the format of the time.

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

--- source/Commands/CommandObjectTarget.cpp
+++ source/Commands/CommandObjectTarget.cpp
@@ -52,6 +52,7 @@
 #include "lldb/Utility/Timer.h"

 #include "llvm/Support/FileSystem.h"
+#include "llvm/Support/FormatAdapters.h"

 // C Includes
 // C++ Includes
@@ -133,25 +134,6 @@
     }
   }
   return num_targets;
-}
-
-// TODO: Remove this once llvm can pretty-print time points
-static void DumpTimePoint(llvm::sys::TimePoint<> tp, Stream &s, uint32_t width) {
-#ifndef LLDB_DISABLE_POSIX
-  char time_buf[32];
-  time_t time = llvm::sys::toTimeT(tp);
-  char *time_cstr = ::ctime_r(&time, time_buf);
-  if (time_cstr) {
-    char *newline = ::strpbrk(time_cstr, "\n\r");
-    if (newline)
-      *newline = '\0';
-    if (width > 0)
-      s.Printf("%-*s", width, time_cstr);
-    else
-      s.PutCString(time_cstr);
-  } else if (width > 0)
-    s.Printf("%-*s", width, "");
-#endif
 }

 #pragma mark CommandObjectTargetCreate
@@ -3176,7 +3158,8 @@
       } break;

       case 'm':
-        DumpTimePoint(module->GetModificationTime(), strm, width);
+        strm.Format("{0:%c}", llvm::fmt_align(module->GetModificationTime(),
+                                              llvm::AlignStyle::Left, width));
         break;

       case 'p':


ENH: removed vtk.h

ENH: removed vtk.h

--- graphics/examplesCxx/Mace.cxx
+++ graphics/examplesCxx/Mace.cxx
@@ -1,4 +1,13 @@
-#include "vtk.h"
+#include "vtkRenderer.h"
+#include "vtkRenderWindow.h"
+#include "vtkRenderWindowInteractor.h"
+#include "vtkSphereSource.h"
+#include "vtkPolyDataMapper.h"
+#include "vtkActor.h"
+#include "vtkConeSource.h"
+#include "vtkGlyph3D.h"
+#include "vtkPolyDataMapper.h"
+
 #include "SaveImage.h"

 int main( int argc, char *argv[] )


allt ad smella

allt ad smella

--- Vln-2016/ui.cpp
+++ Vln-2016/ui.cpp
@@ -205,6 +205,8 @@
                     if(numb == 1)
                     {
                         order = _lists.youngestOrderScientist();
+                        printNames(order);
+                        /*
                         for(unsigned int i = 0 ; i < order.size() ; i++)
                         {
                             cout << order[i].getFirstName()  << "\t";
@@ -215,7 +217,7 @@
                             cout << order[i].getDeathYear()  << "\t";
                             cout << order[i].getAwardYear();
                             cout << endl;
-                        }
+                        }*/
                     }
                     else if (numb == 2)
                     {


Removed deprecated header (unsupported/Eigen/BDCSVD is included in Eigen/SVD now)

--- lapack/svd.cpp
+++ lapack/svd.cpp
@@ -9,7 +9,6 @@

 #include "lapack_common.h"
 #include <Eigen/SVD>
-#include <unsupported/Eigen/BDCSVD>

 // computes the singular values/vectors a general M-by-N matrix A using divide-and-conquer
 EIGEN_LAPACK_FUNC(gesdd,(char *jobz, int *m, int* n, Scalar* a, int *lda, RealScalar *s, Scalar *u, int *ldu, Scalar *vt, int *ldvt, Scalar* /*work*/, int* lwork,


Properly set the last character to 0

Properly set the last character to 0

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

--- gui/gui/src/TGFont.cxx
+++ gui/gui/src/TGFont.cxx
@@ -1946,6 +1946,7 @@

    char *str = new char[strlen(string)+1];
    strncpy(str, string, strlen(string));
+   str[strlen(string)] = 0;

    if (*str == '-' || *str == '*') {


Possible fix of invalid xml

Possible fix of invalid xml

--- src/lib/VSDXContentCollector.cpp
+++ src/lib/VSDXContentCollector.cpp
@@ -177,9 +177,8 @@
     m_shapeOutput->addInsertText(text);
     m_shapeOutput->addEndTextSpan();

-    if (m_textStream.size() == 0)
-      m_shapeOutput->addEndTextObject();
-  }
+  }
+  m_shapeOutput->addEndTextObject();
 }

 void libvisio::VSDXContentCollector::_flushCurrentForeignData()


Fixed a bug in setup and addsolvent

Fixed a bug in setup and addsolvent

--- source/MOLMEC/COMMON/periodicBoundary.C
+++ source/MOLMEC/COMMON/periodicBoundary.C
@@ -1,4 +1,4 @@
-// $Id: periodicBoundary.C,v 1.4 2000/02/02 09:53:39 len Exp $
+// $Id: periodicBoundary.C,v 1.5 2000/02/02 14:10:06 len Exp $

 #include <BALL/MOLMEC/COMMON/periodicBoundary.h>
 #include <BALL/MOLMEC/COMMON/forceField.h>
@@ -396,11 +396,11 @@
 		Size N_y = (Size)(box_.getHeight() / height + 1.0);
 		Size N_z = (Size)(box_.getDepth() / depth + 1.0);

-		for (Size i = 0; i < N_x; ++i)
-		{
-			for (Size j = 0; j < N_y; ++j)
-			{
-				for (Size k = 0; k < N_z; ++k)
+		for (Size i = 0; i <= N_x; ++i)
+		{
+			for (Size j = 0; j <= N_y; ++j)
+			{
+				for (Size k = 0; k <= N_z; ++k)
 				{
 					Vector3 tmp;
 					tmp.x = basis.x + (float)i * width;


Fix Skinning Plugin actions behavior

Fix Skinning Plugin actions behavior

--- Plugins/Skinning/src/SkinningPlugin.cpp
+++ Plugins/Skinning/src/SkinningPlugin.cpp
@@ -74,7 +74,8 @@
         if (it.m_entity)
         {
             const std::vector< std::unique_ptr<Ra::Engine::Component> >& comps = it.m_entity->getComponents();
-            for (size_t i = 0; i<comps.size(); ++i)
+            size_t i = 0;
+            for ( ; i<comps.size(); ++i)
             {
                 auto skinComp = dynamic_cast<SkinningPlugin::SkinningComponent*>(comps[i].get());
                 if(skinComp)
@@ -83,6 +84,12 @@
                     break;
                 }
             }
+            if (i >= comps.size())
+            {
+                m_widget->setCurrent(it, nullptr);
+            }
+        } else {
+            m_widget->setCurrent(it, nullptr);
         }
     }

@@ -106,6 +113,9 @@
         m_actionLBS = new QAction(QIcon(":/Assets/Images/LB.png"), QString("Linear Blending"));
         m_actionDQ  = new QAction(QIcon(":/Assets/Images/DQ_on.png"), QString("Dual Quaternion"));
         m_actionCoR = new QAction(QIcon(":/Assets/Images/CoR.png"), QString("Center of Rotation"));
+        m_actionLBS->setEnabled( false );
+        m_actionDQ->setEnabled( false );
+        m_actionCoR->setEnabled( false );

         connect( m_skinningSelect,
             static_cast< void (QComboBox::*) (int)>(&QComboBox::currentIndexChanged),


#139 modify windows webpath dir -- file mode


Fixes a issue with doubling data

Fixes a issue with doubling data

The plugin threads were sending data updates before the syncUpdate
was triggered, binds the signals later.

--- lib/aggregatedmodel.cpp
+++ lib/aggregatedmodel.cpp
@@ -34,17 +34,8 @@
 void McaAggregatedModel::addSourceModel(QAbstractItemModel *model)
 {
 #ifdef THREADING
-    connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
-            this, SLOT(sourceRowsInserted(QModelIndex,int,int)), Qt::BlockingQueuedConnection);
-    connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
-            this, SLOT(sourceRowsRemoved(QModelIndex,int,int)), Qt::BlockingQueuedConnection);
-    connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
-            this, SLOT(sourceDataChanged(QModelIndex,QModelIndex)), Qt::BlockingQueuedConnection);
-
-
     McaAdapter *adapter_model = qobject_cast<McaAdapter*>(model);
     if (adapter_model) {
-        qDebug() << "Got adapter: " << adapter_model;
         // Alternative: Pass this object as a argument, use invokeMethod,
         connect(adapter_model, SIGNAL(syncUpdate(McaAdapter*,int,int)),
                 this, SLOT(syncUpdate(McaAdapter*,int,int)), Qt::BlockingQueuedConnection);
@@ -57,6 +48,13 @@
     } else {
         qWarning() << "McaAggregatedModel: Recieved an unknown model, threading might break.";
         rowsInserted(model, 0, model->rowCount() - 1);
+
+        connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
+                this, SLOT(sourceRowsInserted(QModelIndex,int,int)), Qt::BlockingQueuedConnection);
+        connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
+                this, SLOT(sourceRowsRemoved(QModelIndex,int,int)), Qt::BlockingQueuedConnection);
+        connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
+                this, SLOT(sourceDataChanged(QModelIndex,QModelIndex)), Qt::BlockingQueuedConnection);
     }
 #else
     connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
@@ -122,6 +120,13 @@
 void McaAggregatedModel::syncUpdate(McaAdapter *model, int start, int end)
 {
     rowsInserted(model, start, end);
+
+    connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
+            this, SLOT(sourceRowsInserted(QModelIndex,int,int)), Qt::BlockingQueuedConnection);
+    connect(model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
+            this, SLOT(sourceRowsRemoved(QModelIndex,int,int)), Qt::BlockingQueuedConnection);
+    connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
+            this, SLOT(sourceDataChanged(QModelIndex,QModelIndex)), Qt::BlockingQueuedConnection);
 }

 void McaAggregatedModel::syncRemoval(McaAdapter *model, int start, int end)


Implemented integer version of linear interpolator

--- source/SoundTouch/InterpolateLinear.cpp
+++ source/SoundTouch/InterpolateLinear.cpp
@@ -69,9 +69,31 @@
 // the "dest" buffer
 int InterpolateLinearInteger::transposeMono(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples)
 {
-    // not yet implemented
-    assert(FALSE);
-    return 0;
+    int i;
+    int srcSampleEnd = srcSamples - 1;
+    int srcCount = 0;
+
+    i = 0;
+    while (srcCount < srcSampleEnd)
+    {
+        LONG_SAMPLETYPE temp;
+
+        assert(iFract < SCALE);
+
+        temp = (SCALE - iFract) * src[0] + iFract * src[1];
+        dest[i] = (SAMPLETYPE)(temp / SCALE);
+        i++;
+
+        iFract += iRate;
+
+        int iWhole = iFract / SCALE;
+        iFract -= iWhole * SCALE;
+        srcCount += iWhole;
+        src += iWhole;
+    }
+    srcSamples = srcCount;
+
+    return i;
 }

@@ -80,8 +102,35 @@
 // the "dest" buffer
 int InterpolateLinearInteger::transposeStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, int &srcSamples)
 {
-    // not yet implemented
-    return 0;
+    int i;
+    int srcSampleEnd = srcSamples - 1;
+    int srcCount = 0;
+
+    i = 0;
+    while (srcCount < srcSampleEnd)
+    {
+        LONG_SAMPLETYPE temp0;
+        LONG_SAMPLETYPE temp1;
+
+        assert(iFract < SCALE);
+
+        temp0 = (SCALE - iFract) * src[0] + iFract * src[2];
+        temp1 = (SCALE - iFract) * src[1] + iFract * src[3];
+        dest[0] = (SAMPLETYPE)(temp0 / SCALE);
+        dest[1] = (SAMPLETYPE)(temp1 / SCALE);
+        dest += 2;
+        i++;
+
+        iFract += iRate;
+
+        int iWhole = iFract / SCALE;
+        iFract -= iWhole * SCALE;
+        srcCount += iWhole;
+        src += 2*iWhole;
+    }
+    srcSamples = srcCount;
+
+    return i;
 }

@@ -100,8 +149,8 @@
         vol1 = (SCALE - iFract);
         for (int c = 0; c < numChannels; c ++)
         {
-            temp = iFract * src[c] + vol1 * src[c + numChannels];
-            *dest = (SAMPLETYPE)(temp / SCALE);
+            temp = vol1 * src[c] + iFract * src[c + numChannels];
+            dest[0] = (SAMPLETYPE)(temp / SCALE);
             dest ++;
         }
         i++;


Allow the filenames that has non-ascii characters

Signed-off-by: janus_wel <0d0ff7a9d29f0ddfdd011e7431e322b0a35fda8c@gmail.com>

--- src/apps/avs2wav/main.cpp
+++ src/apps/avs2wav/main.cpp
@@ -14,6 +14,7 @@
 #include <string>
 #include <stdexcept>
 #include <vector>
+#include <locale>
 #include "../../helper/tconv.hpp"

 #ifdef _MSC_VER
@@ -46,6 +47,8 @@
 ostream& operator <<(ostream&, const AudioInfo&);

 int main(const unsigned int argc, const char* argv[]) {
+    locale::global(locale(""));
+
     // constants
     const unsigned int header_width = 24;
     const unsigned int buf_samples_def = 4096;


Refactor

Refactor

--- src/apps/console/help.cpp
+++ src/apps/console/help.cpp
@@ -64,7 +64,9 @@
   cout << ", <http://primesieve.org>" << endl;
   cout << "Copyright (C) 2010-2016 Kim Walisch" << endl;
   cout << endl;
+
   cout << "BSD 2-Clause License <http://opensource.org/licenses/BSD-2-Clause>" << endl;
+  cout << endl;

   exit(1);
 }


Fix a bug of ankles rotation

Fix a bug of ankles rotation

--- SkeletonBasics-D2D/kinectbvh.cpp
+++ SkeletonBasics-D2D/kinectbvh.cpp
@@ -294,14 +294,14 @@

 	// roll a few bones to make the skeleton T pose
 	Vec_Math::Quaternion q_delta;
-	if (idx == NUI_SKELETON_POSITION_SHOULDER_RIGHT) {
-		q_delta = Vec_Math::quat_multiply(q, q_z_30);
-	} else if (idx == NUI_SKELETON_POSITION_SHOULDER_LEFT) {
-		q_delta = Vec_Math::quat_multiply(q, q_z_n30);
+	if (idx == NUI_SKELETON_POSITION_SHOULDER_LEFT) {
+		q_delta = Vec_Math::quat_left_multiply(q, q_z_n30);
+	} else if (idx == NUI_SKELETON_POSITION_SHOULDER_RIGHT) {
+		q_delta = Vec_Math::quat_left_multiply(q, q_z_30);
+	} else if (idx == NUI_SKELETON_POSITION_HIP_LEFT) {
+		q_delta = Vec_Math::quat_left_multiply(q, q_z_43);
 	} else if (idx == NUI_SKELETON_POSITION_HIP_RIGHT) {
-		q_delta = Vec_Math::quat_multiply(q, q_z_n43);
-	} else if (idx == NUI_SKELETON_POSITION_HIP_LEFT) {
-		q_delta = Vec_Math::quat_multiply(q, q_z_43);
+		q_delta = Vec_Math::quat_left_multiply(q, q_z_n43);
 	} else {
 		q_delta = q;
 	}
@@ -309,6 +309,11 @@
 	// convert the quaternion to euler angles by different orders to get right euler angles
 	Quat2Euler::Quaternion q_to_convert(q_delta.x, q_delta.y, q_delta.z, q_delta.w);
 	Quat2Euler::quaternion2Euler(q_to_convert, angles, (idx < NUI_SKELETON_POSITION_HIP_LEFT) ? Quat2Euler::zxy : Quat2Euler::zyx);
+
+	if (idx == NUI_SKELETON_POSITION_SHOULDER_LEFT) {
+		// rotate around yaw, turn the arm from back to front
+		angles[0] += M_PI;
+	}

 	// adjust a few bones to fit BVH skeleton
 	if (idx == NUI_SKELETON_POSITION_SHOULDER_RIGHT) {
@@ -316,13 +321,8 @@
 		angles[0] = -angles[0];
 	}

-	if (idx == NUI_SKELETON_POSITION_SHOULDER_LEFT) {
-		// rotate around yaw, turn the arm from back to front
-		angles[0] += M_PI;
-	}
-
-	if (idx == NUI_SKELETON_POSITION_HIP_RIGHT ||
-		idx == NUI_SKELETON_POSITION_HIP_LEFT ||
+	if (idx == NUI_SKELETON_POSITION_HIP_LEFT ||
+		idx == NUI_SKELETON_POSITION_HIP_RIGHT ||
 		idx == NUI_SKELETON_POSITION_KNEE_LEFT ||
 		idx == NUI_SKELETON_POSITION_KNEE_RIGHT) {
 		// flip pitch data
@@ -332,6 +332,20 @@
 	// adjust kinect angle slightly
 	if (idx == NUI_SKELETON_POSITION_HIP_CENTER) {
 		angles[0] -= 8. * Vec_Math::kDegToRad;
+	}
+
+	if (idx == NUI_SKELETON_POSITION_ANKLE_LEFT) {
+		// swap yaw and roll
+		double t = angles[1];
+		angles[1] = angles[2];
+		angles[2] = t;
+	}
+
+	if (idx == NUI_SKELETON_POSITION_ANKLE_RIGHT) {
+		// swap yaw and roll
+		double t = angles[1];
+		angles[1] = angles[2];
+		angles[2] = t;
 	}

 	// clamp to valid range


add test cases and unit test for xl::Set

--- UnitTest/xlSetTest/Main.cpp
+++ UnitTest/xlSetTest/Main.cpp
@@ -14,8 +14,239 @@
 //------------------------------------------------------------------------------

+#include <xl/Containers/xlSet.h>
+#include "../UnitTestFrame.h"
+
+using namespace xl;
+
+TEST_CASE(ctor)
+{
+    Set<int> a;
+    TEST_ASSERT(a.Size() == 0);
+}
+
+TEST_CASE(ctor_copy)
+{
+    Set<int> a;
+    TEST_ASSERT(a.Size() == 0);
+
+    Set<int> b(a);
+    TEST_ASSERT(b.Size() == 0);
+
+    a.Insert(1);
+    a.Insert(2);
+    Set<int> c(a);
+    TEST_ASSERT(c.Size() == 2);
+    TEST_ASSERT(*c.Begin() == 1);
+    TEST_ASSERT(*c.ReverseBegin() == 2);
+}
+
+TEST_CASE(operator_set)
+{
+    Set<int> a;
+    TEST_ASSERT(a.Size() == 0);
+
+    Set<int> b;
+    b = a;
+    TEST_ASSERT(b.Size() == 0);
+
+    a.Insert(1);
+    a.Insert(2);
+    Set<int> c;
+    c = a;
+    TEST_ASSERT(c.Size() == 2);
+    TEST_ASSERT(*a.Begin() == 1);
+    TEST_ASSERT(*++a.Begin() == 2);
+}
+
+TEST_CASE(operator_equal)
+{
+    Set<int> a;
+    TEST_ASSERT(a.Size() == 0);
+
+    Set<int> b;
+    b = a;
+    TEST_ASSERT(b == a);
+    TEST_ASSERT(!(b != a));
+
+    a.Insert(1);
+    a.Insert(2);
+    TEST_ASSERT(b != a);
+    TEST_ASSERT(!(b == a));
+
+    Set<int> c(a);
+    TEST_ASSERT(c == a);
+    TEST_ASSERT(!(c != a));
+
+    b.Insert(1);
+    b.Insert(2);
+    TEST_ASSERT(b == a);
+    TEST_ASSERT(!(b != a));
+    TEST_ASSERT(b == c);
+    TEST_ASSERT(!(b != c));
+}
+
+TEST_CASE(method_size)
+{
+    Set<int> a;
+    TEST_ASSERT(a.Size() == 0);
+    TEST_ASSERT(a.Empty() == true);
+
+    a.Insert(10);
+    TEST_ASSERT(a.Size() == 1);
+    TEST_ASSERT(a.Empty() == false);
+
+    a.Insert(20);
+    a.Insert(30);
+    a.Insert(40);
+    a.Insert(50);
+    TEST_ASSERT(a.Size() == 5);
+    TEST_ASSERT(a.Empty() == false);
+}
+
+TEST_CASE(method_insert_delete)
+{
+    Set<int> a;
+
+    a.Insert(2);
+    a.Insert(6);
+    a.Insert(4);
+    a.Insert(3);
+    a.Insert(5);
+    a.Insert(1);
+
+    Set<int>::Iterator it = a.Begin();
+
+    TEST_ASSERT(*it == 1);
+
+    ++it;
+    TEST_ASSERT(*it == 2);
+
+    ++it;
+    TEST_ASSERT(*it == 3);
+
+    ++it;
+    TEST_ASSERT(*it == 4);
+
+    ++it;
+    TEST_ASSERT(*it == 5);
+
+    ++it;
+    TEST_ASSERT(*it == 6);
+
+    ++it;
+    TEST_ASSERT(it == a.End());
+}
+
+TEST_CASE(method_find)
+{
+    Set<int> a;
+
+    a.Insert(2);
+    a.Insert(6);
+    a.Insert(4);
+    a.Insert(3);
+    a.Insert(5);
+    a.Insert(1);
+
+    Set<int>::Iterator it = a.Find(5);
+
+    TEST_ASSERT(*it == 5);
+
+    Set<int>::Iterator it2 = it;
+
+    ++it2;
+    TEST_ASSERT(*it2 == 6);
+
+    ++it2;
+    TEST_ASSERT(it2 == a.End());
+}
+
+
+// Performance Test
+
+#include <stdio.h>
+#include <time.h>
+
+#define SECTION_BEGIN(name) \
+    printf("Testing \"" #name "\"...\n")
+#define SECTION_END()   \
+    printf("\n")
+#define PERFORMANCE_TEST_BEGIN(name)    \
+    printf("Test begins.\n");   \
+    clock_t begin_##name = clock()
+#define PERFORMANCE_TEST_END(name)  \
+    clock_t end_##name = clock();   \
+    printf("Test ends. Time elasped: %lfs.\n", (double)(end_##name - begin_##name) / CLK_TCK)
+
+#include <vector>
+using namespace std;
+
+#include <set>

 int main()
 {
+    SECTION_BEGIN(StdSetInsert100000);
+    set<int> s1;
+    PERFORMANCE_TEST_BEGIN(StdSetInsert100000);
+    for (int i = 0; i < 100000; ++i)
+    {
+        s1.insert(i);
+    }
+    PERFORMANCE_TEST_END(StdSetInsert100000);
+    SECTION_END();
+
+    SECTION_BEGIN(xlSetInsert100000);
+    Set<int> a1;
+    PERFORMANCE_TEST_BEGIN(xlSetInsert100000);
+    for (int i = 0; i < 100000; ++i)
+    {
+        a1.Insert(i);
+    }
+    PERFORMANCE_TEST_END(xlSetInsert100000);
+    SECTION_END();
+
+
+    SECTION_BEGIN(StdSetInsert1000000);
+    set<int> s2;
+    PERFORMANCE_TEST_BEGIN(StdSetInsert1000000);
+    for (int i = 0; i < 1000000; ++i)
+    {
+        s2.insert(i);
+    }
+    PERFORMANCE_TEST_END(StdSetInsert1000000);
+    SECTION_END();
+
+    SECTION_BEGIN(xlSetInsert1000000);
+    Set<int> a2;
+    PERFORMANCE_TEST_BEGIN(xlSetInsert1000000);
+    for (int i = 0; i < 1000000; ++i)
+    {
+        a2.Insert(i);
+    }
+    PERFORMANCE_TEST_END(xlSetInsert1000000);
+    SECTION_END();
+
+
+    SECTION_BEGIN(StdSetInsert10000000);
+    set<int> s3;
+    PERFORMANCE_TEST_BEGIN(StdSetInsert10000000);
+    for (int i = 0; i < 10000000; ++i)
+    {
+        s3.insert(i);
+    }
+    PERFORMANCE_TEST_END(StdSetInsert10000000);
+    SECTION_END();
+
+    SECTION_BEGIN(xlSetInsert10000000);
+    Set<int> a3;
+    PERFORMANCE_TEST_BEGIN(xlSetInsert10000000);
+    for (int i = 0; i < 10000000; ++i)
+    {
+        a3.Insert(i);
+    }
+    PERFORMANCE_TEST_END(xlSetInsert10000000);
+    SECTION_END();
+
     return 0;
 }


COMP (#3685): fix syntax error

COMP (#3685): fix syntax error

--- Utilities/mbilog/mbilog.cpp
+++ Utilities/mbilog/mbilog.cpp
@@ -645,7 +645,7 @@
 };

-static void mbilog::BackendCout::FormatSmartWindows(const mbilog::LogMessage &l,int /*threadID*/)
+void mbilog::BackendCout::FormatSmartWindows(const mbilog::LogMessage &l,int /*threadID*/)
 {
   int colorNormal = FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE;


add a question commit for gauss point loop

--- applications/AMR/ex1/ex1.cpp
+++ applications/AMR/ex1/ex1.cpp
@@ -268,7 +268,7 @@

     s.new_recording();

-    // *** Gauss point loop *** // I don't understand clearly What variable ig mean and the principle in the Gauss point
+    // *** Gauss point loop *** // Q I don't clearly understand this loop. Is it sol the qestionn U=\sum \nu_i *\phi_i.
     for (unsigned ig = 0; ig < msh->_finiteElement[kelGeom][solUType]->GetGaussPointNumber(); ig++) {
       // *** get gauss point weight, test function and test function partial derivatives ***
       msh->_finiteElement[kelGeom][solUType]->Jacobian(crdX, ig, weight, phi, phi_x, phi_xx);


Fix heading in sim control (#289)

Fix heading in sim control (#289)

--- modules/dreamview/backend/sim_control/sim_control.cc
+++ modules/dreamview/backend/sim_control/sim_control.cc
@@ -28,6 +28,7 @@

 using apollo::common::adapter::AdapterManager;
 using apollo::common::math::HeadingToQuaternion;
+using apollo::common::math::QuaternionToHeading;
 using apollo::common::math::NormalizeAngle;
 using apollo::common::time::Clock;
 using apollo::common::TrajectoryPoint;
@@ -202,16 +203,17 @@
   double cur_z = Interpolate(prev.z(), next.z(), lambda);
   pose->mutable_position()->set_z(cur_z);

-  // Set orientation
+  // Set orientation and heading
   double cur_theta = NormalizeAngle(
       prev.theta() + lambda * NormalizeAngle(next.theta() - prev.theta()));

   Eigen::Quaternion<double> cur_orientation =
       HeadingToQuaternion<double>(cur_theta);
+  pose->mutable_orientation()->set_qw(cur_orientation.w());
   pose->mutable_orientation()->set_qx(cur_orientation.x());
   pose->mutable_orientation()->set_qy(cur_orientation.y());
   pose->mutable_orientation()->set_qz(cur_orientation.z());
-  pose->mutable_orientation()->set_qw(cur_orientation.w());
+  pose->set_heading(cur_theta);

   // Set linear_velocity
   double cur_speed = Interpolate(prev_point_.v(), next_point_.v(), lambda);


am d9a4fdb9: am a83f8e59: (-s ours) DO NOT MERGE: Apply fix for tessellation fractional even test verification.

* commit 'd9a4fdb9f53c54813fc82f06297fb8f662e2dce5':

--- modules/gles31/functional/es31fTessellationTests.cpp
+++ modules/gles31/functional/es31fTessellationTests.cpp
@@ -1322,12 +1322,6 @@
 					return false;
 				}
 			}
-			else
-			{
-				// We have 2 segmentsA and 2 segmentsB, ensure segmentsB has the shorter lengths
-				if (segmentsB[0].length > segmentsA[0].length)
-					std::swap(segmentsA, segmentsB);
-			}

 			// Check that the additional segments are placed symmetrically.
 			if (segmentsB[0].index + segmentsB[1].index + 1 != (int)segments.size())
@@ -1344,8 +1338,8 @@
 				additionalSegmentLocationDst = de::min(segmentsB[0].index, segmentsB[1].index);
 			else
 				additionalSegmentLocationDst = segmentsB[0].length < segmentsA[0].length - 0.001f ? de::min(segmentsB[0].index, segmentsB[1].index)
+											 : segmentsA[0].length < segmentsB[0].length - 0.001f ? de::min(segmentsA[0].index, segmentsA[1].index)
 											 : -1; // \note -1 when can't reliably decide which ones are the additional segments, a or b.
-
 			return true;
 		}
 	}


Signedness mismatch

Signedness mismatch

--- modules/gui/qt4/components/sout/profile_selector.cpp
+++ modules/gui/qt4/components/sout/profile_selector.cpp
@@ -91,7 +91,7 @@
     }
     if( i_size == 0 )
     {
-        for( int i = 0; i < NB_PROFILE; i++ )
+        for( size_t i = 0; i < NB_PROFILE; i++ )
         {
             profileBox->addItem( video_profile_name_list[i],
                                  video_profile_value_list[i] );


Registered FiniteStrainPlastic

Registered FiniteStrainPlastic

r16386

--- modules/tensor_mechanics/src/TensorMechanicsModule.C
+++ modules/tensor_mechanics/src/TensorMechanicsModule.C
@@ -8,6 +8,7 @@
 #include "StressDivergenceTensors.h"
 #include "LinearElasticMaterial.h"
 #include "FiniteStrainElasticMaterial.h"
+#include "FiniteStrainPlasticMaterial.h"
 #include "RankTwoAux.h"
 #include "RealTensorValueAux.h"
 #include "RankFourAux.h"
@@ -21,6 +22,7 @@

   registerMaterial(LinearElasticMaterial);
   registerMaterial(FiniteStrainElasticMaterial);
+  registerMaterial(FiniteStrainPlasticMaterial);

   registerAux(RankTwoAux);


In write_i(), when compiling debugging code, print out the full message in
4-byte blocks just before sending it.  This is still at vprDBG_HEX_LVL,
but it ensures that the entire message gets printed.

git-svn-id: 769d22dfa2d22aad706b9a451492fb87c0735f19@6902 08b38cba-cd3b-11de-854e-f91c5b6e4272

--- modules/vapor/vpr/md/SIM/IO/Socket/SocketImplSIM.cpp
+++ modules/vapor/vpr/md/SIM/IO/Socket/SocketImplSIM.cpp
@@ -244,10 +244,39 @@
    {
       data_written = length;

+#ifdef VPR_DEBUG
+      vpr::Uint32 remainder;
+      const char* msg_ptr = (const char*) buffer;
+      remainder = length % 4;
+
       vprDEBUG(vprDBG_ALL, vprDBG_HEX_LVL)
-         << "Sending message from " << mLocalAddr << " to " << mRemoteAddr
-         << ".  Message (size " << length << "): " << std::hex << buffer
-         << std::dec << std::endl << vprDEBUG_FLUSH;
+         << "SocketImplSIM::write_i(): Message (" << length
+         << " bytes in 4-byte hex blocks):" << vprDEBUG_FLUSH;
+
+      for ( vpr::Uint32 i = 0; i < length; i += 4 )
+      {
+         if ( i % 16 == 0 )
+         {
+            vprDEBUG_NEXT(vprDBG_ALL, vprDBG_HEX_LVL)
+               << "\n" << std::hex << std::setfill('0') << std::setw(8)
+               << *((vpr::Uint32*) (&msg_ptr[i])) << " " << vprDEBUG_FLUSH;
+         }
+         else
+         {
+            vprDEBUG_CONT(vprDBG_ALL, vprDBG_HEX_LVL)
+               << std::hex << std::setfill('0') << std::setw(8)
+               << *((vpr::Uint32*) (&msg_ptr[i])) << " " << vprDEBUG_FLUSH;
+         }
+      }
+
+      for ( vpr::Uint32 i = 0; i < remainder; i++ )
+      {
+         vprDEBUG_CONT(vprDBG_ALL, vprDBG_HEX_LVL) << "00" << vprDEBUG_FLUSH;
+      }
+
+      vprDEBUG_NEXT(vprDBG_ALL, vprDBG_HEX_LVL)
+         << "\n---------------------------\n" << std::dec << vprDEBUG_FLUSH;
+#endif

       vpr::sim::MessagePtr msg(new vpr::sim::Message(buffer, length));
       msg->setPath(mPathToPeer, this, mPeer);


Disabling VideoCaptureTest on Linux.

Disabling VideoCaptureTest on Linux.

Has been really flaky lately, due to NumberOfDevices returning 0.

TBR=perkj@webrtc.org
NOTRY=True

Bug: webrtc:9292
Change-Id: I5a74236559f13bb6316abced5c12e5d276c398d6
Reviewed-on: https://webrtc-review.googlesource.com/79680
Commit-Queue: Taylor Brandstetter <f49cf6381e322b147053b74e4500af8533ac1e4c@webrtc.org>
Reviewed-by: Taylor Brandstetter <f49cf6381e322b147053b74e4500af8533ac1e4c@webrtc.org>
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#23436}

--- modules/video_capture/test/video_capture_unittest.cc
+++ modules/video_capture/test/video_capture_unittest.cc
@@ -190,9 +190,10 @@
   unsigned int number_of_devices_;
 };

-#ifdef WEBRTC_MAC
 // Currently fails on Mac 64-bit, see
 // https://bugs.chromium.org/p/webrtc/issues/detail?id=5406
+// And flaky on Linux, see bugs.webrtc.org/9292.
+#if defined(WEBRTC_MAC) || defined(WEBRTC_LINUX)
 #define MAYBE_CreateDelete DISABLED_CreateDelete
 #else
 #define MAYBE_CreateDelete CreateDelete
@@ -232,9 +233,10 @@
   }
 }

-#ifdef WEBRTC_MAC
 // Currently fails on Mac 64-bit, see
 // https://bugs.chromium.org/p/webrtc/issues/detail?id=5406
+// And flaky on Linux, see bugs.webrtc.org/9292.
+#if defined(WEBRTC_MAC) || defined(WEBRTC_LINUX)
 #define MAYBE_Capabilities DISABLED_Capabilities
 #else
 #define MAYBE_Capabilities Capabilities


Use isatty first, before getchar()

Use isatty first, before getchar()

--- lib/Interpreter/NullDerefProtectionTransformer.cpp
+++ lib/Interpreter/NullDerefProtectionTransformer.cpp
@@ -22,20 +22,22 @@
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/InstIterator.h"

+#include "stdio.h"
+
 extern "C" {
-  int printf(const char *...);
-  int getchar(void);
   bool shouldProceed(void *S, void *T) {
-    int input;
     clang::Sema *Sem = (clang::Sema *)S;
     clang::DiagnosticsEngine& Diag = Sem->getDiagnostics();
     cling::Transaction* Trans = (cling::Transaction*)T;
     clang::SourceLocation Loc = Trans->getWrapperFD()->getLocation();
     Diag.Report(Loc, clang::diag::warn_null_ptr_deref);
-    input = getchar();
-    getchar();
-    if (input == 'y' || input == 'Y') return false;
-    else return true;
+    if (isatty(fileno(stdin))) {
+      int input = getchar();
+      getchar();
+      if (input == 'y' || input == 'Y')
+        return false;
+    }
+    return true;
   }
 }


Remove base::Value::GetAsBinary

Remove base::Value::GetAsBinary

https://codereview.chromium.org/2839753005

--- atom/browser/net/url_request_buffer_job.cc
+++ atom/browser/net/url_request_buffer_job.cc
@@ -41,7 +41,7 @@
     dict->GetString("charset", &charset_);
     dict->GetBinary("data", &binary);
   } else if (options->IsType(base::Value::Type::BINARY)) {
-    options->GetAsBinary(&binary);
+    binary = options.get();
   }

   if (mime_type_.empty()) {


added missing spacedim template

added missing spacedim template

--- source/distributed/solution_transfer.cc
+++ source/distributed/solution_transfer.cc
@@ -49,8 +49,8 @@
       dof_handler(&dof, typeid(*this).name()),
       offset (numbers::invalid_unsigned_int)
     {
-      Assert (dynamic_cast<const parallel::distributed::Triangulation<dim>*>
-              (&dof_handler->get_triangulation()) != nullptr,
+      Assert ((dynamic_cast<const parallel::distributed::Triangulation<dim,DoFHandlerType::space_dimension>*>
+               (&dof_handler->get_triangulation()) != nullptr),
               ExcMessage("parallel::distributed::SolutionTransfer requires a parallel::distributed::Triangulation object."));
     }


glstate: Fix snapshots with PBuffers.

glstate: Fix snapshots with PBuffers.

--- retrace/glstate_images.cpp
+++ retrace/glstate_images.cpp
@@ -744,10 +744,7 @@
 #elif defined(HAVE_X11)

     Display *display;
-    Drawable drawable;
-    Window root;
-    int x, y;
-    unsigned int w, h, bw, depth;
+    GLXDrawable drawable;

     display = glXGetCurrentDisplay();
     if (!display) {
@@ -759,9 +756,11 @@
         return false;
     }

-    if (!XGetGeometry(display, drawable, &root, &x, &y, &w, &h, &bw, &depth)) {
-        return false;
-    }
+    // XGetGeometry will fail for PBuffers, whereas glXQueryDrawable should not.
+    unsigned int w = 0;
+    unsigned int h = 0;
+    glXQueryDrawable(display, drawable, GLX_WIDTH, &w);
+    glXQueryDrawable(display, drawable, GLX_HEIGHT, &h);

     *width = w;
     *height = h;


Fix hermite curve

Fix hermite curve

--- ros/src/computing/planning/mission/packages/lane_planner/nodes/lane_select/hermite_curve.cpp
+++ ros/src/computing/planning/mission/packages/lane_planner/nodes/lane_select/hermite_curve.cpp
@@ -95,9 +95,9 @@
 {
   std::vector<Element2D> result;
   const double interval = 1.0;
-  const double error = 1e-3;
   int32_t divide = 2;
-  while (divide < 100)
+  const int32_t loop = 100;
+  while (divide < loop)
   {
     result.reserve(divide);
     for (int32_t i = 0; i < divide; i++)
@@ -114,9 +114,10 @@
           Element2D((p0.x * coeff_p0 + vlength * v0.x * coeff_v0 + p1.x * coeff_p1 + vlength * v1.x * coeff_v1),
                     (p0.y * coeff_p0 + vlength * v0.y * coeff_v0 + p1.y * coeff_p1 + vlength * v1.y * coeff_v1)));
     }
-    ROS_INFO_STREAM(sqrt(pow((result.at(0).x - result.at(1).x), 2) + pow((result.at(0).y - result.at(1).y), 2)));
-    if (fabs(interval < sqrt(pow((result.at(0).x - result.at(1).x), 2) + pow((result.at(0).y - result.at(1).y), 2))) <
-        error)
+
+    double dt = sqrt(pow((result.at(divide/2 - 1).x - result.at(divide/2).x), 2) + pow((result.at(divide/2 - 1).y - result.at(divide/2).y), 2));
+    std::cout << "interval : " << dt << std::endl;
+    if (interval > dt || divide == loop -1)
       return result;
     else
     {


ENH: Add texture coordinates for showing text.

--- Rendering/vtkOpenGLPolyDataMapper2D.cxx
+++ Rendering/vtkOpenGLPolyDataMapper2D.cxx
@@ -38,7 +38,7 @@
 #include <math.h>

 #ifndef VTK_IMPLEMENT_MESA_CXX
-vtkCxxRevisionMacro(vtkOpenGLPolyDataMapper2D, "1.55");
+vtkCxxRevisionMacro(vtkOpenGLPolyDataMapper2D, "1.56");
 vtkStandardNewMacro(vtkOpenGLPolyDataMapper2D);
 #endif

@@ -61,6 +61,7 @@
   vtkPlane           *plane;
   int                 i,numClipPlanes;
   double              planeEquation[4];
+  vtkDataArray*  t = 0;

   vtkDebugMacro (<< "vtkOpenGLPolyDataMapper2D::Render");

@@ -84,6 +85,18 @@
   if ( this->LookupTable == NULL )
     {
     this->CreateDefaultLookupTable();
+    }
+
+  // Texture and color by texture
+  t = input->GetPointData()->GetTCoords();
+  if ( t )
+    {
+    int tDim = t->GetNumberOfComponents();
+    if (tDim != 2)
+      {
+      vtkDebugMacro(<< "Currently only 2d textures are supported.\n");
+      t = 0;
+      }
     }

   // if something has changed regenrate colors and display lists
@@ -180,9 +193,13 @@
   glPushMatrix();
   glLoadIdentity();

-  glDisable( GL_TEXTURE_2D );
+  if ( ! t)
+    {
+    glDisable( GL_TEXTURE_2D );
+    }
   glDisable( GL_LIGHTING );
-
+
+
   // Assume we want to do Zbuffering for now.
   // we may turn this off later
   glDepthMask(GL_TRUE);
@@ -262,6 +279,10 @@
           }
         glColor4ubv(rgba);
         }
+      if (t)
+        {
+        glTexCoord2dv(t->GetTuple(pts[j]));
+        }
       // this is done to work around an OpenGL bug, otherwise we could just
       // call glVertex2dv
       dptr = p->GetPoint(pts[j]);
@@ -317,6 +338,10 @@
           }
         glColor4ubv(rgba);
         }
+      if (t)
+        {
+        glTexCoord2dv(t->GetTuple(pts[j]));
+        }
       // this is done to work around an OpenGL bug, otherwise we could just
       // call glVertex2dv
       dptr = p->GetPoint(pts[j]);
@@ -343,6 +368,10 @@
           }
         glColor4ubv(rgba);
         }
+      if (t)
+        {
+        glTexCoord2dv(t->GetTuple(pts[j]));
+        }
       // this is done to work around an OpenGL bug, otherwise we could just
       // call glVertex2dv
       dptr = p->GetPoint(pts[j]);