get collection delete working

get collection delete working

--- Diffbot.cpp
+++ Diffbot.cpp
@@ -25,6 +25,8 @@
 bool sendBackDump ( TcpSocket *s,HttpRequest *hr );
 //void gotMsg4ReplyWrapper ( void *state ) ;
 //bool showAllCrawls ( TcpSocket *s , HttpRequest *hr ) ;
+char *getTokenFromHttpRequest ( HttpRequest *hr , long *tokenLen ) ;
+char *getCrawlIdFromHttpRequest ( HttpRequest *hr ) ;
 CollectionRec *getCollRecFromHttpRequest ( HttpRequest *hr ) ;
 //CollectionRec *getCollRecFromCrawlId ( char *crawlId );
 //void printCrawlStatsWrapper ( void *state ) ;
@@ -1280,17 +1282,53 @@
 }
 */

+char *getTokenFromHttpRequest ( HttpRequest *hr , long *tokenLen ) {
+	// provided directly?
+	char *token = hr->getString("token",tokenLen);
+	if ( token ) return token;
+	// extract token from coll?
+	char *c = hr->getString("c",NULL,NULL);
+	if ( ! c ) return NULL;
+	// the collection name is <token>-<crawlid>
+	char *tp = c;
+	long i; for ( i = 0 ; tp[i] && tp[i] != '-'; i++ );
+	if ( i > 60 ) return NULL;
+	*tokenLen = i;
+	return c;
+}
+
+char *getCrawlIdFromHttpRequest ( HttpRequest *hr ) {
+	// crawlid?
+	char *crawlId = hr->getString("id",NULL,NULL);
+	if ( crawlId ) return crawlId;
+	// extract from coll?
+	char *c = hr->getString("c",NULL,NULL);
+	if ( ! c ) return NULL;
+	// the collection name is <token>-<crawlid>
+	char *p = c;
+	for ( ; *p && *p != '-'; p++ );
+	// if never hit a hyphen...
+	if ( ! *p ) return NULL;
+	// advance over it
+	p++;
+	// that is the crawlid then
+	return p;
+}
+
 CollectionRec *getCollRecFromHttpRequest ( HttpRequest *hr ) {

+	// if we have the collection name explicitly, get the coll rec then
 	char *c = hr->getString("c",NULL,NULL);
 	if ( c ) return g_collectiondb.getRec ( c );

+	// otherwise, get it from token/crawlid
 	long tokenLen;
-	char *token = hr->getString("token",&tokenLen,NULL);
-	char *crawlId = hr->getString("id",NULL,NULL);
-
+	char *token = getTokenFromHttpRequest( hr , &tokenLen );
+	// token is required
 	if ( ! token ) return NULL;
-	//if ( ! crawlId ) return NULL;
+	// crawlid is NOT required, but useful
+	char *crawlId = getCrawlIdFromHttpRequest ( hr );
+

 	for ( long i = 0 ; i < g_collectiondb.m_numRecs ; i++ ) {
 		CollectionRec *cr = g_collectiondb.m_recs[i];
@@ -1302,10 +1340,8 @@
 		if ( strncmp(coll,token,tokenLen) ) continue;
 		// coll name is <token>-<crawlid>
 		if ( coll[tokenLen] != '-' ) continue;
-
-		// if no crawler id supplied, just use that then
+		// if no crawler id supplied, just use the first token match
 		if ( ! crawlId ) return cr;
-
 		// if current coll id...
 		char *cid = coll+tokenLen+1;
 		// return if crawlid matches
@@ -1488,7 +1524,7 @@

 // generate a random collection name
-char *getNewCollName ( char *token ) {
+char *getNewCollName ( char *token , long tokenLen ) {
 	// let's create a new crawl id. dan was making it 32 characters
 	// with 4 hyphens in it for a total of 36 bytes, but since
 	// MAX_COLL_LEN, the maximum length of a collection name, is just
@@ -1509,14 +1545,15 @@
 	// they only crawl.
 	static char s_collBuf[MAX_COLL_LEN+1];

-	long tokenLen = gbstrlen(token);
+	//long tokenLen = gbstrlen(token);

 	// include a +5 for "-test"
 	// include 16 for crawlid (16 char hex #)
 	if ( tokenLen + 16 + 5>= MAX_COLL_LEN ) { char *xx=NULL;*xx=0;}
 	// ensure the crawlid is the full 16 characters long so we
 	// can quickly extricate the crawlid from the collection name
-	sprintf(s_collBuf,"%s-%016llx",token,crawlId64);
+	memcpy ( s_collBuf, token, tokenLen );
+	sprintf(s_collBuf + tokenLen ,"-%016llx",crawlId64);
 	return s_collBuf;
 }

@@ -1539,32 +1576,10 @@
 	// if no token... they need to login or signup
 	//
 	long tokenLen;
-	char *token = hr->getString("token",&tokenLen);
-
-	// crawlid?
-	char *crawlId = hr->getString("id",NULL,NULL);
-
-	char tokenBuf[64];
-
-	// extract token/crawlid from coll?
-	char *c = hr->getString("c",NULL,NULL);
-	if ( c ) {
-		// the collection name is <token>-<crawlid> but we
-		// need token to be null terminated so we have to
-		// copy it into tokenBuf.
-		char *tp = c;
-		long i; for ( i = 0 ; tp[i] && tp[i] != '-'; i++ );
-		if ( i > 60 ) goto needToken;
-		strncpy ( tokenBuf, c , i );
-		tokenLen = i;
-		token = tokenBuf;
-		// now point to crawl id in the collection name itself
-		crawlId = c + i + 1;
-	}
+	char *token = getTokenFromHttpRequest( hr , &tokenLen );

 	if ( ! token || tokenLen == 0 ) {
-	needToken:
 		sb.safePrintf("In order to use crawlbot you must "
 			      "first LOGIN:"
 			      "<form action=/crawlbot method=get>"
@@ -1591,13 +1606,19 @@
 						     -1); // cachetime
 	}

+	//char *crawlId = getCrawlIdFromHttpRequest();
+
 	CollectionRec *cr = NULL;

-	// add new collection?
+	// . add new collection?
+	// . make a new collection and it also becomes the cursor
 	long addColl = hr->getLong("addcoll",0);
-	// make a new collection and it also becomes the cursor
 	if ( addColl )
 		cr = addNewDiffbotColl ( hr );
+
+	char *delColl = hr->getString("delcoll",NULL,NULL);
+	if ( delColl )
+		g_collectiondb.deleteRec ( delColl , true );

 	// set this to current collection. if only token was provided
 	// then it will return the first collection owned by token.
@@ -1633,16 +1654,18 @@
 	sb.safePrintf("
");

 	// first print "add new collection"
-	sb.safePrintf(""
+	sb.safePrintf(""
 		      "add new collection"
 		      "   "

-		      ""
+		      ""
 		      "all collections"
 		      "   "
-
-		      , token
-		      , token
 		      );

@@ -1662,7 +1685,7 @@
 		// if current coll id...
 		char *cid = coll+tokenLen+1;
 		// if no crawlid "id" was given, use first for now!
-		if ( ! crawlId ) crawlId = cid;
+		//if ( ! crawlId ) crawlId = cid;
 		// highlight the tab if it is what we selected
 		bool highlight = false;
 		if ( cx == cr ) highlight = true;
@@ -2025,8 +2048,6 @@

 	sb.safePrintf("<input type=hidden name=c value=\"%s\">"
 		      "<input type=hidden name=crawlbotapi value=1>"
-		      "<input type=hidden name=token value=\"%s\">"
-		      "<input type=hidden name=id value=\"%s\">"
 		      "	"
 		      "
"
 		      "</form>"
@@ -2048,8 +2069,6 @@
 		      "
"
 		      "
"
 		      , cr->m_coll
-		      , token
-		      , crawlId
 		      );

@@ -2156,6 +2175,13 @@

 	sb.safePrintf("
"
+		      "<form method=get action=/crawlbot>"
+		      "<input type=hidden name=token value=\""
+		      );
+	sb.safeMemcpy ( token , tokenLen );
+	sb.safePrintf("\">"
+
+		      "<input type=hidden name=delcoll value=%s>"
 		      "
"
 		      "
"

@@ -2170,7 +2196,10 @@
 		      "	"

 		      "
"
-		      "
");
+		      "
"
+		      "</form>"
+		      , cr->m_coll
+		      );

 	return g_httpServer.sendDynamicPage ( s,
@@ -2263,14 +2292,14 @@
 CollectionRec *addNewDiffbotColl ( HttpRequest *hr ) {

 	long tokenLen = 0;
-	char *token = hr->getString("token",&tokenLen);
+	char *token = getTokenFromHttpRequest ( hr ,&tokenLen);

 	if ( ! token ) {
 		log("crawlbot: need token to add new coll");
 		return NULL;
 	}

-	char *collBuf = getNewCollName ( token );
+	char *collBuf = getNewCollName ( token , tokenLen );

 	if ( ! g_collectiondb.addRec ( collBuf ,
 				       NULL ,  // copy from


report error if some files in a checksum file were not found during verification with -verify (close #7)

--- DirHash.cpp
+++ DirHash.cpp
@@ -738,12 +738,13 @@
 public:
 	wstring m_hashName;
 	ByteArray m_digest;
-
-	HashResultEntry() : m_hashName(L"") {}
-	HashResultEntry(const HashResultEntry& hre) : m_hashName(hre.m_hashName), m_digest(hre.m_digest) {}
+	mutable bool m_processed;
+
+	HashResultEntry() : m_hashName(L""), m_processed (false){}
+	HashResultEntry(const HashResultEntry& hre) : m_hashName(hre.m_hashName), m_digest(hre.m_digest), m_processed (hre.m_processed) {}
 	~HashResultEntry() {}

-	HashResultEntry& operator = (const HashResultEntry& hre) { m_hashName = hre.m_hashName; m_digest = hre.m_digest; return *this; }
+	HashResultEntry& operator = (const HashResultEntry& hre) { m_hashName = hre.m_hashName; m_digest = hre.m_digest; m_processed = hre.m_processed; return *this; }
 };

 class CDirContent
@@ -882,7 +883,10 @@
 				}
 			}
 			else
+			{
+				It->second.m_processed = true;
 				bSumVerificationMode = true;
+			}
 		}
 		pHash = Hash::GetHash(pHash->GetID());
 	}
@@ -2021,6 +2025,54 @@
 		{
 			if (bVerifyMode)
 			{
+				// check if some entries in SUM files where not processed
+				size_t skippedEntries = 0;
+				for (std::map<wstring, HashResultEntry>::iterator It = digestsList.begin(); It != digestsList.end(); It++)
+				{
+					if (!It->second.m_processed)
+						skippedEntries++;
+				}
+
+				if (skippedEntries)
+				{
+					if (!bQuiet)
+					{
+						if (skippedEntries == 1)
+							ShowWarning(_T("1 entry in \"%s\" was not found:\n"), verificationFileName.c_str());
+						else
+							ShowWarning(_T("%lu entries in \"%s\" where not found:\n"), (unsigned long)skippedEntries, verificationFileName.c_str());
+					}
+					if (outputFile)
+					{
+						if (skippedEntries == 1)
+							_ftprintf(outputFile, _T("1 entry in \"%s\" was not found:\n"), verificationFileName.c_str());
+						else
+							_ftprintf(outputFile, _T("%lu entries in \"%s\" where not found:\n"), (unsigned long)skippedEntries, verificationFileName.c_str());
+					}
+
+					unsigned long counter = 1;
+					for (std::map<wstring, HashResultEntry>::iterator It = digestsList.begin(); It != digestsList.end(); It++)
+					{
+						if (!It->second.m_processed)
+						{
+							if (!bQuiet)
+								ShowWarning(_T(" %lu - %s\n"), counter, It->first.c_str());
+							if (outputFile)
+								_ftprintf(outputFile, _T(" %lu - %s\n"), counter, It->first.c_str());
+							counter++;
+						}
+					}
+
+					if (!bQuiet)
+						_tprintf(_T("\n"));
+					if (outputFile)
+						_ftprintf(outputFile, _T("\n"));
+
+					// report error
+					g_bMismatchFound = true;
+
+				}
+
 				if (g_bMismatchFound)
 				{
 					if (!bQuiet)


[ELF] - ICF: Remove dead code. NFC.

[ELF] - ICF: Remove dead code. NFC.

Code is dead. We use only InputSections when building the list of
sections elegible for the ICF:
https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L439
And 'isEligible' filters out SyntheticSections as well for us.

That way the only Kind we have in the Sections vector is SectionBase::Regular,
so we do not need to check sections kind at all, it is always the same.

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

--- ELF/ICF.cpp
+++ ELF/ICF.cpp
@@ -267,9 +267,6 @@
     if (!DA->Section || !DB->Section)
       return false;

-    if (DA->Section->kind() != DB->Section->kind())
-      return false;
-
     // Relocations referring to InputSections are constant-equal if their
     // section offsets are equal.
     if (isa<InputSection>(DA->Section)) {


Change for phi/tht/psi calcs based on suggestion from Li Weimin

--- FGState.cpp
+++ FGState.cpp
@@ -461,13 +461,12 @@
 FGColumnVector FGState::CalcEuler(void) {
   static FGColumnVector vEuler(3);

-  if (mTl2b(3,3) == 0)    vEuler(ePhi) = 0.0000001;
-  else                    vEuler(ePhi) = atan2(mTl2b(2,3), mTl2b(3,3));
-
+  if (mTl2b(3,3) == 0.0) mTl2b(3,3) = 0.0000001;
+  if (mTl2b(1,1) == 0.0) mTl2b(1,1) = 0.0000001;
+
+  vEuler(ePhi) = atan2(mTl2b(2,3), mTl2b(3,3));
   vEuler(eTht) = asin(-mTl2b(1,3));
-
-  if (mTl2b(1,1) == 0.0)  vEuler(ePsi) = 0.0000001;
-  else                    vEuler(ePsi) = atan2(mTl2b(1,2), mTl2b(1,1));
+  vEuler(ePsi) = atan2(mTl2b(1,2), mTl2b(1,1));

   if (vEuler(ePsi) < 0.0) vEuler(ePsi) += 2*M_PI;


INTEGRATION: CWS warnings01 (1.7.10); FILE MERGED 2006/03/10 15:40:13 sb 1.7.10.1: #i53898# Made code warning-free.

--- ucb/source/ucp/ftp/ftploaderthread.hxx
+++ ucb/source/ucp/ftp/ftploaderthread.hxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: ftploaderthread.hxx,v $
  *
- *  $Revision: 1.7 $
+ *  $Revision: 1.8 $
  *
- *  last change: $Author: rt $ $Date: 2005-09-09 15:37:08 $
+ *  last change: $Author: hr $ $Date: 2006-06-20 05:25:13 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -45,8 +45,7 @@
 #ifndef _OSL_THREAD_H_
 #include <osl/thread.h>
 #endif
-#include <curl/curl.h>
-
+#include "curl.hxx"

 namespace ftp {


#80246# - Changed defines for folder/stream content type.

--- ucb/source/ucp/package/pkgprovider.hxx
+++ ucb/source/ucp/package/pkgprovider.hxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: pkgprovider.hxx,v $
  *
- *  $Revision: 1.2 $
+ *  $Revision: 1.3 $
  *
- *  last change: $Author: kso $ $Date: 2000-11-29 14:16:26 $
+ *  last change: $Author: kso $ $Date: 2000-12-06 08:44:12 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -66,6 +66,10 @@
 #include <ucbhelper/providerhelper.hxx>
 #endif

+#ifndef _PKGURI_HXX
+#include "pkguri.hxx"
+#endif
+
 namespace com { namespace sun { namespace star { namespace container {
     class XHierarchicalNameAccess;
 } } } }
@@ -82,9 +86,9 @@

 // UCB Content Type.
 #define PACKAGE_FOLDER_CONTENT_TYPE \
-                "application/package-folder"
+                "application/" PACKAGE_URL_SCHEME "-folder"
 #define PACKAGE_STREAM_CONTENT_TYPE \
-                "application/package-stream"
+                "application/" PACKAGE_URL_SCHEME "-stream"

 //=========================================================================


Fix OCL Canny

Fix OCL Canny

--- modules/ocl/src/canny.cpp
+++ modules/ocl/src/canny.cpp
@@ -98,7 +98,7 @@
     {
         openCLFree(counter);
     }
-    counter = clCreateBuffer( (cl_context)getoclContext(), CL_MEM_COPY_HOST_PTR, sizeof(int), counter_i, &err );
+    counter = clCreateBuffer( *((cl_context*)getoclContext()), CL_MEM_COPY_HOST_PTR, sizeof(int), counter_i, &err );
     openCLSafeCall(err);
 }

@@ -354,7 +354,7 @@
 void canny::edgesHysteresisGlobal_gpu(oclMat &map, oclMat &st1, oclMat &st2, void *counter, int rows, int cols)
 {
     unsigned int count;
-    openCLSafeCall(clEnqueueReadBuffer((cl_command_queue)getoclCommandQueue(), (cl_mem)counter, 1, 0, sizeof(float), &count, 0, NULL, NULL));
+    openCLSafeCall(clEnqueueReadBuffer(*(cl_command_queue*)getoclCommandQueue(), (cl_mem)counter, 1, 0, sizeof(float), &count, 0, NULL, NULL));
     Context *clCxt = map.clCxt;
     string kernelName = "edgesHysteresisGlobal";
     vector< pair<size_t, const void *> > args;
@@ -364,7 +364,7 @@
     int count_i[1] = {0};
     while(count > 0)
     {
-        openCLSafeCall(clEnqueueWriteBuffer((cl_command_queue)getoclCommandQueue(), (cl_mem)counter, 1, 0, sizeof(int), &count_i, 0, NULL, NULL));
+        openCLSafeCall(clEnqueueWriteBuffer(*(cl_command_queue*)getoclCommandQueue(), (cl_mem)counter, 1, 0, sizeof(int), &count_i, 0, NULL, NULL));

         args.clear();
         size_t globalThreads[3] = {std::min(count, 65535u) * 128, DIVUP(count, 65535), 1};
@@ -379,7 +379,7 @@
         args.push_back( make_pair( sizeof(cl_int), (void *)&map.offset));

         openCLExecuteKernel2(clCxt, &imgproc_canny, kernelName, globalThreads, localThreads, args, -1, -1, DISABLE);
-        openCLSafeCall(clEnqueueReadBuffer((cl_command_queue)getoclCommandQueue(), (cl_mem)counter, 1, 0, sizeof(int), &count, 0, NULL, NULL));
+        openCLSafeCall(clEnqueueReadBuffer(*(cl_command_queue*)getoclCommandQueue(), (cl_mem)counter, 1, 0, sizeof(int), &count, 0, NULL, NULL));
         std::swap(st1, st2);
     }
 #undef DIVUP


Обновление библиотеки

Обновление библиотеки

--- Source/HarrixQtLibrary.cpp
+++ Source/HarrixQtLibrary.cpp
@@ -1,5 +1,5 @@
 //HarrixQtLibrary
-//Версия 3.26
+//Версия 3.27
 //Сборник функций для Qt.
 //https://github.com/Harrix/HarrixQtLibrary
 //Библиотека распространяется по лицензии Apache License, Version 2.0.
@@ -2319,7 +2319,7 @@
     */
     QString VMHL_Result;

-    VMHL_Result=String.replace("_","\\_").replace("#","\\#");
+    VMHL_Result=String.replace("_","\\_").replace("#","\\#").replace("~", "\\~");

     return VMHL_Result;
 }


Use QTest::qWait() instead of repeated calls to processEvents()

Add testing for signals.

svn path=/trunk/kdesupport/qca/; revision=686457

--- unittest/pipeunittest/pipeunittest.cpp
+++ unittest/pipeunittest/pipeunittest.cpp
@@ -36,6 +36,7 @@
     void createPipeWithInsecureMemory();
     void createPipeWithSecureMemory();
     void readWrite();
+    void signalTests();
 private:
     QCA::Initializer* m_init;
 };
@@ -103,23 +104,71 @@
     pipe1.readEnd().enable();

     pipe1.writeEnd().write( testData1 );
-    // QTest::qWait(1);
-    QCoreApplication::processEvents();
-    QCoreApplication::processEvents();
+    QTest::qWait(1); // process events
     QByteArray out1 = pipe1.readEnd().read(); // read all...
     QCOMPARE( testData1, out1 );

     pipe1.writeEnd().write( testData1 ); // put it back in
-    QCoreApplication::processEvents();
-    QCoreApplication::processEvents();
+    QTest::qWait(1); // process events
     QCOMPARE( pipe1.readEnd().bytesAvailable(), testData1.size() );
-    pipe1.writeEnd().write( testData2 );
-    QCoreApplication::processEvents();
-    QCoreApplication::processEvents();
+
+    pipe1.writeEnd().write( testData2 ); // add some more data
+    QTest::qWait(1); // process events
     QCOMPARE( pipe1.readEnd().bytesAvailable(), testData1.size() + testData2.size() );
+    QByteArray thisRead = pipe1.readEnd().read(1);
+    QCOMPARE( thisRead, QByteArray("D") );
+    thisRead = pipe1.readEnd().read(3);
+    QCOMPARE( thisRead, QByteArray("own") );
+    thisRead = pipe1.readEnd().read();
+    QCOMPARE( thisRead, QByteArray(" thepipe!") );
+}
+
+void PipeUnitTest::signalTests()
+{
+    QCA::QPipe* pipe = new QCA::QPipe;
+    pipe->create();

+    QVERIFY( pipe->writeEnd().isValid() );
+    pipe->writeEnd().enable();
+    QVERIFY( pipe->readEnd().isValid() );
+    pipe->readEnd().enable();

+    QSignalSpy readyReadSpy( &(pipe->readEnd()), SIGNAL( readyRead() ) );
+    QVERIFY( readyReadSpy.isValid() );
+    QSignalSpy bytesWrittenSpy( &(pipe->writeEnd()), SIGNAL( bytesWritten(int) ) );
+    QVERIFY( bytesWrittenSpy.isValid() );
+    QSignalSpy closedWriteSpy( &(pipe->writeEnd()), SIGNAL( closed() ) );
+    QVERIFY( closedWriteSpy.isValid() );
+    QSignalSpy closedReadSpy( &(pipe->readEnd()), SIGNAL( closed() ) );
+    QVERIFY( closedReadSpy.isValid() );
+
+    QCOMPARE( readyReadSpy.count(), 0 );
+    QCOMPARE( bytesWrittenSpy.count(), 0 );
+    QCOMPARE( closedWriteSpy.count(), 0 );
+    QCOMPARE( closedReadSpy.count(), 0 );
+
+    QByteArray data("Far better, it is, to dare mighty things");
+    pipe->writeEnd().write( data );
+    QTest::qWait(1);
+    QCOMPARE( readyReadSpy.count(), 1 );
+    QCOMPARE( bytesWrittenSpy.count(), 1 );
+    // this pulls out the first argument to the first signal as an integer
+    QCOMPARE( bytesWrittenSpy.takeFirst().at(0).toInt(), data.size() );
+    QCOMPARE( pipe->readEnd().bytesAvailable(), data.size() );
+
+    QCOMPARE( closedWriteSpy.count(), 0 );
+    QCOMPARE( closedReadSpy.count(), 0 );
+
+    pipe->readEnd().close();
+    QTest::qWait(1);
+    QCOMPARE( closedWriteSpy.count(), 0 );
+    QCOMPARE( closedReadSpy.count(), 1 );
+    pipe->writeEnd().close();
+    QTest::qWait(1);
+    QCOMPARE( closedWriteSpy.count(), 1 );
+    QCOMPARE( closedReadSpy.count(), 1 );
 }
+
 QTEST_MAIN(PipeUnitTest)

 #include "pipeunittest.moc"


Resolves fdo#41295 tmp name reuse in mass pdf export

--- unotools/source/ucbhelper/tempfile.cxx
+++ unotools/source/ucbhelper/tempfile.cxx
@@ -206,8 +206,8 @@
     aName += String::CreateFromAscii( "lu" );

     rName.Erase();
-    unsigned long nSeed = Time::GetSystemTicks() % nMax;
-    for ( unsigned long u = nSeed; ++u != nSeed; )
+    static unsigned long u = Time::GetSystemTicks() % nMax;
+    for ( unsigned long nSeed = u; ++u != nSeed; )
     {
         u %= nMax;
         String aTmp( aName );


Apply InfoLogLevel to the logs in utilities/merge_operators/uint64add.cc

Summary:
Apply InfoLogLevel to the logs and add missing copy-right information
to  utilities/merge_operators/uint64add.cc.

Test Plan: make

Reviewers: ljin, sdong, igor

Reviewed By: igor

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D27897

--- utilities/merge_operators/uint64add.cc
+++ utilities/merge_operators/uint64add.cc
@@ -1,3 +1,8 @@
+// Copyright (c) 2013, Facebook, Inc.  All rights reserved.
+// This source code is licensed under the BSD-style license found in the
+// LICENSE file in the root directory of this source tree. An additional grant
+// of patent rights can be found in the PATENTS file in the same directory.
+
 #include <memory>
 #include "rocksdb/env.h"
 #include "rocksdb/merge_operator.h"
@@ -45,7 +50,8 @@
       result = DecodeFixed64(value.data());
     } else if (logger != nullptr) {
       // If value is corrupted, treat it as 0
-      Log(logger, "uint64 value corruption, size: %zu > %zu",
+      Log(InfoLogLevel::ERROR_LEVEL, logger,
+          "uint64 value corruption, size: %zu > %zu",
           value.size(), sizeof(uint64_t));
     }


NiceMock MockFecController in VideoStreamEncoderUnittests

The MockFecController is spitting out lots of warnings, as it is
being called when we don't care about it, in normal tests. Making
it a NiceMock allows it to receive calls without expectation and
not warn.

Bug: None
Change-Id: I1ea219c4665d86917718692dc013ae3ac47222ad
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170600
Reviewed-by: Henrik Boström <106ab6647ddadbf38d6259e9d5ec4de77fa52c00@webrtc.org>
Reviewed-by: Elad Alon <9d66cb9c3c57b29e6fc055a4405dac15e20e28ee@webrtc.org>
Reviewed-by: Erik Språng <3ab8c90c99d6dd7822e0fad803ab0211dd287ae5@webrtc.org>
Commit-Queue: Evan Shrubsole <7a4ae6b96648f94a29a5ec4b2747fe0ea094fcde@google.com>
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#30820}

--- video/video_stream_encoder_unittest.cc
+++ video/video_stream_encoder_unittest.cc
@@ -999,7 +999,7 @@
     bool expect_null_frame_ = false;
     EncodedImageCallback* encoded_image_callback_
         RTC_GUARDED_BY(local_crit_sect_) = nullptr;
-    MockFecControllerOverride fec_controller_override_;
+    NiceMock<MockFecControllerOverride> fec_controller_override_;
     int num_encoder_initializations_ RTC_GUARDED_BY(local_crit_sect_) = 0;
     std::vector<ResolutionBitrateLimits> resolution_bitrate_limits_
         RTC_GUARDED_BY(local_crit_sect_);


Fix touch compile after some button cleanup (r88149).

BUG=none
TEST=compile works with touchui
TBR=pkasting@chromium.org

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

--- views/controls/button/native_button.cc
+++ views/controls/button/native_button.cc
@@ -247,7 +247,7 @@
 NativeButton::NativeButton(ButtonListener* listener, const std::wstring& label)
     : TextButton(listener, label), is_default_(false) {
   set_alignment(TextButton::ALIGN_CENTER);
-  SetNormalHasBorder(true);
+  static_cast<TextButtonBorder*>(border())->copy_normal_set_to_hot_set();
   set_focusable(true);
 }


Fix context menus for touchui=1

Fix context menus for touchui=1

Nested tasks are generally allowed for context menus (e.g. in
MenuController::Run, NativeMenuDOMUI::RunMenuAt). Do the same here. This fixes a
X-freeze caused by context menus when touchui=1 with the X message-pump.

BUG=none
TEST=manual, context menus in web-pages should work and not freeze X.

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

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

--- views/controls/menu/native_menu_gtk.cc
+++ views/controls/menu/native_menu_gtk.cc
@@ -124,7 +124,7 @@
                        G_CALLBACK(OnMenuMoveCurrentThunk), this);

   // Block until menu is no longer shown by running a nested message loop.
-  nested_dispatcher_ = new NestedDispatcherGtk(this, false);
+  nested_dispatcher_ = new NestedDispatcherGtk(this, true);
   bool deleted = nested_dispatcher_->RunAndSelfDestruct();
   if (deleted) {
     // The menu was destryed while menu is shown, so return immediately.


Rework a loop in the native menu code to iterate over the vector of items we have, rather than the actual system menu.

I believe this may fix a crash where the code indexes out of bounds in the vector. The trouble is the assumption that the native menu index matches the index into the vector. If someone has installed a windows addon this may not be true. It's safer to restrict the iteration to the bounds of the vector and index into the menu based on that.

http://crbug.com/14600
TEST=none

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

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

--- views/controls/menu/native_menu_win.cc
+++ views/controls/menu/native_menu_win.cc
@@ -346,16 +346,17 @@

 void NativeMenuWin::UpdateStates() {
   // A depth-first walk of the menu items, updating states.
-  for (int menu_index = first_item_index_;
-       menu_index < first_item_index_ + model_->GetItemCount(); ++menu_index) {
-    int model_index = menu_index - first_item_index_;
+  int model_index = 0;
+  std::vector<ItemData*>::const_iterator it;
+  for (it = items_.begin(); it != items_.end(); ++it, ++model_index) {
+    int menu_index = model_index + first_item_index_;
     SetMenuItemState(menu_index, model_->IsEnabledAt(model_index),
                      model_->IsItemCheckedAt(model_index), false);
     if (model_->IsLabelDynamicAt(model_index)) {
       SetMenuItemLabel(menu_index, model_index,
                        model_->GetLabelAt(model_index));
     }
-    Menu2* submenu = items_[model_index]->submenu.get();
+    Menu2* submenu = (*it)->submenu.get();
     if (submenu)
       submenu->UpdateStates();
   }


Update vnxtpmd.cpp

Update vnxtpmd.cpp

--- vnpy/api/xtp/vnxtp/vnxtpmd/vnxtpmd.cpp
+++ vnpy/api/xtp/vnxtp/vnxtpmd/vnxtpmd.cpp
@@ -69,7 +69,7 @@
 	this->task_queue.push(task);
 };

-void MdApi::OnDepthMarketData(XTPMD *market_data)
+void MdApi::OnDepthMarketData(XTPMD *market_data, int64_t bid1_qty[], int32_t bid1_count, int32_t max_bid1_count, int64_t ask1_qty[], int32_t ask1_count, int32_t max_ask1_count)
 {
 	Task task = Task();
 	task.task_name = ONDEPTHMARKETDATA;
@@ -1083,14 +1083,6 @@
 	return error;
 };

-// 修改方法
-//dict error;
-//if (task->task_error)
-//{
-//	XTPRI *task_error = (XTPRI*)task->task_error;
-//	error["error_id"] = task_error->error_id;
-//	error["error_msg"] = toUtf(task_error->error_msg);
-// 11111

 void MdApi::setUDPBufferSize(int buff_size)
 {
@@ -1108,7 +1100,7 @@
 {
 	char* buffer = (char*)ticker.c_str();
 	char* myreq[1] = { buffer };
-	int i = this->api->SubscribeMarketData(myreq, 1,(XTP_EXCHANGE_TYPE) exchange_id);
+	int i = this->api->SubscribeMarketData(myreq, 1, (XTP_EXCHANGE_TYPE)exchange_id);
 	return i;
 };

@@ -1156,52 +1148,60 @@

 int MdApi::subscribeAllMarketData(int exchange_id)
 {
-	this->api->SubscribeAllMarketData((XTP_EXCHANGE_TYPE)exchange_id);
+	int i = this->api->SubscribeAllMarketData((XTP_EXCHANGE_TYPE)exchange_id);
+	return i;
 };

 int MdApi::unSubscribeAllMarketData(int exchange_id)
 {
-	this->api->UnSubscribeAllMarketData((XTP_EXCHANGE_TYPE)exchange_id);
+	int i = this->api->UnSubscribeAllMarketData((XTP_EXCHANGE_TYPE)exchange_id);
+	return i;
 };

 int MdApi::subscribeAllOrderBook(int exchange_id)
 {
-	this->api->SubscribeAllOrderBook((XTP_EXCHANGE_TYPE)exchange_id);
+	int i = this->api->SubscribeAllOrderBook((XTP_EXCHANGE_TYPE)exchange_id);
+	return i;
 };

 int MdApi::unSubscribeAllOrderBook(int exchange_id)
 {
-	this->api->UnSubscribeAllOrderBook((XTP_EXCHANGE_TYPE)exchange_id);
+	int i = this->api->UnSubscribeAllOrderBook((XTP_EXCHANGE_TYPE)exchange_id);
+	return i;
 };

 int MdApi::subscribeAllTickByTick(int exchange_id)
 {
-	this->api->SubscribeAllTickByTick((XTP_EXCHANGE_TYPE)exchange_id);
+	int i = this->api->SubscribeAllTickByTick((XTP_EXCHANGE_TYPE)exchange_id);
+	return i;
 };

 int MdApi::unSubscribeAllTickByTick(int exchange_id)
 {
-	this->api->UnSubscribeAllTickByTick((XTP_EXCHANGE_TYPE)exchange_id);
+	int i = this->api->UnSubscribeAllTickByTick((XTP_EXCHANGE_TYPE)exchange_id);
+	return i;
 };

 int MdApi::login(string ip, int port, string user, string password, int sock_type)
 {
-	this->api->QuoteApi::Login(ip.c_str(), port, user.c_str(), password.c_str(),(XTP_PROTOCOL_TYPE) sock_type );
+	int i = this->api->Login(ip.c_str(), port, user.c_str(), password.c_str(), (XTP_PROTOCOL_TYPE)sock_type);
+	return i;
 };

 int MdApi::logout()
 {
-	this->api->Logout();
-
+	int i = this->api->Logout();
+	return i;
 };

 int MdApi::queryAllTickers(int exchange_id)
 {

-	this->api->QueryAllTickers((XTP_EXCHANGE_TYPE) exchange_id);
+	int i = this->api->QueryAllTickers((XTP_EXCHANGE_TYPE)exchange_id);
+	return i;

 };

@@ -1216,7 +1216,8 @@

 int MdApi::queryAllTickersPriceInfo()
 {
-	this->api->QueryAllTickersPriceInfo();
+	int i = this->api->QueryAllTickersPriceInfo();
+	return i;

 };


fix crash when trying to align over a very long gap

--- nanopolish_eventalign.cpp
+++ nanopolish_eventalign.cpp
@@ -267,6 +267,13 @@
             input.event_start_idx = curr_start_event;
             input.event_stop_idx = sr.get_closest_event_to(curr_end_read, strand_idx);

+            // A limitation of the segment-by-segment alignment is that we can't jump
+            // over very large deletions wrt to the reference. The effect of this
+            // is that we can get segments that have very few alignable events. We
+            // just stop processing them for now
+            if(abs(input.event_start_idx - input.event_stop_idx) < 2)
+                break;
+
             input.strand = strand_idx;
             input.event_stride = input.event_start_idx < input.event_stop_idx ? 1 : -1;
             input.rc = rc_flags[strand_idx];


Error handling

Error handling

--- native/recog/src/main.cpp
+++ native/recog/src/main.cpp
@@ -11,10 +11,10 @@
 }

 std::string Main::handleMessage(const AmqpClient::BasicMessage::ptr_t message, const AmqpClient::Channel::ptr_t channel) {
-	ImageMessage imageMessage(message);
-
 	Jzon::Object responseJson;
 	try {
+		ImageMessage imageMessage(message);
+
 		Jzon::Array coinsJson;
 		//Jzon::Array facesJson;
 		auto imageData = imageMessage.headImage();


reference the concentration of a metab explicitly. Do not rely on metab->getReference() to be the concentration (may be particle number in the future).

--- copasi/model/CReaction.cpp
+++ copasi/model/CReaction.cpp
@@ -1,9 +1,9 @@
 /* Begin CVS Header
    $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/model/CReaction.cpp,v $
-   $Revision: 1.114 $
+   $Revision: 1.115 $
    $Name:  $
    $Author: ssahle $
-   $Date: 2005/05/29 14:25:30 $
+   $Date: 2005/05/29 21:40:55 $
    End CVS Header */

 // CReaction
@@ -501,10 +501,14 @@
               mMap.clearCallParameter(paramName);
               jmax = mMetabKeyMap[i].size();
               for (j = 0; j < jmax; ++j)
-                mMap.addCallParameter(paramName, GlobalKeys.get(mMetabKeyMap[i][j]));
+                mMap.addCallParameter(paramName,
+                                      GlobalKeys.get(mMetabKeyMap[i][j])->getObject(CCopasiObjectName("Reference=Concentration")));
+              //mMap.addCallParameter(paramName, GlobalKeys.get(mMetabKeyMap[i][j]));
             }
           else
-            mMap.setCallParameter(getFunctionParameters()[i]->getObjectName(), GlobalKeys.get(mMetabKeyMap[i][0]));
+            mMap.setCallParameter(getFunctionParameters()[i]->getObjectName(),
+                                  GlobalKeys.get(mMetabKeyMap[i][0])->getObject(CCopasiObjectName("Reference=Concentration")));
+          //mMap.setCallParameter(getFunctionParameters()[i]->getObjectName(), GlobalKeys.get(mMetabKeyMap[i][0]));
         }
     }


Removed debugging output.

Removed debugging output.

--- copasi/model/CReaction.cpp
+++ copasi/model/CReaction.cpp
@@ -1493,24 +1493,19 @@
 {
   // Bug 3083: valid SBML Ids are valid COPASI Ids. However we allow importing invalid Ids
   // ID       (\"([^\\\"]|\\.)*\"|[a-z_A-Z][a-z_A-Z0-9]*)
-  std::cout << id.find_first_of("_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") << ", " << id.find_first_not_of("_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") << std::endl;
-
   if (id.find_first_of("_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") != 0
       || id.find_first_not_of("_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") != std::string::npos)
     return "\"" + id + "\"";

   // We need to check that we have no reserved name.
-  static const char * Reserved[] =
+  static const std::set< std::string > Reserved(
   {
     "pi", "exponentiale", "true", "false", "infinity", "nan",
     "PI", "EXPONENTIALE", "TRUE", "FALSE", "INFINITY", "NAN"
-  };
-
-  size_t j, jmax = 12;
-
-  for (j = 0; j < jmax; j++)
-    if (id == Reserved[j])
-      return "\"" + id + "\"";
+  });
+
+  if (Reserved.find(id) != Reserved.end())
+    return "\"" + id + "\"";

   return id;
 }


Decrease fade in/out time

Decrease fade in/out time

--- Sub-Terra/src/Freefall.cpp
+++ Sub-Terra/src/Freefall.cpp
@@ -176,7 +176,7 @@

 		engine->GetSystem<Renderer>().lock()->SetUniform("u_exposure", Point3(1));
 		auto tweener = engine->GetSystem<Tweener<float>>().lock();
-		st.dtors.emplace_back(tweener->Tween(1.0f, 0.0f, 1.0f, false, [] (Polar *engine, float x) {
+		st.dtors.emplace_back(tweener->Tween(1.0f, 0.0f, 0.5f, false, [] (Polar *engine, float x) {
 			engine->GetSystem<Renderer>().lock()->SetUniform("u_exposure", Point3(-glm::pow(x, 2.0f)));
 		}));
 	});
@@ -342,7 +342,7 @@
 		engine->AddComponent<AudioSource>(gameoverID, assetM->Get<AudioAsset>("gameover"));

 		auto tweener = engine->GetSystem<Tweener<float>>().lock();
-		st.dtors.emplace_back(tweener->Tween(0.0f, -1.0f, 1.0f, false, [] (Polar *engine, float x) {
+		st.dtors.emplace_back(tweener->Tween(0.0f, -1.0f, 0.5f, false, [] (Polar *engine, float x) {
 			engine->GetSystem<Renderer>().lock()->SetUniform("u_exposure", Point3(x));
 		}));
 	});


Add credit

Add credit

--- Sub-Terra/src/Freefall.cpp
+++ Sub-Terra/src/Freefall.cpp
@@ -335,6 +335,7 @@
 				//"Justin Kaufman",
 				"Kitsune Curator",
 				"Liquid Fear",
+				"Mark M. Miller",
 				//"Mark Miller + brother?",
 				"Peter Black",
 				"Shane Huberdeau",


Various updates

Various updates

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

--- Tests/Memory/Stressmem.cpp
+++ Tests/Memory/Stressmem.cpp
@@ -18,7 +18,7 @@
 #include <PlatformSupport/DOMStringHelper.hpp>
 #include <PlatformSupport/XalanFileOutputStream.hpp>
 #include <PlatformSupport/XalanOutputStreamPrintWriter.hpp>
-#include <DOMSupport/DOMSupportDefault.hpp>
+#include <XercesParserLiaison/XercesDOMSupport.hpp>

 #include <XPath/XObjectFactoryDefault.hpp>
 #include <XPath/XPathSupportDefault.hpp>
@@ -59,8 +59,25 @@
 #include <crtdbg.h>
 #endif

-
-const char* const	xslStylesheets[] =
+const char* const xxslStylesheets[] =
+{
+	"v:\\xsl-test\\perf\\basic\\basic-all_well",
+	"v:\\xsl-test\\perf\\basic\\basic-datetranscode",
+	"v:\\xsl-test\\perf\\basic\\basic-dict2",
+	"v:\\xsl-test\\perf\\basic\\basic-Fischer-Euwe",
+	"v:\\xsl-test\\perf\\basic\\basic-queens",
+	"v:\\xsl-test\\perf\\large\\large-all_well",
+	//"v:\\xsl-test\\perf\\large\\large-evans_large",
+	"v:\\xsl-test\\perf\\nodes\\nodes-fancy_xml_tree_viewer_34",
+	"v:\\xsl-test\\perf\\nodes\\nodes-showtree-19991008",
+	"v:\\xsl-test\\perf\\sort\\sort-big",
+	"v:\\xsl-test\\perf\\xpath\\xpath-evans_small",
+	"v:\\xsl-test\\perf\\xpath\\xpath-evans_tiny",
+	0
+};
+
+
+const char* const xslStylesheets[] =
 {
 	"v:\\xsl-test\\conf\\attribset\\attribset01",
 	"v:\\xsl-test\\conf\\attribset\\attribset02",
@@ -106,7 +123,6 @@
 	"v:\\xsl-test\\conf\\attribvaltemplate\\attribvaltemplate04",
 	"v:\\xsl-test\\conf\\attribvaltemplate\\attribvaltemplate05",
 	"v:\\xsl-test\\conf\\attribvaltemplate\\attribvaltemplate07",
-	"v:\\xsl-test\\conf\\attribvaltemplate\\attribvaltemplate08",
 	"v:\\xsl-test\\conf\\axes\\axes01",
 	"v:\\xsl-test\\conf\\axes\\axes02",
 	"v:\\xsl-test\\conf\\axes\\axes03",
@@ -568,7 +584,7 @@
 	"v:\\xsl-test\\conf\\namedtemplate\\namedtemplate03",
 	"v:\\xsl-test\\conf\\namedtemplate\\namedtemplate04",
 	"v:\\xsl-test\\conf\\namedtemplate\\namedtemplate05",
-//	"v:\\xsl-test\\conf\\namedtemplate\\namedtemplate06",
+	//"v:\\xsl-test\\conf\\namedtemplate\\namedtemplate06",
 	"v:\\xsl-test\\conf\\namedtemplate\\namedtemplate07",
 	"v:\\xsl-test\\conf\\namedtemplate\\namedtemplate08",
 	"v:\\xsl-test\\conf\\namedtemplate\\namedtemplate09",
@@ -1166,7 +1182,26 @@
 	"v:\\xsl-test\\conf\\variable\\variable21",
 	"v:\\xsl-test\\conf\\variable\\variable23",
 	"v:\\xsl-test\\conf\\variable\\variable24",
-	//"v:\\xsl-test\\conf\\variable\\variable25",
+	//"v:\\xsl-test\\conf\\variable\\variable25",
+	"v:\\xsl-test\\conf\\variable\\variable26",
+	"v:\\xsl-test\\conf\\variable\\variable27",
+	"v:\\xsl-test\\conf\\variable\\variable28",
+	"v:\\xsl-test\\conf\\variable\\variable29",
+	"v:\\xsl-test\\conf\\variable\\variable30",
+	"v:\\xsl-test\\conf\\variable\\variable31",
+	//"v:\\xsl-test\\conf\\variable\\variable32",
+	//"v:\\xsl-test\\conf\\variable\\variable33",
+	//"v:\\xsl-test\\conf\\variable\\variable34",
+	//"v:\\xsl-test\\conf\\variable\\variable35",
+	"v:\\xsl-test\\conf\\variable\\variable36",
+	"v:\\xsl-test\\conf\\variable\\variable37",
+	"v:\\xsl-test\\conf\\variable\\variable38",
+	"v:\\xsl-test\\conf\\variable\\variable39",
+	"v:\\xsl-test\\conf\\variable\\variable40",
+	"v:\\xsl-test\\conf\\variable\\variable41",
+	"v:\\xsl-test\\conf\\variable\\variable42",
+	"v:\\xsl-test\\conf\\variable\\variable43",
+	//"v:\\xsl-test\\conf\\variable\\variable44",
 	"v:\\xsl-test\\conf\\ver\\ver01",
 	"v:\\xsl-test\\conf\\ver\\ver02",
 	"v:\\xsl-test\\conf\\ver\\ver03",
@@ -1195,7 +1230,6 @@
 };

-
 // Used to hold compiled stylesheet, and source document.
 StylesheetRoot*		glbStylesheetRoot[sizeof(xslStylesheets) / sizeof(const char*)];

@@ -1242,7 +1276,7 @@
 				XSLTInit	theInit;

 				// Create the necessary stuff to compile the stylesheet.
-				DOMSupportDefault				csDOMSupport;
+				XercesDOMSupport				csDOMSupport;
 				XercesParserLiaison				csParserLiaison(csDOMSupport);
 				XPathSupportDefault				csXPathSupport(csDOMSupport);
 				XSLTProcessorEnvSupportDefault	csXSLTProcessorEnvSupport;
@@ -1283,6 +1317,7 @@
 					const XalanDOMString  theXMLFilename(XalanDOMString(xslStylesheets[i]) + theXMLSuffix);

 					//cout << "Now compiling Stylesheet: " << xslStylesheets[i] << endl;
+					cout << ".";

 					//Generate the XML and XSL input objects.
 					XSLTInputSource		csStylesheetSourceXSL(c_wstr(theXSLFilename));
@@ -1309,9 +1344,9 @@
 					for(int ii = 0; xslStylesheets[ii] != 0; ii++)
 					{
 						//cout << "Now running test: " << xslStylesheets[ii] << endl;
-
+						cout << "#";
 						// Create the necessary stuff to run the processor.
-						DOMSupportDefault				psDOMSupport;
+						XercesDOMSupport				psDOMSupport;
 						XercesParserLiaison				psParserLiaison(psDOMSupport);
 						XPathSupportDefault				psXPathSupport(psDOMSupport);
 						XSLTProcessorEnvSupportDefault	psXSLTProcessorEnvSupport;
@@ -1339,11 +1374,11 @@
 								psXPathSupport,
 								psXObjectFactory);

-						const XalanDOMString  outputFileName("foo.out");
+						const XalanDOMString  outputFile("foo.out");

 						//Generate the XML input and output objects.
 						XSLTInputSource		csDocumentSource(glbSourceDoc[ii]);
-						XSLTResultTarget	theResultTarget(c_wstr(outputFileName));
+						XSLTResultTarget	theResultTarget(outputFile);

 						// Set the stylesheet to be the compiled stylesheet. Then do the transform.
 						psProcessor.setStylesheetRoot(glbStylesheetRoot[ii]);


Updated to run with new XalanSourceTreeDomSupport and other minor changes.

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

--- Tests/Memory/Stressmem.cpp
+++ Tests/Memory/Stressmem.cpp
@@ -18,10 +18,11 @@
 #include <PlatformSupport/DOMStringHelper.hpp>
 #include <PlatformSupport/XalanFileOutputStream.hpp>
 #include <PlatformSupport/XalanOutputStreamPrintWriter.hpp>
-#include <XercesParserLiaison/XercesDOMSupport.hpp>
+
+#include <XalanSourceTree/XalanSourceTreeDOMSupport.hpp>
+#include <XalanSourceTree/XalanSourceTreeParserLiaison.hpp>

 #include <XPath/XObjectFactoryDefault.hpp>
-#include <XPath/XPathSupportDefault.hpp>
 #include <XPath/XPathFactoryDefault.hpp>

 #include <XSLT/StylesheetConstructionContextDefault.hpp>
@@ -33,8 +34,8 @@
 #include <XSLT/XSLTProcessorEnvSupportDefault.hpp>
 #include <XSLT/XSLTResultTarget.hpp>

-#include <XercesParserLiaison/XercesParserLiaison.hpp>
-
+//#include <XMLFileReporter.hpp>
+//#include <FileUtility.hpp>

 //This is here for the threads.
 #define WIN32_LEAN_AND_MEAN
@@ -347,9 +348,9 @@
 	"v:\\xsl-test\\conf\\entref\\entref05",
 	"v:\\xsl-test\\conf\\entref\\entref06",
 	"v:\\xsl-test\\conf\\entref\\entref07",
-	"v:\\xsl-test\\conf\\entref\\entref08",
+	//"v:\\xsl-test\\conf\\entref\\entref08",
 	"v:\\xsl-test\\conf\\entref\\entref09",
-	"v:\\xsl-test\\conf\\entref\\entref10",
+	//"v:\\xsl-test\\conf\\entref\\entref10",
 	"v:\\xsl-test\\conf\\expression\\expression01",
 	"v:\\xsl-test\\conf\\expression\\expression02",
 	"v:\\xsl-test\\conf\\expression\\expression03",
@@ -411,10 +412,10 @@
 	"v:\\xsl-test\\conf\\lre\\lre03",
 	"v:\\xsl-test\\conf\\lre\\lre04",
 	"v:\\xsl-test\\conf\\lre\\lre05",
-	"v:\\xsl-test\\conf\\lre\\lre06",
+	//"v:\\xsl-test\\conf\\lre\\lre06",
 	"v:\\xsl-test\\conf\\lre\\lre07",
 	"v:\\xsl-test\\conf\\lre\\lre08",
-	"v:\\xsl-test\\conf\\lre\\lre09",
+	//"v:\\xsl-test\\conf\\lre\\lre09",
 	"v:\\xsl-test\\conf\\lre\\lre10",
 	"v:\\xsl-test\\conf\\lre\\lre11",
 	"v:\\xsl-test\\conf\\lre\\lre12",
@@ -1276,9 +1277,11 @@
 				XSLTInit	theInit;

 				// Create the necessary stuff to compile the stylesheet.
-				XercesDOMSupport				csDOMSupport;
-				XercesParserLiaison				csParserLiaison(csDOMSupport);
-				XPathSupportDefault				csXPathSupport(csDOMSupport);
+				XalanSourceTreeDOMSupport		csDOMSupport;
+				XalanSourceTreeParserLiaison	csParserLiaison(csDOMSupport);
+
+				csDOMSupport.setParserLiaison(&csParserLiaison);
+
 				XSLTProcessorEnvSupportDefault	csXSLTProcessorEnvSupport;
 				XObjectFactoryDefault			csXObjectFactory;
 				XPathFactoryDefault				csXPathFactory;
@@ -1286,7 +1289,6 @@
 				// Create a processor to compile the stylesheet...
 				XSLTEngineImpl	csProcessor(
 						csParserLiaison,
-						csXPathSupport,
 						csXSLTProcessorEnvSupport,
 						csDOMSupport,
 						csXObjectFactory,
@@ -1346,9 +1348,8 @@
 						//cout << "Now running test: " << xslStylesheets[ii] << endl;
 						cout << "#";
 						// Create the necessary stuff to run the processor.
-						XercesDOMSupport				psDOMSupport;
-						XercesParserLiaison				psParserLiaison(psDOMSupport);
-						XPathSupportDefault				psXPathSupport(psDOMSupport);
+						XalanSourceTreeDOMSupport		psDOMSupport;
+						XalanSourceTreeParserLiaison	psParserLiaison(psDOMSupport);
 						XSLTProcessorEnvSupportDefault	psXSLTProcessorEnvSupport;
 						XObjectFactoryDefault			psXObjectFactory;
 						XPathFactoryDefault				psXPathFactory;
@@ -1356,7 +1357,6 @@
 						// Create a processor to compile the stylesheet...
 						XSLTEngineImpl	psProcessor(
 							psParserLiaison,
-							psXPathSupport,
 							psXSLTProcessorEnvSupport,
 							psDOMSupport,
 							psXObjectFactory,
@@ -1371,7 +1371,7 @@
 						StylesheetExecutionContextDefault		psExecutionContext(
 								psProcessor,
 								psXSLTProcessorEnvSupport,
-								psXPathSupport,
+								psDOMSupport,
 								psXObjectFactory);

 						const XalanDOMString  outputFile("foo.out");


fix missing commas

fix missing commas

--- eugenics/test_innocuous.cc
+++ eugenics/test_innocuous.cc
@@ -24,11 +24,11 @@

 TEST(InnocuousAttempt, XOR) {
   BooleanTable expected_o = {{false},
-                             {true}
+                             {true},
                              {false},
                              {true}};
   BooleanTable expected_o = {{false},
-                             {true}
+                             {true},
                              {true},
                              {false}};


Modifications done for plab scheduler:
* pass thru the UPLOAD/CLEAR events to local elvind so that
  plab-scheduler can get them.
* filter events with <plabsched, 1>
* listen to scheduler==2 evennts also from ops elvind

--- event/proxy/evproxyplab.cc
+++ event/proxy/evproxyplab.cc
@@ -54,6 +54,9 @@

 static void subscribe_callback(event_handle_t handle,  int result,
 			       event_subscription_t es, void *data);
+
+static void async_callback(event_handle_t handle,  int result,
+			   event_subscription_t es, void *data);

 static void schedule_updateevent();

@@ -305,6 +308,7 @@
 	      }

 	      tuple->expt = expt;
+	      tuple->scheduler = 2;

 	      /* malloc data -- to be freed in subscribe_callback */
 	      char *data = (char *) xmalloc(sizeof(expt));
@@ -317,6 +321,16 @@
 	      if (! retval) {
 		error("could not subscribe to events on remote server.\n");
 	      }
+
+	      tuple->scheduler = 0;
+
+	      retval = event_async_subscribe(bosshandle,
+					  expt_callback, tuple, NULL,
+					  async_callback,
+					  NULL, 1);
+	      if (! retval) {
+		error("could not subscribe to events on remote server.\n");
+	      }

               info("Subscribing to experiment: %s\n", expt);

@@ -375,6 +389,10 @@

 	  }

+	  /* pass thru EVPROXY events to plab-scheduler */
+	  if (! event_notify(localhandle, notification))
+            error("Failed to deliver notification!\n");
+
 	}
 }

@@ -387,6 +405,7 @@
 	char		objecttype[TBDB_FLEN_EVOBJTYPE];
         char		objectname[TBDB_FLEN_EVOBJNAME];
 	char            expt[TBDB_FLEN_PID + TBDB_FLEN_EID + 1];
+	int		plabsched = 0;

 	event_notification_get_objtype(handle,
 				       notification, objecttype, sizeof(objecttype));
@@ -400,12 +419,18 @@

 	if (strcmp(objecttype,TBDB_OBJECTTYPE_EVPROXY) != 0) {
 	  /*
-           * Resend the notification to the local server.
+           * Filter <plabsched,1> events, and for rest resend the notification
+	   * to the local elvind server.
            */
-          if (! event_notify(localhandle, notification))
-            error("Failed to deliver notification!\n");
-	}
-
+	  int ret = event_notification_get_int32(handle, notification,
+						 TBDB_PLABSCHED, &plabsched);
+
+	  if ((!ret) || (plabsched != 1)) {
+
+	    if (! event_notify(localhandle, notification))
+	      error("Failed to deliver notification!\n");
+	  }
+	}
 }

@@ -422,7 +447,7 @@

-/* Callback functions for asysn event subscribe and ubnsubscribe */
+/* Callback functions for asysn event subscribe */

 void subscribe_callback(event_handle_t handle,  int result,
 			event_subscription_t es, void *data) {
@@ -431,11 +456,24 @@
     exptmap[key] = es;
     info("Subscription for %s added successfully.\n", (char *)data);
   } else {
-    error("not able to delete the subscription.\n");
+    error("not able to add the subscription.\n");
     elvin_error_fprintf(stderr, handle->status);
   }

   free(data);
+
+}
+
+
+/* Callback functions for async event subscribe/unsubscribe */
+
+void async_callback(event_handle_t handle,  int result,
+			event_subscription_t es, void *data) {
+  if (!result) {
+    error("Error in async callback\n");
+    elvin_error_fprintf(stderr, handle->status);
+  }
+

 }


From Philippe:
Fix a compilation error on alpha/cxx

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

--- treeplayer/src/TTreeFormula.cxx
+++ treeplayer/src/TTreeFormula.cxx
@@ -1,4 +1,4 @@
-// @(#)root/treeplayer:$Name:  $:$Id: TTreeFormula.cxx,v 1.131 2003/12/18 13:21:33 brun Exp $
+// @(#)root/treeplayer:$Name:  $:$Id: TTreeFormula.cxx,v 1.132 2003/12/27 16:14:31 brun Exp $
 // Author: Rene Brun   19/01/96

 /*************************************************************************
@@ -1920,11 +1920,11 @@

          fAliases.AddAtAndExpand(primary,fNoper);
          fExpr[fNoper] = "";
-         fOper[fNoper] = kAlternate + isstring; // if isstring=1 then it is kAlternateString
+         fOper[fNoper] = (Int_t)kAlternate + isstring; // if isstring=1 then it is kAlternateString
          ++fNoper;

          fAliases.AddAtAndExpand(alternate,fNoper);
-         return kAlias + isstring - kVariable; // need to compensate for the TFormula induced offset
+         return (Int_t)kAlias + isstring - (Int_t)kVariable; // need to compensate for the TFormula induced offset
       }
    }


From Philippe:
This patch adds a missing 'continue' statement that was essentually
rendering Length4(xyz) useless when used inside an expression
(eg Length$(xyz)<20)

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

--- treeplayer/src/TTreeFormula.cxx
+++ treeplayer/src/TTreeFormula.cxx
@@ -1,4 +1,4 @@
-// @(#)root/treeplayer:$Name:  $:$Id: TTreeFormula.cxx,v 1.174 2005/03/28 21:06:38 brun Exp $
+// @(#)root/treeplayer:$Name:  $:$Id: TTreeFormula.cxx,v 1.175 2005/03/30 21:09:19 brun Exp $
 // Author: Rene Brun   19/01/96

 /*************************************************************************
@@ -3328,7 +3328,7 @@
                case kIndexOfEntry: tab[pos++] = fTree->GetReadEntry(); continue;
                case kEntries:      tab[pos++] = fTree->GetEntries(); continue;
                case kLength:       tab[pos++] = fManager->fNdata; continue;
-               case kLengthFunc:   tab[pos++] = ((TTreeFormula*)fAliases.UncheckedAt(i))->GetNdata();
+               case kLengthFunc:   tab[pos++] = ((TTreeFormula*)fAliases.UncheckedAt(i))->GetNdata(); continue;
                case kIteration:    tab[pos++] = instance; continue;

                case kDirect:     { TT_EVAL_INIT_LOOP; tab[pos++] = leaf->GetValue(real_instance); continue; }


Don't erase twice in the same vector.

Don't erase twice in the same vector.

It was giving the error "vector iterators incompatible" on Windows,
presumambly because the first erase call invalidated the existing
iterator.

--- Xcode/ESP/src/iostream.cpp
+++ Xcode/ESP/src/iostream.cpp
@@ -30,8 +30,7 @@
     if (newline != buffer.end()) {
         string s(buffer.begin(), newline);

-        buffer.erase(newline);
-        buffer.erase(buffer.begin(), newline);
+        buffer.erase(buffer.begin(), ++newline);

         if (data_ready_callback_ != nullptr) {
             istringstream iss(s);


fixed warning

fixed warning

--- YorozuyaGS/Performance.cpp
+++ YorozuyaGS/Performance.cpp
@@ -70,6 +70,7 @@
             float * fTar,
             ATF::Global::Info::GetYAngle700_ptr next)
         {
+            UNREFERENCED_PARAMETER(next);
             const F32vec4 vecTar = F32vec4(0.f, fTar[2], 0.f, fTar[0]);
             const F32vec4 vecPos = F32vec4(0.f, fPos[2], 0.f, fPos[0]);
             const F32vec4 diff = vecTar - vecPos;


Fix Linux compilation

Fix Linux compilation

--- include/Nazara/OpenGLRenderer/Wrapper/Linux/EGLContextX11.hpp
+++ include/Nazara/OpenGLRenderer/Wrapper/Linux/EGLContextX11.hpp
@@ -21,7 +21,6 @@
 			~EGLContextX11() = default;

 			bool Create(const ContextParams& params, WindowHandle window, const EGLContextBase* shareContext = nullptr) override;
-			void Destroy() override;

 			EGLContextX11& operator=(const EGLContextX11&) = delete;
 			EGLContextX11& operator=(EGLContextX11&&) = delete;


Add an option to only apply L1 level tiling for matmulOp (#3049)

--- iree/compiler/Conversion/LinalgToLLVM/MatMulVectorization.cpp
+++ iree/compiler/Conversion/LinalgToLLVM/MatMulVectorization.cpp
@@ -18,6 +18,19 @@

 namespace mlir {
 namespace iree_compiler {
+
+static llvm::cl::opt<bool> useL1TilesOnly(
+    "iree-codegen-linalg-to-llvm-matmul-use-l1-tiles-only",
+    llvm::cl::desc("If specified only L1 tiling applies, tiling for reduction "
+                   "dim is set l1-tile-size, other dimension are tiled by "
+                   "at most l1-reigster-max-tile-size"),
+    llvm::cl::init(false));
+
+static llvm::cl::opt<int> l1RegisterMaxTileSize(
+    "iree-codegen-linalg-to-llvm-matmul-l1-register-max-tile-size",
+    llvm::cl::desc(
+        "Max tile size for M & N dimensions when use-l1-tiles-only is set"),
+    llvm::cl::init(8));

 static llvm::cl::opt<int> l1TileSize(
     "iree-codegen-linalg-to-llvm-matmul-l1-tile-size",
@@ -60,16 +73,42 @@
 void MatMulTileAndVectorizePass::runOnFunction() {
   FuncOp fn = getFunction();
   MatmulCodegenStrategy strategy;
-  strategy
-      .tile<linalg::MatmulOp>(linalg::LinalgTilingOptions().setTileSizes(
-          {l3TileSize, l3TileSize, l3TileSize}))
-      .tile<linalg::MatmulOp>(linalg::LinalgTilingOptions().setTileSizes(
-          {l2TileSize, l2TileSize, l2TileSize}))
-      .tile<linalg::MatmulOp>(linalg::LinalgTilingOptions().setTileSizes(
-          {l1TileSize, l1TileSize, l1TileSize}))
-      .vectorize<linalg::MatmulOp>()
-      .setVectorTransferToSCFOptions(
-          VectorTransferToSCFOptions().setUnroll(unrollVectorTransfer));
+
+  if (useL1TilesOnly) {
+    auto matmulOps = llvm::to_vector<1>(fn.getOps<linalg::MatmulOp>());
+    if (matmulOps.size() != 1) return;
+
+    auto lhsShapeType =
+        matmulOps[0].getInput(0).getType().dyn_cast_or_null<ShapedType>();
+    auto rhsShapeType =
+        matmulOps[0].getInput(1).getType().dyn_cast_or_null<ShapedType>();
+
+    if (!lhsShapeType || !rhsShapeType) return;
+
+    auto lhsShape = lhsShapeType.getShape();
+    auto rhsShape = rhsShapeType.getShape();
+
+    int M = lhsShape[0], N = rhsShape[1];
+    auto tileDim = [](int dim, int maxSize) -> int {
+      for (int i = maxSize; i > 0; --i) {
+        if (dim % i == 0) return i;
+      }
+      return 1;
+    };
+    strategy.tile<linalg::MatmulOp>(linalg::LinalgTilingOptions().setTileSizes(
+        {tileDim(M, l1RegisterMaxTileSize), tileDim(N, l1RegisterMaxTileSize),
+         l1TileSize}));
+  } else {
+    strategy
+        .tile<linalg::MatmulOp>(linalg::LinalgTilingOptions().setTileSizes(
+            {l3TileSize, l3TileSize, l3TileSize}))
+        .tile<linalg::MatmulOp>(linalg::LinalgTilingOptions().setTileSizes(
+            {l2TileSize, l2TileSize, l2TileSize}))
+        .tile<linalg::MatmulOp>(linalg::LinalgTilingOptions().setTileSizes(
+            {l1TileSize, l1TileSize, l1TileSize}));
+  }
+  strategy.vectorize<linalg::MatmulOp>().setVectorTransferToSCFOptions(
+      VectorTransferToSCFOptions().setUnroll(unrollVectorTransfer));
   if (vectorOpLowering == "outer_product") {
     strategy.setVectorTransformsOptions(
         vector::VectorTransformsOptions().setVectorTransformsOptions(


[ASan] fix assign_large_valloc_to_global.cc to use the correct header for valloc() on OSX.

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@192901 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/asan/lit_tests/TestCases/assign_large_valloc_to_global.cc
+++ lib/asan/lit_tests/TestCases/assign_large_valloc_to_global.cc
@@ -1,5 +1,9 @@
 // Make sure we don't report a leak nor hang.
 // RUN: %clangxx_asan -O3 %s -o %t && %t
+#if defined(__APPLE__)
+#include <stdlib.h>
+#else
 #include <malloc.h>
+#endif
 int *p = (int*)valloc(1 << 20);
 int main() { }


fixes from d redgrave

fixes from d redgrave

git-svn-id: 83d585846b3bb6dc23aa7649400c5e2e04e3d09e@500 685f7672-210f-0410-90b4-fe3ad19314fe

--- ode/drawstuff/src/x11.cpp
+++ ode/drawstuff/src/x11.cpp
@@ -100,8 +100,8 @@
 static void createMainWindow (int _width, int _height)
 {
   // create X11 display connection
-  display = XOpenDisplay (0);
-  if (!display) dsError (0,"can not open X11 display");
+  display = XOpenDisplay (NULL);
+  if (!display) dsError ("can not open X11 display");
   screen = DefaultScreen(display);

   // get GL visual


changed variable size array 'avail' to fixed size.

--- ode/src/collision_std.cpp
+++ ode/src/collision_std.cpp
@@ -457,7 +457,7 @@
   for (i=0; i<n; i++) A[i] = dAtan2(p[i*2+1]-cy,p[i*2]-cx);

   // search for points that have angles closest to A[i0] + i*(2*pi/m).
-  int avail[n];
+  int avail[8];
   for (i=0; i<n; i++) avail[i] = 1;
   avail[i0] = 0;
   iret[0] = i0;


Fixing r8698.

Fixing r8698.

8698 causing android bots to fail. This is a fix.

BUG=
R=turaj@webrtc.org
TBR=henrik.lundin@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/41259004

git-svn-id: 03ae4fbe531b1eefc9d815f31e49022782c42458@8699 4adac7df-926f-26a2-2b94-8c16560cd09d

--- modules/audio_coding/main/acm2/acm_generic_codec_opus_test.cc
+++ modules/audio_coding/main/acm2/acm_generic_codec_opus_test.cc
@@ -119,16 +119,16 @@

   // Audio mode is not allowed when DTX is on, and DTX forcing flag is false.
   EXPECT_EQ(-1, codec_wrapper_->SetOpusApplication(kAudio, false));
-  EXPECT_EQ(true, GetAudioEncoderOpus()->dtx_enabled());
+  EXPECT_TRUE(GetAudioEncoderOpus()->dtx_enabled());

   // Audio mode will be set, if DTX forcing flag is true. Then DTX is switched
   // off.
   EXPECT_EQ(0, codec_wrapper_->SetOpusApplication(kAudio, true));
-  EXPECT_EQ(false, GetAudioEncoderOpus()->dtx_enabled());
+  EXPECT_FALSE(GetAudioEncoderOpus()->dtx_enabled());

   // Now we set VOIP mode. The DTX forcing flag has no effect.
   EXPECT_EQ(0, codec_wrapper_->SetOpusApplication(kVoip, true));
-  EXPECT_EQ(false, GetAudioEncoderOpus()->dtx_enabled());
+  EXPECT_FALSE(GetAudioEncoderOpus()->dtx_enabled());

   // In VOIP mode, we can enable DTX with mode forcing flag being false.
   EXPECT_EQ(0, codec_wrapper_->EnableOpusDtx(false));


Fix memory leaks in GetIpAddress() and CurlEnv. (#159)

Found with: --config=asan -c opt

--- opencensus/exporters/trace/zipkin/internal/zipkin_exporter.cc
+++ opencensus/exporters/trace/zipkin/internal/zipkin_exporter.cc
@@ -160,7 +160,6 @@
   writer->EndObject();
 }

-// JSON encoding
 std::string EncodeJson(
     const std::vector<::opencensus::trace::exporter::SpanData>& spans,
     const ZipkinExporterOptions::Service& service) {
@@ -175,12 +174,9 @@
   return buffer.GetString();
 }

-std::string GetIpAddress(ZipkinExporterOptions::AddressFamily af_type) {
-  struct ifaddrs* if_address_list;
-  struct ifaddrs* if_address;
-
-  getifaddrs(&if_address_list);
-  for (if_address = if_address_list; if_address != nullptr;
+std::string GetIpAddressHelper(ZipkinExporterOptions::AddressFamily af_type,
+                               ifaddrs* ifaddr_list) {
+  for (ifaddrs* if_address = ifaddr_list; if_address != nullptr;
        if_address = if_address->ifa_next) {
     if (if_address->ifa_addr == nullptr) {
       continue;
@@ -218,11 +214,28 @@
     return ipv6_loopback;
 }

+std::string GetIpAddress(ZipkinExporterOptions::AddressFamily af_type) {
+  ifaddrs* ifaddr;
+  getifaddrs(&ifaddr);
+  std::string out = GetIpAddressHelper(af_type, ifaddr);
+  freeifaddrs(ifaddr);
+  return out;
+}
+
 class CurlEnv {
  public:
+  static CurlEnv* Get();
+
+ private:
   CurlEnv() { curl_global_init(CURL_GLOBAL_DEFAULT); }
   ~CurlEnv() { curl_global_cleanup(); }
 };
+
+// static
+CurlEnv* CurlEnv::Get() {
+  static CurlEnv* g_curl_env = new CurlEnv;
+  return g_curl_env;
+}

 CURLcode CurlSendMessage(const uint8_t* data,
                          const ZipkinExporterOptions& options, size_t size,
@@ -313,8 +326,6 @@
   return res;
 }

-}  // namespace
-
 class ZipkinExportHandler
     : public ::opencensus::trace::exporter::SpanExporter::Handler {
  public:
@@ -338,7 +349,7 @@
   struct curl_slist* headers = nullptr;

   if (!curl) {
-    // Failed to create curl handle.
+    std::cerr << "Failed to create curl handle.\n";
     return;
   }

@@ -348,7 +359,7 @@
   CURLcode res = CurlSendMessage(reinterpret_cast<const uint8_t*>(msg.data()),
                                  options_, size, headers, curl, err_msg);
   if (res != CURLE_OK) {
-    std::cerr << "curl error: " << curl_easy_strerror(res);
+    std::cerr << "curl error: " << curl_easy_strerror(res) << "\n";
   }

   curl_slist_free_all(headers);
@@ -363,9 +374,11 @@
   }
 }

+}  // namespace
+
 void ZipkinExporter::Register(const ZipkinExporterOptions& options) {
   // Initialize libcurl. This MUST only be done once per process.
-  static CurlEnv* curl_lib ABSL_ATTRIBUTE_UNUSED = new CurlEnv();
+  CurlEnv::Get();

   // Create new exporter.
   ZipkinExportHandler* handler = new ZipkinExportHandler(options);


Fix compiler warnings.

Fix compiler warnings.

Change OSCL_UNUSED_ARG to (void).

--- opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/l_extract.cpp
+++ opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/l_extract.cpp
@@ -163,7 +163,7 @@

     Word32  temp;

-    OSCL_UNUSED_ARG(pOverflow);
+    (void)(pOverflow);

     temp = (L_var >> 16);


Remove comment about hardcoded spacenav link :)

--- xiv.cpp
+++ xiv.cpp
@@ -1301,9 +1301,6 @@
 {
     spnav_event spev;

-    // XXX make this udev link not hardcoded. this really doesn't matter for
-    // now, though, because this is LG-specific, and each LG will have one of
-    // these links
     if (!init_spacenav(spdev == NULL ? "/dev/input/spacenavigator" : spdev)) {
         pthread_exit(0);
     }


Fix: 2022-01-19

Fix: 2022-01-19

--- xpe.cpp
+++ xpe.cpp
@@ -2964,7 +2964,7 @@

             nNumberOfHeaders=pListImportHeaders->count();

-            for(int i=0; i<nNumberOfHeaders; i++)
+            for(qint32 i=0; i<nNumberOfHeaders; i++)
             {
                 pIID->FirstThunk=pIAT-pDataOffset;
                 listPatches.append((char *)pIID-pDataOffset+offsetof(XPE_DEF::IMAGE_IMPORT_DESCRIPTOR,FirstThunk));


Fix: 2021-12-22

Fix: 2021-12-22

--- xpe.cpp
+++ xpe.cpp
@@ -2782,7 +2782,7 @@
     {
         qint32 nNumberOfImports=pListImportHashes->count();

-        for(int i=0;i<nNumberOfImports;i++)
+        for(qint32 i=0;i<nNumberOfImports;i++)
         {
             if(pListImportHashes->at(i)==nHash)
             {


Fix: 2021-10-10

Fix: 2021-10-10

--- xpe.cpp
+++ xpe.cpp
@@ -1099,7 +1099,7 @@
         nDirectoriesOffset+=offsetof(XPE_DEF::IMAGE_OPTIONAL_HEADER32,DataDirectory);
     }

-    for(int i=0; i<nNumberNumberOfRvaAndSizes; i++)
+    for(int i=0;i<nNumberNumberOfRvaAndSizes;i++)
     {
         XPE_DEF::IMAGE_DATA_DIRECTORY record={};


Fix: 2022-10-31

Fix: 2022-10-31

--- xpe.cpp
+++ xpe.cpp
@@ -56,7 +56,7 @@
     return xpe.isValid();
 }

-XBinary::MODE XPE::getMode(QIODevice *pDevice, bool bIsImage, XADDR nModuleAddress)
+XBinary::MODE XPE::getMode(QIODevice *pDevice,bool bIsImage,XADDR nModuleAddress)
 {
     XPE xpe(pDevice,bIsImage,nModuleAddress);


possible fix for locked normals failing to be transformed. O

--- InputMesh.C
+++ InputMesh.C
@@ -322,8 +322,7 @@

     // build the per-vertex normals
     std::vector<int> lockedNormals(normalIds.length());
-    std::vector<float> vertexNormals;
-    vertexNormals.reserve(normalIds.length() * 3);
+    std::vector<float> vertexNormals(normalIds.length() * 3);
     for(unsigned int i = 0; i < normalIds.length(); ++i)
     {
         if(meshFn.isNormalLocked(normalIds[i]))
@@ -331,9 +330,9 @@
             lockedNormals[i] = 1;
         }

-        vertexNormals.push_back(rawNormals[normalIds[i] * 3 + 0]);
-        vertexNormals.push_back(rawNormals[normalIds[i] * 3 + 1]);
-        vertexNormals.push_back(rawNormals[normalIds[i] * 3 + 2]);
+        vertexNormals[i*3 + 0] = (rawNormals[normalIds[i] * 3 + 0]);
+        vertexNormals[i*3 + 1] = (rawNormals[normalIds[i] * 3 + 1]);
+        vertexNormals[i*3 + 2] = (rawNormals[normalIds[i] * 3 + 2]);
     }

     // add and set it to HAPI


Finished add, subtract, multiply, and divide

--- Integer.cpp
+++ Integer.cpp
@@ -26,6 +26,8 @@
     }else if(a->type == "exponential"){

     }else if(a->type == "integer"){
+        Integer *b = (Integer *)a;
+        this->value+=b->getValue;

     }else if(a->type == "logarithm"){

@@ -34,6 +36,9 @@
     }else if(a->type == "pi"){

     }else if(a->type == "rational"){
+        Rational *b = (Rational *) a;
+        b->setNumerator(b->getNumerator->add(this->multiply(b->getDenominator)));
+        this = b;

     }else{
         cout << "type not recognized" << endl;
@@ -46,6 +51,8 @@
     }else if(a->type == "exponential"){

     }else if(a->type == "integer"){
+        Integer *b = (Integer *)a;
+        this->value-=b->getValue;

     }else if(a->type == "logarithm"){

@@ -54,6 +61,9 @@
     }else if(a->type == "pi"){

     }else if(a->type == "rational"){
+        Rational *b = (Rational *) a;
+        b->setNumerator(b->getNumerator->subtract(this->multiply(b->getDenominator)));
+        this = b;

     }else{
         cout << "type not recognized" << endl;
@@ -66,6 +76,8 @@
     }else if(a->type == "exponential"){

     }else if(a->type == "integer"){
+        Integer *b = (Integer *)a;
+        this->value*=b->getValue;

     }else if(a->type == "logarithm"){

@@ -74,6 +86,9 @@
     }else if(a->type == "pi"){

     }else if(a->type == "rational"){
+        Rational *b = (Rational *) a;
+        b->setNumerator(b->getNumerator->multiply(this));
+        this = b;

     }else{
         cout << "type not recognized" << endl;
@@ -86,6 +101,8 @@
     }else if(a->type == "exponential"){

     }else if(a->type == "integer"){
+        Integer *b = (Integer *)a;
+        this->value/=b->getValue;

     }else if(a->type == "logarithm"){

@@ -94,6 +111,9 @@
     }else if(a->type == "pi"){

     }else if(a->type == "rational"){
+        Rational *b = (Rational *) a;
+        b->setDenominator(b->getDenominator->multiply(this));
+        this = b;

     }else{
         cout << "type not recognized" << endl;
@@ -106,6 +126,6 @@
 }

 string Integer::toString() {
-    string str = value;
+    string str = (string) value;
     return str;
 }


fix bump param.

fix bump param.

--- tools.cc
+++ tools.cc
@@ -135,7 +135,8 @@
       for(int i = 0; i < 3; i ++)
         data[i] = filter.compute(data[i], filter.SHARPEN_BOTH);
     } else if(strcmp(argv[1], "bump") == 0) {
-      filter.dist = ratio * 2 + 1;
+      assert(0 < ratio);
+      filter.dist = ratio;
       data[0] = data[1] = data[2] = redig.autoLevel(filter.compute(redig.rgb2l(data), filter.BUMP_BOTH), 8 * (data[0].rows() + data[0].cols()));
     }
     redig.normalize(data, num_t(1));


removed redundant degree-guard

removed redundant degree-guard

--- tree.cpp
+++ tree.cpp
@@ -412,7 +412,7 @@

 void RotateTree(tree_node *Node, int Deg)
 {
-    if (Node == NULL || IsLeafNode(Node) || Deg == 0)
+    if (Node == NULL || IsLeafNode(Node))
         return;

     DEBUG("RotateTree() " << Deg << " degrees")


Be very careful with compare_exchange_strong.
Fixed memory orders, took advantage of the load behavior of the failure case to avoid the subsequent load (as it was already done!), and write a very thorough explanatory comment.

PiperOrigin-RevId: 260735438

--- trmul.cc
+++ trmul.cc
@@ -106,22 +106,59 @@
   }

  private:
-  bool TryEnsurePacked(Side side, bool* local_packed, int block, int start,
-                       int end, Tuning tuning) {
+  // Tries to pack a block, without blocking.
+  // If the block was already packed, returns true.
+  // If the block was not started packing, packs it and returns true.
+  // If the block was being packed by another thread, returns false.
+  bool TryPack(Side side, bool* local_packed, int block, int start, int end,
+               Tuning tuning) {
     if (local_packed && !local_packed[block]) {
-      PackingStatus not_started = PackingStatus::kNotStarted;
+      // Explanation of this compare_exchange_strong operation:
+      // This atomically performs all of the following:
+      // 1. Read `status` with "acquire" memory order.
+      //    * That this read uses "acquire" is because both memory orders
+      //      specified have "acquire" as their read-component.
+      // 2. Compare (bitwise) with `exchanged_status`.
+      // 3. If equal, stores the value kInProgress to `status` with "release"
+      //    memory order, and returns true, so we take this 'if' branch.
+      //    * That this store uses "release" is because of the _rel part in
+      //      memory_order_acq_rel passed as the first memory order argument.
+      // 4. If not equal, stores the loaded value of `status` to
+      //    `exchanged_status` with "relaxed" semantics, and returns false,
+      //    so we take the 'else' branch.
+      //    * That this store uses "relaxed" is because the second memory
+      //      order argument, memory_order_acquire, implies no particular store
+      //      semantics. "relaxed" is acceptable here because this stores to
+      //      a local stack variable.
+      //
+      // Rationale for compare_exchange_strong as opposed to
+      // compare_exchange_weak:
+      // The spurious-failure case with compare_exchange_weak will actually
+      // happen a lot here, because the atomic 'status' bytes are stored
+      // contiguously in arrays and neighboring values will be accessed
+      // by multiple threads concurrently. On a typical ARM CPU, an exclusives
+      // reservation granule is 64 bytes, so a lot of false-sharing may happen.
+      // Using compare_exchange_weak would thus result in often having TryPack
+      // return 'false' when it could instead have done the packing work and
+      // returned 'true'. Heuristically, that is not a good thing. Moreover,
+      // this changes the TryPack contract, loosening it and making it harder
+      // for the caller to reason about. Finally, the overhead of atomic
+      // operations is mitigated by the enclosing check on local_packed, so
+      // maybe the overhead of compare_exchange_strong isn't such a problem.
+      // But we don't really know for sure, that would be interesting to
+      // experiment more with.
+      PackingStatus exchanged_status = PackingStatus::kNotStarted;
       std::atomic<PackingStatus>& status = packing_status[side][block];
-      if (status.compare_exchange_strong(not_started,
-                                         PackingStatus::kInProgress,
-                                         std::memory_order_acquire)) {
+      if (status.compare_exchange_strong(
+              exchanged_status, PackingStatus::kInProgress,
+              std::memory_order_acq_rel, std::memory_order_acquire)) {
         // In this branch, the status was kNotStarted and we just atomically
         // changed it to kInProgress as we are about to handle the packing
         // ourselves.
         params->RunPack(side, tuning, start, end);
         TraceRecordBlockPacked(thread_id, side, block, trace);
         status.store(PackingStatus::kFinished, std::memory_order_release);
-      } else if (status.load(std::memory_order_acquire) ==
-                 PackingStatus::kInProgress) {
+      } else if (exchanged_status == PackingStatus::kInProgress) {
         // Another thread is currently packing this block.
         return false;
       }
@@ -132,15 +169,16 @@
     return true;
   }

+  // Ensures that both the LHS and RHS blocks required by the specified block
+  // are packed.
   void EnsurePacked(const SidePair<bool*> local_packed,
                     const SidePair<int>& block, const SidePair<int>& start,
                     const SidePair<int>& end, Tuning tuning) {
     while (true) {
       bool both_sides_packed = true;
       for (Side side : {Side::kLhs, Side::kRhs}) {
-        both_sides_packed &=
-            TryEnsurePacked(side, local_packed[side], block[side], start[side],
-                            end[side], tuning);
+        both_sides_packed &= TryPack(side, local_packed[side], block[side],
+                                     start[side], end[side], tuning);
       }
       if (both_sides_packed) {
         break;


FIX: due to PlugIn interface changes

FIX: due to PlugIn interface changes

--- QApplications/MainApp/ChiliPlugin/QcMITKSamplePlugin.cpp
+++ QApplications/MainApp/ChiliPlugin/QcMITKSamplePlugin.cpp
@@ -1,7 +1,7 @@
 #include <chili/task.h>
 #include <chili/plugin.xpm>
 #include <chili/qclightbox.h>
-#include <chili/qclightboxmanager.h>
+//#include <chili/qclightboxmanager.h>
 #include <qlayout.h>
 #include <qpushbutton.h>
 #include <qptrlist.h>


fix build

fix build

--- Console.cpp
+++ Console.cpp
@@ -22,7 +22,6 @@
 #include <llvm/Support/MemoryBuffer.h>
 #include <llvm/Linker.h>
 #include <llvm/Module.h>
-//#include <llvm/ModuleProvider.h>
 #include <llvm/DerivedTypes.h>
 #include <llvm/ExecutionEngine/ExecutionEngine.h>
 #include <llvm/ExecutionEngine/GenericValue.h>
@@ -76,7 +75,8 @@
 		}
 	}

-	void MacroUndefined(const clang::IdentifierInfo *II,
+	void MacroUndefined(clang::SourceLocation Loc,
+	                    const clang::IdentifierInfo *II,
 	                    const clang::MacroInfo *MI) {
 		if (MI->isBuiltinMacro())
 			return;
@@ -330,7 +330,7 @@
 				                         VD->getType(), VD->getNameAsCString());
 				if (const clang::Expr *I = VD->getInit()) {
 					SrcRange range = getStmtRange(I, *sm, _options);
-					if (I->isConstantInitializer(*context)) {
+					if (I->isConstantInitializer(*context, false)) {
 						// Keep the whole thing in the global context.
 						std::stringstream global;
 						global << decl << " = ";


using namespace fplll is required for NTLs namespaces to be recognized

--- fplll/sieve/sieve_main.cpp
+++ fplll/sieve/sieve_main.cpp
@@ -4,7 +4,9 @@
   based on Panagiotis Voulgaris's implementation of the Gauss sieve.
 */
 #include "sieve_main.h"
-//#include "fplll.h"
+#include "fplll.h"
+
+using namespace fplll;

 /**
  * help function
@@ -33,10 +35,11 @@
 /**
  * run sieve
  */
-#if 0
+
 template <class ZT> int main_run_sieve(ZZ_mat<ZT> B, Z_NR<ZT> goal_norm, int alg, int ver, int seed)
 {
-  GaussSieve<ZT, FP_NR<double>> gsieve(B, alg, ver, seed);
+  /*
+   GaussSieve<ZT, FP_NR<double>> gsieve(B, alg, ver, seed);
   gsieve.set_goal_norm2(goal_norm);
   if (gsieve.alg == 3)
     gsieve.run_3sieve();
@@ -44,10 +47,10 @@
     gsieve.run_4sieve();
   else
     gsieve.run_2sieve();
-
+   */
   return 0;
 }
-#endif
+

 /**
  * main function


EKF: fix Travis build error

EKF: fix Travis build error

--- EKF/ekf.cpp
+++ EKF/ekf.cpp
@@ -273,8 +273,8 @@
 				float local_time_step = 1e-6f*(float)(_baro_sample_delayed.time_us - last_baro_time_us);
 				local_time_step = math::constrain(local_time_step,0.0f,1.0f);
 				last_baro_time_us = _baro_sample_delayed.time_us;
-				float raw_offset_error =  (_baro_sample_delayed.hgt - _hgt_sensor_offset) + _state.pos(2) - _baro_hgt_offset;
-				_baro_hgt_offset += local_time_step * math::constrain((0.1f * raw_offset_error), -0.1f, 0.1f);
+				float offset_rate_correction =  0.1f * (_baro_sample_delayed.hgt - _hgt_sensor_offset) + _state.pos(2) - _baro_hgt_offset;
+				_baro_hgt_offset += local_time_step * math::constrain(offset_rate_correction, -0.1f, 0.1f);
 			}
 		}


added new livewire interctor to node

added new livewire interctor to node

--- Modules/Segmentation/Interactions/mitkLiveWireTool2D.cpp
+++ Modules/Segmentation/Interactions/mitkLiveWireTool2D.cpp
@@ -24,7 +24,7 @@
 #include "mitkLiveWireTool2D.xpm"

 #include <mitkInteractionConst.h>
-#include <mitkContourModelInteractor.h>
+#include <mitkContourModelLiveWireInteractor.h>
 #include <mitkGlobalInteraction.h>

@@ -279,7 +279,7 @@
   m_ContourModelNode->AddProperty( "color", ColorProperty::New(1.0, 1.0, 0.1), NULL, true );

   //set the livewire interactor to edit control points
-  mitk::ContourModelInteractor::Pointer interactor = mitk::ContourModelInteractor::New(m_ContourModelNode);
+  mitk::ContourModelLiveWireInteractor::Pointer interactor = mitk::ContourModelLiveWireInteractor::New(m_ContourModelNode);
   m_ContourModelNode->SetInteractor(interactor);

   //add interactor to globalInteraction instance


Fix unsafe dereference.

Fix unsafe dereference.

Bound may point to one element beyond the end of the
vector, so *Bound is not safe.

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

--- ELF/ICF.cpp
+++ ELF/ICF.cpp
@@ -201,12 +201,12 @@
 template <class ELFT>
 void ICF<ELFT>::forEachGroup(std::vector<InputSection<ELFT> *> &V,
                              Comparator Eq) {
-  for (auto I = V.begin(), E = V.end(); I != E;) {
+  for (InputSection<ELFT> **I = V.data(), **E = I + V.size(); I != E;) {
     InputSection<ELFT> *Head = *I;
     auto Bound = std::find_if(I + 1, E, [&](InputSection<ELFT> *S) {
       return S->GroupId != Head->GroupId;
     });
-    segregate(&*I, &*Bound, Eq);
+    segregate(I, Bound, Eq);
     I = Bound;
   }
 }


Replaced references to Joint's CoordinateSet with new "coordinates" list property.

--- OpenSim/Utilities/simmFileWriterDLL/SimbodySimmModel.cpp
+++ OpenSim/Utilities/simmFileWriterDLL/SimbodySimmModel.cpp
@@ -478,12 +478,12 @@
         // Nothing to do.
     } else if (joint.getConcreteClassName()==("PinJoint")) {
         int index = 0;
-        string coordName = joint.getCoordinateSet().get(index).getName();
+        string coordName = joint.get_coordinates(index).getName();
         SimTK::Vec3 axis(0.0, 0.0, 1.0); // Pin joints always rotate about the Z axis.
         ssj->addFunctionDof(axis, coordName, 0, Coordinate::Rotational);
     } else if (joint.getConcreteClassName()==("SliderJoint")) {
         int index = 0;
-        string coordName = joint.getCoordinateSet().get(index).getName();
+        string coordName = joint.get_coordinates(index).getName();
         SimTK::Vec3 axis(1.0, 0.0, 0.0); // Slider joints always translate along the X axis.
         ssj->addFunctionDof(axis, coordName, 0, Coordinate::Translational);
     } else if (joint.getConcreteClassName()==("EllipsoidJoint")) {
@@ -493,15 +493,14 @@
         SimTK::Vec3 yaxis(0.0, 1.0, 0.0);
         SimTK::Vec3 zaxis(0.0, 0.0, 1.0);
         int index = 0;
-        ssj->addFunctionDof(xaxis, joint.getCoordinateSet().get(index++).getName(), 0, Coordinate::Translational);
-        ssj->addFunctionDof(yaxis, joint.getCoordinateSet().get(index++).getName(), 0, Coordinate::Translational);
-        ssj->addFunctionDof(zaxis, joint.getCoordinateSet().get(index++).getName(), 0, Coordinate::Translational);
-        ssj->addFunctionDof(xaxis, joint.getCoordinateSet().get(index++).getName(), 0, Coordinate::Rotational);
-        ssj->addFunctionDof(yaxis, joint.getCoordinateSet().get(index++).getName(), 0, Coordinate::Rotational);
-        ssj->addFunctionDof(zaxis, joint.getCoordinateSet().get(index).getName(), 0, Coordinate::Rotational);
+        ssj->addFunctionDof(xaxis, joint.get_coordinates(index++).getName(), 0, Coordinate::Translational);
+        ssj->addFunctionDof(yaxis, joint.get_coordinates(index++).getName(), 0, Coordinate::Translational);
+        ssj->addFunctionDof(zaxis, joint.get_coordinates(index++).getName(), 0, Coordinate::Translational);
+        ssj->addFunctionDof(xaxis, joint.get_coordinates(index++).getName(), 0, Coordinate::Rotational);
+        ssj->addFunctionDof(yaxis, joint.get_coordinates(index++).getName(), 0, Coordinate::Rotational);
+        ssj->addFunctionDof(zaxis, joint.get_coordinates(index).getName(), 0, Coordinate::Rotational);
     } else if (joint.getConcreteClassName()==("CustomJoint")) {
         const CustomJoint* cj = (CustomJoint*)(&joint);
-        const CoordinateSet& coordinates = cj->getCoordinateSet();

         // Add the joint's transform axes to the SimbodySimmJoint.
         const SpatialTransform& dofs = cj->getSpatialTransform();
@@ -516,9 +515,11 @@
                 const Function* constraintFunc = NULL;
                 Coordinate::MotionType motionType = (order[i]<3) ? Coordinate::Rotational : Coordinate::Translational;
                 if (ta->getCoordinateNames().size() > 0)
-                    coord = &coordinates.get(ta->getCoordinateNames()[0]);
-                if (coord)
+                    const int ix = cj->getProperty_coordinates().findIndexForName(ta->getCoordinateNames()[0]);
+                if (ix >= 0) {
+                    coord = cj->get_coordinates(ix);
                     constraintFunc = isDependent(coord, &independentCoord);
+                }
                 if (constraintFunc != NULL) {  // dof is constrained to a coordinate in another joint
                     ssj->addFunctionDof(ta->getAxis(), independentCoord->getName(), addJointFunction(constraintFunc, independentCoord->getMotionType(), motionType), motionType);
                 } else {


minor fix

minor fix


Added an include of <algorithm> for an issue that shows up on gcc 4.4

M    FONgGrid.cc

--- FONgGrid.cc
+++ FONgGrid.cc
@@ -22,8 +22,7 @@
 // You can contact University Corporation for Atmospheric Research at
 // 3080 Center Green Drive, Boulder, CO 80301

-#include <BESInternalError.h>
-#include <BESDebug.h>
+#include <algorithm>

 #include <gdal.h>
 #include <gdal_priv.h>
@@ -33,6 +32,9 @@
 #include <Grid.h>
 // #include <ce_functions.h>
 #include <util.h>
+
+#include <BESInternalError.h>
+#include <BESDebug.h>

 #include "GeoTiffTransmitter.h"
 #include "FONgTransform.h"


Adding loading mappig from DBB (now required) (Christian)

--- MUON/mapping/AliMpDEVisu.cxx
+++ MUON/mapping/AliMpDEVisu.cxx
@@ -38,6 +38,7 @@
 #include "AliMpPad.h"
 #include "AliMpDDLStore.h"
 #include "AliMpVPadIterator.h"
+#include "AliMpCDB.h"

 #include "AliLog.h"

@@ -90,10 +91,24 @@
   fCurrentDetElem(100),
   fCurrentDEName(),
   fSegmentation(),
-  fDDLStore(AliMpDDLStore::Instance()),
   fZoomMode(false)
 {
 /// Standard constructor
+
+  // Load mapping
+  if ( ! AliMpCDB::LoadMpSegmentation() )
+  {
+    AliFatal("Could not access mapping from OCDB !");
+  }
+
+  // Load DDL store
+  if ( ! AliMpCDB::LoadDDLStore() )
+  {
+    AliFatal("Could not access DDL Store from OCDB !");
+  }
+
+  fDDLStore = AliMpDDLStore::Instance();
+

   fTrashList.SetOwner(kFALSE);


Rewrite without protected access

Rewrite without protected access

--- data-structures-COP3530/bin-packing/BinPacking.cpp
+++ data-structures-COP3530/bin-packing/BinPacking.cpp
@@ -64,7 +64,7 @@
 	cout << "== bin cap is " << binCapacity << " ==" << endl;
 	cout << "object set is { " << objectSize << " } with total number of " << numberOfObjects << endl << endl;

-	// make bst with dummy root as root is protected prop of binaryTree, no can modify
+	// make bst ref
 	BinarySearchTree *bst;

 	// insert all objects
@@ -86,24 +86,30 @@
 		// yes there is bin that fits
 		else if (bst->find(objectSize[i - 1]) != NULL || bst->root->capacity >= objectSize[i - 1]) {
 			int foundBinNumber = 0;
-			BinaryTreeNode *bin = bst->root;

-			// check if root has cap (error with find function, idk)
-			if (bst->root->capacity >= objectSize[i - 1]) foundBinNumber = 1;
+			// check if root has cap (error with overwriting root, root is protected)
+			if (bst->root->capacity >= objectSize[i - 1]) {
+				foundBinNumber = 1;
+				bst->erase(bst->root);
+
+				// update capacity
+				int newCapacity = binNumberArray[foundBinNumber - 1] - objectSize[i - 1];
+				if (newCapacity != 0) bst->insert(binNumberArray[foundBinNumber - 1] - objectSize[i - 1], foundBinNumber);
+				binNumberArray[foundBinNumber - 1] = newCapacity;
+			}
 			// not, find in tree
 			else {
-				bin = bst->find(objectSize[i - 1]);
-				foundBin = returnedBin->binNumber; // ugh needed to change index offset this whole time
+				BinaryTreeNode *bin = bst->find(objectSize[i - 1]);
+				foundBinNumber = bin->binNumber; // ugh needed to change index offset this whole time
+
+				// update capacity
+				int newCapacity = binNumberArray[foundBinNumber - 1] - objectSize[i - 1];
+				bin->capacity = newCapacity;
+				binNumberArray[foundBinNumber - 1] = newCapacity;
+
+				// remove bin from bst if cap is now zero
+				if (newCapacity == 0) bst->erase(bin);
 			}
-
-
-			// update capacity
-			int newCapacity = binNumberArray[foundBinNumber - 1] - objectSize[i - 1];
-			bin->capacity = newCapacity;
-			binNumberArray[foundBinNumber - 1] = newCapacity;
-
-			// remove bin from bst if cap is now zero
-			if (newCapacity == 0) bst->erase(bin);

 			cout << "yes has bin, now using bin " << foundBinNumber << ", insert " << objectSize[i - 1] << endl;
 		}


remove unused using declaration

remove unused using declaration

--- ModelBase/src/nodes/Node.cpp
+++ ModelBase/src/nodes/Node.cpp
@@ -37,8 +37,6 @@

 #include "../commands/NodeOwningCommand.h"

-using namespace Logger;
-
 namespace Model {

 DEFINE_TYPE_ID_BASE(Node, "Node", )


Roto: Holding down CTRL  + SHIFT now allows to remove points from selection with the selection rectangle

--- Gui/RotoGui.cpp
+++ Gui/RotoGui.cpp
@@ -178,6 +178,7 @@
     bool evaluateOnKeyUp;  //< if true the next key up will call context->evaluateChange()
     bool iSelectingwithCtrlA;
     bool shiftDown;
+    bool ctrlDown;

     RotoGuiPrivate(RotoGui* pub,
                    NodeGui* n,
@@ -206,6 +207,7 @@
           , evaluateOnKeyUp(false)
           , iSelectingwithCtrlA(false)
           , shiftDown(false)
+          , ctrlDown(false)
     {
         if ( n->getNode()->isRotoPaintingNode() ) {
             type = ROTOPAINTING;
@@ -1262,7 +1264,16 @@
                     if ( !isFeatherVisible() && ptIt->first->isFeatherPoint() ) {
                         continue;
                     }
-                    _imp->rotoData->selectedCps.push_back(*ptIt);
+                    SelectedCPs::iterator foundCP = std::find(_imp->rotoData->selectedCps.begin(),_imp->rotoData->selectedCps.end(),*ptIt);
+                    if (foundCP == _imp->rotoData->selectedCps.end()) {
+                        if (!_imp->shiftDown || !_imp->ctrlDown) {
+                            _imp->rotoData->selectedCps.push_back(*ptIt);
+                        }
+                    } else {
+                        if (_imp->shiftDown && _imp->ctrlDown) {
+                            _imp->rotoData->selectedCps.erase(foundCP);
+                        }
+                    }
                 }
             }
             if ( !points.empty()) {
@@ -2196,6 +2207,8 @@

     if (key == Qt::Key_Shift) {
         _imp->shiftDown = true;
+    } else if (key == Qt::Key_Control) {
+        _imp->ctrlDown = true;
     }

     if ( modCASIsControl(e) ) {
@@ -2314,7 +2327,10 @@

     if (e->key() == Qt::Key_Shift) {
         _imp->shiftDown = false;
-    }
+    } else if (e->key() == Qt::Key_Control) {
+        _imp->ctrlDown = false;
+    }
+

     if ( !modCASIsControl(e) ) {
         if ( !_imp->iSelectingwithCtrlA && _imp->rotoData->showCpsBbox && (e->key() == Qt::Key_Control) ) {


cosmetics...

cosmetics...

--- SoPyScript/SoPyScript.cpp
+++ SoPyScript/SoPyScript.cpp
@@ -62,14 +62,10 @@
   struct swig_type_info  *prev;
 } swig_type_info;

-#define SWIG_ConvertPtr(obj, pp, type, flags) \
-  SWIG_Python_ConvertPtr(obj, pp, type, flags)
-#define SWIG_NewPointerObj(p, type, flags) \
-  SWIG_Python_NewPointerObj(p, type, flags)
+#define SWIG_NewPointerObj SWIG_Python_NewPointerObj
 #define SWIG_TypeQuery SWIG_Python_TypeQuery

 extern "C" {
-int SWIG_Python_ConvertPtr(PyObject *, void **, swig_type_info *, int);
 PyObject * SWIG_Python_NewPointerObj(void *, swig_type_info *,int own);
 swig_type_info * SWIG_TypeQuery(const char *);
 }
@@ -121,19 +117,18 @@
   Py_SetProgramName("SoPyScript");
   this->globalModuleDict = PyModule_GetDict(PyImport_AddModule("__main__"));

-
   /* shovel the the node itself on to the Python interpreter as self instance */
   swig_type_info * swig_type = 0;

   if ((swig_type = SWIG_TypeQuery("SoNode *")) == 0) {
     SoDebugError::post("SoPyScript::SoPyScript",
-                       "No SoPyscript SWIG type found!");
+                       "SoNode type could not be found!");
   }

   /* add the field to the global dict */
   PyDict_SetItemString((PyObject*)this->globalModuleDict,
                        "self",
-                       SWIG_NewPointerObj((void *)this, swig_type, 0));
+                       SWIG_NewPointerObj(this, swig_type, 0));

   PyThreadState_Swap(tstate);
 }
@@ -225,7 +220,7 @@
             *soTypeVal += typeVal;
             if ((swig_type = SWIG_TypeQuery(soTypeVal->getString())) == 0) {
               SoDebugError::post("SoPyScript::readInstance",
-                                 "%s unknown to Pivy!", typeVal.getString());
+                                 "field type %s unknown!", typeVal.getString());

               return FALSE;
             }
@@ -236,7 +231,7 @@
           /* add the field to the global dict */
           PyDict_SetItemString((PyObject*)this->globalModuleDict,
                                fieldname,
-                               SWIG_NewPointerObj((void *)field, swig_type, 0));
+                               SWIG_NewPointerObj(field, swig_type, 0));
           PyThreadState_Swap(tstate);
         }
       }
@@ -301,7 +296,7 @@
     PyObject * pyAction = NULL;

     if (swig_type) {
-      pyAction = SWIG_NewPointerObj((void *) action, swig_type, 0);
+      pyAction = SWIG_NewPointerObj(action, swig_type, 0);
     }

     PyObject * argtuple = NULL;


Changed tan(x/y) -> tan(y/x)

Changed tan(x/y) -> tan(y/x)

--- HOG/src/HOG.cpp
+++ HOG/src/HOG.cpp
@@ -34,7 +34,7 @@
 			dx = dx/mag;
 			dy = dy/mag;

-			float ang = atan((dx+eps)/(dy+eps));
+			float ang = atan((dy+eps)/(dx+eps));
 			ang = M_PI/2.0 + ang;
 			ang = ang*(180.0/M_PI);

@@ -119,12 +119,19 @@
 	return HOG_features;
 }

-void print_features( vector<float>& features){
+void print_features( vector<float>& features ){
 	for( unsigned int i = 0; i < (unsigned int)features.size(); i++){
 		// Remember: SVM_light feature indices start at 1
 		printf("%d:%f ", i+1, features[i]);
 	}
 	printf("\n");
+}
+void print_features( vector<float>& features, FILE* fp){
+	for( unsigned int i = 0; i < (unsigned int)features.size(); i++){
+		// Remember: SVM_light feature indices start at 1
+		fprintf(fp,"%d:%f ", i+1, features[i]);
+	}
+	fprintf(fp,"\n");
 }


Fix bug 71658.

Fix bug 71658.

CCMAIL: 71658-done@bugs.kde.org

svn path=/trunk/kdenetwork/kopete/; revision=276160

--- protocols/oscar/oscaraccount.cpp
+++ protocols/oscar/oscaraccount.cpp
@@ -234,7 +234,7 @@

 	// 1 = username unknown to server
 	// 5 = wrong password
-	if (errorCode == 1 || errorCode == 5)
+	if (errorCode == 1 || errorCode == 5 || errorCode == 24)
 		OscarAccount::disconnect();

 	KMessageBox::queuedMessageBox(0, KMessageBox::Error, errmsg,


don't send picture information when connecting into invisible state.

svn path=/branches/work/kopete/dev-0.12/kopete/; revision=489422

--- protocols/yahoo/yahooaccount.cpp
+++ protocols/yahoo/yahooaccount.cpp
@@ -681,7 +681,8 @@
 			kc->removeProperty( m_protocol->awayMessage );

 		if( newStatus != static_cast<YahooProtocol*>( m_protocol )->Offline &&
-		    oldStatus == static_cast<YahooProtocol*>( m_protocol )->Offline && contact(who) != myself() )
+		    oldStatus == static_cast<YahooProtocol*>( m_protocol )->Offline && contact(who) != myself() &&
+		    myself()->onlineStatus() != m_protocol->Invisible )
 		{
 			m_session->requestBuddyIcon( who );		// Try to get Buddy Icon


added protection against empty strings in copy to avoid false warnings

--- ANALYSIS/AliESDtrackCuts.cxx
+++ ANALYSIS/AliESDtrackCuts.cxx
@@ -542,16 +542,16 @@
   target.fCutMinDCAToVertexZ = fCutMinDCAToVertexZ;

   target.fCutMaxDCAToVertexXYPtDep = fCutMaxDCAToVertexXYPtDep;
-  target.SetMaxDCAToVertexXYPtDep(fCutMaxDCAToVertexXYPtDep.Data());
+  if(fCutMaxDCAToVertexXYPtDep.Length()>0)target.SetMaxDCAToVertexXYPtDep(fCutMaxDCAToVertexXYPtDep.Data());

   target.fCutMaxDCAToVertexZPtDep = fCutMaxDCAToVertexZPtDep;
-  target.SetMaxDCAToVertexZPtDep(fCutMaxDCAToVertexZPtDep.Data());
+  if(fCutMaxDCAToVertexZPtDep.Length()>0)target.SetMaxDCAToVertexZPtDep(fCutMaxDCAToVertexZPtDep.Data());

   target.fCutMinDCAToVertexXYPtDep = fCutMinDCAToVertexXYPtDep;
-  target.SetMinDCAToVertexXYPtDep(fCutMinDCAToVertexXYPtDep.Data());
+  if(fCutMinDCAToVertexXYPtDep.Length()>0)target.SetMinDCAToVertexXYPtDep(fCutMinDCAToVertexXYPtDep.Data());

   target.fCutMinDCAToVertexZPtDep = fCutMinDCAToVertexZPtDep;
-  target.SetMinDCAToVertexZPtDep(fCutMinDCAToVertexZPtDep.Data());
+  if(fCutMinDCAToVertexZPtDep.Length()>0)target.SetMinDCAToVertexZPtDep(fCutMinDCAToVertexZPtDep.Data());

   target.fPMin = fPMin;
   target.fPMax = fPMax;


Fixed alignment for nRF51

Fixed alignment for nRF51

--- ARM/Nordic/src/ble_intrf.cpp
+++ ARM/Nordic/src/ble_intrf.cpp
@@ -39,11 +39,11 @@
 #include "ble_intrf.h"
 #include "ble_app.h"

-#define NRFBLEINTRF_PACKET_SIZE		NRF_BLE_MAX_MTU_SIZE
+#define NRFBLEINTRF_PACKET_SIZE		(NRF_BLE_MAX_MTU_SIZE - 3)
 #define NRFBLEINTRF_CFIFO_SIZE		CFIFO_TOTAL_MEMSIZE(2, NRFBLEINTRF_PACKET_SIZE + sizeof(BLEINTRF_PKT) - 1)

-static uint8_t s_nRFBleRxFifoMem[NRFBLEINTRF_CFIFO_SIZE];
-static uint8_t s_nRFBleTxFifoMem[NRFBLEINTRF_CFIFO_SIZE];
+alignas(4) static uint8_t s_nRFBleRxFifoMem[NRFBLEINTRF_CFIFO_SIZE];
+alignas(4) static uint8_t s_nRFBleTxFifoMem[NRFBLEINTRF_CFIFO_SIZE];

 /**
  * @brief - Disable


Cleaned up includes.

Cleaned up includes.

--- applications/object_search/src/object_search_main.cpp
+++ applications/object_search/src/object_search_main.cpp
@@ -1,21 +1,11 @@
 #include <iostream>
 #include <string>
-#include <vector>

-#include "pcl/common/time.h"
-#include "pcl/features/fpfh_omp.h"
-#include "pcl/features/normal_3d_omp.h"
-#include "pcl/filters/crop_box.h"
 #include "pcl/filters/filter.h"
-#include "pcl/filters/voxel_grid.h"
 #include "pcl/point_cloud.h"
 #include "pcl/point_types.h"
-#include "pcl/registration/icp.h"
-#include "pcl/registration/sample_consensus_prerejective.h"
-#include "pcl/segmentation/sac_segmentation.h"
 #include "pcl_conversions/pcl_conversions.h"
 #include "pcl_ros/transforms.h"
-#include "rapid_perception/pr2.h"
 #include "rapid_perception/box3d_roi_server.h"
 #include "rapid_perception/pose_estimation.h"
 #include "rapid_perception/random_heat_mapper.h"
@@ -25,7 +15,6 @@
 #include "rapid_msgs/SaveStaticCloud.h"
 #include "rapid_ros/publisher.h"
 #include "ros/ros.h"
-#include "sensor_msgs/Image.h"
 #include "sensor_msgs/PointCloud2.h"
 #include "visualization_msgs/Marker.h"

@@ -34,14 +23,10 @@
 #include "object_search/command_line.h"
 #include "object_search/cloud_database.h"

-using sensor_msgs::Image;
 using sensor_msgs::PointCloud2;
-using pcl::FPFHSignature33;
 using pcl::PointCloud;
 using pcl::PointXYZRGB;
-using pcl::PointXYZRGBNormal;
 using visualization_msgs::Marker;
-namespace rp = rapid::perception;

 using namespace object_search;

@@ -79,7 +64,6 @@
                                                true));

   // Build ROI server
-  tf::TransformListener tf_listener;
   rapid::perception::Box3DRoiServer roi_server("roi");
   CaptureRoi capture(&roi_server);


Thread: Re-add pthread_np.h include for FreeBSD/OpenBSD

Was a regression from #45315.

Fixes #46998.

(cherry picked from commit 7a64819c2fa839eb6ce198285fdc2dc65493d062)

--- drivers/unix/thread_posix.cpp
+++ drivers/unix/thread_posix.cpp
@@ -35,6 +35,10 @@
 #include "core/os/thread.h"
 #include "core/ustring.h"

+#ifdef PTHREAD_BSD_SET_NAME
+#include <pthread_np.h>
+#endif
+
 static Error set_name(const String &p_name) {
 #ifdef PTHREAD_NO_RENAME
 	return ERR_UNAVAILABLE;


removed temp debug code

removed temp debug code

--- examples/echo/testecho.cpp
+++ examples/echo/testecho.cpp
@@ -128,7 +128,7 @@
     print_timer(LOOP_COUNT);
     printf("call_say: elapsed %lld average %lld\n", elapsed, elapsed/LOOP_COUNT);
     echoRequestProxy->setLeds(9);
-    print_dbg_requeste_intervals();
+    //print_dbg_requeste_intervals();
     portalExec_end();
     return 0;
 }


AU: generate a delta payload usage report

Currently, the report is generated as part of delta payload generation.
Here's a sample of the top of the report:

  1.06%    1104147 BSDIFF     /opt/google/o3d/libnpo3dautoplugin.so
  1.53%    1596334 REPLACE_BZ /usr/share/fonts/droid-cros/DroidSansFallback.ttf
  1.92%    2004371 BSDIFF     /opt/google/chrome/libpdf.so
  2.22%    2317201 BSDIFF     /usr/sbin/chromeos-firmwareupdate
  3.01%    3138556 REPLACE_BZ <kernel-operation-0>
  3.01%    3139632 REPLACE    /boot/vmlinuz-2.6.32.21+drm33.7
  7.48%    7801907 REPLACE_BZ <rootfs-final-operation>
 15.61%   16281170 BSDIFF     /opt/google/chrome/chrome
 28.19%   29391876 BSDIFF     /usr/libexec/ibus-engine-mozc
100.00%  104276861            <total>

BUG=7266
TEST=generated a delta payload and looked at the report

Change-Id: I9f32f000260469cc15fd8e0f9b55a8aa10db0cd9

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

--- delta_diff_generator.cc
+++ delta_diff_generator.cc
@@ -3,17 +3,22 @@
 // found in the LICENSE file.

 #include "update_engine/delta_diff_generator.h"
+
+#include <errno.h>
+#include <fcntl.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-#include <errno.h>
-#include <fcntl.h>
+
 #include <algorithm>
 #include <set>
 #include <string>
 #include <utility>
 #include <vector>
+
+#include <base/logging.h>
+#include <base/string_util.h>
 #include <bzlib.h>
-#include "base/logging.h"
+
 #include "update_engine/bzip.h"
 #include "update_engine/cycle_breaker.h"
 #include "update_engine/extent_mapper.h"
@@ -467,6 +472,72 @@
   return true;
 }

+struct DeltaObject {
+  DeltaObject(const string& in_name, const int in_type, const off_t in_size)
+      : name(in_name),
+        type(in_type),
+        size(in_size) {}
+  bool operator <(const DeltaObject& object) const {
+    return size < object.size;
+  }
+  string name;
+  int type;
+  off_t size;
+};
+
+static const char* kInstallOperationTypes[] = {
+  "REPLACE",
+  "REPLACE_BZ",
+  "MOVE",
+  "BSDIFF"
+};
+
+void ReportPayloadUsage(const Graph& graph,
+                        const DeltaArchiveManifest& manifest) {
+  vector<DeltaObject> objects;
+  off_t total_size = 0;
+
+  // Graph nodes with information about file names.
+  for (Vertex::Index node = 0; node < graph.size(); node++) {
+    objects.push_back(DeltaObject(graph[node].file_name,
+                                  graph[node].op.type(),
+                                  graph[node].op.data_length()));
+    total_size += graph[node].op.data_length();
+  }
+
+  // Final rootfs operation writing non-file-data.
+  const DeltaArchiveManifest_InstallOperation& final_op =
+      manifest.install_operations(manifest.install_operations_size() - 1);
+  objects.push_back(DeltaObject("<rootfs-final-operation>",
+                                final_op.type(),
+                                final_op.data_length()));
+  total_size += final_op.data_length();
+
+  // Kernel install operations.
+  for (int i = 0; i < manifest.kernel_install_operations_size(); ++i) {
+    const DeltaArchiveManifest_InstallOperation& op =
+        manifest.kernel_install_operations(i);
+    objects.push_back(DeltaObject(StringPrintf("<kernel-operation-%d>", i),
+                                  op.type(),
+                                  op.data_length()));
+    total_size += op.data_length();
+  }
+
+  std::sort(objects.begin(), objects.end());
+
+  static const char kFormatString[] = "%6.2f%% %10llu %-10s %s\n";
+  for (vector<DeltaObject>::const_iterator it = objects.begin();
+       it != objects.end(); ++it) {
+    const DeltaObject& object = *it;
+    fprintf(stderr, kFormatString,
+            object.size * 100.0 / total_size,
+            object.size,
+            kInstallOperationTypes[object.type],
+            object.name.c_str());
+  }
+  fprintf(stderr, kFormatString, 100.0, total_size, "", "<total>");
+}
+
 }  // namespace {}

 bool DeltaDiffGenerator::ReadFileToDiff(
@@ -984,6 +1055,8 @@
                           static_cast<ssize_t>(signature_blob.size()));
   }

+  ReportPayloadUsage(graph, manifest);
+
   LOG(INFO) << "All done. Successfully created delta file.";
   return true;
 }