Suport multiple ABI libraries on command line (#388)

* Convert --abi_library to --abi_libraries

* Change path delimeter to ','

--- tools/mcsema_lift/Lift.cpp
+++ tools/mcsema_lift/Lift.cpp
@@ -55,7 +55,11 @@

 DEFINE_string(output, "", "Output bitcode file name.");

-DEFINE_string(abi_library, "", "Path to an LLVM bitcode or IR file that contains "
+// Using ',' as it will work well enough on Windows and Linux
+// Other suggestions were ':', which is a path character on Windows
+// and ';', which is an end of statement escape on Linux shells
+static const char kPathDelimeter = ',';
+DEFINE_string(abi_libraries, "", "Path to one or more bitcode files that contain "
                                "external library definitions for the C/C++ ABI.");

 DECLARE_bool(version);
@@ -85,6 +89,22 @@
                       [=](llvm::GlobalVariable *isel, llvm::Function *) {
                         std::cout << isel->getName().str() << std::endl;
                       });
+}
+
+// simple function to split a string on a delimeter
+// used to separate comma separated arguments
+std::vector<std::string>
+split(const std::string &s, const char delim) {
+
+	std::vector<std::string> res;
+	std::string rem;
+	std::istringstream instream(s);
+
+	while(std::getline(instream, rem, delim)) {
+		res.push_back(rem);
+	}
+
+	return res;
 }

 static std::unique_ptr<llvm::Module> gLibrary;
@@ -221,7 +241,12 @@
      // And compile this file to bitcode using `remill-clang-M.m` (Major.minor).
      // This bitcode file will then be the source of type information for
      // McSema.
-     << "    [--abi_library BITCODE_FILE] \\" << std::endl
+     //
+     // One may want multiple such files, such as one for libc, one for exception
+     // handling and one for zlib, and so on. McSema supports loading multiple
+     // ABI library definitions via a ';' separated list of paths
+     << "    [--abi_libraries BITCODE_FILE[" << kPathDelimeter <<
+        "BITCODE_FILE" << kPathDelimeter << "...] ] \\" << std::endl

      // Annotate each LLVM IR instruction with some metadata that includes the
      // original program counter. The name of the LLVM metadats is
@@ -287,8 +312,12 @@

   // Load in a special library before CFG processing. This affects the
   // renaming of exported functions.
-  if (!FLAGS_abi_library.empty()) {
-    LoadLibraryIntoModule(FLAGS_abi_library);
+  if (!FLAGS_abi_libraries.empty()) {
+    auto abi_libs = split(FLAGS_abi_libraries, kPathDelimeter);
+    for(const auto &abi_lib : abi_libs) {
+      LOG(INFO) << "Loading ABI Library: " << abi_lib << "\n";
+      LoadLibraryIntoModule(abi_lib);
+    }
   }

   auto cfg_module = mcsema::ReadProtoBuf(
@@ -302,7 +331,7 @@
       << "Unable to lift CFG from " << FLAGS_cfg << " into module "
       << FLAGS_output;

-  if (!FLAGS_abi_library.empty()) {
+  if (!FLAGS_abi_libraries.empty()) {
     UnloadLibraryFromModule();
     gLibrary.reset(nullptr);
   }


Add mutex to tests

Add mutex to tests

--- test/unittest/rtps/ros2features/ros2feature_test.cpp
+++ test/unittest/rtps/ros2features/ros2feature_test.cpp
@@ -25,8 +25,10 @@
 #include <fastrtps/rtps/reader/StatefulReader.h>

 #include <boost/interprocess/detail/os_thread_functions.hpp>
+
 #include <gtest/gtest.h>

+#include <mutex>

 class pub_dummy_listener:public PublisherListener
 {
@@ -47,6 +49,8 @@
 class gettopicnamesandtypesReaderListener:public ReaderListener
 {
 	public:
+	std::mutex mapmutex;
+	std::map<std::string,std::set<std::string>> topicNtypes;
 	void onNewCacheChangeAdded(RTPSReader* reader, const CacheChange_t* const change_in){
 		CacheChange_t* change = (CacheChange_t*) change_in;
 		if(change->kind == ALIVE){
@@ -56,12 +60,12 @@
 			tempMsg.length = change->serializedPayload.length;
 			memcpy(tempMsg.buffer,change->serializedPayload.data,tempMsg.length);
 			if(proxyData.readFromCDRMessage(&tempMsg)){
+				mapmutex.lock();
 				topicNtypes[proxyData.m_topicName].insert(proxyData.m_typeName);
+				mapmutex.unlock();
 			}
 		}
 	}
-	std::map<std::string,std::set<std::string>> topicNtypes;
-
 };

 TEST(ros2features, EDPSlaveReaderAttachment)
@@ -170,7 +174,10 @@
 	result = target->hasReaderAttached();
 	ASSERT_EQ(result,true);
 	slave_target =  dynamic_cast<gettopicnamesandtypesReaderListener*>(target->getAttachedListener());
+
+	slave_target->mapmutex.lock();
 	ASSERT_EQ(slave_target->topicNtypes.size(),0);
+	slave_target->mapmutex.unlock();

 	Participant *my_participant2;
 	Publisher *my_publisher2;
@@ -188,8 +195,10 @@
 	pub_attr2.topic.topicDataType = "HelloWorldType";
 	my_publisher2 = Domain::createPublisher(my_participant2, pub_attr2, &my_dummy_listener2);
 	ASSERT_NE(my_publisher2, nullptr);
+
+	slave_target->mapmutex.lock();
 	ASSERT_EQ(slave_target->topicNtypes.size(),1);
-
+	slave_target->mapmutex.unlock();

 }


added tests for birthday offset

added tests for birthday offset

--- testframes/test_mne_anonymize/test_mne_anonymize.cpp
+++ testframes/test_mne_anonymize/test_mne_anonymize.cpp
@@ -92,7 +92,8 @@

 private:
     double epsilon;
-    void verifyTags(FIFFLIB::FiffStream::SPtr &outStream);
+    void verifyTags(FIFFLIB::FiffStream::SPtr &outStream,
+                    bool SubjBirthdayOffset=false);
     void verifyCRC(const QString file,
                    const quint16 validatedCRC);
 };
@@ -316,6 +317,17 @@

     MNEANONYMIZE::SettingsController controller(arguments, "MNE Anonymize", "1.0");

+    QFile fFileOut(sFileOut);
+    FIFFLIB::FiffStream::SPtr outStream(&fFileOut);
+    if(outStream->open(QIODevice::ReadOnly))
+    {
+        qInfo() << "TestMneAnonymize::testDefaultAnonymizationOfTags - output file opened correctly " << sFileIn;
+    } else {
+        QFAIL("Output file could not be loaded.");
+    }
+
+    verifyTags(outStream, true);
+
 }

@@ -354,7 +366,8 @@

 //*************************************************************************************************************

-void TestMneAnonymize::verifyTags(FIFFLIB::FiffStream::SPtr &stream)
+void TestMneAnonymize::verifyTags(FIFFLIB::FiffStream::SPtr &stream,
+                                  bool SubjBirthdayOffset)
 {
     //Using defined shared pointer FiffAnonymnizer class
     //FiffAnonymizer::SPtr objAnon = FiffAnonymizer::SPtr::create();
@@ -488,8 +501,12 @@
         {
             QDateTime defaultDate(QDate(2000,1,1), QTime(1, 1, 0));
             QDateTime inBirthday(QDate::fromJulianDay(*pTag->toJulian()));
-
-            QVERIFY(defaultDate == inBirthday);
+            QDateTime offSetBirtday(defaultDate.date().addDays(-35));
+            if(SubjBirthdayOffset) {
+                QVERIFY(defaultDate == offSetBirtday);
+            } else {
+                QVERIFY(defaultDate == inBirthday);
+            }

 //            qDebug() << "*inTag->toJulian()" << *inTag->toJulian();


Use != 0 instead of > 0 when checking bit mask.

--- scene/gui/base_button.cpp
+++ scene/gui/base_button.cpp
@@ -60,7 +60,7 @@
 	Ref<InputEventMouseButton> mouse_button = p_event;
 	bool ui_accept = p_event->is_action("ui_accept") && !p_event->is_echo();

-	bool button_masked = mouse_button.is_valid() && ((1 << (mouse_button->get_button_index() - 1)) & button_mask) > 0;
+	bool button_masked = mouse_button.is_valid() && ((1 << (mouse_button->get_button_index() - 1)) & button_mask) != 0;
 	if (button_masked || ui_accept) {
 		on_action_event(p_event);
 		return;


Show timeout in right hand corner

Show timeout in right hand corner

--- MiniZincIDE/mainwindow.cpp
+++ MiniZincIDE/mainwindow.cpp
@@ -1452,10 +1452,11 @@

 QString MainWindow::setElapsedTime()
 {
-    int hours = elapsedTime.elapsed() / 3600000;
-    int minutes = (elapsedTime.elapsed() % 3600000) / 60000;
-    int seconds = (elapsedTime.elapsed() % 60000) / 1000;
-    int msec = (elapsedTime.elapsed() % 1000);
+    qint64 elapsed_t = elapsedTime.elapsed();
+    int hours =  elapsed_t / 3600000;
+    int minutes = (elapsed_t % 3600000) / 60000;
+    int seconds = (elapsed_t % 60000) / 1000;
+    int msec = (elapsed_t % 1000);
     QString elapsed;
     if (hours > 0)
         elapsed += QString().number(hours)+"h ";
@@ -1465,7 +1466,20 @@
         elapsed += QString().number(seconds)+"s";
     if (hours==0 && minutes==0)
         elapsed += " "+QString().number(msec)+"msec";
-    statusLabel->setText(elapsed);
+
+    QString timeLimit;
+    if (project.timeLimit() > 0) {
+        timeLimit += " / ";
+        int tl_hours = project.timeLimit() / 3600;
+        int tl_minutes = (project.timeLimit() % 3600) / 60;
+        int tl_seconds = project.timeLimit() % 60;
+        if (tl_hours > 0)
+            timeLimit += QString().number(tl_hours)+"h ";
+        if (tl_hours > 0 || tl_minutes > 0)
+            timeLimit += QString().number(tl_minutes)+"m ";
+        timeLimit += QString().number(tl_seconds)+"s";
+    }
+    statusLabel->setText(elapsed+timeLimit);
     return elapsed;
 }


Set the radius of capsule, cylindr and sphere to be the same radius and the height of box, caspsule and cylinder to be the same.

--- SurgSim/Graphics/RenderTests/OsgRepresentationRenderTests.cpp
+++ SurgSim/Graphics/RenderTests/OsgRepresentationRenderTests.cpp
@@ -95,7 +95,7 @@
 	/// Sphere position
 	Vector3d spherePosition(0.05, 0.0, -0.2);
 	/// Size of the box
-	Vector3d boxSize(0.01, 0.01, 0.01);
+	Vector3d boxSize(0.01, 0.015, 0.01);
 	/// Size of the capsule (raidus, height)
 	Vector2d capsuleSize(0.005, 0.015);
 	/// Size of the cylinder


Refactor shutdown command[029477]

Refactor shutdown command[029477]

--- TTKModule/TTKCore/musicToolsSetsKits/musictimerautoobject.cpp
+++ TTKModule/TTKCore/musicToolsSetsKits/musictimerautoobject.cpp
@@ -7,7 +7,9 @@
 #ifdef Q_OS_WIN
 #  include <qt_windows.h>
 #else
-#  include <QProcess>
+#  include <signal.h>
+#  include <unistd.h>
+#  include <sys/reboot.h>
 #endif

 MusicTimerAutoObject::MusicTimerAutoObject(QObject *parent)
@@ -122,7 +124,20 @@
         ExitWindowsEx(EWX_SHUTDOWN | EWX_POWEROFF, 0);
     }
 #elif defined Q_OS_UNIX
-    QProcess::execute("shutdown", QStringList() << "now");
+    /* first disable all our signals */
+    sigset_t set;
+    sigfillset(&set);
+    sigprocmask(SIG_BLOCK, &set, nullptr);
+    /* send signals to all processes  _except_ pid 1 */
+    kill(-1, SIGTERM);
+    sync();
+    sleep(3);
+
+    kill(-1, SIGKILL);
+    sync();
+    sleep(3);
+    /* shutdown */
+    reboot(RB_POWER_OFF);
 #endif
     M_LOGGER_INFO("shutdown now");
 }


fix bug in encrypt

fix bug in encrypt

Note that the pad is present when M is evenly divisible by 16. EXAMPLE A 9-byte message has a pad of 7 bytes, each with the value 0x07.

--- PdfWriter/Src/Encrypt.cpp
+++ PdfWriter/Src/Encrypt.cpp
@@ -322,10 +322,8 @@
  #define PADDING_SIZE 16
          unsigned int CEncrypt::CryptBuf(const BYTE* pSrc, BYTE* pDst, unsigned int unLen)
         {
-            unsigned int unLenOut = unLen;
-
-            if (unLenOut % PADDING_SIZE != 0)
-                unLenOut = (unLen / PADDING_SIZE + 1) * PADDING_SIZE;
+            // Note that the pad is present when M is evenly divisible by 16
+            unsigned int unLenOut = (unLen / PADDING_SIZE + 1) * PADDING_SIZE;

 			memcpy(pDst, impl->streamInitialization, 16);

@@ -336,6 +334,8 @@
 			if (unLenOut != unLen)
             {
 				unsigned char empty[16] = {};
+				// EXAMPLE A 9-byte message has a pad of 7 bytes, each with the value 0x07.
+				memset(empty, unLenOut - unLen, 16);
 				stfEncryption.Put2(empty, unLenOut - unLen, 0, true);

             }


remove gccism

remove gccism

--- genomeFile.cpp
+++ genomeFile.cpp
@@ -42,7 +42,7 @@
 			// TODO: we currently skip all the notes
 			for (int i = 0; i < 19; i++) {
 				uint16 skip = read16(s);
-				uint8 dummy[skip]; s.read((char *)dummy, skip);
+				uint8 *dummy = new uint8[skip]; s.read((char *)dummy, skip); delete[] dummy;
 			}
     		}

@@ -73,9 +73,9 @@
 		s.read(buffer, buflen);
 		n->description = buffer;
 		buflen = read16(s);
-		delete buffer; buffer = new char[buflen];
+		delete[] buffer; buffer = new char[buflen];
 		n->comments = buffer;
-		delete buffer;
+		delete[] buffer;
 	}
 }


*** empty log message ***

*** empty log message ***

--- ghistogram.cpp
+++ ghistogram.cpp
@@ -27,6 +27,7 @@
 #include "ghistogram.h"
 #include "histogram.h"
 #include "labelconstructor.h"
+#include "histogramtotals.h"

 ////@begin XPM images
 ////@end XPM images
@@ -157,7 +158,7 @@
   gridHisto->DeleteCols( 0, gridHisto->GetNumberCols() );
   gridHisto->DeleteRows( 0, gridHisto->GetNumberRows() );
   gridHisto->AppendCols( myHistogram->getNumColumns() );
-  gridHisto->AppendRows( myHistogram->getNumRows() );
+  gridHisto->AppendRows( myHistogram->getNumRows() + NUMTOTALS );
   for( THistogramColumn iCol = 0; iCol < myHistogram->getNumColumns(); iCol++ )
   {
     if( commStat )
@@ -211,6 +212,22 @@
         }
       }
     }
+
+    HistogramTotals *histoTotals = myHistogram->getTotals( myHistogram->getCurrentStat() );
+    vector<TSemanticValue> totals;
+    histoTotals->getAll( totals, idStat, iCol, curPlane );
+
+    for( int i = 0; i < NUMTOTALS; i++ )
+    {
+      gridHisto->SetRowLabelValue( myHistogram->getNumRows() + i, "" );
+      if( totals[ 0 ] > 0.0 )
+      {
+        string tmpStr;
+        tmpStr = LabelConstructor::histoCellLabel( myHistogram, totals[ i ] );
+        gridHisto->SetCellValue( myHistogram->getNumRows() + i, iCol, wxString( tmpStr ) );
+      }
+      else gridHisto->SetCellValue( myHistogram->getNumRows() + i, iCol, wxString( "-" ) );
+    }
   }

   gridHisto->SetRowLabelSize( rowLabelWidth );


qdoc3: Eliminates req to doc internal signal handlers

qdoc no longer requires, or even allows, documenting
signal handlers that are nested in sub-components of
a component.

Task-number:  QTBUG-22366
Change-Id: I1e23dade93a0f6d4c8c6e138fd79a5e4f46ec6c8
Sanity-Review: Qt Sanity Bot <5581206bb7e0307f0d99eb71898ae6b694149ca5@ovi.com>
Reviewed-by: Casper van Donderen <808524cef5c654648bea2a2b954f3b3445ed083c@nokia.com>

--- tools/qdoc3/qmlvisitor.cpp
+++ tools/qdoc3/qmlvisitor.cpp
@@ -490,8 +490,14 @@
     lastEndOffset = fd->lastSourceLocation().end();
 }

+/*!
+  Begin the visit of the signal handler declaration \a sb, but only
+  if the nesting level is 1.
+ */
 bool QmlDocVisitor::visit(QDeclarativeJS::AST::UiScriptBinding* sb)
 {
+    if (nestingLevel > 1)
+        return true;
     if (current->type() == Node::Fake) {
         QString handler = sb->qualifiedId->name.toString();
         if (handler.length() > 2 && handler.startsWith("on") && handler.at(2).isUpper()) {


fixed #3019

fixed #3019

--- tools/rospack/rosstack.cpp
+++ tools/rospack/rosstack.cpp
@@ -434,6 +434,17 @@

 int ROSStack::cmd_depends_on(bool include_indirect)
 {
+  // We can't proceed if the argument-parsing logic wasn't able to provide
+  // any package name.  Note that we need to check for an empty opt_package
+  // here, but not in other places (e.g., cmd_deps()), because here we're
+  // catching the exception that get_pkg() throws when it can't find the
+  // package.  Elsewhere, we let that exception propagate up.
+  if(g_stack.size() == 0)
+  {
+    string errmsg = string("no stack name given, and current directory is not a stack root");
+    throw runtime_error(errmsg);
+  }
+
   // Explicitly crawl for stacks, to ensure that we get newly added
   // dependent stacks.  We also avoid the possibility of a recrawl
   // happening within the loop below, which could invalidate the stacks


BUG: The code for reading in non-uniform rectilinear grids was just wrong.

--- IO/vtkNetCDFCOARDSReader.cxx
+++ IO/vtkNetCDFCOARDSReader.cxx
@@ -155,7 +155,7 @@

 //=============================================================================
-vtkCxxRevisionMacro(vtkNetCDFCOARDSReader, "1.3");
+vtkCxxRevisionMacro(vtkNetCDFCOARDSReader, "1.4");
 vtkStandardNewMacro(vtkNetCDFCOARDSReader);

 //-----------------------------------------------------------------------------
@@ -335,25 +335,34 @@
     rectOutput->GetExtent(extent);

     int numDim = this->LoadingDimensions->GetNumberOfTuples();
-    for (int i = 0; i < numDim; i++)
-      {
-      // Remember that netCDF dimension ordering is backward from VTK.
-      int dim = this->LoadingDimensions->GetValue(numDim-i-1);
-      vtkSmartPointer<vtkDoubleArray> coords
-        = this->DimensionInfo[dim].GetCoordinates();
-      int extLow = extent[2*i];
-      int extHi = extent[2*i+1];
-      if ((extLow != 0) || (extHi != coords->GetNumberOfTuples()-1))
-        {
-        // Getting a subset of this dimension.
-        VTK_CREATE(vtkDoubleArray, newcoords);
-        newcoords->SetNumberOfComponents(1);
-        newcoords->SetNumberOfTuples(extHi-extLow+1);
-        memcpy(newcoords->GetPointer(0), coords->GetPointer(extLow),
-               (extHi-extLow+1)*sizeof(double));
-        coords = newcoords;
-        }
-      switch (dim)
+    for (int i = 0; i < 3; i++)
+      {
+      vtkSmartPointer<vtkDoubleArray> coords;
+      if (i < numDim)
+        {
+        // Remember that netCDF dimension ordering is backward from VTK.
+        int dim = this->LoadingDimensions->GetValue(numDim-i-1);
+        coords = this->DimensionInfo[dim].GetCoordinates();
+        int extLow = extent[2*i];
+        int extHi = extent[2*i+1];
+        if ((extLow != 0) || (extHi != coords->GetNumberOfTuples()-1))
+          {
+          // Getting a subset of this dimension.
+          VTK_CREATE(vtkDoubleArray, newcoords);
+          newcoords->SetNumberOfComponents(1);
+          newcoords->SetNumberOfTuples(extHi-extLow+1);
+          memcpy(newcoords->GetPointer(0), coords->GetPointer(extLow),
+                 (extHi-extLow+1)*sizeof(double));
+          coords = newcoords;
+          }
+        }
+      else
+        {
+        coords = vtkSmartPointer<vtkDoubleArray>::New();
+        coords->SetNumberOfTuples(1);
+        coords->SetComponent(0, 0, 0.0);
+        }
+      switch (i)
         {
         case 0: rectOutput->SetXCoordinates(coords);  break;
         case 1: rectOutput->SetYCoordinates(coords);  break;


comment out writing temp and temp2

 comment out writing temp and temp2

git-svn-id: 471e042b35a12bde91bbe895b1188443e6ce8888@241 fd2da0a4-d968-48df-9cb5-d8c496287cbf

--- ImageRegistration/itkANTSImageRegistrationOptimizer.cxx
+++ ImageRegistration/itkANTSImageRegistrationOptimizer.cxx
@@ -659,18 +659,18 @@
         if ( movingwarp)
 	          wfimage= this->WarpMultiTransform( this->m_SmoothFixedImages[metricCount], this->m_SmoothFixedImages[metricCount], NULL, movingwarp, false , this->m_FixedImageAffineTransform );
         else wfimage=this->SubsampleImage( this->m_SmoothFixedImages[metricCount] , this->m_ScaleFactor , this->m_SmoothFixedImages[metricCount]->GetOrigin() , this->m_SmoothFixedImages[metricCount]->GetDirection() ,  NULL);
-
+	/*
 	if (this->m_TimeVaryingVelocity && ! this->m_MaskImage ) {
 	  std::string outname=this->localANTSGetFilePrefix(this->m_OutputNamingConvention.c_str())+std::string("thick.nii.gz");
-	  WriteImage<ImageType>(wmimage,outname.c_str());
+	  ///	  WriteImage<ImageType>(wmimage,outname.c_str());
 	  outname=this->localANTSGetFilePrefix(this->m_OutputNamingConvention.c_str())+std::string("thick2.nii.gz");
 	  WriteImage<ImageType>(wfimage,outname.c_str());
 	}
-
-	  std::string outname=this->localANTSGetFilePrefix(this->m_OutputNamingConvention.c_str())+std::string("temp.nii.gz");
-	  WriteImage<ImageType>(wmimage,outname.c_str());
-	  std::string outname2=this->localANTSGetFilePrefix(this->m_OutputNamingConvention.c_str())+std::string("temp2.nii.gz");
-	  WriteImage<ImageType>(wfimage,outname2.c_str());
+	*/
+	//	  std::string outname=this->localANTSGetFilePrefix(this->m_OutputNamingConvention.c_str())+std::string("temp.nii.gz");
+	//	  WriteImage<ImageType>(wmimage,outname.c_str());
+	//	  std::string outname2=this->localANTSGetFilePrefix(this->m_OutputNamingConvention.c_str())+std::string("temp2.nii.gz");
+	//	  WriteImage<ImageType>(wfimage,outname2.c_str());

 /** MV Loop END -- Would have to collect update fields then add them
 * together somehow -- Would also have to eliminate the similarity


Remove XFAILs that was due to strict mode

In non-strict mode we can use with() and eval() again, and so these tests pass.

Change-Id: I66b16653a28b1d7e420e53c012d7908c8fc6c29a
Reviewed-by: Lars Knoll <a812617a4072dcbeb80684eca0f369f0083af109@digia.com>

--- tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -5744,7 +5744,6 @@
     QObject *o = component.create();
     QVERIFY(o != 0);

-    QEXPECT_FAIL("", "The eval statement works differently in strict mode", Abort);
     QCOMPARE(o->property("test1").toBool(), true);
     QCOMPARE(o->property("test2").toBool(), true);
     QCOMPARE(o->property("test3").toBool(), true);
@@ -6690,16 +6689,10 @@
 {
     {
         QUrl url = testFileUrl("withStatement.1.qml");
-        QString warning = url.toString() + ":12:1: 'with' statement is not allowed in strict mode";
-        QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
-        warning = url.toString() + ":12:12: Unable to assign [undefined] to int";
-        QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData());
-
         QQmlComponent component(&engine, url);
         MyQmlObject *object = qobject_cast<MyQmlObject *>(component.create());
         QVERIFY(object != 0);

-        QEXPECT_FAIL("", "The with statement is not allowed in strict mode", Abort);
         QCOMPARE(object->value(), 123);
     }
 }


Loading JASP files with RM Anova do not remove columns in Available Variables list when used in Repeated Measures Cells (#4166)

Fixes jasp-stats/jasp-test-release#858

--- JASP-Desktop/widgets/listmodelmeasurescellsassigned.cpp
+++ JASP-Desktop/widgets/listmodelmeasurescellsassigned.cpp
@@ -49,6 +49,9 @@
 		_terms = variables;

 	_fitTermsWithLevels();
+
+	if (source() != nullptr)
+		source()->removeTermsInAssignedList();

 	endResetModel();
 }


Fix listview highlight tests.

Fix listview highlight tests.

--- tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp
+++ tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp
@@ -291,6 +291,7 @@
     QMetaObject::invokeMethod(canvas->root(), "checkProperties");
     QVERIFY(testObject->error() == false);

+    QVERIFY(listview->highlightItem() != 0);
     QCOMPARE(listview->count(), model.count());
     QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item

@@ -315,6 +316,7 @@
     testObject->setInvalidHighlight(true);
     QMetaObject::invokeMethod(canvas->root(), "checkProperties");
     QVERIFY(testObject->error() == false);
+    QVERIFY(listview->highlightItem() == 0);

     // set an empty model and confirm that items are destroyed
     T model2;
@@ -1006,7 +1008,7 @@
     QVERIFY(viewport != 0);
     QVERIFY(listview->delegate() != 0);
     QVERIFY(listview->model() != 0);
-    QVERIFY(listview->highlight() == 0);
+    QVERIFY(listview->highlight() != 0);

     // Confirm items positioned correctly
     int itemCount = findItems<QmlGraphicsItem>(viewport, "wrapper").count();


Add deleteLater() test to tst_qmediaplayerbackend

Task-number: QTBUG-24927
Change-Id: Ic58a33aad9038af0325d20bed16d3e70d7e15b5a
Reviewed-by: Jason McDonald <40c1146f72b16acca7bc08c70880d435c5d12691@nokia.com>
Reviewed-by: Michael Goddard <3ec82c9d770214b86c58e0ffe200ac64c3ff8da3@nokia.com>

--- tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
+++ tests/auto/integration/qmediaplayerbackend/tst_qmediaplayerbackend.cpp
@@ -73,6 +73,7 @@
     void unloadMedia();
     void playPauseStop();
     void processEOS();
+    void deleteLaterAtEOS();
     void volumeAndMuted();
     void volumeAcrossFiles_data();
     void volumeAcrossFiles();
@@ -377,6 +378,57 @@
     QCOMPARE(stateSpy.count(), 0);
     QTRY_VERIFY(statusSpy.count() > 0 &&
         statusSpy.last()[0].value<QMediaPlayer::MediaStatus>() == QMediaPlayer::LoadedMedia);
+}
+
+// Helper class for tst_QMediaPlayerBackend::deleteLaterAtEOS()
+class DeleteLaterAtEos : public QObject
+{
+    Q_OBJECT
+public:
+    DeleteLaterAtEos(QMediaPlayer* p) : player(p)
+    {
+    }
+
+public slots:
+    void play()
+    {
+        QVERIFY(connect(player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),
+                        this,   SLOT(onMediaStatusChanged(QMediaPlayer::MediaStatus))));
+        player->play();
+    }
+
+private slots:
+    void onMediaStatusChanged(QMediaPlayer::MediaStatus status)
+    {
+        if (status == QMediaPlayer::EndOfMedia) {
+            player-> deleteLater();
+            player = 0;
+        }
+    }
+
+private:
+    QMediaPlayer* player;
+};
+
+// Regression test for
+// QTBUG-24927 - deleteLater() called to QMediaPlayer from its signal handler does not work as expected
+void tst_QMediaPlayerBackend::deleteLaterAtEOS()
+{
+    QPointer<QMediaPlayer> player(new QMediaPlayer);
+    DeleteLaterAtEos deleter(player);
+    player->setMedia(localWavFile);
+
+    // Create an event loop for verifying deleteLater behavior instead of using
+    // QTRY_VERIFY or QTest::qWait. QTest::qWait makes extra effort to process
+    // DeferredDelete events during the wait, which interferes with this test.
+    QEventLoop loop;
+    QTimer::singleShot(0, &deleter, SLOT(play()));
+    QTimer::singleShot(5000, &loop, SLOT(quit()));
+    connect(player.data(), SIGNAL(destroyed()), &loop, SLOT(quit()));
+    loop.exec();
+    // Verify that the player was destroyed within the event loop.
+    // This check will fail without the fix for QTBUG-24927.
+    QVERIFY(player.isNull());
 }

 void tst_QMediaPlayerBackend::volumeAndMuted()


disable send() retry loop for bluesim read responses (want to see if/when this is really needed)

--- cpp/BsimCtrl.cxx
+++ cpp/BsimCtrl.cxx
@@ -46,8 +46,6 @@
 static int sockfd;
 static struct memresponse respitem;
 static int cleanedup;
-#define MAX_PATH_LENGTH 100
-static char path[MAX_PATH_LENGTH];

 extern "C" {
   void initPortal(unsigned long id){
@@ -72,8 +70,7 @@
 		  head.req.portal, rr, head.req.write_flag, (long)head.req.addr, head.req.data);
           if (!cleanedup && head.req.portal) {
                cleanedup = 1;
-               snprintf(path, sizeof(path), "fpga0_rc", 0);
-               remove(path);
+               remove("fpga0_rc");
                remove("fd_sock_wc");
           }
 	}
@@ -97,7 +94,7 @@
     //fprintf(stderr, "readData()\n");
     respitem.data = x;
     head.valid = 0;
-    int send_attempts = 0;
+    int send_attempts = 666;
     while(send(sockfd, &respitem, sizeof(respitem), 0) == -1){
       if(send_attempts++ > 16){
 	fprintf(stderr, "(%d) send failure\n", respitem.portal);


PROTON-2396: Use random_device for seed initialization in uuid.cpp

Closes #340

--- cpp/src/uuid.cpp
+++ cpp/src/uuid.cpp
@@ -22,10 +22,15 @@
 #include "proton/uuid.hpp"
 #include "proton/types_fwd.hpp"

+#include <algorithm>
+#include <chrono>
+#include <climits>
 #include <cstdlib>
 #include <ctime>
+#include <functional>
+#include <iomanip>
+#include <random>
 #include <sstream>
-#include <iomanip>

 #if defined(_WIN32)
 #include <process.h>
@@ -39,19 +44,19 @@

 namespace {

+thread_local std::independent_bits_engine<std::mt19937, CHAR_BIT, unsigned int> engine = [] {
+  // A hash of time, PID and random_device to produce an unsigned integer
+  // for seeding the engine.
+  std::seed_seq seq{
+      (unsigned long)std::chrono::system_clock::now().time_since_epoch().count(),
+      (unsigned long)GETPID(),
+      (unsigned long)std::random_device{}()};

-// Seed the random number generated once at startup.
-struct seed {
-    seed() {
-        // A hash of time and PID, time alone is a bad seed as programs started
-        // within the same second will get the same seed.
-        unsigned long secs = time(0);
-        unsigned long pid = GETPID();
-        std::srand(((secs*181)*((pid-83)*359))%104729);
-    }
-} seed_;
+  return
+      std::independent_bits_engine<std::mt19937, CHAR_BIT, unsigned int>(seq);
+}();

-}
+} // namespace

 uuid uuid::copy() {
     uuid u;
@@ -70,12 +75,7 @@

 uuid uuid::random() {
     uuid bytes;
-    int r = std::rand();
-    for (size_t i = 0; i < bytes.size(); ++i ) {
-        bytes[i] = r & 0xFF;
-        r >>= 8;
-        if (!r) r = std::rand();
-    }
+    std::generate(bytes.begin(), bytes.end(), std::ref(engine));

     // From RFC4122, the version bits are set to 0100
     bytes[6] = (bytes[6] & 0x0F) | 0x40;


cql3: Cleanup code formatting

cql3: Cleanup code formatting

--- cql3/relation.hh
+++ cql3/relation.hh
@@ -106,8 +106,7 @@
      * @return true if the operator of this relation is a Slice, false otherwise.
      */
     virtual bool is_slice() final {
-        return _relation_type == operator_type::
-        GT
+        return _relation_type == operator_type::GT
                 || _relation_type == operator_type::GTE
                 || _relation_type == operator_type::LTE
                 || _relation_type ==


Get this to compile with GCC 3.3. Now, all of vrkit can be compiled with
that compiler.

Submitted by: Carsten Neumann

--- src/plugins/GrabPlugin/isect/RayIntersection/RayIntersectionStrategy.cpp
+++ src/plugins/GrabPlugin/isect/RayIntersection/RayIntersectionStrategy.cpp
@@ -350,8 +350,9 @@
    OSG::Pnt3f vol_min, vol_max;
    root->getVolume().getBounds(vol_min, vol_max);

-   gmtl::AABoxf bbox(gmtl::Point3f(vol_min[0], vol_min[1], vol_min[2]),
-                     gmtl::Point3f(vol_max[0], vol_max[1], vol_max[2]));
+   gmtl::AABoxf bbox;
+   bbox.setMin(gmtl::Point3f(vol_min[0], vol_min[1], vol_min[2]));
+   bbox.setMax(gmtl::Point3f(vol_max[0], vol_max[1], vol_max[2]));
    unsigned int num_hits;
    float enter_val, exit_val;


Fixes for coverity 13053

Fixes for coverity 13053

--- ITS/AliITSDCSAnalyzerSDD.cxx
+++ ITS/AliITSDCSAnalyzerSDD.cxx
@@ -93,7 +93,7 @@
    Float_t lastMVValLower;
                         // Thresholds for float DCS variables

-   Int_t nEntries;      // Number of entries in each TObjArray, that contains DCS variable values
+   Int_t nEntries=0;      // Number of entries in each TObjArray, that contains DCS variable values
    AliDCSValue *valToProcess;
                         // Pointer to currently processed DCS variable value
    Float_t valToProcessFloat;


Fixed usage of bc7enc.

Fixed usage of bc7enc.

Properly initialize the parameters. Since updating many new parameters were
added, so now call bc7enc_compress_block_params_init() to ensure they're
initialized.

Only call initialize for bc7e and bc7enc once during program execution.

--- lib/src/S3tcConverter.cpp
+++ lib/src/S3tcConverter.cpp
@@ -33,6 +33,7 @@
 #else
 #include "bc7enc.h"
 #endif
+
 #include "cmp_core.h"
 #include "rgbcx.h"
 #include "squish.h"
@@ -118,11 +119,36 @@
 	}
 }

-#if !CUTTLEFISH_ISPC
+#if CUTTLEFISH_ISPC
+static bool initializeBc7eImpl()
+{
+	ispc::bc7e_compress_block_init();
+	return true;
+}
+
+static void initializeBc7e()
+{
+	static bool initialized = initializeBc7eImpl();
+	CUTTLEFISH_UNUSED(initialized);
+}
+#else
+static bool initializeBc7encImpl()
+{
+	bc7enc_compress_block_init();
+	return true;
+}
+
+static void initializeBc7enc()
+{
+	static bool initialized = initializeBc7encImpl();
+	CUTTLEFISH_UNUSED(initialized);
+}
+
 static bc7enc_compress_block_params createBc7BlockParams(const S3tcConverter& converter)
 {
 	bc7enc_compress_block_params params;

+	bc7enc_compress_block_params_init(&params);
 	switch (converter.quality())
 	{
 		case Texture::Quality::Lowest:
@@ -536,7 +562,7 @@
 	: S3tcConverter(texture, image, 16, quality), m_params(nullptr)
 {
 #if CUTTLEFISH_ISPC
-	ispc::bc7e_compress_block_init();
+	initializeBc7e();
 	m_params = new ispc::bc7e_compress_block_params;
 	bool perceptual = image.colorSpace() == ColorSpace::sRGB;
 	switch (quality)
@@ -561,7 +587,7 @@
 			break;
 	}
 #else
-	bc7enc_compress_block_init();
+	initializeBc7enc();
 	m_params = new bc7enc_compress_block_params(createBc7BlockParams(*this));
 #endif
 }
@@ -583,7 +609,7 @@
 	// NOTE: would be slightly more optimal to create this ahead of time, but can't forward
 	// declare the type due to how it's declared in bc7enc. The overhead of this is expected
 	// to be very small.
-	bc7enc_compress_block(block, &colorBlock, m_params);
+	bc7enc_compress_block(block, colorBlock, m_params);
 #endif
 }


Fix static initialization issue in the Source class

--- lib/src/models/source.cpp
+++ lib/src/models/source.cpp
@@ -10,14 +10,17 @@
 #include "functions.h"

-#if defined NIGHTLY || defined QT_DEBUG
-	const QString updaterBaseUrl = "https://raw.githubusercontent.com/Bionus/imgbrd-grabber/develop/release/sites";
-#else
-	const QString updaterBaseUrl = "https://raw.githubusercontent.com/Bionus/imgbrd-grabber/master/release/sites";
-#endif
+QString getUpdaterBaseUrl()
+{
+	#if defined NIGHTLY || defined QT_DEBUG
+		return QStringLiteral("https://raw.githubusercontent.com/Bionus/imgbrd-grabber/develop/release/sites");
+	#else
+		return QStringLiteral("https://raw.githubusercontent.com/Bionus/imgbrd-grabber/master/release/sites");
+	#endif
+}

 Source::Source(Profile *profile, QString dir)
-	: m_dir(dir), m_name(QFileInfo(dir).fileName()), m_profile(profile), m_updater(m_name, m_dir, updaterBaseUrl)
+	: m_dir(dir), m_name(QFileInfo(dir).fileName()), m_profile(profile), m_updater(m_name, m_dir, getUpdaterBaseUrl())
 {
 	// Load XML details for this source from its model file
 	QFile file(m_dir + "/model.xml");


Fixed last commit.

Fixed last commit.

--- ImageProcessing/pixelize.cpp
+++ ImageProcessing/pixelize.cpp
@@ -2185,10 +2185,10 @@
     long jmax = (long)(ymax);

     for(size_t j = jmin ; j <= jmax ; ++j ){
-      double area1 = MIN(ymax,j+1) -  MIN(ymin,j);
+      double area1 = MIN(ymax,j+1) -  MAX(ymin,j);
       if(area1 <= 0.0) continue;
       for(size_t i = imin ; i <= imax ; ++i ){
-        double area = (MIN(xmax,i+1) -  MIN(xmin,i)) * area1 ;
+        double area = (MIN(xmax,i+1) -  MAX(xmin,i)) * area1 ;
         map[ii] += pmap.map[i + NNx*j]*area/res_ratio2;
       }
     }


Neo4j List Query Parameter Test Added

Neo4j List Query Parameter Test Added

--- aossl/neo4j/neo4j_test.cpp
+++ aossl/neo4j/neo4j_test.cpp
@@ -425,6 +425,60 @@
   return 0;
 }

+int int_list_parameter_test() {
+  std::cout << "Running Integer List Parameter Test" << std::endl;
+  // Setup the query
+  std::string query = \
+    "CREATE (you:Person {name:'GummyBear', list: {list_vals}}) RETURN you";
+  std::unordered_map<std::string, Neo4jQueryParameterInterface*> query_params;
+  Neo4jQueryParameterInterface* list_vals_parameter = \
+    neo4j_factory->get_neo4j_query_parameter();
+  list_vals_parameter->add_value(1);
+  list_vals_parameter->add_value(2);
+  list_vals_parameter->add_value(3);
+  query_params.emplace("list_vals", list_vals_parameter);
+
+  // Execute the query
+  ResultsIteratorInterface *results = NULL;
+  results = neo->execute(query, query_params);
+  if (!results) return -1;
+
+  // Access the results
+  ResultTreeInterface* result = results->next();
+  if (!result) return -1;
+  DbObjectInterface* obj = result->get(0);
+  std::string result_string = obj->to_string();
+  std::cout << result_string << std::endl;
+
+  assert(obj->is_node());
+
+  // Labels
+  DbListInterface* label_list = obj->labels();
+  assert(label_list->get_string_element(0) == "Person");
+
+  // Properties
+  DbMapInterface* map = obj->properties();
+  std::cout << map->to_string() << std::endl;
+
+  assert(map->element_exists("name"));
+  assert(map->get_string_element("name") == "GummyBear");
+  assert(map->element_exists("list"));
+
+  DbListInterface *list_prop = map->get_list_element("list");
+  assert(list_prop->size() == 3);
+  assert(list_prop->get_int_element(0) == 1);
+  assert(list_prop->get_int_element(1) == 2);
+  assert(list_prop->get_int_element(2) == 3);
+
+  delete list_prop;
+  delete map;
+  delete label_list;
+  delete obj;
+  delete result;
+  delete results;
+  return 0;
+}
+
 int run_tests() {
   if (hello_world_test() != 0) return -1;
   if (creation_test() != 0) return -1;


bug fix

bug fix

--- HLT/TPCLib/comp/AliHLTTPCDataCompressionComponent.cxx
+++ HLT/TPCLib/comp/AliHLTTPCDataCompressionComponent.cxx
@@ -349,8 +349,7 @@
   // loop over raw cluster blocks, assign to tracks and write
   // unassigned clusters
   for (pDesc=GetFirstInputBlock(AliHLTTPCDefinitions::fgkRawClustersDataType);
-       pDesc!=NULL; pDesc=GetNextInputBlock()) {
-    if (pDesc->fSize<=sizeof(AliRawDataHeader)) continue;
+       pDesc!=NULL; pDesc=GetNextInputBlock()) {
     if (GetBenchmarkInstance()) {
       GetBenchmarkInstance()->Start(1);
       GetBenchmarkInstance()->AddInput(pDesc->fSize);


ndb -   Make StartREDO come up as default in cluster log

--- ndb/src/common/debugger/EventLogger.cpp
+++ ndb/src/common/debugger/EventLogger.cpp
@@ -836,7 +836,7 @@
   ROW(NDBStopCompleted,        LogLevel::llStartUp,     1, Logger::LL_INFO ),
   ROW(NDBStopForced,           LogLevel::llStartUp,     1, Logger::LL_ALERT ),
   ROW(NDBStopAborted,          LogLevel::llStartUp,     1, Logger::LL_INFO ),
-  ROW(StartREDOLog,            LogLevel::llStartUp,    10, Logger::LL_INFO ),
+  ROW(StartREDOLog,            LogLevel::llStartUp,     4, Logger::LL_INFO ),
   ROW(StartLog,                LogLevel::llStartUp,    10, Logger::LL_INFO ),
   ROW(UNDORecordsExecuted,     LogLevel::llStartUp,    15, Logger::LL_INFO ),
   ROW(StartReport,             LogLevel::llStartUp,     4, Logger::LL_INFO ),


Add loaded zones logging.

Add loaded zones logging.

--- utils/dls2sf/src/dls2sf.cpp
+++ utils/dls2sf/src/dls2sf.cpp
@@ -147,7 +147,7 @@
             std::vector<SFPresetZone>{
             SFPresetZone(instrument)
         }));
-        std::cout << "Done.\n";
+        std::cout << "Done: " << zones.size() << " zones loaded.\n";
     }
     std::cout << instruments.size() << " instruments converted.\n";


Skip CNAME lookup if resolver_ is NULL in the Negotiate handler.

This is a bit of a bad solution, I want to get the quick fix in first.

BUG=56819
TEST=net_unittests
Review URL: http://codereview.chromium.org/3455023

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

--- net/http/http_auth_handler_negotiate.cc
+++ net/http/http_auth_handler_negotiate.cc
@@ -211,7 +211,7 @@

 int HttpAuthHandlerNegotiate::DoResolveCanonicalName() {
   next_state_ = STATE_RESOLVE_CANONICAL_NAME_COMPLETE;
-  if (disable_cname_lookup_)
+  if (disable_cname_lookup_ || !resolver_)
     return OK;

   // TODO(cbentzel): Add reverse DNS lookup for numeric addresses.


Current world position re-calculated before updating status bar

Signed-off-by: Miklos Espak <1f23f8cb8ef21e3878b3aceb94f79bc0b720967c@ucl.ac.uk>

--- Modules/Core/src/Interactions/mitkDisplayInteractor.cpp
+++ Modules/Core/src/Interactions/mitkDisplayInteractor.cpp
@@ -715,7 +715,13 @@

   mitk::DataStorage::SetOfObjects::ConstPointer nodes =
     posEvent->GetSender()->GetDataStorage()->GetSubset(isImageData).GetPointer();
-  mitk::Point3D worldposition = posEvent->GetPositionInWorld();
+
+  /// Although you could call 'posEvent->GetPositionInWorld()', that would return the world
+  /// position at the time of initiating the interaction. However, we need to update the
+  /// status bar with the position *after* changing slice. Therefore, we translate the same
+  /// display position with the renderer again to get the new world position.
+  Point3D worldposition;
+  event->GetSender()->DisplayToWorld(posEvent->GetPointerPositionOnScreen(), worldposition);

   mitk::Image::Pointer image3D;
   mitk::DataNode::Pointer node;


Linux: avoid using a NULL MessageLoopForIO to get its MessageLoopProxy in ProxySettingGetterImplKDE.
BUG=130761

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

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

--- net/proxy/proxy_config_service_linux.cc
+++ net/proxy/proxy_config_service_linux.cc
@@ -1032,7 +1032,7 @@
   }

   virtual base::SingleThreadTaskRunner* GetNotificationTaskRunner() OVERRIDE {
-    return file_loop_->message_loop_proxy();
+    return file_loop_ ? file_loop_->message_loop_proxy() : NULL;
   }

   // Implement base::MessagePumpLibevent::Watcher.


Correctly update gconf proxy settings on Linux.
BUG=19229
TEST=set gnome proxy settings, start chromium, change proxy settings, change proxy settings *back*, see that they correctly update in chromium

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

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

--- net/proxy/proxy_config_service_linux.cc
+++ net/proxy/proxy_config_service_linux.cc
@@ -512,7 +512,7 @@
   glib_default_loop_ = glib_default_loop;
   io_loop_ = io_loop;

-  // If we are passed a NULL io_loop, then we don't setup gconf
+  // If we are passed a NULL io_loop, then we don't set up gconf
   // notifications. This should not be the usual case but is intended
   // to simplify test setups.
   if (!io_loop_)
@@ -612,6 +612,8 @@
             this,
             &ProxyConfigServiceLinux::Delegate::SetNewProxyConfig,
             new_config));
+    // Update the thread-private copy in |reference_config_| as well.
+    reference_config_ = new_config;
   }
 }


Linux: correctly ignore KDE "indirect" environment variable proxy settings when they are unset
BUG=41095
TEST=configure KDE to use proxy settings from unset environment variables, it should not try to use the variable names as proxies
Review URL: http://codereview.chromium.org/1518036

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

Former-commit-id: 3a5c4d6c4c91b3381a3d55c78c6ebd6b6ed7dbb8

--- net/proxy/proxy_config_service_linux.cc
+++ net/proxy/proxy_config_service_linux.cc
@@ -652,6 +652,8 @@
       char* value = getenv(it->second.c_str());
       if (value)
         it->second = value;
+      else
+        string_table_.erase(it);
     }
   }


net: add code for encrypting DNS cert check uploads.

(This code isn't live yet.)

BUG=none
TEST=none

http://codereview.chromium.org/4698003

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

Former-commit-id: 68f91cc15593173fa9e5fe02ff5a2acd58378cd5

--- net/socket/dns_cert_provenance_check.cc
+++ net/socket/dns_cert_provenance_check.cc
@@ -5,21 +5,39 @@
 #include "net/socket/dns_cert_provenance_check.h"

 #include <nspr.h>
+
 #include <hasht.h>
+#include <keyhi.h>
+#include <pk11pub.h>
 #include <sechash.h>

 #include <string>

+#include "base/crypto/encryptor.h"
+#include "base/crypto/symmetric_key.h"
 #include "base/non_thread_safe.h"
+#include "base/pickle.h"
 #include "net/base/completion_callback.h"
 #include "net/base/dns_util.h"
 #include "net/base/dnsrr_resolver.h"
+#include "net/base/net_errors.h"
 #include "net/base/net_log.h"
-#include "net/base/net_errors.h"

 namespace net {

 namespace {
+
+// A DER encoded SubjectPublicKeyInfo structure containing the server's public
+// key.
+const uint8 kServerPublicKey[] = {
+  0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01,
+  0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00,
+  0x04, 0xc7, 0xea, 0x88, 0x60, 0x52, 0xe3, 0xa3, 0x3e, 0x39, 0x92, 0x0f, 0xa4,
+  0x3d, 0xba, 0xd8, 0x02, 0x2d, 0x06, 0x4d, 0x64, 0x98, 0x66, 0xb4, 0x82, 0xf0,
+  0x23, 0xa6, 0xd8, 0x37, 0x55, 0x7c, 0x01, 0xbf, 0x18, 0xd8, 0x16, 0x9e, 0x66,
+  0xdc, 0x49, 0xbf, 0x2e, 0x86, 0xe3, 0x99, 0xbd, 0xb3, 0x75, 0x25, 0x61, 0x04,
+  0x6c, 0x2e, 0xfb, 0x32, 0x42, 0x27, 0xe4, 0x23, 0xea, 0xcd, 0x81, 0x62, 0xc1,
+};

 class DNSCertProvenanceChecker : public NonThreadSafe {
  public:
@@ -77,6 +95,7 @@
       LOG(ERROR) << "FAILED"
                  << " hostname:" << hostname_
                  << " domain:" << domain_;
+      BuildRecord();
     } else if (status == OK) {
       LOG(ERROR) << "GOOD"
                  << " hostname:" << hostname_
@@ -86,6 +105,123 @@
     }

     delete this;
+  }
+
+  // BuildRecord encrypts the certificate chain to a fixed public key and
+  // returns the encrypted blob. Since this code is reporting a possible HTTPS
+  // failure, it would seem silly to use HTTPS to protect the uploaded report.
+  std::string BuildRecord() {
+    static const int kVersion = 0;
+    static const unsigned kKeySizeInBytes = 16;  // AES-128
+    static const unsigned kIVSizeInBytes = 16;  // AES's block size
+    static const unsigned kPadSize = 4096; // we pad up to 4KB,
+    // This is a DER encoded, ANSI X9.62 CurveParams object which simply
+    // specifies P256.
+    static const uint8 kANSIX962CurveParams[] = {
+      0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07
+    };
+
+    DCHECK(CalledOnValidThread());
+
+    Pickle p;
+    p.WriteString(hostname_);
+    p.WriteInt(der_certs_.size());
+    for (std::vector<std::string>::const_iterator
+         i = der_certs_.begin(); i != der_certs_.end(); i++) {
+      p.WriteString(*i);
+    }
+    // We pad to eliminate the possibility that someone could see the size of
+    // an upload and use that information to reduce the anonymity set of the
+    // certificate chain.
+    // The "2*sizeof(uint32)" here covers the padding length which we add next
+    // and Pickle's internal length which it includes at the beginning of the
+    // data.
+    unsigned pad_bytes = kPadSize - ((p.size() + 2*sizeof(uint32)) % kPadSize);
+    p.WriteUInt32(pad_bytes);
+    char* padding = new char[pad_bytes];
+    memset(padding, 0, pad_bytes);
+    p.WriteData(padding, pad_bytes);
+    delete[] padding;
+
+    // We generate a random public value and perform a DH key agreement with
+    // the server's fixed value.
+    SECKEYPublicKey* pub_key = NULL;
+    SECKEYPrivateKey* priv_key = NULL;
+    SECItem ec_der_params;
+    memset(&ec_der_params, 0, sizeof(ec_der_params));
+    ec_der_params.data = const_cast<uint8*>(kANSIX962CurveParams);
+    ec_der_params.len = sizeof(kANSIX962CurveParams);
+    priv_key = SECKEY_CreateECPrivateKey(&ec_der_params, &pub_key, NULL);
+    SECKEYPublicKey* server_pub_key = GetServerPubKey();
+
+    // This extracts the big-endian, x value of the shared point.
+    // The values of the arguments match ssl3_SendECDHClientKeyExchange in NSS
+    // 3.12.8's lib/ssl/ssl3ecc.c
+    PK11SymKey* pms = PK11_PubDeriveWithKDF(
+        priv_key, server_pub_key, PR_FALSE /* is sender */,
+        NULL /* random a */, NULL /* random b */, CKM_ECDH1_DERIVE,
+        CKM_TLS_MASTER_KEY_DERIVE_DH, CKA_DERIVE, 0 /* key size */,
+        CKD_NULL /* KDF */, NULL /* shared data */, NULL /* wincx */);
+    SECKEY_DestroyPublicKey(server_pub_key);
+    SECStatus rv = PK11_ExtractKeyValue(pms);
+    DCHECK_EQ(SECSuccess, rv);
+    SECItem* x_data = PK11_GetKeyData(pms);
+
+    // The key and IV are 128-bits and generated from a SHA256 hash of the x
+    // value.
+    char key_data[SHA256_LENGTH];
+    HASH_HashBuf(HASH_AlgSHA256, reinterpret_cast<uint8*>(key_data),
+                 x_data->data, x_data->len);
+    PK11_FreeSymKey(pms);
+
+    DCHECK_GE(sizeof(key_data), kKeySizeInBytes + kIVSizeInBytes);
+    std::string raw_key(key_data, kKeySizeInBytes);
+
+    scoped_ptr<base::SymmetricKey> symkey(
+        base::SymmetricKey::Import(base::SymmetricKey::AES, raw_key));
+    std::string iv(key_data + kKeySizeInBytes, kIVSizeInBytes);
+
+    base::Encryptor encryptor;
+    bool r = encryptor.Init(symkey.get(), base::Encryptor::CBC, iv);
+    CHECK(r);
+
+    std::string plaintext(reinterpret_cast<const char*>(p.data()), p.size());
+    std::string ciphertext;
+    encryptor.Encrypt(plaintext, &ciphertext);
+
+    // We use another Pickle object to serialise the 'outer' wrapping of the
+    // plaintext.
+    Pickle outer;
+    outer.WriteInt(kVersion);
+
+    SECItem* pub_key_serialized = SECKEY_EncodeDERSubjectPublicKeyInfo(pub_key);
+    outer.WriteString(
+        std::string(reinterpret_cast<char*>(pub_key_serialized->data),
+                    pub_key_serialized->len));
+    SECITEM_FreeItem(pub_key_serialized, PR_TRUE);
+
+    outer.WriteString(ciphertext);
+
+    SECKEY_DestroyPublicKey(pub_key);
+    SECKEY_DestroyPrivateKey(priv_key);
+
+    return std::string(reinterpret_cast<const char*>(outer.data()),
+                       outer.size());
+  }
+
+  SECKEYPublicKey* GetServerPubKey() {
+    DCHECK(CalledOnValidThread());
+
+    SECItem der;
+    memset(&der, 0, sizeof(der));
+    der.data = const_cast<uint8*>(kServerPublicKey);
+    der.len = sizeof(kServerPublicKey);
+
+    CERTSubjectPublicKeyInfo* spki = SECKEY_DecodeDERSubjectPublicKeyInfo(&der);
+    SECKEYPublicKey* public_key = SECKEY_ExtractPublicKey(spki);
+    SECKEY_DestroySubjectPublicKeyInfo(spki);
+
+    return public_key;
   }

   const std::string hostname_;


This fix is only needed because ALICE uses too old compilers!

No logical reason behind, just adapting to ancient compiler.

--- PWG/EMCAL/EMCALtrigger/AliEmcalTriggerSelectionCuts.cxx
+++ PWG/EMCAL/EMCALtrigger/AliEmcalTriggerSelectionCuts.cxx
@@ -26,7 +26,7 @@
  ************************************************************************************/
 #include <iostream>
 #include <string>
-#include <unordered_map>
+#include <map>
 #include "AliEmcalTriggerSelectionCuts.h"
 #include "AliEMCALTriggerPatchInfo.h"

@@ -109,17 +109,17 @@
 }

 void AliEmcalTriggerSelectionCuts::PrintStream(std::ostream &stream) const {
-  std::unordered_map<AcceptanceType_t, std::string> acceptancetext = {{kEMCALAcceptance, "EMCAL"},
+  std::map<AcceptanceType_t, std::string> acceptancetext = {{kEMCALAcceptance, "EMCAL"},
                                                                       {kDCALAcceptance, "DCAL"},
                                                                       {kEMCALDCALAcceptance, "EMCAL-DCAL"}};
-  std::unordered_map<PatchType_t, std::string> patchtypetext = {{kL0Patch, "Level0"},
+  std::map<PatchType_t, std::string> patchtypetext = {{kL0Patch, "Level0"},
                                                                 {kL1GammaPatch, "L1-gamma"},
                                                                 {kL1GammaHighPatch, "L1-gamma, high threshold"},
                                                                 {kL1GammaLowPatch, "L1-gamma, low threshold"},
                                                                 {kL1JetPatch, "L1-jet"},
                                                                 {kL1JetHighPatch, "L1-jet, high threshold"},
                                                                 {kL1JetLowPatch, "L1-jet, low threshold"}};
-  std::unordered_map<SelectionMethod_t, std::string> selmodetext = {{kADC, "FastOR ADC"},
+  std::map<SelectionMethod_t, std::string> selmodetext = {{kADC, "FastOR ADC"},
                                                                     {kEnergyRough, "FastOR Energy"},
                                                                     {kEnergyOffline, "FEE Energy"},
                                                                     {kEnergyOfflineSmeared, "FEE Energy, decalibrated"}};


Lc->K0sp cut object updates

Lc->K0sp cut object updates

--- PWGHF/vertexingHF/macros/makeTFile4CutsLctoV0bachelor.C
+++ PWGHF/vertexingHF/macros/makeTFile4CutsLctoV0bachelor.C
@@ -25,13 +25,14 @@
   //default
   esdTrackCuts->SetRequireTPCRefit(kTRUE);
   esdTrackCuts->SetRequireITSRefit(kTRUE);
-  esdTrackCuts->SetMinNClustersITS(4); // default is 5
+  esdTrackCuts->SetMinNClustersITS(0);//(4); // default is 5
   esdTrackCuts->SetMinNClustersTPC(70);
-  esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
-					 AliESDtrackCuts::kAny);
+  //esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
+  //	 				   AliESDtrackCuts::kAny);
   // default is kBoth, otherwise kAny
   esdTrackCuts->SetMinDCAToVertexXY(0.);
   esdTrackCuts->SetPtRange(0.3,1.e10);
+  esdTrackCuts->SetAcceptKinkDaughters(kFALSE);

@@ -39,14 +40,15 @@
   esdTrackCutsV0daughters->SetRequireSigmaToVertex(kFALSE);
   //default
   esdTrackCutsV0daughters->SetRequireTPCRefit(kTRUE);
-  esdTrackCutsV0daughters->SetRequireITSRefit(kTRUE);
-  esdTrackCutsV0daughters->SetMinNClustersITS(4); // default is 5
+  esdTrackCutsV0daughters->SetRequireITSRefit(kFALSE);//kTRUE);
+  esdTrackCutsV0daughters->SetMinNClustersITS(0);//(4); // default is 5
   esdTrackCutsV0daughters->SetMinNClustersTPC(70);
-  esdTrackCutsV0daughters->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
-					      AliESDtrackCuts::kAny);
+  //esdTrackCutsV0daughters->SetClusterRequirementITS(AliESDtrackCuts::kSPD,
+  //	      				              AliESDtrackCuts::kAny);
   // default is kBoth, otherwise kAny
   esdTrackCutsV0daughters->SetMinDCAToVertexXY(0.);
   esdTrackCutsV0daughters->SetPtRange(0.,1.e10);
+  esdTrackCutsV0daughters->SetAcceptKinkDaughters(kFALSE);

@@ -64,8 +66,10 @@
   RDHFLctoV0Prod->AddTrackCutsV0daughters(esdTrackCutsV0daughters);
   RDHFLctoV0An->AddTrackCutsV0daughters(esdTrackCutsV0daughters);

-  RDHFLctoV0Prod->SetPidSelectionFlag(0); // TOF AND TPC
-  RDHFLctoV0An->SetPidSelectionFlag(0); // TOF AND TPC
+  RDHFLctoV0Prod->SetPidSelectionFlag(1); // 0 -> TOF AND TPC
+                                          // 1 -> if (TOF) TOF else TPC w veto
+  RDHFLctoV0An->SetPidSelectionFlag(1); // 0 -> TOF AND TPC
+                                        // 1 -> if (TOF) TOF else TPC w veto

   const Int_t nptbins=1;
   Float_t* ptbins;
@@ -122,7 +126,9 @@
   pidObjBachelor->SetTPC(kTRUE);
   pidObjBachelor->SetTOF(kTRUE);
   pidObjBachelor->SetTOFdecide(kFALSE);
+
   RDHFLctoV0An->SetPidHF(pidObjBachelor);
+  RDHFLctoV0Prod->SetPidHF(pidObjBachelor);

   //2. V0pos
   AliAODPidHF* pidObjV0pos = new AliAODPidHF();
@@ -133,7 +139,9 @@
   pidObjV0pos->SetTPC(kTRUE);
   pidObjV0pos->SetTOF(kTRUE);
   pidObjV0pos->SetTOFdecide(kFALSE);
+
   RDHFLctoV0An->SetPidV0pos(pidObjV0pos);
+  RDHFLctoV0Prod->SetPidV0pos(pidObjV0pos);

   //2. V0neg
   AliAODPidHF* pidObjV0neg = new AliAODPidHF();
@@ -144,7 +152,9 @@
   pidObjV0neg->SetTPC(kTRUE);
   pidObjV0neg->SetTOF(kTRUE);
   pidObjV0neg->SetTOFdecide(kFALSE);
+
   RDHFLctoV0An->SetPidV0neg(pidObjV0neg);
+  RDHFLctoV0Prod->SetPidV0neg(pidObjV0neg);

   // uncomment these lines for Baysian PID:
@@ -163,6 +173,7 @@

   Bool_t pidflag=kTRUE;
   RDHFLctoV0An->SetUsePID(pidflag);
+  RDHFLctoV0Prod->SetUsePID(kFALSE);
   if(pidflag) cout<<"PID is used"<<endl;
   else cout<<"PID is not used"<<endl;

@@ -170,7 +181,7 @@
   RDHFLctoV0Prod->PrintAll();
   cout<<"This is the object I'm going to save:"<<endl;
   RDHFLctoV0An->PrintAll();
-  TFile* fout=new TFile("LctoV0bachelorCuts.root","RECREATE");
+  TFile* fout=new TFile("Lc2pK0SCuts.root","RECREATE");
   fout->cd();
   RDHFLctoV0Prod->Write();
   RDHFLctoV0An->Write();
@@ -224,7 +235,8 @@

   RDHFLctoV0->AddTrackCutsV0daughters(esdTrackCutsV0daughters);

-  RDHFLctoV0->SetPidSelectionFlag(0); // TOF AND TPC
+  RDHFLctoV0->SetPidSelectionFlag(1); // 0 -> TOF AND TPC
+                                      // 1 -> if (TOF) TOF else TPC w veto

   const Int_t nvars=9;


Reducing train output size

Reducing train output size

--- PWGJE/FlavourJetTasks/AliAnalysisTaskHFSubstructure.cxx
+++ PWGJE/FlavourJetTasks/AliAnalysisTaskHFSubstructure.cxx
@@ -1021,6 +1021,7 @@
 	Bool_t Is_Unmatched_D=kFALSE;
 	Int_t D_Meson_Matched_Index=-1;
 	if (TMath::Abs(Inclusive_Jets_Truth[i_Jet_Truth].pseudorapidity()) > 0.9-fJetRadius) continue;
+	if (Inclusive_Jets_Truth[i_Jet_Truth].perp()<fJetMinPt) continue;
 	std::vector<fastjet::PseudoJet> Constituents_Truth(fFastJetWrapper_Truth->GetJetConstituents(i_Jet_Truth));
 	for (UInt_t i_Constituents_Truth = 0; i_Constituents_Truth < Constituents_Truth.size(); i_Constituents_Truth++) {
 	  for (UInt_t i_Unmacthed_D=0; i_Unmacthed_D<Unmatched_Truth_Level_D.size(); i_Unmacthed_D++){


Try uncommenting these now, I don't think the FIXME holds any more

Change-Id: Idded90eaa68481dbb9b4045ff62a54e13c7baa31


-Typo: falback -> fallback

-Typo: falback -> fallback

Change-Id: Ic6ad17315d0d4566971f006e3a8736e1608eb934


INTEGRATION: CWS ooo19126 (1.3.246); FILE MERGED 2005/09/05 14:44:39 rt 1.3.246.1: #i54170# Change license header: remove SISSL

--- vcl/source/app/unohelp2.cxx
+++ vcl/source/app/unohelp2.cxx
@@ -1,61 +1,35 @@
 /*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
  *
  *  $RCSfile: unohelp2.cxx,v $
  *
- *  $Revision: 1.3 $
+ *  $Revision: 1.4 $
  *
- *  last change: $Author: rt $ $Date: 2005-02-01 08:37:40 $
+ *  last change: $Author: rt $ $Date: 2005-09-09 11:44:18 $
  *
- *  The Contents of this file are made available subject to the terms of
- *  either of the following licenses
- *
- *         - GNU Lesser General Public License Version 2.1
- *         - Sun Industry Standards Source License Version 1.1
- *
- *  Sun Microsystems Inc., October, 2000
- *
- *  GNU Lesser General Public License Version 2.1
- *  =============================================
- *  Copyright 2000 by Sun Microsystems, Inc.
- *  901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License version 2.1, as published by the Free Software Foundation.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *  MA  02111-1307  USA
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
  *
  *
- *  Sun Industry Standards Source License Version 1.1
- *  =================================================
- *  The contents of this file are subject to the Sun Industry Standards
- *  Source License Version 1.1 (the "License"); You may not use this file
- *  except in compliance with the License. You may obtain a copy of the
- *  License at http://www.openoffice.org/license.html.
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 by Sun Microsystems, Inc.
+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
  *
- *  Software provided under this License is provided on an "AS IS" basis,
- *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
- *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
- *  See the License for the specific provisions governing your rights and
- *  obligations concerning the Software.
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+ *    License version 2.1, as published by the Free Software Foundation.
  *
- *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *    This library is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *    Lesser General Public License for more details.
  *
- *  Copyright: 2000 by Sun Microsystems, Inc.
- *
- *  All Rights Reserved.
- *
- *  Contributor(s): _______________________________________
- *
+ *    You should have received a copy of the GNU Lesser General Public
+ *    License along with this library; if not, write to the Free Software
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *    MA  02111-1307  USA
  *
  ************************************************************************/


INTEGRATION: CWS ooo19126 (1.1.1.1.994); FILE MERGED 2005/09/05 14:44:51 rt 1.1.1.1.994.1: #i54170# Change license header: remove SISSL

--- vcl/source/gdi/impanmvw.hxx
+++ vcl/source/gdi/impanmvw.hxx
@@ -1,61 +1,35 @@
 /*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
  *
  *  $RCSfile: impanmvw.hxx,v $
  *
- *  $Revision: 1.1.1.1 $
+ *  $Revision: 1.2 $
  *
- *  last change: $Author: hr $ $Date: 2000-09-18 17:05:37 $
+ *  last change: $Author: rt $ $Date: 2005-09-09 12:00:41 $
  *
- *  The Contents of this file are made available subject to the terms of
- *  either of the following licenses
- *
- *         - GNU Lesser General Public License Version 2.1
- *         - Sun Industry Standards Source License Version 1.1
- *
- *  Sun Microsystems Inc., October, 2000
- *
- *  GNU Lesser General Public License Version 2.1
- *  =============================================
- *  Copyright 2000 by Sun Microsystems, Inc.
- *  901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License version 2.1, as published by the Free Software Foundation.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *  MA  02111-1307  USA
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
  *
  *
- *  Sun Industry Standards Source License Version 1.1
- *  =================================================
- *  The contents of this file are subject to the Sun Industry Standards
- *  Source License Version 1.1 (the "License"); You may not use this file
- *  except in compliance with the License. You may obtain a copy of the
- *  License at http://www.openoffice.org/license.html.
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 by Sun Microsystems, Inc.
+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
  *
- *  Software provided under this License is provided on an "AS IS" basis,
- *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
- *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
- *  See the License for the specific provisions governing your rights and
- *  obligations concerning the Software.
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+ *    License version 2.1, as published by the Free Software Foundation.
  *
- *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *    This library is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *    Lesser General Public License for more details.
  *
- *  Copyright: 2000 by Sun Microsystems, Inc.
- *
- *  All Rights Reserved.
- *
- *  Contributor(s): _______________________________________
- *
+ *    You should have received a copy of the GNU Lesser General Public
+ *    License along with this library; if not, write to the Free Software
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *    MA  02111-1307  USA
  *
  ************************************************************************/


INTEGRATION: CWS sixtyfour02 (1.6.192); FILE MERGED 2006/02/23 08:48:25 cmc 1.6.192.2: accidental commit 2006/02/21 14:58:45 cmc 1.6.192.1: #i62227# stream sal_uInt32 explicitly as is currently assumed implicitly

--- vcl/source/gdi/pngwrite.cxx
+++ vcl/source/gdi/pngwrite.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: pngwrite.cxx,v $
  *
- *  $Revision: 1.6 $
- *
- *  last change: $Author: rt $ $Date: 2005-09-09 12:09:34 $
+ *  $Revision: 1.7 $
+ *
+ *  last change: $Author: vg $ $Date: 2006-03-16 12:55:52 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -268,8 +268,8 @@
    /* png signature is always an array of 8 bytes */
     sal_uInt16 nOldMode = rOStm.GetNumberFormatInt();
     rOStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
-    rOStm << (ULONG)0x89504e47;
-    rOStm << (ULONG)0x0d0a1a0a;
+    rOStm << static_cast<sal_uInt32>(0x89504e47);
+    rOStm << static_cast<sal_uInt32>(0x0d0a1a0a);

     std::vector< vcl::PNGWriter::ChunkData >::iterator aBeg( maChunkSeq.begin() );
     std::vector< vcl::PNGWriter::ChunkData >::iterator aEnd( maChunkSeq.end() );


INTEGRATION: CWS vgbugs07 (1.12.104); FILE MERGED 2007/06/04 13:29:38 vg 1.12.104.1: #i76605# Remove -I .../inc/module hack introduced by hedaburemove01

--- vcl/source/gdi/pngwrite.cxx
+++ vcl/source/gdi/pngwrite.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: pngwrite.cxx,v $
  *
- *  $Revision: 1.12 $
- *
- *  last change: $Author: obo $ $Date: 2007-01-25 10:59:19 $
+ *  $Revision: 1.13 $
+ *
+ *  last change: $Author: hr $ $Date: 2007-06-27 20:21:55 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -36,7 +36,7 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_vcl.hxx"

-#include "pngwrite.hxx"
+#include <vcl/pngwrite.hxx>

 #include <cmath>
 #include <limits>
@@ -45,9 +45,9 @@
 #include <rtl/alloc.h>
 #include <tools/zcodec.hxx>
 #include <tools/stream.hxx>
-#include "bmpacc.hxx"
-#include "svapp.hxx"
-#include "alpha.hxx"
+#include <vcl/bmpacc.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/alpha.hxx>

 #ifndef _OSL_ENDIAN_H_
 #include <osl/endian.h>


INTEGRATION: CWS changefileheader (1.10.224); FILE MERGED 2008/04/01 16:05:39 thb 1.10.224.3: #i85898# Stripping all external header guards 2008/04/01 13:01:45 thb 1.10.224.2: #i85898# Stripping all external header guards 2008/03/28 15:44:59 rt 1.10.224.1: #i87441# Change license header to LPGL v3.

--- vcl/source/window/accel.cxx
+++ vcl/source/window/accel.cxx
@@ -1,60 +1,43 @@
 /*************************************************************************
  *
- *  OpenOffice.org - a multi-platform office productivity suite
- *
- *  $RCSfile: accel.cxx,v $
- *
- *  $Revision: 1.10 $
- *
- *  last change: $Author: rt $ $Date: 2007-07-24 10:17:55 $
- *
- *  The Contents of this file are made available subject to
- *  the terms of GNU Lesser General Public License Version 2.1.
- *
- *
- *    GNU Lesser General Public License Version 2.1
- *    =============================================
- *    Copyright 2005 by Sun Microsystems, Inc.
- *    901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- *    This library is free software; you can redistribute it and/or
- *    modify it under the terms of the GNU Lesser General Public
- *    License version 2.1, as published by the Free Software Foundation.
- *
- *    This library is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *    Lesser General Public License for more details.
- *
- *    You should have received a copy of the GNU Lesser General Public
- *    License along with this library; if not, write to the Free Software
- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *    MA  02111-1307  USA
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: accel.cxx,v $
+ * $Revision: 1.11 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
  *
  ************************************************************************/

 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_vcl.hxx"
-
-#ifndef _LIST_HXX
 #include <tools/list.hxx>
-#endif
 #ifndef _TABLE_HXX
 #include <tools/table.hxx>
 #endif
-#ifndef _DEBUG_HXX
 #include <tools/debug.hxx>
-#endif
-
-#ifndef _SV_SVAPP_HXX
 #include <vcl/svapp.hxx>
-#endif
-#ifndef _SV_ACCEL_H
 #include <vcl/accel.h>
-#endif
-#ifndef _SV_ACCEL_HXX
 #include <vcl/accel.hxx>
-#endif
 #ifndef _RC_H
 #include <tools/rc.h>
 #endif


INTEGRATION: CWS vclcleanup02 (1.8.346); FILE MERGED 2003/12/17 16:05:47 mt 1.8.346.4: #i23061# header cleanup, remove #ifdef ???_CXX and #define ???_CXX, also removed .impl files and fixed soke windows compiler warnings 2003/12/10 15:59:39 mt 1.8.346.3: #i23061# VCL cleanup, removed headers, methods and types... 2003/12/05 16:36:53 mt 1.8.346.2: RESYNC: (1.8-1.9); FILE MERGED 2003/12/05 13:28:49 mt 1.8.346.1: #i23061# Code cleanups, fixed gcc WAll warnings, removed unused variables and unused code

--- vcl/source/window/split.cxx
+++ vcl/source/window/split.cxx
@@ -1,10 +1,11 @@
+
 /*************************************************************************
  *
  *  $RCSfile: split.cxx,v $
  *
- *  $Revision: 1.9 $
- *
- *  last change: $Author: rt $ $Date: 2003-12-01 13:39:37 $
+ *  $Revision: 1.10 $
+ *
+ *  last change: $Author: vg $ $Date: 2004-01-06 14:15:38 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -59,10 +60,8 @@
  *
  ************************************************************************/

-#define _SV_SPLIT_CXX
-
 #ifndef _SV_RC_H
-#include <rc.h>
+#include <tools/rc.h>
 #endif
 #ifndef _SV_EVENT_HXX
 #include <event.hxx>
@@ -84,8 +83,8 @@
 #ifndef _SV_GRADIENT_HXX
 #include <gradient.hxx>
 #endif
-#ifndef _SV_POLY_HXX
-#include <poly.hxx>
+#ifndef _TL_POLY_HXX
+#include <tools/poly.hxx>
 #endif
 #ifndef _SV_LINEINFO_HXX
 #include <lineinfo.hxx>
@@ -667,7 +666,6 @@
     Splitter *pSibling = ImplFindSibling();
     KeyCode aKeyCode = rKEvt.GetKeyCode();
     USHORT nCode = aKeyCode.GetCode();
-    BOOL bForwardKey = FALSE;
     switch ( nCode )
     {
         case KEY_UP:


Be more forgiving when parsing MARC-XML.

--- cpp/lib/src/MarcUtil.cc
+++ cpp/lib/src/MarcUtil.cc
@@ -548,28 +548,32 @@
     while (xml_parser->getNext(&type, &attrib_map, &data) and type == SimpleXmlParser::CHARACTERS)
 	/* Intentionally empty! */;
     if (unlikely(type != SimpleXmlParser::OPENING_TAG or data !="leader"))
-	throw std::runtime_error("in MarcUtil::ProcessLeader: opening <leader> tag expected while parsing \"" + input_filename
+	throw std::runtime_error("in MarcUtil::ParseLeader: opening <leader> tag expected while parsing \"" + input_filename
 				 + "\" on line " + std::to_string(xml_parser->getLineNo()) + ".");

     if (unlikely(not xml_parser->getNext(&type, &attrib_map, &data)))
-	throw std::runtime_error("in MarcUtil::ProcessLeader: error while parsing \"" + input_filename + "\": "
+	throw std::runtime_error("in MarcUtil::ParseLeader: error while parsing \"" + input_filename + "\": "
 				 + xml_parser->getLastErrorMessage() + " on line "
 				 + std::to_string(xml_parser->getLineNo()) + ".");
     if (unlikely(type != SimpleXmlParser::CHARACTERS or data.length() != Leader::LEADER_LENGTH))
-	throw std::runtime_error("in MarcUtil::ProcessLeader: leader data expected while parsing \"" + input_filename
+	throw std::runtime_error("in MarcUtil::ParseLeader: leader data expected while parsing \"" + input_filename
 				 + "\" on line " + std::to_string(xml_parser->getLineNo()) + ".");

+    if (data.substr(0, 5) == "     ") // record length
+	data = "00000" + data.substr(5);
+    if (data.substr(12, 5) == "     ") // base address of data
+	data = data.substr(0, 12) + "00000" + data.substr(12 + 5);
     std::string err_msg;
     if (unlikely(not Leader::ParseLeader(data, leader, &err_msg)))
-	throw std::runtime_error("in MarcUtil::ProcessLeader: error while parsing leader data: " + err_msg);
+	throw std::runtime_error("in MarcUtil::ParseLeader: error while parsing leader data: " + err_msg);

     if (unlikely(not xml_parser->getNext(&type, &attrib_map, &data)))
-	throw std::runtime_error("in MarcUtil::ProcessLeader: error while parsing \"" + input_filename + "\": "
+	throw std::runtime_error("in MarcUtil::ParseLeader: error while parsing \"" + input_filename + "\": "
 				 + xml_parser->getLastErrorMessage() + " on line "
 				 + std::to_string(xml_parser->getLineNo()) + ".");
     if (unlikely(type != SimpleXmlParser::CLOSING_TAG or data !="leader")) {
 	const bool tag_found(type == SimpleXmlParser::OPENING_TAG or type == SimpleXmlParser::CLOSING_TAG);
-	throw std::runtime_error("in MarcUtil::ProcessLeader: closing </leader> tag expected while parsing \"" + input_filename
+	throw std::runtime_error("in MarcUtil::ParseLeader: closing </leader> tag expected while parsing \"" + input_filename
 				 + "\" on line " + std::to_string(xml_parser->getLineNo()) + ". (Found: "
 				 + SimpleXmlParser::TypeToString(type) + (tag_found ? (":" + data) : ""));
     }


fprintf -> sal/log.hxx

fprintf -> sal/log.hxx

Change-Id: Ic9962abc8ac8e9992fc26136eb3693e146d38c63

--- vcl/unx/gtk/app/gtkinst.cxx
+++ vcl/unx/gtk/app/gtkinst.cxx
@@ -38,10 +38,6 @@

 #include <rtl/uri.hxx>

-#if OSL_DEBUG_LEVEL > 1
-#include <stdio.h>
-#endif
-
 #include <dlfcn.h>
 #include <fcntl.h>
 #include <unistd.h>
@@ -64,11 +60,10 @@

     VCLPLUG_GTK_PUBLIC SalInstance* create_SalInstance( oslModule )
     {
-#if OSL_DEBUG_LEVEL > 1
-        fprintf( stderr, "create vcl plugin instance with gtk version %d %d %d\n",
-                 (int) gtk_major_version, (int) gtk_minor_version,
-                 (int) gtk_micro_version );
-#endif
+        SAL_INFO(
+            "vcl.gtk",
+            "create vcl plugin instance with gtk version " << gtk_major_version
+                << " " << gtk_minor_version << " " << gtk_micro_version);
         if( gtk_major_version < 2 || // very unlikely sanity check
             ( gtk_major_version == 2 && gtk_minor_version < 4 ) )
         {
@@ -93,9 +88,7 @@
 #endif
         if( pVersion )
         {
-#if OSL_DEBUG_LEVEL > 1
-            fprintf( stderr, "gtk version conflict: %s\n", pVersion );
-#endif
+            SAL_WARN("vcl.gtk", "gtk version conflict: " << pVersion);
             return NULL;
         }

@@ -109,19 +102,14 @@
 #error "Requires gtk 2.4.0+ for lock hooking"
 #endif
         gdk_threads_set_lock_functions (GdkThreadsEnter, GdkThreadsLeave);
-
-#if OSL_DEBUG_LEVEL > 1
-        fprintf( stderr, "Hooked gdk threads locks\n" );
-#endif
+        SAL_INFO("vcl.gtk", "Hooked gdk threads locks");

         pYieldMutex = new GtkYieldMutex();

         gdk_threads_init();

         GtkInstance* pInstance = new GtkInstance( pYieldMutex );
-#if OSL_DEBUG_LEVEL > 1
-        fprintf( stderr, "creating GtkSalInstance 0x%p\n", pInstance );
-#endif
+        SAL_INFO("vcl.gtk", "creating GtkSalInstance " << pInstance);

         //Create SalData, this does not leak
         /*GtkData *pSalData =*/ new GtkData( pInstance );
@@ -342,11 +330,9 @@
 {
     aYieldStack.push_front( mnCount );

-#if OSL_DEBUG_LEVEL > 1
-    if( mnThreadId &&
-        mnThreadId != osl::Thread::getCurrentIdentifier())
-        fprintf( stderr, "\n\n--- A different thread owns the mutex ...---\n\n\n");
-#endif
+    SAL_WARN_IF(
+        mnThreadId && mnThreadId != osl::Thread::getCurrentIdentifier(),
+        "vcl.gtk", "other thread " << mnThreadId << " owns the mutex");

     while( mnCount > 1 )
         release();


Fixed bug with specifying number of fd structs to poll.

--- cpp/net/SocketTools.cpp
+++ cpp/net/SocketTools.cpp
@@ -33,9 +33,6 @@
    fds.fd = fd;
    fds.events = read ? POLLIN : POLLOUT;

-   // "n" parameter is the highest numbered descriptor plus 1
-   int n = fd + 1;
-
    // set 20 millisecond interrupt check timeout (currently necessary to
    // enable thread interruptions)
    int intck = INT32_C(20);
@@ -61,8 +58,8 @@
    Thread* t = Thread::currentThread();
    while(remaining > 0 && rval == 0 && !t->isInterrupted())
    {
-      // wait for file descriptors to be updated
-      rval = ::poll(&fds, n, to);
+      // wait for file descriptor to be updated
+      rval = ::poll(&fds, 1, to);

       // check for error events
       if(rval > 0)


Added removeContext test.

Added removeContext test.

--- cpp/tests/test-data.cpp
+++ cpp/tests/test-data.cpp
@@ -914,6 +914,31 @@
    }
    tr.passIfNoException();

+   tr.test("remove context (input has no <> on ex:contains)");
+   {
+      DynamicObject in;
+      in["#"]["dc"] = "http://purl.org/dc/elements/1.1/";
+      in["#"]["ex"] = "http://example.org/vocab#";
+      in["#"]["xsd"] = "http://www.w3.org/2001/XMLSchema#";
+      in["#"]["#types"]["ex:contains"] = "xsd:anyURI";
+      in["@"] = "http://example.org/test#book";
+      in["ex:contains"] = "http://example.org/test#chapter";
+      in["dc:title"] = "Title";
+
+      DynamicObject out;
+      assertNoException(
+         JsonLd::removeContext(in, out));
+
+      DynamicObject expect;
+      expect["@"] = "<http://example.org/test#book>";
+      expect["<http://example.org/vocab#contains>"] =
+         "<http://example.org/test#chapter>";
+      expect["<http://purl.org/dc/elements/1.1/title>"] = "Title";
+
+      assertDynoCmp(expect, out);
+   }
+   tr.passIfNoException();
+
    tr.test("change context");
    {
       DynamicObject in;


Update BLEServer.cpp

Update BLEServer.cpp

--- cpp_utils/BLEServer.cpp
+++ cpp_utils/BLEServer.cpp
@@ -18,7 +18,6 @@
 #include "BLEUtils.h"
 #include <string.h>
 #include <string>
-#include <gatt_api.h>
 #include <unordered_set>
 #ifdef ARDUINO_ARCH_ESP32
 #include "esp32-hal-log.h"


pre-allocate only max_size()/2 elements

pre-allocate only max_size()/2 elements

--- cppa/abstract_actor.hpp
+++ cppa/abstract_actor.hpp
@@ -202,7 +202,8 @@
     abstract_actor(Args&&... args) : Base(std::forward<Args>(args)...)
                                    , m_exit_reason(exit_reason::not_exited)
     {
-        for (size_t i = 0; i < m_nodes.max_size(); ++i)
+        // pre-allocate some nodes
+        for (size_t i = 0; i < m_nodes.max_size() / 2; ++i)
         {
             m_nodes.push_back(new mailbox_element);
         }


INTEGRATION: CWS vcl74 (1.9.462); FILE MERGED 2007/02/14 18:14:24 pl 1.9.462.1: #i73965# handle possible own IME status window

--- vcl/unx/inc/i18n_status.hxx
+++ vcl/unx/inc/i18n_status.hxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: i18n_status.hxx,v $
  *
- *  $Revision: 1.9 $
+ *  $Revision: 1.10 $
  *
- *  last change: $Author: kz $ $Date: 2005-11-01 10:36:22 $
+ *  last change: $Author: obo $ $Date: 2007-03-05 15:25:46 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -103,6 +103,7 @@

 public:
     static I18NStatus& get();
+    static bool exists();
     static void free();

     void setParent( SalFrame* pParent );


Added operator delete to Any, to silence some compiler warnings in Fedora packaging.

--- libbirch/libbirch/Any.hpp
+++ libbirch/libbirch/Any.hpp
@@ -118,6 +118,13 @@
   }

   /**
+   * Delete operator.
+   */
+  void operator delete(void* ptr) {
+    std::free(ptr);
+  }
+
+  /**
    * Assignment operator.
    */
   Any& operator=(const Any&) {


Sending status fix for module.

Sending status fix for module.

R=mflodman@webrtc.org

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

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

--- video_engine/vie_channel.cc
+++ video_engine/vie_channel.cc
@@ -341,6 +341,7 @@
         rtp_rtcp->SetGenericFECStatus(fec_enabled, payload_type_red,
             payload_type_fec);
       }
+      rtp_rtcp->SetSendingStatus(rtp_rtcp_->Sending());
       rtp_rtcp->SetSendingMediaStatus(rtp_rtcp_->SendingMedia());
       simulcast_rtp_rtcp_.push_back(rtp_rtcp);
     }


Revert "Revert "Fix double-free""

Revert "Revert "Fix double-free""

This reverts commit a13f3a552f124affc4d061746d39a529e1820898.

--- Native/Core/CG/Adapter.cpp
+++ Native/Core/CG/Adapter.cpp
@@ -192,7 +192,9 @@
         ExprValue dstExprValue( this, USAGE_LVALUE, basicBlockBuilder.getContext(), dstLValue );
         functionSymbol->llvmCreateCall( basicBlockBuilder, dstExprValue, srcExprValue );
         basicBlockBuilder.getScope().put( VariableSymbol::Create( dstExprValue ) );
-        return llvmLValueToRValue( basicBlockBuilder, dstLValue );
+        llvm::Value *dstRValue = llvmLValueToRValue( basicBlockBuilder, dstLValue );
+        llvmRetain( basicBlockBuilder, dstRValue );
+        return dstRValue;
       }
     }


remove useless code

remove useless code

--- libluaclingo/luaclingo.cc
+++ libluaclingo/luaclingo.cc
@@ -1832,8 +1832,6 @@
                 lua_pushlightuserdata(L, goon);     // +1
                 int code = lua_pcall(L, 3, 0, -5);  // -4|-3
                 lua_remove(L, top + 1);             // -1
-                if (code) {
-                }
                 return handle_lua_error(L, "on_model", "error in model callback", code); // |-1
             }
             case clingo_solve_event_type_finish: {


Add GetChildren

Add GetChildren

--- tensorflow/c/experimental/filesystem/plugins/hadoop/hadoop_filesystem.cc
+++ tensorflow/c/experimental/filesystem/plugins/hadoop/hadoop_filesystem.cc
@@ -597,6 +597,44 @@
     TF_SetStatus(status, TF_OK, "");
 }

+int GetChildren(const TF_Filesystem* filesystem, const char* path,
+                char*** entries, TF_Status* status) {
+  auto libhdfs = static_cast<LibHDFS*>(filesystem->plugin_filesystem);
+  auto fs = Connect(libhdfs, path, status);
+  if (TF_GetCode(status) != TF_OK) return;
+
+  std::string scheme, namenode, hdfs_path;
+  ParseHadoopPath(path, &scheme, &namenode, &hdfs_path);
+
+  // hdfsListDirectory returns nullptr if the directory is empty. Do a separate
+  // check to verify the directory exists first.
+  TF_FileStatistics stat;
+  Stat(filesystem, path, &stat, status);
+  if (TF_GetCode(status) != TF_OK) return;
+
+  int num_entries = 0;
+  auto info = libhdfs->hdfsListDirectory(fs, hdfs_path.c_str(), &num_entries);
+  if (info == nullptr) {
+    if (stat.is_directory) {
+      // Assume it's an empty directory.
+      TF_SetStatus(status, TF_OK, "");
+      return 0;
+    }
+    TF_SetStatusFromIOError(status, errno, path);
+    return -1;
+  }
+  *entries = static_cast<char**>(
+      plugin_memory_allocate(num_entries * sizeof((*entries)[0])));
+  auto BaseName = [](const std::string& name) {
+    return name.substr(name.find_last_of('/') + 1);
+  };
+  for (int i = 0; i < num_entries; i++) {
+    (*entries)[i] = strdup(BaseName(info[i].mName).c_str());
+  }
+  libhdfs->hdfsFreeFileInfo(info, num_entries);
+  TF_SetStatus(status, TF_OK, "");
+}
+
 // TODO(vnvo2409): Implement later

 }  // namespace tf_hadoop_filesystem


added iterator constructors

added iterator constructors

--- viennagrid/storage/view.hpp
+++ viennagrid/storage/view.hpp
@@ -48,6 +48,7 @@
                 typedef typename hook_container_type::iterator base;
             public:
                 iterator(const base & foo) : base(foo) {}
+                iterator(const iterator & it) : base(it) {}

                 typedef typename std::iterator_traits<base>::difference_type difference_type;
                 typedef view_t::value_type value_type;
@@ -57,6 +58,8 @@

                 reference operator* () { return *(base::operator*()); }
                 const reference operator* () const { return *(base::operator*()); }
+
+                pointer operator->() const { return &(operator* ()); }
             };

@@ -65,6 +68,8 @@
                 typedef typename hook_container_type::const_iterator base;
             public:
                 const_iterator(const base & foo) : base(foo) {}
+                const_iterator(const const_iterator & it) : base(it) {}
+                const_iterator(const iterator & it) : base(it) {}

                 typedef typename std::iterator_traits<base>::difference_type difference_type;
                 typedef view_t::value_type value_type;
@@ -74,6 +79,8 @@

                 reference operator* () { return *(base::operator*()); }
                 const reference operator* () const { return *(base::operator*()); }
+
+                pointer operator->() const { return &(operator* ()); }
             };

@@ -194,12 +201,15 @@
             typedef const value_type * const_pointer;

+            class const_iterator;

             class iterator : public hook_container_type::iterator
             {
                 typedef typename hook_container_type::iterator base;
+                friend class const_iterator;
             public:
                 iterator(view_t & view__, const base & foo) : base(foo), view(view__) {}
+                iterator(const iterator & it) : base(it), view(it.view) {}

                 typedef typename std::iterator_traits<base>::difference_type difference_type;
                 typedef view_t::value_type value_type;
@@ -210,6 +220,7 @@
                 reference operator* () { return view.dereference_hook( base::operator*() ); }
                 const reference operator* () const { return view.dereference_hook( base::operator*() ); }

+                pointer operator->() const { return &view.dereference_hook( base::operator*() ); }

             private:
                 view_t & view;
@@ -221,6 +232,8 @@
                 typedef typename hook_container_type::const_iterator base;
             public:
                 const_iterator(const view_t & view__, const base & foo) : base(foo), view(view__) {}
+                const_iterator(const const_iterator & it) : base(it), view(it.view) {}
+                const_iterator(const iterator & it) : base(it), view(it.view) {}

                 typedef typename std::iterator_traits<base>::difference_type difference_type;
                 typedef view_t::value_type value_type;
@@ -230,6 +243,8 @@

                 reference operator* () { return view.dereference_hook( base::operator*() ); }
                 const reference operator* () const { return view.dereference_hook( base::operator*() ); }
+
+                pointer operator->() const { return &view.dereference_hook( base::operator*() ); }

             private:
                 const view_t & view;


Improve ctkExpandableWidgetTest to better show features

Show all three size grips look and location

--- Libs/Widgets/Testing/Cpp/ctkExpandableWidgetTest1.cpp
+++ Libs/Widgets/Testing/Cpp/ctkExpandableWidgetTest1.cpp
@@ -23,7 +23,9 @@
 #include <QDebug>
 #include <QGroupBox>
 #include <QLabel>
+#include <QListView>
 #include <QStyle>
+#include <QTableView>
 #include <QTimer>
 #include <QTreeView>
 #include <QVBoxLayout>
@@ -46,22 +48,18 @@
   QHBoxLayout* topLevelLayout = new QHBoxLayout;
   topLevel.setLayout(topLevelLayout);

-  QWidget frame(&topLevel);
-  //ctkExpandableWidget frame(&topLevel);
+  QWidget frame;
   topLevelLayout->addWidget(&frame);

-  QGroupBox groupBox(&topLevel);
-  topLevelLayout->addWidget(&groupBox);
-
-  QLabel* label0 = new QLabel("should be invisible", &frame);
-  QLabel* label1 = new QLabel("should be visible", &frame);
-  QLabel* label2 = new QLabel("should be invisible", &frame);
-  QLabel* label3 = new QLabel("should be visible", &frame);
-  QLabel* label4 = new QLabel("should be invisible", &frame);
-  QLabel* label5 = new QLabel("should be visible", &frame);
-  QLabel* label6 = new QLabel("should be visible", &frame);
-  QLabel* label7 = new QLabel("should be visible", &frame);
-  QLabel* label8 = new QLabel("should be invisible", &frame);
+  ctkExpandableWidget resizableFrame1(&frame);
+  QListView* listView = new QListView(&resizableFrame1);
+  listView->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred));
+  QVBoxLayout* resizableFrameLayout1 = new QVBoxLayout(&resizableFrame1);
+  resizableFrameLayout1->setContentsMargins(0,0,0,0);
+  resizableFrame1.setSizeGripMargins(QSize(2, 2));
+  resizableFrame1.setLayout(resizableFrameLayout1);
+  resizableFrameLayout1->addWidget(listView);
+  resizableFrame1.setOrientations(Qt::Horizontal | Qt::Vertical);

   ctkExpandableWidget resizableFrame(&frame);
   resizableFrame.setSizeGripInside(false);
@@ -74,24 +72,22 @@
   resizableFrameLayout->addWidget(treeView);
   resizableFrame.setOrientations(Qt::Horizontal);

-  label8->setVisible(false);
-  label2->setVisible(false);
-  label4->setVisible(false);
-  label8->setVisible(false);
-
   QVBoxLayout *vbox = new QVBoxLayout;
   vbox->setContentsMargins(0, 0, 0, 0);
-  vbox->addWidget(label0);
-  vbox->addWidget(label1);
-  vbox->addWidget(label2);
-  vbox->addWidget(label3);
-  vbox->addWidget(label4);
-  vbox->addWidget(label5);
-  vbox->addWidget(label6);
-  vbox->addWidget(label7);
-  vbox->addWidget(label8);
+  vbox->addWidget(&resizableFrame1);
   vbox->addWidget(&resizableFrame);
   frame.setLayout(vbox);
+
+  ctkExpandableWidget resizableFrame0(&topLevel);
+  QTableView* tableView = new QTableView(&resizableFrame0);
+  tableView->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred));
+  QVBoxLayout* resizableFrameLayout0 = new QVBoxLayout(&resizableFrame0);
+  resizableFrameLayout0->setContentsMargins(0,0,0,0);
+  resizableFrame0.setSizeGripMargins(QSize(2, 2));
+  resizableFrame0.setLayout(resizableFrameLayout0);
+  resizableFrameLayout0->addWidget(tableView);
+  resizableFrame0.setOrientations(Qt::Vertical);
+  topLevelLayout->addWidget(&resizableFrame0);

   topLevel.show();


Remove some unused declarations.

Remove some unused declarations.

--- libpolyml/interpreter.cpp
+++ libpolyml/interpreter.cpp
@@ -209,27 +209,6 @@
     return was;
 }

-extern "C" {
-    typedef POLYUNSIGNED(*callFastRts0)();
-    typedef POLYUNSIGNED(*callFastRts1)(intptr_t);
-    typedef POLYUNSIGNED(*callFastRts2)(intptr_t, intptr_t);
-    typedef POLYUNSIGNED(*callFastRts3)(intptr_t, intptr_t, intptr_t);
-    typedef POLYUNSIGNED(*callFastRts4)(intptr_t, intptr_t, intptr_t, intptr_t);
-    typedef POLYUNSIGNED(*callFastRts5)(intptr_t, intptr_t, intptr_t, intptr_t, intptr_t);
-    typedef POLYUNSIGNED(*callFullRts0)(PolyObject *);
-    typedef POLYUNSIGNED(*callFullRts1)(PolyObject *, intptr_t);
-    typedef POLYUNSIGNED(*callFullRts2)(PolyObject *, intptr_t, intptr_t);
-    typedef POLYUNSIGNED(*callFullRts3)(PolyObject *, intptr_t, intptr_t, intptr_t);
-    typedef double (*callRTSRtoR) (double);
-    typedef double (*callRTSRRtoR) (double, double);
-    typedef double (*callRTSGtoR) (intptr_t);
-    typedef double (*callRTSRGtoR) (double, intptr_t);
-    typedef float(*callRTSFtoF) (float);
-    typedef float(*callRTSFFtoF) (float, float);
-    typedef float(*callRTSGtoF) (intptr_t);
-    typedef float(*callRTSFGtoF) (float, intptr_t);
-}
-
 void IntTaskData::GarbageCollect(ScanAddress *process)
 {
     TaskData::GarbageCollect(process);


Adjust filter for Las Vegas Convention center lighting (halogen and some kind of focused spotlight on the field)

--- viking_mpg_streamer/plugins/input_uvc/viking_cv/CUpperGoalDetector.cpp
+++ viking_mpg_streamer/plugins/input_uvc/viking_cv/CUpperGoalDetector.cpp
@@ -159,8 +159,8 @@
         static int iCount = 0;

         // Look for the green hue wee are emitting from the LED halo
-        cv::Scalar lowerBounds = cv::Scalar(86,0,150);
-	cv::Scalar upperBounds = cv::Scalar(94,255,255);
+        cv::Scalar lowerBounds = cv::Scalar(79,0,150);
+	cv::Scalar upperBounds = cv::Scalar(90,255,255);

         int timeSinceLastCameraFrameMilliseconds = (int) CTestMonitor::getDeltaTimeMilliseconds(
                 timeLastCameraFrame,


Revert "BUG: mantis-1318 fix GDAL UTF-8 on Windows"

(does not actually fix the issue.)

--- Modules/IO/IOGDAL/src/otbGDALDriverManagerWrapper.cxx
+++ Modules/IO/IOGDAL/src/otbGDALDriverManagerWrapper.cxx
@@ -53,10 +53,6 @@
 GDALDatasetWrapper::Pointer
 GDALDriverManagerWrapper::Open( std::string filename ) const
 {
-  // This GDAL config option is there to handle UTF-8 filenames on Windows
-  // It fixes mantis bug 1318 where images with filenames like 你好.tif could not be read on Windows
-  CPLSetConfigOption("GDAL_FILENAME_IS_UTF8","NO");
-
   GDALDatasetWrapper::Pointer datasetWrapper;

   if (boost::algorithm::starts_with(filename, "http://")


BUG: Enable VectorImage to work with the ImageSeriesWriter

Propagate the number of components to the slice image for writing .

Change-Id: I9f18fc7962140ca4989f42011f26a0536e29af22

--- Modules/IO/ImageBase/include/itkImageSeriesWriter.hxx
+++ Modules/IO/ImageBase/include/itkImageSeriesWriter.hxx
@@ -210,6 +210,7 @@
   // Allocate an image for output and create an iterator for it
   typename OutputImageType::Pointer outputImage = OutputImageType::New();
   outputImage->SetRegions(outRegion);
+  outputImage->SetNumberOfComponentsPerPixel(inputImage->GetNumberOfComponentsPerPixel());
   outputImage->Allocate();
   ImageRegionIterator< OutputImageType > ot(outputImage, outRegion);


Set measurement vector size of histogram before its initialization

--- Modules/ImageStatistics/mitkStatisticsImageFilter.hxx
+++ Modules/ImageStatistics/mitkStatisticsImageFilter.hxx
@@ -14,6 +14,7 @@
 #define mitkStatisticsImageFilter_hxx

 #include <mitkStatisticsImageFilter.h>
+#include <mitkHistogramStatisticsCalculator.h>
 #include <itkImageScanlineConstIterator.h>

 template <typename TInputImage>
@@ -126,17 +127,18 @@
 {
   typename HistogramType::SizeType size;
   size.SetSize(1);
-  size[0] = m_HistogramSize;
+  size.Fill(m_HistogramSize);

   typename HistogramType::MeasurementVectorType lowerBound;
   lowerBound.SetSize(1);
-  lowerBound[0] = m_HistogramLowerBound;
+  lowerBound.Fill(m_HistogramLowerBound);

   typename HistogramType::MeasurementVectorType upperBound;
   upperBound.SetSize(1);
-  upperBound.[0] = m_HistogramUpperBound;
+  upperBound.Fill(m_HistogramUpperBound);

   auto histogram = HistogramType::New();
+  histogram->SetMeasurementVectorSize(1);
   histogram->Initialize(size, lowerBound, upperBound);

   return histogram;