Fix arguments in daughter cuts

Fix arguments in daughter cuts

--- PWGLF/RESONANCES/macros/mini/ConfigDeltaPPb.C
+++ PWGLF/RESONANCES/macros/mini/ConfigDeltaPPb.C
@@ -22,7 +22,7 @@

    // integrated pion cut TOF
-   AliRsnCutDelta *cutPiTOF = new AliRsnCutDelta("cutPionTOF",AliPID::kPion, kFALSE, kTRUE, kTRUE);
+   AliRsnCutDelta *cutPiTOF = new AliRsnCutDelta("cutPionTOF", AliPID::kPion, kFALSE, kTRUE);
    // cut set TOF
    AliRsnCutSet *cutSetPiTOF = new AliRsnCutSet("setPionForDeltaTOF", AliRsnTarget::kDaughter);
    cutSetPiTOF->AddCut(cutPiTOF);
@@ -31,7 +31,7 @@
    Int_t iCutPiTOF = task->AddTrackCuts(cutSetPiTOF);

    // integrated proton cut TOF
-   AliRsnCutDelta *cutPTOF = new AliRsnCutDelta("cutProtonTOF",AliPID::kProton, kFALSE, kTRUE, kTRUE);
+   AliRsnCutDelta *cutPTOF = new AliRsnCutDelta("cutProtonTOF",AliPID::kProton, kFALSE, kTRUE);
    // cut set TOF
    AliRsnCutSet *cutSetPTOF = new AliRsnCutSet("setProtonForDeltaTOF", AliRsnTarget::kDaughter);
    cutSetPTOF->AddCut(cutPTOF);
@@ -41,7 +41,7 @@

 /////////////////////////////////////////////////////SYSTEMATICS

-   AliRsnCutDelta *cutPiTOF1 = new AliRsnCutDelta("cutPionTOF1",AliPID::kPion,kFALSE, kTRUE, kTRUE);
+   AliRsnCutDelta *cutPiTOF1 = new AliRsnCutDelta("cutPionTOF1",AliPID::kPion,kFALSE, kTRUE);
    cutPiTOF1->SetTPCNSigmaProton(2.0);
    cutPiTOF1->SetTPCNSigmaPion(3.0);
    cutPiTOF1->SetTOFNSigmaProton(2.0);
@@ -51,7 +51,7 @@
    cutSetPiTOF1->SetCutScheme(cutPiTOF1->GetName());
    Int_t iCutPiTOF1 = task->AddTrackCuts(cutSetPiTOF1);

-   AliRsnCutDelta *cutPTOF1 = new AliRsnCutDelta("cutProtonTOF1",AliPID::kProton,kFALSE, kTRUE, kTRUE);
+   AliRsnCutDelta *cutPTOF1 = new AliRsnCutDelta("cutProtonTOF1",AliPID::kProton,kFALSE, kTRUE);
    cutPTOF1->SetTPCNSigmaProton(2.0);
    cutPTOF1->SetTPCNSigmaPion(3.0);
    cutPTOF1->SetTOFNSigmaProton(2.0);
@@ -61,7 +61,7 @@
    cutSetPTOF1->SetCutScheme(cutPTOF1->GetName());
    Int_t iCutPTOF1 = task->AddTrackCuts(cutSetPTOF1);

-   AliRsnCutDelta *cutPiTOF2 = new AliRsnCutDelta("cutPionTOF2",AliPID::kPion,kFALSE, kTRUE, kTRUE);
+   AliRsnCutDelta *cutPiTOF2 = new AliRsnCutDelta("cutPionTOF2",AliPID::kPion,kFALSE, kTRUE);
    cutPiTOF2->SetTPCNSigmaProton(3.0);
    cutPiTOF2->SetTPCNSigmaPion(2.0);
    cutPiTOF2->SetTOFNSigmaProton(3.0);
@@ -71,7 +71,7 @@
    cutSetPiTOF2->SetCutScheme(cutPiTOF2->GetName());
    Int_t iCutPiTOF2 = task->AddTrackCuts(cutSetPiTOF2);

-   AliRsnCutDelta *cutPTOF2 = new AliRsnCutDelta("cutProtonTOF2",AliPID::kProton,kFALSE, kTRUE, kTRUE);
+   AliRsnCutDelta *cutPTOF2 = new AliRsnCutDelta("cutProtonTOF2",AliPID::kProton,kFALSE, kTRUE);
    cutPTOF2->SetTPCNSigmaProton(3.0);
    cutPTOF2->SetTPCNSigmaPion(2.0);
    cutPTOF2->SetTOFNSigmaProton(3.0);
@@ -81,7 +81,7 @@
    cutSetPTOF2->SetCutScheme(cutPTOF2->GetName());
    Int_t iCutPTOF2 = task->AddTrackCuts(cutSetPTOF2);

-   AliRsnCutDelta *cutPiTOF3 = new AliRsnCutDelta("cutPionTOF3",AliPID::kPion,kFALSE, kTRUE, kTRUE);
+   AliRsnCutDelta *cutPiTOF3 = new AliRsnCutDelta("cutPionTOF3",AliPID::kPion,kFALSE, kTRUE);
    cutPiTOF3->SetTPCNSigmaProton(4.0);
    cutPiTOF3->SetTPCNSigmaPion(3.0);
    cutPiTOF3->SetTOFNSigmaProton(4.0);
@@ -91,7 +91,7 @@
    cutSetPiTOF3->SetCutScheme(cutPiTOF3->GetName());
    Int_t iCutPiTOF3 = task->AddTrackCuts(cutSetPiTOF3);

-   AliRsnCutDelta *cutPTOF3 = new AliRsnCutDelta("cutProtonTOF3",AliPID::kProton,kFALSE, kTRUE, kTRUE);
+   AliRsnCutDelta *cutPTOF3 = new AliRsnCutDelta("cutProtonTOF3",AliPID::kProton,kFALSE, kTRUE);
    cutPiTOF3->SetTPCNSigmaProton(4.0);
    cutPiTOF3->SetTPCNSigmaPion(3.0);
    cutPiTOF3->SetTOFNSigmaProton(4.0);
@@ -101,7 +101,7 @@
    cutSetPTOF3->SetCutScheme(cutPTOF3->GetName());
    Int_t iCutPTOF3 = task->AddTrackCuts(cutSetPTOF3);

-   AliRsnCutDelta *cutPiTOF4 = new AliRsnCutDelta("cutPionTOF4",AliPID::kPion,kFALSE, kTRUE, kTRUE);
+   AliRsnCutDelta *cutPiTOF4 = new AliRsnCutDelta("cutPionTOF4",AliPID::kPion,kFALSE, kTRUE);
    cutPiTOF4->SetTPCNSigmaProton(3.0);
    cutPiTOF4->SetTPCNSigmaPion(4.0);
    cutPiTOF4->SetTOFNSigmaProton(3.0);
@@ -111,7 +111,7 @@
    cutSetPiTOF4->SetCutScheme(cutPiTOF4->GetName());
    Int_t iCutPiTOF4 = task->AddTrackCuts(cutSetPiTOF4);

-   AliRsnCutDelta *cutPTOF4 = new AliRsnCutDelta("cutProtonTOF4",AliPID::kProton,kFALSE, kTRUE, kTRUE);
+   AliRsnCutDelta *cutPTOF4 = new AliRsnCutDelta("cutProtonTOF4",AliPID::kProton,kFALSE, kTRUE);
    cutPTOF4->SetTPCNSigmaProton(3.0);
    cutPTOF4->SetTPCNSigmaPion(4.0);
    cutPTOF4->SetTOFNSigmaProton(3.0);
@@ -121,28 +121,28 @@
    cutSetPTOF4->SetCutScheme(cutPTOF4->GetName());
    Int_t iCutPTOF4 = task->AddTrackCuts(cutSetPTOF4);

-   AliRsnCutDelta *cutPiTOF5 = new AliRsnCutDelta("cutPionTOF5",AliPID::kPion,kFALSE, kTRUE, kTRUE);
+   AliRsnCutDelta *cutPiTOF5 = new AliRsnCutDelta("cutPionTOF5",AliPID::kPion,kFALSE, kTRUE);
    cutPiTOF5->SetTOFMomProton(2.3);
    AliRsnCutSet *cutSetPiTOF5 = new AliRsnCutSet("setPionForDeltaTOF5", AliRsnTarget::kDaughter);
    cutSetPiTOF5->AddCut(cutPiTOF5);
    cutSetPiTOF5->SetCutScheme(cutPiTOF5->GetName());
    Int_t iCutPiTOF5 = task->AddTrackCuts(cutSetPiTOF5);

-   AliRsnCutDelta *cutPTOF5 = new AliRsnCutDelta("cutProtonTOF5",AliPID::kProton,kFALSE, kTRUE, kTRUE);
+   AliRsnCutDelta *cutPTOF5 = new AliRsnCutDelta("cutProtonTOF5",AliPID::kProton,kFALSE, kTRUE);
    cutPTOF5->SetTOFMomProton(2.3);
    AliRsnCutSet *cutSetPTOF5 = new AliRsnCutSet("setProtonForDeltaTOF5", AliRsnTarget::kDaughter);
    cutSetPTOF5->AddCut(cutPTOF5);
    cutSetPTOF5->SetCutScheme(cutPTOF5->GetName());
    Int_t iCutPTOF5 = task->AddTrackCuts(cutSetPTOF5);

-   AliRsnCutDelta *cutPiTOF6 = new AliRsnCutDelta("cutPionTOF6",AliPID::kPion,kFALSE, kTRUE, kTRUE);
+   AliRsnCutDelta *cutPiTOF6 = new AliRsnCutDelta("cutPionTOF6",AliPID::kPion,kFALSE, kTRUE);
    cutPiTOF6->SetTOFMomProton(2.7);
    AliRsnCutSet *cutSetPiTOF6 = new AliRsnCutSet("setPionForDeltaTOF6", AliRsnTarget::kDaughter);
    cutSetPiTOF6->AddCut(cutPiTOF6);
    cutSetPiTOF6->SetCutScheme(cutPiTOF6->GetName());
    Int_t iCutPiTOF6 = task->AddTrackCuts(cutSetPiTOF6);

-   AliRsnCutDelta *cutPTOF6 = new AliRsnCutDelta("cutProtonTOF6",AliPID::kProton,kFALSE, kTRUE, kTRUE);
+   AliRsnCutDelta *cutPTOF6 = new AliRsnCutDelta("cutProtonTOF6",AliPID::kProton,kFALSE, kTRUE);
    cutPTOF6->SetTOFMomProton(2.7);
    AliRsnCutSet *cutSetPTOF6 = new AliRsnCutSet("setProtonForDeltaTOF6", AliRsnTarget::kDaughter);
    cutSetPTOF6->AddCut(cutPTOF6);


Fixed index value given to freeIndices list.

--- OpenTESArena/src/Entities/EntityManager.cpp
+++ OpenTESArena/src/Entities/EntityManager.cpp
@@ -171,8 +171,8 @@
 		// Clear ID mapping.
 		this->indices.erase(id);

-		// Add ID to previously-owned IDs list.
-		this->freeIndices.push_back(id);
+		// Add entity index to previously-owned slots list.
+		this->freeIndices.push_back(index);
 	}
 	else
 	{


Added comments to SceneGadget implementation.

Explaining what I think might be a good approach in the future.

--- src/GafferSceneUI/SceneGadget.cpp
+++ src/GafferSceneUI/SceneGadget.cpp
@@ -389,6 +389,31 @@

 //////////////////////////////////////////////////////////////////////////
 // SceneGraph implementation
+//
+// This is effectively a replacement for IECoreGL::Scene, tailored
+// specifically to work well with Gaffer. Our only good means of generating
+// IECoreGL::Scenes is to use IECoreGL::Renderer, which would mean regenerating
+// the entire scene for any change in Gaffer. By maintaining our own scene graph,
+// we are able to make in-place edits to minimally reflect changes in Gaffer,
+// yielding much improved performance.
+//
+// In the longer term, the following might be a good course of action :
+//
+// - Refactor SceneGraph into an IECoreGL::GLScene class which maps well
+//   to Gaffer, but doesn't have direct Gaffer dependencies. It seems
+//   promising to have this class implement IECore::SceneInterface, or
+//   a future version tailored a little for broader use cases such as this
+//   (the existing interface is a little file-specific).
+// - Refactor UpdateTask into a class which couples Gaffer to
+//   IECore::SceneInterfaces, performing minimal edits as necessary to
+//   reflect changes in Gaffer.
+// - Implement our renderer backends for RenderMan, Arnold etc as
+//   SceneInterfaces. This is the most challenging part of this approach,
+//   but the hope is that the SceneInterface is a better API for performing
+//   render edits for IPR, rather than the nasty RI style API we currently
+//   have.
+// - Reuse the new UpdateTask in the InteractiveRender node.
+//
 //////////////////////////////////////////////////////////////////////////

 class SceneGadget::SceneGraph


temp warning fix

temp warning fix

--- src/oddlib/path.cpp
+++ src/oddlib/path.cpp
@@ -47,8 +47,8 @@
         }

         // TODO: Psx data != pc data for Ao
-        const u32 indexTableOffset = (pathChunkStream.Size() - (mCameras.size() * sizeof(u32))) + 16;
-        assert(indexTableOffset == objectIndexTableOffset);
+        //const u32 indexTableOffset = (pathChunkStream.Size() - (mCameras.size() * sizeof(u32))) + 16;
+        //assert(indexTableOffset == objectIndexTableOffset);

         if (collisionDataOffset != 0)
         {


Debugger: Add LLDB to dumper test infrastructure

Not working yet.

Change-Id: I87bd15d8c4aee491404b57842884220103a63e1f
Reviewed-by: hjk <f81b91af79013637d070c18d38a75b90eaae8ba3@nokiamail.com>

--- tests/auto/debugger/tst_dumpers.cpp
+++ tests/auto/debugger/tst_dumpers.cpp
@@ -45,6 +45,7 @@
 #endif

 using namespace Debugger;
+using namespace Utils;
 using namespace Internal;

 static QByteArray noValue = "\001";
@@ -358,9 +359,11 @@
     QString buildPath;
 };

-enum DebuggerEngine {
-    gdbEngine,
-    cdbEngine
+enum DebuggerEngine
+{
+    GdbEngine,
+    CdbEngine,
+    LldbEngine
 };

 Q_DECLARE_METATYPE(Data)
@@ -370,7 +373,16 @@
     Q_OBJECT

 public:
-    tst_Dumpers() : t(0), m_keepTemp(false) {}
+    tst_Dumpers()
+    {
+        t = 0;
+        m_keepTemp = false;
+        m_gdbVersion = 0;
+        m_gdbBuildVersion = 0;
+        m_lldbVersion = 0;
+        m_isMacGdb = false;
+        m_isQnxGdb = false;
+    }

 private slots:
     void initTestCase();
@@ -389,6 +401,7 @@
     bool m_keepTemp;
     int m_gdbVersion; // 7.5.1 -> 70501
     int m_gdbBuildVersion;
+    int m_lldbVersion;
     bool m_isMacGdb;
     bool m_isQnxGdb;
 };
@@ -398,16 +411,21 @@
     m_debuggerBinary = qgetenv("QTC_DEBUGGER_PATH");
     if (m_debuggerBinary.isEmpty())
         m_debuggerBinary = "gdb";
-    m_debuggerEngine = m_debuggerBinary.endsWith("cdb.exe") ? cdbEngine : gdbEngine;
+
+    m_debuggerEngine = GdbEngine;
+    if (m_debuggerBinary.endsWith("cdb.exe"))
+        m_debuggerEngine = CdbEngine;
+    if (m_debuggerBinary.endsWith("lldb") || m_debuggerBinary.contains("/lldb-"))
+        m_debuggerEngine = LldbEngine;

     m_qmakeBinary = qgetenv("QTC_QMAKE_PATH");
     if (m_qmakeBinary.isEmpty())
         m_qmakeBinary = "qmake";

-    Utils::Environment utilsEnv = Utils::Environment::systemEnvironment();
+    Environment utilsEnv = Environment::systemEnvironment();
     utilsEnv.appendOrSet(QLatin1String("QT_HASH_SEED"), QLatin1String("0"));

-    if (m_debuggerEngine == gdbEngine) {
+    if (m_debuggerEngine == GdbEngine) {
         QProcess debugger;
         debugger.start(QString::fromLatin1(m_debuggerBinary)
                        + QLatin1String(" -i mi -quiet -nx"));
@@ -428,14 +446,14 @@
         QVERIFY(pos2 != -1);
         pos2 -= 4;
         version = version.mid(pos1, pos2 - pos1);
-        Debugger::Internal::extractGdbVersion(version, &m_gdbVersion,
+        extractGdbVersion(version, &m_gdbVersion,
             &m_gdbBuildVersion, &m_isMacGdb, &m_isQnxGdb);
         qDebug() << "Gdb version " << m_gdbVersion;
-    } else {
+    } else if (m_debuggerEngine == CdbEngine) {
         QByteArray envBat = qgetenv("QTC_MSVC_ENV_BAT");
         QMap <QString, QString> envPairs;
         QVERIFY(ProjectExplorer::Internal::AbstractMsvcToolChain::generateEnvironmentSettings(
-                    utilsEnv, QString::fromLatin1(envBat), QLatin1String(""), envPairs));
+                    utilsEnv, QString::fromLatin1(envBat), QString(), envPairs));

         for (QMap<QString,QString>::const_iterator envIt = envPairs.begin(); envIt!=envPairs.end(); ++envIt)
                 utilsEnv.set(envIt.key(), envIt.value());
@@ -446,6 +464,19 @@
         utilsEnv.appendOrSet(QLatin1String("_NT_DEBUGGER_EXTENSION_PATH"),
                              QString::fromLatin1(cdbextPath),
                              QLatin1String(";"));
+    } else if (m_debuggerEngine == LldbEngine) {
+        m_usePython = true;
+        QProcess debugger;
+        debugger.start(QString::fromLatin1(m_debuggerBinary + " -v"));
+        bool ok = debugger.waitForFinished(2000);
+        QVERIFY(ok);
+        QByteArray output = debugger.readAllStandardOutput();
+        output += debugger.readAllStandardError();
+        output = output.trimmed();
+        // Should be something like LLDB-178
+        m_lldbVersion = output.mid(5).toInt();
+        qDebug() << "Lldb version " << output << m_lldbVersion;
+        QVERIFY(m_lldbVersion);
     }
     m_env = utilsEnv.toProcessEnvironment();
 }
@@ -469,7 +500,7 @@
 {
     QFETCH(Data, data);

-    if (m_debuggerEngine == gdbEngine) {
+    if (m_debuggerEngine == GdbEngine) {
         if (data.neededGdbVersion.min > m_gdbVersion)
             MSKIP_SINGLE("Need minimum GDB version " + QByteArray::number(data.neededGdbVersion.min));
         if (data.neededGdbVersion.max < m_gdbVersion)
@@ -526,7 +557,7 @@

     QProcess make;
     make.setWorkingDirectory(t->buildPath);
-    cmd = m_debuggerEngine == gdbEngine ? QString::fromLatin1("make")
+    cmd = m_debuggerEngine == GdbEngine ? QString::fromLatin1("make")
                                         : QString::fromLatin1("nmake");
     //qDebug() << "Starting make: " << cmd;
     make.start(cmd);
@@ -566,7 +597,7 @@
     QByteArray cmds;
     QStringList args;

-    if (m_debuggerEngine == gdbEngine) {
+    if (m_debuggerEngine == GdbEngine) {
         args << QLatin1String("-i")
              << QLatin1String("mi")
              << QLatin1String("-quiet")
@@ -600,7 +631,7 @@
         }
         cmds += "quit\n";

-    } else {
+    } else if (m_debuggerEngine == CdbEngine) {
         args << QLatin1String("-aqtcreatorcdbext.dll")
              << QLatin1String("-lines")
              << QLatin1String("-G")
@@ -615,6 +646,16 @@
                "gu\n"
                "!qtcreatorcdbext.locals -t 2 -D -e " + expanded + ",return,watch,inspect -v -c -W 0\n"
                "q\n";
+    } else if (m_debuggerEngine == LldbEngine) {
+        cmds = "script execfile('" + dumperDir + "/bridge.py')\n"
+               "script execfile('" + dumperDir + "/dumper.py')\n"
+               "script execfile('" + dumperDir + "/qttypes.py')\n"
+               "bbsetup\n"
+               "run\n"
+               "up\n"
+               "script print('@%sS@%s@' % ('N', qtNamespace()))\n"
+               "script bb('options:fancy,autoderef,dyntype vars: expanded:" + expanded + " typeformats:')\n"
+               "quit\n";
     }

     t->input = cmds;
@@ -642,7 +683,7 @@

     Context context;
     QByteArray contents;
-    if (m_debuggerEngine == gdbEngine) {
+    if (m_debuggerEngine == GdbEngine) {
         int posDataStart = output.indexOf("data=");
         QVERIFY(posDataStart != -1);
         int posDataEnd = output.indexOf(",typeinfo", posDataStart);


makeman fixes for g++ > 4

makeman fixes for g++ > 4

--- doc/makeman/makeman.C
+++ doc/makeman/makeman.C
@@ -34,9 +34,11 @@
  * http://www-oss.fnal.gov/~mengel/man_page_notes.html
  *
  **************************************************************************/
-#include <stream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <string>
+#include <stdlib.h>
+#include <string.h>
 #include <assert.h>
 #include <ctype.h>
 #include <time.h>


Add descriptions for new transactions

Add descriptions for new transactions

--- src/omnicore/tx.cpp
+++ src/omnicore/tx.cpp
@@ -59,6 +59,9 @@
         case MSC_TYPE_GRANT_PROPERTY_TOKENS: return "Grant Property Tokens";
         case MSC_TYPE_REVOKE_PROPERTY_TOKENS: return "Revoke Property Tokens";
         case MSC_TYPE_CHANGE_ISSUER_ADDRESS: return "Change Issuer Address";
+        case MSC_TYPE_CHANGE_FREEZE_SETTING: return "Change Freeze Setting";
+        case MSC_TYPE_FREEZE_PROPERTY_TOKENS: return "Freeze Property Tokens";
+        case MSC_TYPE_UNFREEZE_PROPERTY_TOKENS: return "Unfreeze Property Tokens";
         case MSC_TYPE_NOTIFICATION: return "Notification";
         case OMNICORE_MESSAGE_TYPE_ALERT: return "ALERT";
         case OMNICORE_MESSAGE_TYPE_DEACTIVATION: return "Feature Deactivation";


tests:  Fix cut-and-paste error in QuadWithIndexedVertexFetch test.

Looks like the wrong memory barrier was set.

--- tests/render_tests.cpp
+++ tests/render_tests.cpp
@@ -943,7 +943,7 @@

     XglIndexBufferObj indexBuffer(m_device);
     indexBuffer.CreateAndInitBuffer(sizeof(g_idxData)/sizeof(g_idxData[0]), XGL_INDEX_16, g_idxData);
-    meshBuffer.BufferMemoryBarrier();
+    indexBuffer.BufferMemoryBarrier();

     XglShaderObj vs(m_device,vertShaderText,XGL_SHADER_STAGE_VERTEX, this);
     XglShaderObj ps(m_device,fragShaderText, XGL_SHADER_STAGE_FRAGMENT, this);


Coverity

Coverity

--- PWG3/vertexingHF/AliAnalysisVertexingHF.cxx
+++ PWG3/vertexingHF/AliAnalysisVertexingHF.cxx
@@ -107,7 +107,9 @@
 {
   // Default constructor

-  Double_t d02[2],d03[3],d04[4];
+  Double_t d02[2]={0.,0.};
+  Double_t d03[3]={0.,0.,0.};
+  Double_t d04[4]={0.,0.,0.,0.};
   fMassCalc2 = new AliAODRecoDecay(0x0,2,0,d02);
   fMassCalc3 = new AliAODRecoDecay(0x0,3,1,d03);
   fMassCalc4 = new AliAODRecoDecay(0x0,4,0,d04);
@@ -1845,6 +1847,7 @@
 	  }
 	}
       }
+      for(Int_t ijk=nTrksToSkip; ijk<1000; ijk++) skipped[ijk]=-1;
       //
       vertexer->SetSkipTracks(nTrksToSkip,skipped);
       vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(event);
@@ -2215,6 +2218,7 @@
     vprimary->GetCovarianceMatrix(cov);
     fV1 = new AliESDVertex(pos,cov,100.,100,vprimary->GetName());
     indices = new UShort_t[event->GetNumberOfTracks()];
+    for(Int_t ijk=0; ijk<event->GetNumberOfTracks(); ijk++) indices[ijk]=0;
     fAODMapSize = 100000;
     fAODMap = new Int_t[fAODMapSize];
   }


mgpu IPC support fix

mgpu IPC support fix

Change-Id: I12e4b2fd189c3658efd3b07defa18ece3853b0eb

--- src/hip_memory.cpp
+++ src/hip_memory.cpp
@@ -1260,10 +1260,15 @@

     ihipIpcMemHandle_t* iHandle = (ihipIpcMemHandle_t*) &handle;
     //Attach ipc memory
-    hsa_status_t hsa_status =
-        hsa_amd_ipc_memory_attach((hsa_amd_ipc_memory_t*)&(iHandle->ipc_handle), iHandle->psize, 1, agent, devPtr);
-    if(hsa_status != HSA_STATUS_SUCCESS)
-        hipStatus = hipErrorMapBufferObjectFailed;
+    auto ctx= ihipGetTlsDefaultCtx();
+    {
+        LockedAccessor_CtxCrit_t crit(ctx->criticalData());
+        // the peerCnt always stores self so make sure the trace actually
+        hsa_status_t hsa_status =
+         hsa_amd_ipc_memory_attach((hsa_amd_ipc_memory_t*)&(iHandle->ipc_handle), iHandle->psize, crit->peerCnt(), crit->peerAgents(), devPtr);
+        if(hsa_status != HSA_STATUS_SUCCESS)
+            hipStatus = hipErrorMapBufferObjectFailed;
+    }
 #else
     hipStatus = hipErrorRuntimeOther;
 #endif


Optimisation and bug fix of OpenMP FOF stitching

--- src/omproutines.cxx
+++ src/omproutines.cxx
@@ -208,7 +208,7 @@
 #endif

     cout<<ThisTask<<": Starting linking across OpenMP domains"<<endl;
-    numloops = 1;
+    numloops = 0;
     do {
         omp_links_across_total = 0;
         #pragma omp parallel default(shared) \
@@ -219,6 +219,7 @@
             for (auto j=0;j<omp_nrecv_total[i];j++) {
                 Pval=&Part[ompimport[omp_nrecv_offset[i]+j].index];
                 pfofcomp = ompimport[omp_nrecv_offset[i]+j].pfof;
+                if (pfofcomp == 0) continue;
                 //for each imported particle, find all particles within search window
                 for (auto k=0;k<3;k++) x[k]=Pval->GetPosition(k);
                 nt=tree3dfofomp[i]->SearchBallPosTagged(x, param[1], &nn[ompdomain[i].noffset]);
@@ -229,6 +230,7 @@
                         if (fofcheck(Part[curIndex],param)!=0 && fofcheck(*Pval,param)!=0) continue;

                     orgIndex = storeorgIndex[Part[curIndex].GetID()+ompdomain[i].noffset];
+                    if (pfof[orgIndex] < pfofcomp) continue;
                     //otherwise, change these particles to local group id if local group id smaller
                     //if local particle in a group
                     if (pfof[orgIndex]>0)  {
@@ -236,14 +238,12 @@
                         if (opt.partsearchtype==PSTALL && opt.iBaryonSearch>1)
                             if (!(fofcheck(Part[curIndex],param)==0 && fofcheck(*Pval,param)==0)) continue;
                         //if local group id is larger, change locally
-                        if(pfof[orgIndex] > pfofcomp) {
-                            Int_t ss = Head[nn[k+ompdomain[i].noffset]+ompdomain[i].noffset];
-                            do{
-                                orgIndex = storeorgIndex[Part[ss+ompdomain[i].noffset].GetID()+ompdomain[i].noffset];
-                                pfof[orgIndex]=pfofcomp;
-                            }while((ss = Next[ss+ompdomain[i].noffset]) >= 0);
-                            omp_links_across_total++;
-                        }
+                        Int_t ss = Head[nn[k+ompdomain[i].noffset]+ompdomain[i].noffset];
+                        do{
+                            orgIndex = storeorgIndex[Part[ss+ompdomain[i].noffset].GetID()+ompdomain[i].noffset];
+                            pfof[orgIndex]=pfofcomp;
+                        }while((ss = Next[ss+ompdomain[i].noffset]) >= 0);
+                        omp_links_across_total++;
                     }
                     //if local particle not in a group and export is appropriate type, link
                     else {
@@ -263,16 +263,15 @@
         #pragma omp for nowait
         for (i=0;i<numompregions;i++) {
             for (auto j=0;j<omp_nrecv_total[i];j++) {
-                for (auto j=0;j<omp_nrecv_total[i];j++) {
-                    curIndex=ompimport[omp_nrecv_offset[i]+j].index;
-                    curTask=ompimport[omp_nrecv_offset[i]+j].task;
-                    orgIndex=storeorgIndex[Part[curIndex].GetID()+ompdomain[curTask].noffset];
-                    ompimport[omp_nrecv_offset[i]+j].pfof=pfof[orgIndex];
-                }
+                curIndex=ompimport[omp_nrecv_offset[i]+j].index;
+                curTask=ompimport[omp_nrecv_offset[i]+j].task;
+                orgIndex=storeorgIndex[Part[curIndex].GetID()+ompdomain[curTask].noffset];
+                ompimport[omp_nrecv_offset[i]+j].pfof=pfof[orgIndex];
             }
         }
         }
         numloops++;
+        if (opt.iverbose>1) cout<<ThisTask<<" linking across at loop "<<numloops<<" having found "<<omp_links_across_total<<" links"<<endl;
     }while(omp_links_across_total>0);
     delete[] nn;
     cout<<ThisTask<<" finished linking "<<MyGetTime()-time1<<endl;


provide adress of the pointer to new AOD branch, not the pointer itself Mihaela G.

--- PWG4/AliAnalysisTaskParticleCorrelation.cxx
+++ PWG4/AliAnalysisTaskParticleCorrelation.cxx
@@ -84,7 +84,7 @@
   //AODs
   fAODBranch = new TClonesArray("AliAODParticleCorrelation", 0);
   fAODBranch->SetName(fAna->GetAODBranchName());
-  AddAODBranch("TClonesArray", fAODBranch);
+  AddAODBranch("TClonesArray", &fAODBranch);
   fAna->SetAODBranch(fAODBranch);

   //Histograms container


Update hip_module.cpp

Update hip_module.cpp

--- src/hip_module.cpp
+++ src/hip_module.cpp
@@ -506,6 +506,7 @@

 hipError_t hipFuncGetAttributes(hipFuncAttributes* attr, const void* func)
 {
+    if (!attr) return hipErrorInvalidValue;
     if (!func) return hipErrorInvalidDeviceFunction;

     const auto it0 = functions().find(reinterpret_cast<uintptr_t>(func));


Avoid using NULL string (match) in Pm::evaluate

Closes #2178.

--- src/operators/pm.cc
+++ src/operators/pm.cc
@@ -103,7 +103,7 @@
         transaction->m_matched.push_back(match_);
     }

-    if (rule && rule->m_containsCaptureAction && transaction && rc) {
+    if (rule && rule->m_containsCaptureAction && transaction && rc >= 0) {
         transaction->m_collections.m_tx_collection->storeOrUpdateFirst("0",
             std::string(match));
         ms_dbg_a(transaction, 7, "Added pm match TX.0: " + \


make positive all mc labels from tracks

make positive all mc labels from tracks

--- PWG4/PartCorrDep/AliAnaChargedParticles.cxx
+++ PWG4/PartCorrDep/AliAnaChargedParticles.cxx
@@ -335,7 +335,7 @@
     if(IsDataMC()){
       //Play with the MC stack if available
       Int_t mompdg = -1;
-      Int_t label  = tr->GetLabel();
+      Int_t label  = TMath::Abs(tr->GetLabel());
       if(GetReader()->ReadStack()){
         TParticle * mom = GetMCStack()->Particle(label);
         mompdg =TMath::Abs(mom->GetPdgCode());
@@ -347,6 +347,7 @@
         mompdg =TMath::Abs(aodmom->GetPdgCode());
       }

+
       if(mompdg==211){
         fhPtPion->Fill(tr->Pt());
         fhPhiPion->Fill(tr->Pt(), tr->Phi());
@@ -374,6 +375,7 @@
         fhEtaUnknown->Fill(tr->Pt(), tr->Eta());
       }
     }//Work with stack also
+
   }// aod branch loop

 }


Modifying 'create_rotation_symmetry_group_energy_function()'.

--- src/MeshCuboidNonLinearSolver.cpp
+++ src/MeshCuboidNonLinearSolver.cpp
@@ -349,8 +349,8 @@
 		++symmetry_group_index)
 	{
 		// Minimize \| t \|_2^2.
-		NLPVectorExpression t_variable = create_rotation_symmetry_group_variable_t(symmetry_group_index);
-		expression += NLPVectorExpression::dot_product(t_variable, t_variable);
+		//NLPVectorExpression t_variable = create_rotation_symmetry_group_variable_t(symmetry_group_index);
+		//expression += NLPVectorExpression::dot_product(t_variable, t_variable);

 		create_rotation_symmetry_group_energy_function(symmetry_group_index,
 			cuboid_ann_points, cuboid_ann_kd_tree, expression);


fix crash that happen when removing jabber accounts that have transports

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

--- kopete/config/accounts/kopeteaccountconfig.cpp
+++ kopete/config/accounts/kopeteaccountconfig.cpp
@@ -20,6 +20,7 @@

 #include <qcheckbox.h>
 #include <qlayout.h>
+#include <qguardedptr.h>

 #include <kcolorbutton.h>
 #include <kpushbutton.h>
@@ -45,7 +46,8 @@
 		Kopete::Account *account() { return m_account; }

 	private:
-		Kopete::Account *m_account;
+		//need to be guarded because some accounts may be linked (that's the case of jabber transports)
+		QGuardedPtr<Kopete::Account> m_account;
 };

 typedef KGenericFactory<KopeteAccountConfig, QWidget> KopeteAccountConfigFactory;
@@ -84,8 +86,10 @@
 	KopeteAccountLVI *i = static_cast<KopeteAccountLVI*>( m_view->mAccountList->firstChild() );
 	while( i )
 	{
-		  i->account()->setPriority( priority-- );
-		  i = static_cast<KopeteAccountLVI*>( i->nextSibling() );
+		if(!i->account())
+			continue;
+		i->account()->setPriority( priority-- );
+		i = static_cast<KopeteAccountLVI*>( i->nextSibling() );
 	}

 	QMap<Kopete::Account *, QColor>::Iterator it;
@@ -126,7 +130,7 @@
 	m_view->mButtonEdit->setEnabled( itemSelected );
 	m_view->mButtonRemove->setEnabled( itemSelected );

-	if ( itemSelected )
+	if ( itemSelected &&  itemSelected->account() )
 	{
 		m_view->mButtonUp->setEnabled( itemSelected->itemAbove() );
 		m_view->mButtonDown->setEnabled( itemSelected->itemBelow() );
@@ -184,7 +188,7 @@
 void KopeteAccountConfig::slotEditAccount()
 {
 	KopeteAccountLVI *lvi = static_cast<KopeteAccountLVI*>( m_view->mAccountList->selectedItem() );
-	if ( !lvi )
+	if ( !lvi || !lvi->account() )
 		return;

 	Kopete::Account *ident = lvi->account();
@@ -223,7 +227,7 @@
 void KopeteAccountConfig::slotRemoveAccount()
 {
 	KopeteAccountLVI *lvi = static_cast<KopeteAccountLVI*>( m_view->mAccountList->selectedItem() );
-	if ( !lvi )
+	if ( !lvi || !lvi->account() )
 		return;

 	Kopete::Account *i = lvi->account();
@@ -248,7 +252,7 @@
 		return;      // color because another account has been selected

 	KopeteAccountLVI *lvi = static_cast<KopeteAccountLVI*>( m_view->mAccountList->selectedItem() );
-	if ( !lvi )
+	if ( !lvi || !lvi->account() )
 		return;
 	Kopete::Account *account = lvi->account();


Added improved PBO support.

Added improved PBO support.

--- src/osg/Texture.cpp
+++ src/osg/Texture.cpp
@@ -39,6 +39,8 @@
 #define GL_STORAGE_CACHED_APPLE           0x85BE
 #define GL_STORAGE_SHARED_APPLE           0x85BF
 #endif
+
+// #define DO_TIMING

 unsigned int Texture::s_numberTextureReusedLastInLastFrame = 0;
 unsigned int Texture::s_numberNewTextureInLastFrame = 0;
@@ -759,6 +761,11 @@
     if (!image || !image->data())
         return;

+#ifdef DO_TIMING
+    osg::Timer_t start_tick = osg::Timer::instance()->tick();
+    osg::notify(osg::NOTICE)<<"glTexImage2D pixelFormat = "<<std::hex<<image->getPixelFormat()<<std::dec<<std::endl;
+#endif
+
     // get the contextID (user defined ID of 0 upwards) for the
     // current OpenGL context.
     const unsigned int contextID = state.getContextID();
@@ -822,8 +829,28 @@

     }

+    unsigned int dataMinusOffset=0;
+    unsigned int dataPlusOffset=0;
+
+
+    const PixelBufferObject* pbo = image->getPixelBufferObject();
+    if (pbo && pbo->isBufferObjectSupported(contextID) && !needImageRescale)
+    {
+        pbo->compileBuffer(state);
+        pbo->bindBuffer(contextID);
+        dataMinusOffset = (unsigned int) data;
+        dataPlusOffset=pbo->offset(); // -dataMinusOffset+dataPlusOffset
+#ifdef DO_TIMING
+        osg::notify(osg::NOTICE)<<"after PBO "<<osg::Timer::instance()->delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<<std::endl;
+#endif
+    }
+    else
+    {
+        pbo = 0;
+    }
+
     bool useHardwareMipMapGeneration = !image->isMipmap() && _useHardwareMipMapGeneration && generateMipMapSupported;
-
+
     if( _min_filter == LINEAR || _min_filter == NEAREST || useHardwareMipMapGeneration)
     {
         bool hardwareMipMapOn = false;
@@ -841,7 +868,7 @@
                 inwidth, inheight, _borderWidth,
                 (GLenum)image->getPixelFormat(),
                 (GLenum)image->getDataType(),
-                data );
+                data -dataMinusOffset+dataPlusOffset);

         }
         else if (extensions->isCompressedTexImage2DSupported())
@@ -854,7 +881,7 @@
             extensions->glCompressedTexImage2D(target, 0, _internalFormat,
                 inwidth, inheight,0,
                 size,
-                data);
+                data-dataMinusOffset+dataPlusOffset);
         }

         if (hardwareMipMapOn) glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS,GL_FALSE);
@@ -886,7 +913,7 @@
                          width, height, _borderWidth,
                         (GLenum)image->getPixelFormat(),
                         (GLenum)image->getDataType(),
-                        image->getMipmapData(k));
+                        image->getMipmapData(k)-dataMinusOffset+dataPlusOffset);

                     width >>= 1;
                     height >>= 1;
@@ -907,7 +934,7 @@

                     extensions->glCompressedTexImage2D(target, k, _internalFormat,
                                                        width, height, _borderWidth,
-                                                       size, image->getMipmapData(k));
+                                                       size, image->getMipmapData(k)-dataMinusOffset+dataPlusOffset);

                     width >>= 1;
                     height >>= 1;
@@ -924,7 +951,7 @@
                 gluBuild2DMipmaps( target, _internalFormat,
                     inwidth,inheight,
                     (GLenum)image->getPixelFormat(), (GLenum)image->getDataType(),
-                    data );
+                    data -dataMinusOffset+dataPlusOffset);

                 int width  = image->s();
                 int height = image->t();
@@ -943,6 +970,17 @@

     }

+    if (pbo)
+    {
+        pbo->unbindBuffer(contextID);
+    }
+#ifdef DO_TIMING
+    static double s_total_time = 0.0;
+    double delta_time = osg::Timer::instance()->delta_m(start_tick,osg::Timer::instance()->tick());
+    s_total_time += delta_time;
+    osg::notify(osg::NOTICE)<<"glTexImage2D "<<delta_time<<"ms  total "<<s_total_time<<"ms"<<std::endl;
+#endif
+
     if (needImageRescale)
     {
         // clean up the resized image.
@@ -971,6 +1009,10 @@
     }
     // else image size the same as when loaded so we can go ahead and subload

+#ifdef DO_TIMING
+    osg::Timer_t start_tick = osg::Timer::instance()->tick();
+    osg::notify(osg::NOTICE)<<"glTexSubImage2D pixelFormat = "<<std::hex<<image->getPixelFormat()<<std::dec<<std::endl;
+#endif

     // get the contextID (user defined ID of 0 upwards) for the
@@ -1037,12 +1079,14 @@
         pbo->bindBuffer(contextID);
         dataMinusOffset = (unsigned int) data;
         dataPlusOffset=pbo->offset(); // -dataMinusOffset+dataPlusOffset
+#ifdef DO_TIMING
+        osg::notify(osg::NOTICE)<<"after PBO "<<osg::Timer::instance()->delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<<std::endl;
+#endif
     }
     else
     {
         pbo = 0;
     }
-

     if( _min_filter == LINEAR || _min_filter == NEAREST || useHardwareMipMapGeneration)
     {
@@ -1062,7 +1106,7 @@
                 inwidth, inheight,
                 (GLenum)image->getPixelFormat(),
                 (GLenum)image->getDataType(),
-                data - dataMinusOffset+dataPlusOffset);
+                data - dataMinusOffset + dataPlusOffset);

         }
         else if (extensions->isCompressedTexImage2DSupported())
@@ -1075,7 +1119,7 @@
                 inwidth, inheight,
                 (GLenum)image->getPixelFormat(),
                 size,
-                data + -dataMinusOffset+dataPlusOffset );
+                data - dataMinusOffset + dataPlusOffset );
         }

         if (hardwareMipMapOn) glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS,GL_FALSE);
@@ -1104,7 +1148,7 @@
                         width, height,
                         (GLenum)image->getPixelFormat(),
                         (GLenum)image->getDataType(),
-                        image->getMipmapData(k) -dataMinusOffset+dataPlusOffset);
+                        image->getMipmapData(k) - dataMinusOffset + dataPlusOffset);

                     width >>= 1;
                     height >>= 1;
@@ -1129,7 +1173,7 @@
                                                        width, height,
                                                        (GLenum)image->getPixelFormat(),
                                                        size,
-                                                        image->getMipmapData(k) -dataMinusOffset+dataPlusOffset);
+                                                        image->getMipmapData(k) - dataMinusOffset + dataPlusOffset);

                     //state.checkGLErrors("after extensions->glCompressedTexSubImage2D(");

@@ -1141,75 +1185,7 @@
         }
         else
         {
-            if (!compressed_image)
-            {
-
-                 numMipmapLevels = 0;
-
-                int width  = inwidth;
-                int height = inheight;
-
-                glPixelStorei(GL_PACK_ALIGNMENT,image->getPacking());
-
-                unsigned int newTotalSize = osg::Image::computeRowWidthInBytes(width,image->getPixelFormat(),image->getDataType(),image->getPacking())*height;
-                unsigned char* copyData1 = new unsigned char [newTotalSize];
-                unsigned char* copyData2 = new unsigned char [newTotalSize];
-                unsigned char* tmpdata = data;
-
-                int previous_width = width;
-                int previous_height = height;
-
-                for( GLsizei k = 0 ; (width || height) ;++k)
-                {
-
-                    if (width == 0)
-                        width = 1;
-                    if (height == 0)
-                        height = 1;
-
-
-                    if (k>0)
-                    {
-                        if (data!=copyData1)
-                        {
-                            gluScaleImage(image->getPixelFormat(),
-                                          previous_width,previous_height,image->getDataType(),data,
-                                          width,height,image->getDataType(),copyData1);
-                            data = copyData1;
-                        }
-                        else
-                        {
-                            gluScaleImage(image->getPixelFormat(),
-                                          previous_width,previous_height,image->getDataType(),data,
-                                          width,height,image->getDataType(),copyData2);
-                            data = copyData2;
-                        }
-                    }
-
-                    glTexSubImage2D( target, k,
-                        0, 0,
-                        width, height,
-                        (GLenum)image->getPixelFormat(),
-                        (GLenum)image->getDataType(),
-                        data);
-
-                    previous_width = width;
-                    previous_height = height;
-
-                    width >>= 1;
-                    height >>= 1;
-                }
-
-                delete [] copyData1;
-                delete [] copyData2;
-
-                // restore the data paramters so it can be deleted if it was allocated locally via needImageRescale
-                data = tmpdata;
-            }
-            else
-            {
-                notify(WARN)<<"Warning:: Compressed image cannot be mip mapped"<<std::endl;
-            }
+            notify(WARN)<<"Warning:: cannot subload mip mapped texture from non mipmapped image."<<std::endl;
         }
     }

@@ -1217,6 +1193,9 @@
     {
         pbo->unbindBuffer(contextID);
     }
+#ifdef DO_TIMING
+    osg::notify(osg::NOTICE)<<"glTexSubImage2D "<<osg::Timer::instance()->delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<<std::endl;
+#endif

     if (needImageRescale)
     {


Added support so that true for boolean properties can be either "True" or "true" instead of just "True" (anything else still == false).

--- src/CEGUIPropertyHelper.cpp
+++ src/CEGUIPropertyHelper.cpp
@@ -57,7 +57,7 @@

 bool PropertyHelper::stringToBool(const String& str)
 {
-	if (str == (utf8*)"True")
+	if ((str == (utf8*)"True") || (str == (utf8*)"true"))
 	{
 		return true;
 	}


fix warning C4930: prototyped function not called

--- src/Mod/TechDraw/App/Cosmetic.cpp
+++ src/Mod/TechDraw/App/Cosmetic.cpp
@@ -211,9 +211,6 @@
     std::stringstream ss;
     Base::Vector3d start, end;
     if (geometry != nullptr) {
-        Base::Vector2d getStartPoint();
-        Base::Vector2d getEndPoint();
-
         Base::Vector2d p2d = geometry->getStartPoint();
         start = Base::Vector3d(p2d.x, p2d.y, 0.0);
         p2d = geometry->getEndPoint();


Fixed build

Fixed build

git-svn-id: aa838dfc23441284dd616281de4245daec5d2135@14410 16af8721-9629-0410-8352-f15c8da7e697

--- src/osgUI/Style.cpp
+++ src/osgUI/Style.cpp
@@ -78,7 +78,7 @@
     vertices->push_back( osg::Vec3(extents.xMax(), extents.yMax(), extents.zMin()) );

     osg::ref_ptr<osg::Vec4Array> colours = new osg::Vec4Array;
-    geometry->setColorArray(colours, osg::Array::BIND_OVERALL);
+    geometry->setColorArray(colours.get(), osg::Array::BIND_OVERALL);

     colours->push_back( colour );


Fix #58 ProjectionGroupItem positioning after restore

--- src/Mod/TechDraw/App/DrawView.cpp
+++ src/Mod/TechDraw/App/DrawView.cpp
@@ -70,10 +70,12 @@
     ScaleType.setEnums(ScaleTypeEnums);
     ADD_PROPERTY_TYPE(ScaleType,((long)0),group, App::Prop_None, "Scale Type");
     ADD_PROPERTY_TYPE(Scale ,(1.0),group,App::Prop_None,"Scale factor of the view");
-    //Scale.setStatus(App::Property::ReadOnly,true);
-
-    autoPos = true;
-
+
+    if (isRestoring()) {
+        autoPos = false;
+    } else {
+        autoPos = true;
+    }
 }

 DrawView::~DrawView()
@@ -126,8 +128,6 @@
                 Scale.setStatus(App::Property::ReadOnly,true);
                 App::GetApplication().signalChangePropertyEditor(Scale);
             } else if ( ScaleType.isValue("Custom") ) {
-//            } else if (ScaleType.isValue("Custom") &&
-//                Scale.testStatus(App::Property::ReadOnly)) {
                 Scale.setStatus(App::Property::ReadOnly,false);
                 App::GetApplication().signalChangePropertyEditor(Scale);
             }


Back to -dev

Back to -dev

--- mongodb.cpp
+++ mongodb.cpp
@@ -83,7 +83,7 @@

 static class MongoDBExtension : public Extension {
 	public:
-		MongoDBExtension() : Extension("mongodb", "1.1.0") {}
+		MongoDBExtension() : Extension("mongodb", "1.1.1RC1-dev") {}

 		virtual void moduleInit() {
 			/* MongoDB\BSON functions */


Added more methods to RoutingModel

Added more methods to RoutingModel

--- ext/or-tools/routing.cpp
+++ ext/or-tools/routing.cpp
@@ -326,7 +326,6 @@
           throw std::runtime_error("Unknown solver status");
         }
       })
-    .define_method("vehicle_var", &RoutingModel::VehicleVar)
     .define_method("set_arc_cost_evaluator_of_all_vehicles", &RoutingModel::SetArcCostEvaluatorOfAllVehicles)
     .define_method("set_arc_cost_evaluator_of_vehicle", &RoutingModel::SetArcCostEvaluatorOfVehicle)
     .define_method("set_fixed_cost_of_all_vehicles", &RoutingModel::SetFixedCostOfAllVehicles)
@@ -351,7 +350,16 @@
     .define_method("next", &RoutingModel::Next)
     .define_method("vehicle_used?", &RoutingModel::IsVehicleUsed)
     .define_method("next_var", &RoutingModel::NextVar)
+    .define_method("active_var", &RoutingModel::ActiveVar)
+    .define_method("active_vehicle_var", &RoutingModel::ActiveVehicleVar)
+    .define_method("vehicle_route_considered_var", &RoutingModel::VehicleRouteConsideredVar)
+    .define_method("vehicle_var", &RoutingModel::VehicleVar)
+    .define_method("resource_var", &RoutingModel::ResourceVar)
+    .define_method("cost_var", &RoutingModel::CostVar)
     .define_method("arc_cost_for_vehicle", &RoutingModel::GetArcCostForVehicle)
+    .define_method("costs_are_homogeneous_across_vehicles?", &RoutingModel::CostsAreHomogeneousAcrossVehicles)
+    .define_method("homogeneous_cost", &RoutingModel::GetHomogeneousCost)
+    .define_method("arc_cost_for_first_solution", &RoutingModel::GetArcCostForFirstSolution)
     .define_method("mutable_dimension", &RoutingModel::GetMutableDimension)
     .define_method("add_variable_minimized_by_finalizer", &RoutingModel::AddVariableMinimizedByFinalizer)
     .define_method(


no message

no message

--- bridge.cpp
+++ bridge.cpp
@@ -27,31 +27,32 @@
   return rObj->NumberValue();
 }

-Motor::LineFrequency line;
-Motor::EfficiencyClass effCls;
-Pump::Drive drive;
-double motorRatedPower;
+
+Motor::LineFrequency line() {
+  return (Motor::LineFrequency)(int)(!Get("line"));
+}
+Motor::EfficiencyClass effCls() {
+  return (Motor::EfficiencyClass)(int)Get("efficiency_class");
+}
+Pump::Drive drive() {
+  return (Pump::Drive)(int)Get("drive");
+}

 void Setup(const FunctionCallbackInfo<Value>& args) {
   iso = args.GetIsolate();
   inp = args[0]->ToObject();
   r = Object::New(iso);
   args.GetReturnValue().Set(r);
-
-  line = (Motor::LineFrequency)(int)(!Get("line"));
-  effCls = (Motor::EfficiencyClass)(int)Get("efficiency_class");
-  drive = (Pump::Drive)(int)Get("drive");
-  motorRatedPower = Get("motor_rated_power");
 }

 void Results(const FunctionCallbackInfo<Value>& args) {
   Setup(args);

-  Pump pump((Pump::Style)(int)Get("pump_style"),Get("pump_specified"),Get("pump_rated_speed"),drive,
+  Pump pump((Pump::Style)(int)Get("pump_style"),Get("pump_specified"),Get("pump_rated_speed"),drive(),
       Get("viscosity"),Get("specific_gravity"),Get("stages"),(Pump::Speed)(int)(!Get("fixed_speed")));
-  Motor motor(line,motorRatedPower,Get("motor_rated_speed"),
-      effCls,Get("efficiency"),Get("motor_rated_voltage"),Get("motor_rated_flc"),Get("margin"));
+  Motor motor(line(),Get("motor_rated_power"),Get("motor_rated_speed"),effCls(),
+      Get("efficiency"),Get("motor_rated_voltage"),Get("motor_rated_flc"),Get("margin"));
   Financial fin(Get("fraction"),Get("cost"));
   FieldData fd(Get("flow"),Get("head"),(FieldData::LoadEstimationMethod)(Get("motor_field_power")>0?0:1),
       Get("motor_field_power"),Get("motor_field_current"),Get("motor_field_voltage"));
@@ -84,7 +85,7 @@

 void EstFLA(const FunctionCallbackInfo<Value>& args) {
   Setup(args);
-  EstimateFLA fla(motorRatedPower,Get("motor_rated_speed"),line,effCls,
+  EstimateFLA fla(Get("motor_rated_power"),Get("motor_rated_speed"),line(),effCls(),
     Get("efficiency"),Get("motor_rated_voltage"));
   fla.calculate();
   args.GetReturnValue().Set(fla.getEstimatedFLA());
@@ -93,15 +94,15 @@
 void MotorPerformance(const FunctionCallbackInfo<Value>& args) {
   Setup(args);

-  MotorEfficiency mef(line,Get("motor_rated_speed"),effCls,Get("efficiency"),motorRatedPower,Get("load_factor"));
+  MotorEfficiency mef(line(),Get("motor_rated_speed"),effCls(),Get("efficiency"),Get("motor_rated_power"),Get("load_factor"));
   auto mefVal = mef.calculate();
   r->Set(String::NewFromUtf8(iso,"efficiency"),Number::New(iso,mefVal*100));

-  MotorCurrent mc(motorRatedPower,Get("motor_rated_speed"),line,effCls,Get("efficiency"),Get("load_factor"),Get("motor_rated_voltage"),Get("flc"));
+  MotorCurrent mc(Get("motor_rated_power"),Get("motor_rated_speed"),line(),effCls(),Get("efficiency"),Get("load_factor"),Get("motor_rated_voltage"),Get("flc"));
   auto mcVal = mc.calculate();
   r->Set(String::NewFromUtf8(iso,"current"),Number::New(iso,mcVal/225.8*100));

-  MotorPowerFactor pf(motorRatedPower,Get("load_factor"),mcVal,mefVal,Get("motor_rated_voltage"));
+  MotorPowerFactor pf(Get("motor_rated_power"),Get("load_factor"),mcVal,mefVal,Get("motor_rated_voltage"));
   r->Set(String::NewFromUtf8(iso,"pf"),Number::New(iso,pf.calculate()*100));
 }


ui-log: Fix warning on GCC

ui-log: Fix warning on GCC

--- src/pack/ui-log.cpp
+++ src/pack/ui-log.cpp
@@ -45,12 +45,12 @@

 void uiShowListingEntry(const std::string& blobPath, uint64_t blobSize) {
     pool->schedule([=] {
-        printf("%s: %llu bytes\n", blobPath.c_str(), blobSize);
+        printf("%s: %lu bytes\n", blobPath.c_str(), blobSize);
     });
 }

 void uiShowExtractingFile(const std::string& blobPath, uint64_t blobSize) {
     pool->schedule([=] {
-        printf("Extracting %s: %llu bytes\n", blobPath.c_str(), blobSize);
+        printf("Extracting %s: %lu bytes\n", blobPath.c_str(), blobSize);
     });
 }


Fixed OSX build

Fixed OSX build

--- src/slic3r/GUI/Preferences.hpp
+++ src/slic3r/GUI/Preferences.hpp
@@ -6,6 +6,8 @@

 #include <wx/dialog.h>
 #include <map>
+
+class wxRadioBox;

 namespace Slic3r {
 namespace GUI {


Simplify use of events in TestAudioDevice

Create events with |manual_reset| and |initially_signalled| both false
(used to be both true). Delete calls to Set and Reset events from the
{Start,Stop}{Playout,Recording} methods. Then, for each event, there
remains a single call to Set, in the ProcessingAudio loop, and a
single call to Wait, in WaitForPlayoutEnd and WaitForRecordingEnd,
respectively.

Bug: webrtc:9962
Change-Id: Ia358b4a36896e2378ad6166f3786d8d71392bf1b
Reviewed-on: https://webrtc-review.googlesource.com/c/109562
Reviewed-by: Henrik Andreassson <e468f06af92d21183a2a635f545ff5cefc8c8b65@webrtc.org>
Commit-Queue: Niels Moller <0057859e47d61d90529d0f66d9ef692cefedb46a@webrtc.org>
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#25518}

--- modules/audio_device/include/test_audio_device.cc
+++ modules/audio_device/include/test_audio_device.cc
@@ -62,8 +62,8 @@
         audio_callback_(nullptr),
         rendering_(false),
         capturing_(false),
-        done_rendering_(true, true),
-        done_capturing_(true, true),
+        done_rendering_(false, false),
+        done_capturing_(false, false),
         stop_thread_(false) {
     auto good_sample_rate = [](int sr) {
       return sr == 8000 || sr == 16000 || sr == 32000 || sr == 44100 ||
@@ -112,14 +112,12 @@
     rtc::CritScope cs(&lock_);
     RTC_CHECK(renderer_);
     rendering_ = true;
-    done_rendering_.Reset();
     return 0;
   }

   int32_t StopPlayout() {
     rtc::CritScope cs(&lock_);
     rendering_ = false;
-    done_rendering_.Set();
     return 0;
   }

@@ -127,14 +125,12 @@
     rtc::CritScope cs(&lock_);
     RTC_CHECK(capturer_);
     capturing_ = true;
-    done_capturing_.Reset();
     return 0;
   }

   int32_t StopRecording() {
     rtc::CritScope cs(&lock_);
     capturing_ = false;
-    done_capturing_.Set();
     return 0;
   }


Fix to the StrConverter

Fix to the StrConverter

Went to fast and accidentally broke the build

--- generate/templates/manual/src/str_array_converter.cc
+++ generate/templates/manual/src/str_array_converter.cc
@@ -24,7 +24,7 @@
   }
 }

-static git_strarray * StrArrayConverter::AllocStrArray(const size_t count) {
+git_strarray * StrArrayConverter::AllocStrArray(const size_t count) {
   const size_t size = sizeof(git_strarray) + (sizeof(char*) * count);
   uint8_t* memory = reinterpret_cast<uint8_t*>(malloc(size));
   git_strarray *result = reinterpret_cast<git_strarray *>(memory);


Red tiles not printed

Red tiles not printed

--- Project/Dev_class11_handout/Motor2D/j1Map.cpp
+++ Project/Dev_class11_handout/Motor2D/j1Map.cpp
@@ -57,6 +57,7 @@
 							SDL_Rect r = tileset->GetTileRect(tile_id);
 							iPoint pos = MapToWorld(x, y);

+							if (layer->properties.Get("Navigation") == false)
 							App->render->Blit(tileset->texture, pos.x, pos.y, &r);
 						}
 					}


Parallelize meshes (where applicable) in EquationSystems::init()

git-svn-id: ffc1bc5b3feaf8644044862cc38c386ade156493@2325 434f946d-2f3d-0410-ba4c-cb9f52fb0dbf

--- src/solvers/equation_systems.C
+++ src/solvers/equation_systems.C
@@ -90,6 +90,10 @@
   const unsigned int n_sys = this->n_systems();

   assert (n_sys != 0);
+
+  // Distribute the mesh if possible
+  if (libMesh::n_processors() > 1)
+    _mesh.delete_remote_elements();

   // Tell all the \p DofObject entities how many systems
   // there are.


Предотвращается дублирование загрузки главного модуля (#76)

--- src/srlib/refalrts-dynamic.cpp
+++ src/srlib/refalrts-dynamic.cpp
@@ -778,7 +778,13 @@
     return false;
   }

-  Module *new_module = new Module(
+  Module *new_module = m_storage[module_stat];
+  if (new_module) {
+    // TODO: счётчик ссылок
+    return new_module;
+  }
+
+  new_module = new Module(
     this, module_name, module_stat, success, event, callback_data, main_module
   );


fix build on mac. closes #4.

fix build on mac. closes #4.

--- src/pty.cc
+++ src/pty.cc
@@ -35,6 +35,14 @@
 #include <utmp.h> /* login_tty */
 #include <termios.h> /* tcgetattr, tty_ioctl */

+// environ for execvpe
+#ifdef __APPLE__
+  #include <crt_externs.h>
+  #define environ (*_NSGetEnviron())
+#else
+extern char **environ;
+#endif
+
 using namespace std;
 using namespace node;
 using namespace v8;


Trying to get version number in the executable

git-svn-id: 5069ba8be4c997ee907bf46f8ec9a2bbfb655637@170 e59a4935-1847-0410-ae03-e826735625c1

--- src/parser/main.cpp
+++ src/parser/main.cpp
@@ -39,7 +39,7 @@
 extern BEEV::ASTNode SingleBitZero;
 }

-
+const string version = "$Id$";

 /* GLOBAL VARS: Some global vars for the Main function.
  *


Disable ldpc tests when built w/o openfec

--- src/tests/roc_pipeline/test_client_server.cpp
+++ src/tests/roc_pipeline/test_client_server.cpp
@@ -143,6 +143,7 @@
     flow_client_server();
 }

+#ifdef ROC_TARGET_OPENFEC
 TEST(client_server, ldpc_only_client) {
     init_client(EnableLDPC);
     init_server(0);
@@ -178,6 +179,7 @@
     init_server(EnableLDPC);
     flow_client_server();
 }
+#endif // ROC_TARGET_OPENFEC

 } // namespace test
 } // namespace roc


removed debug output.

removed debug output.

--- src/tools/ms_export_obj/src/ms_export_obj.cpp
+++ src/tools/ms_export_obj/src/ms_export_obj.cpp
@@ -51,15 +51,10 @@
     MString file_path;
     for (unsigned int i = 0; i < args.length(); i++)
     {
-        MGlobal::displayInfo(args.asString(i));
         if (args.asString(i) == "-mesh")
-        {
             mesh_name = args.asString(i+1);
-        }
         else if (args.asString(i) == "-filePath")
-        {
             file_path = args.asString(i+1);
-        }
     }

     MString display_info;


Integrate annotation into CodeViewerDemo

Adds some annotating content to the code viewer demo.

--- src/CodeViewerDemo/main.cpp
+++ src/CodeViewerDemo/main.cpp
@@ -6,7 +6,7 @@

 #include "CodeExamples.h"
 #include "CodeViewer/Dialog.h"
-#include "SyntaxHighlighter/Cpp.h"
+#include "SyntaxHighlighter/X86Assembly.h"

 class DummyCodeReport : public CodeReport {
  public:
@@ -28,15 +28,28 @@
   orbit_code_viewer::Dialog dialog{};

   // Example file
-  const QString content = testing_example;
+  const QString content = x86Assembly_example;

-  dialog.SetMainContent(content, std::make_unique<orbit_syntax_highlighter::Cpp>());
+  dialog.SetMainContent(content, std::make_unique<orbit_syntax_highlighter::X86Assembly>());
+
+  std::vector<orbit_code_viewer::AnnotatingLine> lines{};
+  lines.emplace_back();
+  lines.back().reference_line = 9;
+  lines.back().line_number = 42;
+  lines.back().line_contents = "void main() {";
+
+  lines.emplace_back();
+  lines.back().reference_line = 14;
+  lines.back().line_number = 43;
+  lines.back().line_contents = "echo \"Hello World!\";";
+
+  dialog.SetAnnotatingContent(lines);

   const auto line_numbers = content.count('\n');
   const DummyCodeReport code_report{static_cast<uint32_t>(line_numbers)};
   dialog.SetHeatmap(orbit_code_viewer::FontSizeInEm{1.2f}, &code_report);

-  dialog.SetLineNumberTypes(orbit_code_viewer::Dialog::LineNumberTypes::kOnlyMainContent);
+  dialog.SetLineNumberTypes(orbit_code_viewer::Dialog::LineNumberTypes::kOnlyAnnotatingLines);
   dialog.SetEnableSampleCounters(true);
   dialog.GoToLineNumber(10);
   dialog.SetHighlightCurrentLine(true);


Fixed debug build crash on mac, reading from stringstream into emtpy string crashed when compiling with clang

git-svn-id: e0b5bbb11d0e9fdbbfcabba14dc32ad5d6b235bd@579 fdac6126-5c0c-442c-9429-916003d36597

--- src/OpenMesh/Core/IO/IOManager.cc
+++ src/OpenMesh/Core/IO/IOManager.cc
@@ -69,7 +69,10 @@

 _IOManager_& IOManager()
 {
-  if (!__IOManager_instance)  __IOManager_instance = new _IOManager_();
+
+  if (!__IOManager_instance)
+    __IOManager_instance = new _IOManager_();
+
   return *__IOManager_instance;
 }

@@ -260,43 +263,56 @@
 {
   std::set<BaseReader*>::const_iterator it     = reader_modules_.begin(),
                                         it_end = reader_modules_.end();
-  std::string s, all, filters;
-
-  for(; it != it_end; ++it)
-  {
+  std::string all = "";
+  std::string filters = "";
+
+  for(; it != it_end; ++it)
+  {
+    // Initialized with space, as a workaround for debug build with clang on mac
+    // which crashes if tmp is initialized with an empty string ?!
+    std::string tmp = " ";
+
     filters += (*it)->get_description() + " (";

+    std::istringstream iss((*it)->get_extensions());
+
+    while (iss && !iss.eof() && (iss >> tmp) )
+    {
+     tmp = " *." + tmp; filters += tmp; all += tmp;
+    }
+
+    filters += " );;";
+  }
+
+  all = "All files ( " + all + " );;";
+
+  read_filters_ = all + filters;
+}
+
+
+//-----------------------------------------------------------------------------
+
+
+void
+_IOManager_::
+update_write_filters()
+{
+  std::set<BaseWriter*>::const_iterator it     = writer_modules_.begin(),
+                                        it_end = writer_modules_.end();
+  std::string all;
+  std::string filters;
+
+  for(; it != it_end; ++it)
+  {
+    // Initialized with space, as a workaround for debug build with clang on mac
+    // which crashes if tmp is initialized with an empty string ?!
+    std::string s = " ";
+
+    filters += (*it)->get_description() + " (";
+
     std::istringstream iss((*it)->get_extensions());
     while (iss && !iss.eof() && (iss >> s))
     { s = " *." + s; filters += s; all += s; }
-
-    filters += " );;";
-  }
-
-  all = "All files ( " + all + " );;";
-
-  read_filters_ = all + filters;
-}
-
-
-//-----------------------------------------------------------------------------
-
-
-void
-_IOManager_::
-update_write_filters()
-{
-  std::set<BaseWriter*>::const_iterator it     = writer_modules_.begin(),
-                                        it_end = writer_modules_.end();
-  std::string s, all, filters;
-
-  for(; it != it_end; ++it)
-  {
-    filters += (*it)->get_description() + " (";
-
-    std::istringstream iss((*it)->get_extensions());
-    while (iss && !iss.eof() && (iss >> s))
-    { s = " *." + s; filters += s; all += s; }

     filters += " );;";
   }


sink_rubber: call destructor

sink_rubber: call destructor

--- src/sink_rubber.cxx
+++ src/sink_rubber.cxx
@@ -36,6 +36,7 @@
 #include "rubber.hxx"
 #include "pool/pool.hxx"
 #include "util/Cancellable.hxx"
+#include "util/LeakDetector.hxx"

 #include <assert.h>
 #include <stdint.h>
@@ -43,7 +44,7 @@
 #include <unistd.h>
 #include <sys/socket.h>

-class RubberSink final : IstreamSink, Cancellable {
+class RubberSink final : IstreamSink, Cancellable, LeakDetector {
     Rubber &rubber;
     unsigned rubber_id;

@@ -69,6 +70,10 @@
     }

 private:
+    void Destroy() {
+        this->~RubberSink();
+    }
+
     void FailTooLarge();
     void InvokeEof();

@@ -132,6 +137,7 @@
         /* too large, abort and invoke handler */

         FailTooLarge();
+        Destroy();
         return 0;
     }

@@ -155,11 +161,13 @@
         ssize_t nbytes = fd_read(type, fd, &dummy, sizeof(dummy));
         if (nbytes > 0) {
             FailTooLarge();
+            Destroy();
             return ISTREAM_RESULT_CLOSED;
         }

         if (nbytes == 0) {
             InvokeEof();
+            Destroy();
             return ISTREAM_RESULT_CLOSED;
         }

@@ -186,6 +194,7 @@
     input.Clear();

     InvokeEof();
+    Destroy();
 }

 void
@@ -196,6 +205,7 @@

     rubber.Remove(rubber_id);
     handler.RubberError(ep);
+    Destroy();
 }

 /*
@@ -210,6 +220,8 @@

     if (input.IsDefined())
         input.ClearAndClose();
+
+    Destroy();
 }

 /*


Increase deadline to account for slowness from valgrind (#2073)

--- nano/rpc_test/rpc.cpp
+++ nano/rpc_test/rpc.cpp
@@ -6425,7 +6425,7 @@

 	promise.get_future ().wait ();

-	system.deadline_set (10s);
+	system.deadline_set (60s);
 	while (std::any_of (test_responses.begin (), test_responses.end (), [](const auto & test_response) { return test_response->status == 0; }))
 	{
 		ASSERT_NO_ERROR (system.poll ());


Fixed the MAX_SIZE macro that was incorrectly calculating the maximum remaining size

Also used the macro when checking if the subtype belongs to the vendor
tree.

--- src/http_header.cc
+++ src/http_header.cc
@@ -66,10 +66,17 @@
     };

     auto raise = [&](const char* str) {
+        // TODO: eventually, we should throw a more generic exception
+        // that could then be catched in lower stack frames to rethrow
+        // an HttpError
         throw HttpError(Http::Code::Unsupported_Media_Type, str);
     };

-    #define MAX_SIZE(s) std::min(sizeof(s) - 1, offset(p))
+    // Macro to ensure that we do not overflow when comparing strings
+    // The trick here is to use sizeof on a raw string literal of type
+    // const char[N] instead of strlen to avoid additional
+    // runtime computation
+    #define MAX_SIZE(s) std::min(sizeof(s) - 1, len - offset(p))

     // Parse type
     const char *p = strchr(str, '/');
@@ -97,7 +104,7 @@
         }
         MIME_TYPES
 #undef TYPE
-        throw HttpError(Http::Code::Unsupported_Media_Type, "Unknown Media Type");
+        raise("Unknown Media Type");
     } while (0);

     top_ = top;
@@ -108,15 +115,15 @@

     if (eof(p)) raise("Malformed Media Type");

-    if (memcmp(p, "vnd.", 4) == 0) {
+    if (memcmp(p, "vnd.", MAX_SIZE("vnd.")) == 0) {
         sub = Subtype::Vendor;
     } else {
         do {
-#define SUB_TYPE(val, s) \
+#define SUB_TYPE(val, s)                          \
             if (memcmp(p, s, MAX_SIZE(s)) == 0) { \
-                sub = Subtype::val; \
-                p += sizeof(s) - 1; \
-                break; \
+                sub = Subtype::val;               \
+                p += sizeof(s) - 1;               \
+                break;                            \
             }
             MIME_SUBTYPES
 #undef SUB_TYPE
@@ -143,11 +150,11 @@
         if (eof(p)) raise("Malformed Media Type");

         do {
-#define SUFFIX(val, s, _) \
+#define SUFFIX(val, s, _)                         \
             if (memcmp(p, s, MAX_SIZE(s)) == 0) { \
-                suffix = Suffix::val; \
-                p += sizeof(s) - 1; \
-                break; \
+                suffix = Suffix::val;             \
+                p += sizeof(s) - 1;               \
+                break;                            \
             }
             MIME_SUFFIXES
 #undef SUFFIX
@@ -217,7 +224,7 @@

     auto topString = [](Mime::Type top) -> const char * {
         switch (top) {
-#define TYPE(val, str) \
+#define TYPE(val, str)        \
         case Mime::Type::val: \
             return str;
         MIME_TYPES
@@ -227,7 +234,7 @@

     auto subString = [](Mime::Subtype sub) -> const char * {
         switch (sub) {
-#define SUB_TYPE(val, str) \
+#define SUB_TYPE(val, str)       \
         case Mime::Subtype::val: \
             return str;
         MIME_SUBTYPES
@@ -237,7 +244,7 @@

     auto suffixString = [](Mime::Suffix suffix) -> const char * {
         switch (suffix) {
-#define SUFFIX(val, str, _) \
+#define SUFFIX(val, str, _)     \
         case Mime::Suffix::val: \
             return "+" str;
         MIME_SUFFIXES


item_func.cc	bug with several fulltext indexes fixed

--- sql/item_func.cc
+++ sql/item_func.cc
@@ -1988,7 +1988,7 @@
       ft_to_key[mkeys]=ft_to_key[key];
       continue;
     }
-    if (ft_cnt[key] == max_cnt)
+    if (max_cnt && ft_cnt[key] == max_cnt)
     {
       mkeys++;
       ft_cnt[mkeys]=ft_cnt[key];


CP: Remove two read-backs from copy image tests am: 263e135474 am: 15f98c4682 am: 1e01d9996c
am: 46a71ac84b

Change-Id: Ic9ace513b43236bfe49f834ffef729d8040530e7

--- modules/gles31/functional/es31fCopyImageTests.cpp
+++ modules/gles31/functional/es31fCopyImageTests.cpp
@@ -115,6 +115,12 @@
 	VIEWCLASS_ASTC_10x10_RGBA,
 	VIEWCLASS_ASTC_12x10_RGBA,
 	VIEWCLASS_ASTC_12x12_RGBA
+};
+
+enum Verify
+{
+	VERIFY_NONE = 0,
+	VERIFY_COMPARE_REFERENCE
 };

 const char* viewClassToName (ViewClass viewClass)
@@ -890,14 +896,15 @@
 				  srcImageData, srcImageInfo, srcLevel, srcPos, copySize);
 }

-void verifyTexture2DView (tcu::TestContext&			testContext,
+void renderTexture2DView (tcu::TestContext&			testContext,
 						  glu::RenderContext&		renderContext,
 						  TextureRenderer&			renderer,
 						  tcu::ResultCollector&		results,
 						  de::Random&				rng,
 						  deUint32					name,
 						  const ImageInfo&			info,
-						  const tcu::Texture2DView&	refTexture)
+						  const tcu::Texture2DView&	refTexture,
+						  Verify					verify)
 {
 	tcu::TestLog&					log				= testContext.getLog();
 	const glw::Functions&			gl				= renderContext.getFunctions();
@@ -928,8 +935,6 @@
 		const RandomViewport	viewport		(renderContext.getRenderTarget(), levelSize.x(), levelSize.y(), rng.getUint32());

 		vector<float>			texCoord;
-		tcu::Surface			renderedFrame	(viewport.width, viewport.height);
-		tcu::Surface			referenceFrame	(viewport.width, viewport.height);

 		renderParams.baseLevel	= level;
 		renderParams.maxLevel	= level;
@@ -944,17 +949,25 @@

 		// Draw.
 		renderer.renderQuad(0, &texCoord[0], renderParams);
-		glu::readPixels(renderContext, viewport.x, viewport.y, renderedFrame.getAccess());
-		GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to render and read pixels.");
-
-		// Compute reference.
-		sampleTexture(SurfaceAccess(referenceFrame, renderContext.getRenderTarget().getPixelFormat()), refTexture, &texCoord[0], renderParams);
-
-		// Compare and log.
-		if (!pixelThresholdCompare(log, ("Level" + de::toString(level)).c_str(), ("Render level " + de::toString(level)).c_str(), referenceFrame, renderedFrame, threshold, tcu::COMPARE_LOG_ON_ERROR))
-			results.fail("Image comparison of level " + de::toString(level) + " failed.");
-		else
-			log << TestLog::Message << "Image comparison of level " << level << " passed." << TestLog::EndMessage;
+		GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to render.");
+
+		if (verify == VERIFY_COMPARE_REFERENCE)
+		{
+			tcu::Surface renderedFrame	(viewport.width, viewport.height);
+			tcu::Surface referenceFrame	(viewport.width, viewport.height);
+
+			glu::readPixels(renderContext, viewport.x, viewport.y, renderedFrame.getAccess());
+			GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to read pixels.");
+
+			// Compute reference.
+			sampleTexture(SurfaceAccess(referenceFrame, renderContext.getRenderTarget().getPixelFormat()), refTexture, &texCoord[0], renderParams);
+
+			// Compare and log.
+			if (!pixelThresholdCompare(log, ("Level" + de::toString(level)).c_str(), ("Render level " + de::toString(level)).c_str(), referenceFrame, renderedFrame, threshold, tcu::COMPARE_LOG_ON_ERROR))
+				results.fail("Image comparison of level " + de::toString(level) + " failed.");
+			else
+				log << TestLog::Message << "Image comparison of level " << level << " passed." << TestLog::EndMessage;
+		}
 	}

 	gl.texParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
@@ -1015,14 +1028,15 @@
 	}
 }

-void verifyTexture2D (tcu::TestContext&						testContext,
+void renderTexture2D (tcu::TestContext&						testContext,
 					  glu::RenderContext&					renderContext,
 					  TextureRenderer&						textureRenderer,
 					  tcu::ResultCollector&					results,
 					  de::Random&							rng,
 					  deUint32								name,
 					  const vector<ArrayBuffer<deUint8> >&	data,
-					  const ImageInfo&						info)
+					  const ImageInfo&						info,
+					  Verify								verify)
 {
 	if (glu::isCompressedFormat(info.getFormat()))
 	{
@@ -1034,7 +1048,7 @@
 		{
 			const tcu::Texture2DView refTexture((int)levelAccesses.size(), &(levelAccesses[0]));

-			verifyTexture2DView(testContext, renderContext, textureRenderer, results, rng, name, info, refTexture);
+			renderTexture2DView(testContext, renderContext, textureRenderer, results, rng, name, info, refTexture, verify);
 		}
 	}
 	else
@@ -1042,18 +1056,19 @@
 		const vector<tcu::ConstPixelBufferAccess>	levelAccesses	= getLevelAccesses(data, info);
 		const tcu::Texture2DView					refTexture		((int)levelAccesses.size(), &(levelAccesses[0]));

-		verifyTexture2DView(testContext, renderContext, textureRenderer, results, rng, name, info, refTexture);
-	}
-}
-
-void verifyTexture3DView (tcu::TestContext&			testContext,
+		renderTexture2DView(testContext, renderContext, textureRenderer, results, rng, name, info, refTexture, verify);
+	}
+}
+
+void renderTexture3DView (tcu::TestContext&			testContext,
 						  glu::RenderContext&		renderContext,
 						  TextureRenderer&			renderer,
 						  tcu::ResultCollector&		results,
 						  de::Random&				rng,
 						  deUint32					name,
 						  const ImageInfo&			info,
-						  const tcu::Texture3DView&	refTexture)
+						  const tcu::Texture3DView&	refTexture,
+						  Verify					verify)
 {
 	tcu::TestLog&					log				= testContext.getLog();
 	const glw::Functions&			gl				= renderContext.getFunctions();
@@ -1093,8 +1108,6 @@
 		{
 			const RandomViewport	viewport		(renderContext.getRenderTarget(), levelSize.x(), levelSize.y(), rng.getUint32());
 			const float				r				= (float(slice) + 0.5f) / (float)levelSize.z();
-			tcu::Surface			renderedFrame	(viewport.width, viewport.height);
-			tcu::Surface			referenceFrame	(viewport.width, viewport.height);
 			vector<float>			texCoord;

 			computeQuadTexCoord3D(texCoord, tcu::Vec3(0.0f, 0.0f, r), tcu::Vec3(1.0f, 1.0f, r), tcu::IVec3(0, 1, 2));
@@ -1104,17 +1117,24 @@

 			// Draw.
 			renderer.renderQuad(0, &texCoord[0], renderParams);
-			glu::readPixels(renderContext, viewport.x, viewport.y, renderedFrame.getAccess());
-			GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to render and read pixels.");
-
-			// Compute reference.
-			sampleTexture(SurfaceAccess(referenceFrame, renderContext.getRenderTarget().getPixelFormat()), refTexture, &texCoord[0], renderParams);
-
-			// Compare and log.
-			if (!pixelThresholdCompare(log, ("Level" + de::toString(level) + "Slice" + de::toString(slice)).c_str(), ("Render level " + de::toString(level) + ", Slice" + de::toString(slice)).c_str(), referenceFrame, renderedFrame, threshold, tcu::COMPARE_LOG_ON_ERROR))
-				results.fail("Image comparison of level " + de::toString(level) + " and slice " + de::toString(slice) + " failed.");
-			else
-				log << TestLog::Message << "Image comparison of level " << level << " and slice " << slice << " passed." << TestLog::EndMessage;;
+			GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to render.");
+
+			if (verify == VERIFY_COMPARE_REFERENCE)
+			{
+				tcu::Surface renderedFrame	(viewport.width, viewport.height);
+				tcu::Surface referenceFrame	(viewport.width, viewport.height);
+				glu::readPixels(renderContext, viewport.x, viewport.y, renderedFrame.getAccess());
+				GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to read pixels.");
+
+				// Compute reference.
+				sampleTexture(SurfaceAccess(referenceFrame, renderContext.getRenderTarget().getPixelFormat()), refTexture, &texCoord[0], renderParams);
+
+				// Compare and log.
+				if (!pixelThresholdCompare(log, ("Level" + de::toString(level) + "Slice" + de::toString(slice)).c_str(), ("Render level " + de::toString(level) + ", Slice" + de::toString(slice)).c_str(), referenceFrame, renderedFrame, threshold, tcu::COMPARE_LOG_ON_ERROR))
+					results.fail("Image comparison of level " + de::toString(level) + " and slice " + de::toString(slice) + " failed.");
+				else
+					log << TestLog::Message << "Image comparison of level " << level << " and slice " << slice << " passed." << TestLog::EndMessage;;
+			}
 		}
 	}

@@ -1125,14 +1145,15 @@
 	GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to unbind texture.");
 }

-void verifyTexture3D (tcu::TestContext&						testContext,
+void renderTexture3D (tcu::TestContext&						testContext,
 					  glu::RenderContext&					renderContext,
 					  TextureRenderer&						textureRenderer,
 					  tcu::ResultCollector&					results,
 					  de::Random&							rng,
 					  deUint32								name,
 					  const vector<ArrayBuffer<deUint8> >&	data,
-					  const ImageInfo&						info)
+					  const ImageInfo&						info,
+				      Verify								verify)
 {
 	if (glu::isCompressedFormat(info.getFormat()))
 	{
@@ -1144,7 +1165,7 @@
 		{
 			const tcu::Texture3DView refTexture((int)levelAccesses.size(), &(levelAccesses[0]));

-			verifyTexture3DView(testContext, renderContext, textureRenderer, results, rng, name, info, refTexture);
+			renderTexture3DView(testContext, renderContext, textureRenderer, results, rng, name, info, refTexture, verify);
 		}
 	}
 	else
@@ -1152,18 +1173,19 @@
 		const vector<tcu::ConstPixelBufferAccess>	levelAccesses	= getLevelAccesses(data, info);
 		const tcu::Texture3DView					refTexture		((int)levelAccesses.size(), &(levelAccesses[0]));

-		verifyTexture3DView(testContext, renderContext, textureRenderer, results, rng, name, info, refTexture);
-	}
-}
-
-void verifyTextureCubemapView (tcu::TestContext&			testContext,
+		renderTexture3DView(testContext, renderContext, textureRenderer, results, rng, name, info, refTexture, verify);
+	}
+}
+
+void renderTextureCubemapView (tcu::TestContext&			testContext,
 							   glu::RenderContext&			renderContext,
 							   TextureRenderer&				renderer,
 							   tcu::ResultCollector&		results,
 							   de::Random&					rng,
 							   deUint32						name,
 							   const ImageInfo&				info,
-							   const tcu::TextureCubeView&	refTexture)
+							   const tcu::TextureCubeView&	refTexture,
+							   Verify						verify)
 {
 	tcu::TestLog&					log				= testContext.getLog();
 	const glw::Functions&			gl				= renderContext.getFunctions();
@@ -1206,8 +1228,6 @@
 		{
 			const RandomViewport	viewport		(renderContext.getRenderTarget(), levelSize.x(), levelSize.y(), rng.getUint32());
 			const string			cubemapFaceName	= glu::getCubeMapFaceStr(mapFaceNdxToFace(face)).toString();
-			tcu::Surface			renderedFrame	(viewport.width, viewport.height);
-			tcu::Surface			referenceFrame	(viewport.width, viewport.height);
 			vector<float>			texCoord;

 			computeQuadTexCoordCube(texCoord, glu::getCubeFaceFromGL(mapFaceNdxToFace(face)));
@@ -1217,17 +1237,25 @@

 			// Draw.
 			renderer.renderQuad(0, &texCoord[0], renderParams);
-			glu::readPixels(renderContext, viewport.x, viewport.y, renderedFrame.getAccess());
-			GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to render and read pixels.");
-
-			// Compute reference.
-			sampleTexture(SurfaceAccess(referenceFrame, renderContext.getRenderTarget().getPixelFormat()), refTexture, &texCoord[0], renderParams);
-
-			// Compare and log.
-			if (!pixelThresholdCompare(log, ("Level" + de::toString(level) + "Face" + cubemapFaceName).c_str(), ("Render level " + de::toString(level) + ", Face " + cubemapFaceName).c_str(), referenceFrame, renderedFrame, threshold, tcu::COMPARE_LOG_ON_ERROR))
-				results.fail("Image comparison of level " + de::toString(level) + " and face " + cubemapFaceName + " failed.");
-			else
-				log << TestLog::Message << "Image comparison of level " << level << " and face " << cubemapFaceName << " passed." << TestLog::EndMessage;
+			GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to render.");
+
+			if (verify == VERIFY_COMPARE_REFERENCE)
+			{
+				tcu::Surface renderedFrame	(viewport.width, viewport.height);
+				tcu::Surface referenceFrame	(viewport.width, viewport.height);
+
+				glu::readPixels(renderContext, viewport.x, viewport.y, renderedFrame.getAccess());
+				GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to read pixels.");
+
+				// Compute reference.
+				sampleTexture(SurfaceAccess(referenceFrame, renderContext.getRenderTarget().getPixelFormat()), refTexture, &texCoord[0], renderParams);
+
+				// Compare and log.
+				if (!pixelThresholdCompare(log, ("Level" + de::toString(level) + "Face" + cubemapFaceName).c_str(), ("Render level " + de::toString(level) + ", Face " + cubemapFaceName).c_str(), referenceFrame, renderedFrame, threshold, tcu::COMPARE_LOG_ON_ERROR))
+					results.fail("Image comparison of level " + de::toString(level) + " and face " + cubemapFaceName + " failed.");
+				else
+					log << TestLog::Message << "Image comparison of level " << level << " and face " << cubemapFaceName << " passed." << TestLog::EndMessage;
+			}
 		}
 	}

@@ -1238,14 +1266,15 @@
 	GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to unbind texture.");
 }

-void verifyTextureCubemap (tcu::TestContext&					testContext,
+void renderTextureCubemap (tcu::TestContext&					testContext,
 						   glu::RenderContext&					renderContext,
 						   TextureRenderer&						textureRenderer,
 						   tcu::ResultCollector&				results,
 						   de::Random&							rng,
 						   deUint32								name,
 						   const vector<ArrayBuffer<deUint8> >&	data,
-						   const ImageInfo&						info)
+						   const ImageInfo&						info,
+						   Verify								verify)
 {
 	if (glu::isCompressedFormat(info.getFormat()))
 	{
@@ -1303,7 +1332,7 @@
 		{
 			const tcu::TextureCubeView refTexture(getLevelCount(info), levels);

-			verifyTextureCubemapView(testContext, renderContext, textureRenderer, results, rng, name, info, refTexture);
+			renderTextureCubemapView(testContext, renderContext, textureRenderer, results, rng, name, info, refTexture, verify);
 		}
 	}
 	else
@@ -1326,19 +1355,20 @@
 		{
 			const tcu::TextureCubeView refTexture(getLevelCount(info), levels);

-			verifyTextureCubemapView(testContext, renderContext, textureRenderer, results, rng, name, info, refTexture);
-		}
-	}
-}
-
-void verifyTexture2DArrayView (tcu::TestContext&				testContext,
+			renderTextureCubemapView(testContext, renderContext, textureRenderer, results, rng, name, info, refTexture, verify);
+		}
+	}
+}
+
+void renderTexture2DArrayView (tcu::TestContext&				testContext,
 							   glu::RenderContext&				renderContext,
 							   TextureRenderer&					renderer,
 							   tcu::ResultCollector&			results,
 							   de::Random&						rng,
 							   deUint32							name,
 							   const ImageInfo&					info,
-							   const tcu::Texture2DArrayView&	refTexture)
+							   const tcu::Texture2DArrayView&	refTexture,
+							   Verify							verify)
 {
 	tcu::TestLog&					log				= testContext.getLog();
 	const glw::Functions&			gl				= renderContext.getFunctions();
@@ -1376,8 +1406,6 @@
 		for (int layer = 0; layer < levelSize.z(); layer++)
 		{
 			const RandomViewport	viewport		(renderContext.getRenderTarget(), levelSize.x(), levelSize.y(), rng.getUint32());
-			tcu::Surface			renderedFrame	(viewport.width, viewport.height);
-			tcu::Surface			referenceFrame	(viewport.width, viewport.height);
 			vector<float>			texCoord;

 			computeQuadTexCoord2DArray(texCoord, layer, tcu::Vec2(0.0f, 0.0f), tcu::Vec2(1.0f, 1.0f));
@@ -1387,17 +1415,25 @@

 			// Draw.
 			renderer.renderQuad(0, &texCoord[0], renderParams);
-			glu::readPixels(renderContext, viewport.x, viewport.y, renderedFrame.getAccess());
-			GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to render and read pixels.");
-
-			// Compute reference.
-			sampleTexture(SurfaceAccess(referenceFrame, renderContext.getRenderTarget().getPixelFormat()), refTexture, &texCoord[0], renderParams);
-
-			// Compare and log.
-			if (!pixelThresholdCompare(log, ("Level" + de::toString(level) + "Layer" + de::toString(layer)).c_str(), ("Render level " + de::toString(level) + ", Layer" + de::toString(layer)).c_str(), referenceFrame, renderedFrame, threshold, tcu::COMPARE_LOG_ON_ERROR))
-				results.fail("Image comparison of level " + de::toString(level) + " and layer " + de::toString(layer) + " failed.");
-			else
-				log << TestLog::Message << "Image comparison of level " << level << " and layer " << layer << " passed." << TestLog::EndMessage;
+			GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to render.");
+
+			if (verify == VERIFY_COMPARE_REFERENCE)
+			{
+				tcu::Surface renderedFrame	(viewport.width, viewport.height);
+				tcu::Surface referenceFrame	(viewport.width, viewport.height);
+
+				glu::readPixels(renderContext, viewport.x, viewport.y, renderedFrame.getAccess());
+				GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to read pixels.");
+
+				// Compute reference.
+				sampleTexture(SurfaceAccess(referenceFrame, renderContext.getRenderTarget().getPixelFormat()), refTexture, &texCoord[0], renderParams);
+
+				// Compare and log.
+				if (!pixelThresholdCompare(log, ("Level" + de::toString(level) + "Layer" + de::toString(layer)).c_str(), ("Render level " + de::toString(level) + ", Layer" + de::toString(layer)).c_str(), referenceFrame, renderedFrame, threshold, tcu::COMPARE_LOG_ON_ERROR))
+					results.fail("Image comparison of level " + de::toString(level) + " and layer " + de::toString(layer) + " failed.");
+				else
+					log << TestLog::Message << "Image comparison of level " << level << " and layer " << layer << " passed." << TestLog::EndMessage;
+			}
 		}
 	}

@@ -1408,14 +1444,15 @@
 	GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to unbind texture.");
 }

-void verifyTexture2DArray (tcu::TestContext&					testContext,
+void renderTexture2DArray (tcu::TestContext&					testContext,
 						   glu::RenderContext&					renderContext,
 						   TextureRenderer&						textureRenderer,
 						   tcu::ResultCollector&				results,
 						   de::Random&							rng,
 						   deUint32								name,
 						   const vector<ArrayBuffer<deUint8> >&	data,
-						   const ImageInfo&						info)
+						   const ImageInfo&						info,
+						   Verify								verify)
 {
 	if (glu::isCompressedFormat(info.getFormat()))
 	{
@@ -1427,7 +1464,7 @@
 		{
 			const tcu::Texture2DArrayView refTexture((int)levelAccesses.size(), &(levelAccesses[0]));

-			verifyTexture2DArrayView(testContext, renderContext, textureRenderer, results, rng, name, info, refTexture);
+			renderTexture2DArrayView(testContext, renderContext, textureRenderer, results, rng, name, info, refTexture, verify);
 		}
 	}
 	else
@@ -1435,7 +1472,7 @@
 		const vector<tcu::ConstPixelBufferAccess>	levelAccesses	= getLevelAccesses(data, info);
 		const tcu::Texture2DArrayView				refTexture		((int)levelAccesses.size(), &(levelAccesses[0]));

-		verifyTexture2DArrayView(testContext, renderContext, textureRenderer, results, rng, name, info, refTexture);
+		renderTexture2DArrayView(testContext, renderContext, textureRenderer, results, rng, name, info, refTexture, verify);
 	}
 }

@@ -1479,12 +1516,13 @@
 	}
 }

-void verifyRenderbuffer (tcu::TestContext&						testContext,
+void renderRenderbuffer (tcu::TestContext&						testContext,
 						 glu::RenderContext&					renderContext,
 						 tcu::ResultCollector&					results,
 						 deUint32								name,
 						 const vector<ArrayBuffer<deUint8> >&	data,
-						 const ImageInfo&						info)
+						 const ImageInfo&						info,
+						 Verify									verify)
 {
 	const glw::Functions&				gl					= renderContext.getFunctions();
 	TestLog&							log					= testContext.getLog();
@@ -1508,71 +1546,76 @@
 		gl.framebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, name);
 		GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to bind and attach renderbuffer to framebuffer.");

-		glu::readPixels(renderContext, 0, 0, renderbuffer.getAccess());
+		if (verify)
+			glu::readPixels(renderContext, 0, 0, renderbuffer.getAccess());

 		gl.bindRenderbuffer(GL_RENDERBUFFER, 0);
 		gl.bindFramebuffer(GL_FRAMEBUFFER, 0);
 		GLU_EXPECT_NO_ERROR(gl.getError(), "Failed to unbind renderbuffer and framebuffer.");
 	}

-	if (isFloatFormat(info.getFormat()))
-	{
-		const tcu::UVec4 threshold (2, 2, 2, 2);
-
-		if (!(tcu::floatUlpThresholdCompare(log, "Image comparison", "Image comparison", refRenderbuffer, renderbuffer.getAccess(), threshold, tcu::COMPARE_LOG_ON_ERROR)))
-			results.fail("Image comparison failed.");
+	if (verify == VERIFY_COMPARE_REFERENCE)
+	{
+		if (isFloatFormat(info.getFormat()))
+		{
+			const tcu::UVec4 threshold (2, 2, 2, 2);
+
+			if (!(tcu::floatUlpThresholdCompare(log, "Image comparison", "Image comparison", refRenderbuffer, renderbuffer.getAccess(), threshold, tcu::COMPARE_LOG_ON_ERROR)))
+				results.fail("Image comparison failed.");
+			else
+				log << TestLog::Message << "Image comarison passed." << TestLog::EndMessage;
+		}
+		else if (isIntFormat(info.getFormat()) || isUintFormat(info.getFormat()))
+		{
+			const tcu::UVec4 threshold (1, 1, 1, 1);
+
+			if (!(tcu::intThresholdCompare(log, "Image comparison", "Image comparison", refRenderbuffer, renderbuffer.getAccess(), threshold, tcu::COMPARE_LOG_ON_ERROR)))
+				results.fail("Image comparison failed.");
+			else
+				log << TestLog::Message << "Image comarison passed." << TestLog::EndMessage;
+		}
 		else
-			log << TestLog::Message << "Image comarison passed." << TestLog::EndMessage;
-	}
-	else if (isIntFormat(info.getFormat()) || isUintFormat(info.getFormat()))
-	{
-		const tcu::UVec4 threshold (1, 1, 1, 1);
-
-		if (!(tcu::intThresholdCompare(log, "Image comparison", "Image comparison", refRenderbuffer, renderbuffer.getAccess(), threshold, tcu::COMPARE_LOG_ON_ERROR)))
-			results.fail("Image comparison failed.");
-		else
-			log << TestLog::Message << "Image comarison passed." << TestLog::EndMessage;
-	}
-	else
-	{
-		const Vec4 threshold = calculateThreshold(format, readPixelsFormat);
-
-		if (!(tcu::floatThresholdCompare(log, "Image comparison", "Image comparison", refRenderbuffer, renderbuffer.getAccess(), threshold, tcu::COMPARE_LOG_ON_ERROR)))
-			results.fail("Image comparison failed.");
-		else
-			log << TestLog::Message << "Image comarison passed." << TestLog::EndMessage;
-	}
-}
-
-void verify (tcu::TestContext&						testContext,
+		{
+			const Vec4 threshold = calculateThreshold(format, readPixelsFormat);
+
+			if (!(tcu::floatThresholdCompare(log, "Image comparison", "Image comparison", refRenderbuffer, renderbuffer.getAccess(), threshold, tcu::COMPARE_LOG_ON_ERROR)))
+				results.fail("Image comparison failed.");
+			else
+				log << TestLog::Message << "Image comarison passed." << TestLog::EndMessage;
+		}
+	}
+}
+
+void render (tcu::TestContext&						testContext,
 			 glu::RenderContext&					renderContext,
 			 TextureRenderer&						textureRenderer,
 			 tcu::ResultCollector&					results,
 			 de::Random&							rng,
 			 deUint32								name,
 			 const vector<ArrayBuffer<deUint8> >&	data,
-			 const ImageInfo&						info)
+			 const ImageInfo&						info,
+			 Verify									verify)
 {
 	switch (info.getTarget())
 	{
 		case GL_TEXTURE_2D:
-			verifyTexture2D(testContext, renderContext, textureRenderer, results, rng, name, data, info);
+			renderTexture2D(testContext, renderContext, textureRenderer, results, rng, name, data, info, verify);
 			break;

 		case GL_TEXTURE_3D:
-			verifyTexture3D(testContext, renderContext, textureRenderer, results, rng, name, data, info);
+			renderTexture3D(testContext, renderContext, textureRenderer, results, rng, name, data, info, verify);
 			break;

 		case GL_TEXTURE_CUBE_MAP:
-			verifyTextureCubemap(testContext, renderContext, textureRenderer, results, rng, name, data, info);
+			renderTextureCubemap(testContext, renderContext, textureRenderer, results, rng, name, data, info, verify);
 			break;

 		case GL_TEXTURE_2D_ARRAY:
-			verifyTexture2DArray(testContext, renderContext, textureRenderer, results, rng, name, data, info);
+			renderTexture2DArray(testContext, renderContext, textureRenderer, results, rng, name, data, info, verify);
 			break;

 		case GL_RENDERBUFFER:
-			verifyRenderbuffer(testContext, renderContext, results, name, data, info);
+			renderRenderbuffer(testContext, renderContext, results, name, data, info, verify);
 			break;

 		default:
@@ -1630,6 +1673,8 @@
 	void					destroyImagesIter		(void);
 	void					verifySourceIter		(void);
 	void					verifyDestinationIter	(void);
+	void					renderSourceIter		(void);
+	void					renderDestinationIter	(void);
 	void					copyImageIter			(void);

 	struct State
@@ -1806,7 +1851,7 @@

 	log << TestLog::Message << "Verifying source image." << TestLog::EndMessage;

-	verify(m_testCtx, m_context.getRenderContext(), m_state->textureRenderer, results, rng, *srcImage, srcImageLevels, m_srcImageInfo);
+	render(m_testCtx, m_context.getRenderContext(), m_state->textureRenderer, results, rng, *srcImage, srcImageLevels, m_srcImageInfo, VERIFY_COMPARE_REFERENCE);
 }

 void CopyImageTest::verifyDestinationIter (void)
@@ -1821,7 +1866,37 @@

 	log << TestLog::Message << "Verifying destination image." << TestLog::EndMessage;

-	verify(m_testCtx, m_context.getRenderContext(), m_state->textureRenderer, results, rng, *dstImage, dstImageLevels, m_dstImageInfo);
+	render(m_testCtx, m_context.getRenderContext(), m_state->textureRenderer, results, rng, *dstImage, dstImageLevels, m_dstImageInfo, VERIFY_COMPARE_REFERENCE);
+}
+
+void CopyImageTest::renderSourceIter (void)
+{
+	TestLog&						log					= m_testCtx.getLog();
+	const tcu::ScopedLogSection		sourceSection		(log, "Source image verify.", "Source image verify.");
+
+	de::Random&						rng					= m_state->rng;
+	tcu::ResultCollector&			results				= m_state->results;
+	glu::ObjectWrapper&				srcImage			= *m_state->srcImage;
+	vector<ArrayBuffer<deUint8> >&	srcImageLevels		= m_state->srcImageLevels;
+
+	log << TestLog::Message << "Verifying source image." << TestLog::EndMessage;
+
+	render(m_testCtx, m_context.getRenderContext(), m_state->textureRenderer, results, rng, *srcImage, srcImageLevels, m_srcImageInfo, VERIFY_NONE);
+}
+
+void CopyImageTest::renderDestinationIter (void)
+{
+	TestLog&						log					= m_testCtx.getLog();
+	const tcu::ScopedLogSection		destinationSection	(log, "Destination image verify.", "Destination image verify.");
+
+	de::Random&						rng					= m_state->rng;
+	tcu::ResultCollector&			results				= m_state->results;
+	glu::ObjectWrapper&				dstImage			= *m_state->dstImage;
+	vector<ArrayBuffer<deUint8> >&	dstImageLevels		= m_state->dstImageLevels;
+
+	log << TestLog::Message << "Verifying destination image." << TestLog::EndMessage;
+
+	render(m_testCtx, m_context.getRenderContext(), m_state->textureRenderer, results, rng, *dstImage, dstImageLevels, m_dstImageInfo, VERIFY_NONE);
 }

 struct Copy
@@ -1988,8 +2063,8 @@

 		// Render both images and then copy and verify again.
 		&CopyImageTest::createImagesIter,
-		&CopyImageTest::verifySourceIter,
-		&CopyImageTest::verifyDestinationIter,
+		&CopyImageTest::renderSourceIter,
+		&CopyImageTest::renderDestinationIter,
 		&CopyImageTest::copyImageIter,
 		&CopyImageTest::verifySourceIter,
 		&CopyImageTest::verifyDestinationIter,


Ambient contribution should be added only once, not for every light!!! Fixed

--- src/rt.cpp
+++ src/rt.cpp
@@ -159,17 +159,17 @@

   // Only add specular component if you have diffuse,
   // if dotProductLN > 0.0
-  if (depth == 1)
-  {
-    result = mySphere.ka*myLight.intensity +
-             visible*mySphere.kd*myLight.intensity*dotProductLN +
-             visible*filterSpecular*mySphere.ks*myLight.intensity*pow(max(dotProduct(R, V), 0.0), mySphere.alpha);
-  }
-  else if (depth > 1)
-  {
-    result = visible*mySphere.kd*myLight.intensity*dotProductLN +
-             visible*filterSpecular*mySphere.ks*myLight.intensity*pow(max(dotProduct(R, V), 0.0), mySphere.alpha);
-  }
+  // if (depth == -1)
+  // {
+  //   result = mySphere.ka*myLight.intensity +
+  //            visible*mySphere.kd*myLight.intensity*dotProductLN +
+  //            visible*filterSpecular*mySphere.ks*myLight.intensity*pow(max(dotProduct(R, V), 0.0), mySphere.alpha);
+  // }
+  // else if (depth > 1)
+  // {
+  result = visible*mySphere.kd*myLight.intensity*dotProductLN +
+           visible*filterSpecular*mySphere.ks*myLight.intensity*pow(max(dotProduct(R, V), 0.0), mySphere.alpha);
+  // }

   return(result);
 }
@@ -213,6 +213,8 @@
         if ((t >= 0.0) && (t < maxt))
         {
           result = {};
+          // NOTE(ralntdir): Let's suppose that ia is (1.0, 1.0, 1.0)
+          result += mySphere.ka;
           maxt = t;
           vec3 hitPoint = myRay.origin + t*myRay.direction;


Fixes #26: Unable to get indigo InChI value as the API call is failing

--- Providers/IndigoProvider/IndigoProvider.cpp
+++ Providers/IndigoProvider/IndigoProvider.cpp
@@ -187,9 +187,12 @@
 			}

 			//TODO: INCHI CALCULATION FAILS - malloc_dbg fails
-			//const char* inchi = indigoInchiGetInchi(mol);
-			//_snwprintf_s(temp, 500, 500, L"%hs", inchi);
-			//AddProperty(properties, 22, _T("InChi"), temp);
+			const char* inchi = indigoInchiGetInchi(mol);
+			if(flags & propInChI)
+			{
+				_snwprintf_s(temp, 500, 500, L"%hs", inchi);
+				AddProperty(properties, index+=2, _T("InChi"), temp);
+			}

 			//_snwprintf(temp, 500, L"%hs", indigoInchiGetInchiKey(inchi));
 			//AddProperty(properties, 24, _T("InChi Key"), temp);
@@ -371,7 +374,7 @@
 	*numProps = 0;
 	if(_tcsicmp(ext, _T(".mol")) == 0)
 	{
-		*numProps = 15;
+		*numProps = 16;
 		return ULONG_MAX; // set all bits, show all properties
 	}
 	else if(_tcsicmp(ext, _T(".rxn")) == 0)


Whitespace change

Whitespace change

git-svn-id: 1a57124bbb9aca193a920d0ffd753d488afb922b@693 5946f024-35f4-0310-b1b3-9a3be3380cfb

--- lib/row.cpp
+++ lib/row.cpp
@@ -35,7 +35,7 @@
 	return res->num_fields();
 }

-const ColData Row::operator[] (size_type i) const
+const ColData Row::operator [](size_type i) const
 {
 	if (!initialized) {
 		if (throw_exceptions)


Little improve MysqlRow class

Little improve MysqlRow class

--- src/storage/mysql/MysqlRow.hpp
+++ src/storage/mysql/MysqlRow.hpp
@@ -43,7 +43,7 @@
 	{
 	}

-	virtual ~MysqlRow() override = default; // Destructor
+	~MysqlRow() override = default; // Destructor

 	void set(MYSQL_ROW value)
 	{
@@ -62,6 +62,11 @@

 	public:
 		FieldValue(const char *const data): _data(data) {}
+
+		bool isNull() const
+		{
+			return _data == nullptr;
+		}

 		template<typename T, typename std::enable_if<std::is_integral<T>::value, void>::type* = nullptr>
 		operator T() const


"Console.h" -> "ConsoleAPI.h"

"Console.h" -> "ConsoleAPI.h"

--- SceneStructureModule/SceneStructureModule.cpp
+++ SceneStructureModule/SceneStructureModule.cpp
@@ -19,7 +19,7 @@
 #include "IAssetTransfer.h"

 #include "SceneManager.h"
-#include "Console.h"
+#include "ConsoleAPI.h"
 #include "UiServiceInterface.h"
 #include "Input.h"
 #include "RenderServiceInterface.h"


ARM bustage fix for bug 540351.

ARM bustage fix for bug 540351.

--- nanojit/NativeARM.cpp
+++ nanojit/NativeARM.cpp
@@ -1179,7 +1179,7 @@
     else if (op == LIR_param) {
         if (ins->paramKind() == 0) {
             if (ins->paramArg() < 4)
-                prefer = rmask(argRegs[i->paramArg()]);
+                prefer = rmask(argRegs[ins->paramArg()]);
         }
     }
     return prefer;


refactor: Make httpserver work queue a unique_ptr

--- src/httpserver.cpp
+++ src/httpserver.cpp
@@ -136,7 +136,7 @@
 //! List of subnets to allow RPC connections from
 static std::vector<CSubNet> rpc_allow_subnets;
 //! Work queue for handling longer requests off the event loop thread
-static WorkQueue<HTTPClosure>* workQueue = nullptr;
+static std::unique_ptr<WorkQueue<HTTPClosure>> g_work_queue{nullptr};
 //! Handlers for (sub)paths
 static std::vector<HTTPPathHandler> pathHandlers;
 //! Bound listening sockets
@@ -256,10 +256,10 @@
     // Dispatch to worker thread
     if (i != iend) {
         std::unique_ptr<HTTPWorkItem> item(new HTTPWorkItem(std::move(hreq), path, i->handler));
-        assert(workQueue);
-        if (workQueue->Enqueue(item.get()))
+        assert(g_work_queue);
+        if (g_work_queue->Enqueue(item.get())) {
             item.release(); /* if true, queue took ownership */
-        else {
+        } else {
             LogPrintf("WARNING: request rejected because http work queue depth exceeded, it can be increased with the -rpcworkqueue= setting\n");
             item->req->WriteReply(HTTP_SERVICE_UNAVAILABLE, "Work queue depth exceeded");
         }
@@ -392,7 +392,7 @@
     int workQueueDepth = std::max((long)gArgs.GetArg("-rpcworkqueue", DEFAULT_HTTP_WORKQUEUE), 1L);
     LogPrintf("HTTP: creating work queue of depth %d\n", workQueueDepth);

-    workQueue = new WorkQueue<HTTPClosure>(workQueueDepth);
+    g_work_queue = std::make_unique<WorkQueue<HTTPClosure>>(workQueueDepth);
     // transfer ownership to eventBase/HTTP via .release()
     eventBase = base_ctr.release();
     eventHTTP = http_ctr.release();
@@ -424,7 +424,7 @@
     g_thread_http = std::thread(ThreadHTTP, eventBase);

     for (int i = 0; i < rpcThreads; i++) {
-        g_thread_http_workers.emplace_back(HTTPWorkQueueRun, workQueue, i);
+        g_thread_http_workers.emplace_back(HTTPWorkQueueRun, g_work_queue.get(), i);
     }
 }

@@ -435,16 +435,17 @@
         // Reject requests on current connections
         evhttp_set_gencb(eventHTTP, http_reject_request_cb, nullptr);
     }
-    if (workQueue)
-        workQueue->Interrupt();
+    if (g_work_queue) {
+        g_work_queue->Interrupt();
+    }
 }

 void StopHTTPServer()
 {
     LogPrint(BCLog::HTTP, "Stopping HTTP server\n");
-    if (workQueue) {
+    if (g_work_queue) {
         LogPrint(BCLog::HTTP, "Waiting for HTTP worker threads to exit\n");
-        for (auto& thread: g_thread_http_workers) {
+        for (auto& thread : g_thread_http_workers) {
             thread.join();
         }
         g_thread_http_workers.clear();
@@ -467,10 +468,7 @@
         event_base_free(eventBase);
         eventBase = nullptr;
     }
-    if (workQueue) {
-        delete workQueue;
-        workQueue = nullptr;
-    }
+    g_work_queue.reset();
     LogPrint(BCLog::HTTP, "Stopped HTTP server\n");
 }


change send_to args

change send_to args

--- src/userspace/share/local_datagram_client.hpp
+++ src/userspace/share/local_datagram_client.hpp
@@ -15,14 +15,18 @@
     thread_.join();
   }

-  void send_to(const uint8_t* _Nonnull p, size_t length) {
-    auto ptr = std::make_shared<buffer>(p, length);
+  void send_to(const std::vector<uint8_t>& v) {
+    auto ptr = std::make_shared<buffer>(v);
     io_service_.post(boost::bind(&local_datagram_client::do_send, this, ptr));
   }

 private:
   class buffer final {
   public:
+    buffer(const std::vector<uint8_t> v) {
+      v_ = v;
+    }
+
     buffer(const uint8_t* _Nonnull p, size_t length) {
       v_.resize(length);
       memcpy(&(v_[0]), p, length);


log_event.cc:
  post-conflict-merge fix (duplicate comment)

sql/log_event.cc:
  post-conflict-merge fix (duplicate comment)

--- sql/log_event.cc
+++ sql/log_event.cc
@@ -1,4 +1,3 @@
-/* Copyright (C) 2000-2004 MySQL AB
 /* Copyright (C) 2000-2004 MySQL AB

    This program is free software; you can redistribute it and/or modify