INTEGRATION: CWS olefix (1.6.2); FILE MERGED 2005/04/15 06:00:58 as 1.6.2.3: #i47154# make sure that no log will be written 2005/04/14 12:53:31 as 1.6.2.2: #i47154# make differences between session management and auto recovery more clear 2005/04/11 13:10:27 as 1.6.2.1: #i47154# differ between recovery and session data

--- framework/source/services/autorecovery.cxx
+++ framework/source/services/autorecovery.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: autorecovery.cxx,v $
  *
- *  $Revision: 1.6 $
+ *  $Revision: 1.7 $
  *
- *  last change: $Author: rt $ $Date: 2005-03-29 14:55:05 $
+ *  last change: $Author: obo $ $Date: 2005-04-18 14:34:59 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -252,7 +252,7 @@
 static const ::rtl::OUString CFG_ENTRY_RECOVERYLIST           = ::rtl::OUString::createFromAscii("RecoveryList"                   );
 static const ::rtl::OUString CFG_PATH_RECOVERYINFO            = ::rtl::OUString::createFromAscii("RecoveryInfo"                   );
 static const ::rtl::OUString CFG_ENTRY_CRASHED                = ::rtl::OUString::createFromAscii("Crashed"                        );
-static const ::rtl::OUString CFG_ENTRY_EXISTSRECOVERYIDATA    = ::rtl::OUString::createFromAscii("ExistsRecoveryData"             );
+static const ::rtl::OUString CFG_ENTRY_SESSIONDATA            = ::rtl::OUString::createFromAscii("SessionData"                    );
 static const ::rtl::OUString CFG_ENTRY_AUTOSAVE_ENABLED       = ::rtl::OUString::createFromAscii("AutoSave/Enabled"               );
 static const ::rtl::OUString CFG_ENTRY_AUTOSAVE_TIMEINTERVALL = ::rtl::OUString::createFromAscii("AutoSave/TimeIntervall"         );

@@ -309,6 +309,22 @@
 static const ::rtl::OUString OPERATION_UPDATE                = ::rtl::OUString::createFromAscii("update");

 #define MIN_TIME_FOR_USER_IDLE 10000 // 10s user idle
+
+//-----------------------------------------------
+// #define ENABLE_RECOVERY_LOGGING
+#undef ENABLE_RECOVERY_LOGGING
+#ifdef ENABLE_RECOVERY_LOGGING
+    #define LOGFILE_RECOVERY "recovery.log"
+
+    #define LOG_RECOVERY(MSG)                       \
+        {                                           \
+            WRITE_LOGFILE(LOGFILE_RECOVERY, MSG)    \
+            WRITE_LOGFILE(LOGFILE_RECOVERY, "\n")   \
+        }
+#else
+    #undef LOGFILE_RECOVERY
+    #define LOG_RECOVERY(MSG)
+#endif

 //-----------------------------------------------
 // TODO debug - remove it!
@@ -496,6 +512,9 @@
                                      const css::uno::Sequence< css::beans::PropertyValue >& lArguments)
     throw(css::uno::RuntimeException)
 {
+    LOG_RECOVERY("AutoRecovery::dispatch() starts ...")
+    LOG_RECOVERY(U2B(aURL.Complete).getStr())
+
     // valid request ?
     sal_Int32 eNewJob = AutoRecovery::implst_classifyJob(aURL);
     if (eNewJob == AutoRecovery::E_NO_JOB)
@@ -571,27 +590,36 @@
         // else
         if ((eJob & AutoRecovery::E_PREPARE_EMERGENCY_SAVE) == AutoRecovery::E_PREPARE_EMERGENCY_SAVE)
         {
+            LOG_RECOVERY("... prepare emergency save ...")
             bAllowAutoSaveReactivation = sal_False;
             implts_prepareEmergencySave();
         }
         else
         if ((eJob & AutoRecovery::E_EMERGENCY_SAVE) == AutoRecovery::E_EMERGENCY_SAVE)
         {
+            LOG_RECOVERY("... do emergency save ...")
             bAllowAutoSaveReactivation = sal_False;
             implts_doEmergencySave();
         }
         else
         if ((eJob & AutoRecovery::E_RECOVERY) == AutoRecovery::E_RECOVERY)
+        {
+            LOG_RECOVERY("... do recovery ...")
             implts_doRecovery();
+        }
         else
         if ((eJob & AutoRecovery::E_SESSION_SAVE) == AutoRecovery::E_SESSION_SAVE)
         {
+            LOG_RECOVERY("... do session save ...")
             bAllowAutoSaveReactivation = sal_False;
             implts_doSessionSave();
         }
         else
         if ((eJob & AutoRecovery::E_SESSION_RESTORE) == AutoRecovery::E_SESSION_RESTORE)
+        {
+            LOG_RECOVERY("... do session restore ...")
             implts_doSessionRestore();
+        }
         else
         if ((eJob & AutoRecovery::E_ENTRY_BACKUP) == AutoRecovery::E_ENTRY_BACKUP)
             implts_backupWorkingEntry();
@@ -1488,6 +1516,8 @@
 //-----------------------------------------------
 void AutoRecovery::implts_prepareSessionShutdown()
 {
+    LOG_RECOVERY("AutoRecovery::implts_prepareSessionShutdown() starts ...")
+
     // a) reset modified documents (of course the must be saved before this method is called!)
     // b) close it without showing any UI!

@@ -2356,6 +2386,8 @@
 //-----------------------------------------------
 void AutoRecovery::implts_doSessionSave()
 {
+    LOG_RECOVERY("AutoRecovery::implts_doSessionSave()")
+
     // Be sure to know all open documents realy .-)
     implts_verifyCacheAgainstDesktopDocumentList();

@@ -2385,11 +2417,23 @@
     // reset all modified documents, so the dont show any UI on closing ...
     // and close all documents, so we can shutdown the OS!
     implts_prepareSessionShutdown();
+
+    // Write a hint for "stored session data" into the configuration, so
+    // the on next startup we know what's happen last time
+    ::comphelper::ConfigurationHelper::writeDirectKey(
+        m_xSMGR,
+        CFG_PACKAGE_RECOVERY,
+        CFG_PATH_RECOVERYINFO,
+        CFG_ENTRY_SESSIONDATA,
+        css::uno::makeAny(sal_True),
+        ::comphelper::ConfigurationHelper::E_STANDARD);
 }

 //-----------------------------------------------
 void AutoRecovery::implts_doSessionRestore()
 {
+    LOG_RECOVERY("AutoRecovery::implts_doSessionRestore() ...")
+
     AutoRecovery::ETimerType eSuggestedTimer = AutoRecovery::E_DONT_START_TIMER;
     do
     {
@@ -2406,6 +2450,18 @@

     // make all opened documents visible
     implts_changeAllDocVisibility(sal_True);
+
+    // Reset the configuration hint for "session save"!
+    LOG_RECOVERY("... reset config key 'SessionData'")
+    ::comphelper::ConfigurationHelper::writeDirectKey(
+        m_xSMGR,
+        CFG_PACKAGE_RECOVERY,
+        CFG_PATH_RECOVERYINFO,
+        CFG_ENTRY_SESSIONDATA,
+        css::uno::makeAny(sal_False),
+        ::comphelper::ConfigurationHelper::E_STANDARD);
+
+    LOG_RECOVERY("... AutoRecovery::implts_doSessionRestore()")
 }

 //-----------------------------------------------
@@ -2547,8 +2603,26 @@
     switch(nHandle)
     {
         case AUTORECOVERY_PROPHANDLE_EXISTS_RECOVERYDATA :
-//                aValue = fpc::getDirectValue(m_xSMGR, CFG_PACKAGE_RECOVERY, CFG_PATH_RECOVERYINFO, CFG_ENTRY_EXISTSRECOVERYIDATA);
-                aValue <<= ((sal_Bool)(m_lDocCache.size()>0));
+                {
+                    css::uno::Any aSessionVal = ::comphelper::ConfigurationHelper::readDirectKey(
+                                                    m_xSMGR,
+                                                    CFG_PACKAGE_RECOVERY,
+                                                    CFG_PATH_RECOVERYINFO,
+                                                    CFG_ENTRY_SESSIONDATA,
+                                                    ::comphelper::ConfigurationHelper::E_READONLY);
+
+                    sal_Bool bSessionData  = sal_False;
+                    aSessionVal >>= bSessionData;
+
+                    sal_Bool bRecoveryData = ((sal_Bool)(m_lDocCache.size()>0));
+
+                    // exists session data ... => then we cant say, that these
+                    // data are valid for recovery. So we have to return FALSE then!
+                    if (bSessionData)
+                        bRecoveryData = sal_False;
+
+                    aValue <<= bRecoveryData;
+                }
                 break;

         case AUTORECOVERY_PROPHANDLE_CRASHED :
@@ -2559,6 +2633,15 @@
                             CFG_ENTRY_CRASHED,
                             ::comphelper::ConfigurationHelper::E_READONLY);
                 break;
+
+        case AUTORECOVERY_PROPHANDLE_EXISTS_SESSIONDATA :
+                aValue = ::comphelper::ConfigurationHelper::readDirectKey(
+                            m_xSMGR,
+                            CFG_PACKAGE_RECOVERY,
+                            CFG_PATH_RECOVERYINFO,
+                            CFG_ENTRY_SESSIONDATA,
+                            ::comphelper::ConfigurationHelper::E_READONLY);
+                break;
     }
 }

@@ -2569,6 +2652,7 @@
     {
         css::beans::Property( AUTORECOVERY_PROPNAME_CRASHED            , AUTORECOVERY_PROPHANDLE_CRASHED            , ::getBooleanCppuType() , css::beans::PropertyAttribute::TRANSIENT | css::beans::PropertyAttribute::READONLY ),
         css::beans::Property( AUTORECOVERY_PROPNAME_EXISTS_RECOVERYDATA, AUTORECOVERY_PROPHANDLE_EXISTS_RECOVERYDATA, ::getBooleanCppuType() , css::beans::PropertyAttribute::TRANSIENT | css::beans::PropertyAttribute::READONLY ),
+        css::beans::Property( AUTORECOVERY_PROPNAME_EXISTS_SESSIONDATA , AUTORECOVERY_PROPHANDLE_EXISTS_SESSIONDATA , ::getBooleanCppuType() , css::beans::PropertyAttribute::TRANSIENT | css::beans::PropertyAttribute::READONLY ),
     };
     static const css::uno::Sequence< css::beans::Property > lPropertyDescriptor(pPropertys, AUTORECOVERY_PROPCOUNT);
     return lPropertyDescriptor;
@@ -2639,6 +2723,8 @@
 //-----------------------------------------------
 void AutoRecovery::implts_verifyCacheAgainstDesktopDocumentList()
 {
+    LOG_RECOVERY("AutoRecovery::implts_verifyCacheAgainstDesktopDocumentList() ...")
+
     // SAFE -> ----------------------------------
     WriteGuard aWriteLock(m_aLock);
     css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
@@ -2707,6 +2793,8 @@
         { throw exRun; }
     catch(const css::uno::Exception&)
         {}
+
+    LOG_RECOVERY("... AutoRecovery::implts_verifyCacheAgainstDesktopDocumentList()")
 }

 } // namespace framework


INTEGRATION: CWS fwkdbdesign01 (1.21.2); FILE MERGED 2007/03/08 14:27:27 as 1.21.2.1: #i45663# remove using of deprectaed module property ShortName

--- framework/source/services/autorecovery.cxx
+++ framework/source/services/autorecovery.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: autorecovery.cxx,v $
  *
- *  $Revision: 1.21 $
+ *  $Revision: 1.22 $
  *
- *  last change: $Author: rt $ $Date: 2007-01-30 13:28:27 $
+ *  last change: $Author: ihi $ $Date: 2007-04-16 16:42:33 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -269,7 +269,6 @@
 static const ::rtl::OUString DOCINFO_PROP_TEMPLATE           = ::rtl::OUString::createFromAscii("TemplateFileName");

 // setup.xcu
-static const ::rtl::OUString CFG_ENTRY_PROP_FACTORYSHORTNAME = ::rtl::OUString::createFromAscii("ooSetupFactoryShortName"       );
 static const ::rtl::OUString CFG_ENTRY_PROP_EMPTYDOCUMENTURL = ::rtl::OUString::createFromAscii("ooSetupFactoryEmptyDocumentURL");
 static const ::rtl::OUString CFG_ENTRY_PROP_DEFAULTFILTER    = ::rtl::OUString::createFromAscii("ooSetupFactoryDefaultFilter"   );


updated scene to use texture shaders

updated scene to use texture shaders

--- NShadeCore/Scene.cpp
+++ NShadeCore/Scene.cpp
@@ -73,52 +73,54 @@
     stdPointLight->SetColorIntensity(pointLightColorIntensity);
     scene->AddLight(stdPointLight);

-    auto stdPixelShader = PixelShader::Load(L"../Debug/PhongPixelShader.cso");
-    auto stdVertexShader = VertexShader::Load(L"../Debug/PhongVertexShader.cso");
+    /* teapot */
+    auto phongPixelShader = PixelShader::Load(L"../Debug/PhongPixelShader.cso");
+    auto phongVertexShader = VertexShader::Load(L"../Debug/PhongVertexShader.cso");

-    auto stdHullShader = HullShader::Load(L"../Debug/TesselationHullShader.cso");
-    auto stdDomainShader = DomainShader::Load(L"../Debug/TesselationDomainShader.cso");
+    auto phongShaders = new Shaders();
+    phongShaders->PixelShader = phongPixelShader;
+    phongShaders->VertexShader = phongVertexShader;

-    auto shaders = new Shaders();
-    shaders->PixelShader = stdPixelShader;
-    shaders->VertexShader = stdVertexShader;
-    shaders->HullShader = stdHullShader;
-    shaders->DomainShader = stdDomainShader;
+    auto phongMaterial = new Material();
+    phongMaterial->AssignShaders(phongShaders);
+    phongMaterial->SetColor(new XMFLOAT4(0.1f, 0.1f, 0.6f, 1.0f));

-    auto phongMaterial1 = new Material();
-    phongMaterial1->AssignShaders(shaders);
-    phongMaterial1->SetColor(new XMFLOAT4(0.1f, 0.1f, 0.6f, 1.0f));
+    auto teapot = Model::LoadModelFromFBXFile("../Debug/teapot.fbx");
+    teapot->AssignMaterial(phongMaterial);
+    scene->AddModel(teapot);

-    auto phongMaterial2 = new Material();
+    /* plane */
+    auto texturePixelShader = PixelShader::Load(L"../Debug/TexturePixelShader.cso");
+    auto textureVertexShader = VertexShader::Load(L"../Debug/TextureVertexShader.cso");
+
+    auto textureShaders = new Shaders();
+    textureShaders->PixelShader = texturePixelShader;
+    textureShaders->VertexShader = textureVertexShader;
+
+    auto textureMaterial = new Material();
     auto gridTexture = Texture::Load(L"../Textures/grid_texture.dds");
-    phongMaterial2->AssignTexture(gridTexture);
-    phongMaterial2->AssignShaders(shaders);
-    phongMaterial2->SetColor(new XMFLOAT4(0.8f, 0.8f, 0.8f, 1.0f));
+    textureMaterial->AssignTexture(gridTexture);
+    textureMaterial->AssignShaders(textureShaders);
+    textureMaterial->SetColor(new XMFLOAT4(0.8f, 0.8f, 0.8f, 1.0f));

-    auto stdTeapot = Model::LoadModelFromFBXFile("../Debug/teapot.fbx");
-    stdTeapot->AssignMaterial(phongMaterial1);
-    scene->AddModel(stdTeapot);
-
-    auto stdPlane = Model::CreateHorizontalPlane(20.0f, new XMFLOAT3(0.0f, 0.0f, 0.0f));
-    stdPlane->AssignMaterial(phongMaterial2);
-    scene->AddModel(stdPlane);
-
-
+    auto plane = Model::CreateHorizontalPlane(20.0f, new XMFLOAT3(0.0f, 0.0f, 0.0f));
+    plane->AssignMaterial(textureMaterial);
+    scene->AddModel(plane);

     auto cameraMatrixBuffer = stdCamera->GetMatrixBuffer();
     auto cameraPositionBuffer = stdCamera->GetPositionBuffer();
     auto sceneAmbientBuffer = scene->GetAmbientBuffer();

-    ResourceMapping m1 = { cameraMatrixBuffer, shaders->PixelShader->GetInput() };
+    ResourceMapping m1 = { cameraMatrixBuffer, phongShaders->PixelShader->GetInput() };
     scene->AddResourceMapping(&m1);

-    ResourceMapping m2 = { cameraPositionBuffer, shaders->PixelShader->GetInput() };
+    ResourceMapping m2 = { cameraPositionBuffer, phongShaders->PixelShader->GetInput() };
     scene->AddResourceMapping(&m2);

-    ResourceMapping m3 = { sceneAmbientBuffer, shaders->PixelShader->GetInput() };
+    ResourceMapping m3 = { sceneAmbientBuffer, phongShaders->PixelShader->GetInput() };
     scene->AddResourceMapping(&m3);

-    ResourceMapping m4 = { stdPointLight->GetBuffer(), shaders->PixelShader->GetInput() };
+    ResourceMapping m4 = { stdPointLight->GetBuffer(), phongShaders->PixelShader->GetInput() };
     scene->AddResourceMapping(&m4);

     return scene;


Quito mensaje de debug que requiere C++14

--- src/main/socket/socket.cpp
+++ src/main/socket/socket.cpp
@@ -12,7 +12,7 @@

 void Socket::flushIn() {
 	inBuffer.clear();
-	const size_t bufsize = 4096;
+	const size_t bufsize = 4097;
 	char b[bufsize];
 	long size;
 	bool cont = true;
@@ -34,11 +34,6 @@
 		}
 		cerr << endl;
 	} while (cont);
-	size_t s = (size_t)inBuffer.size() + 1;
-	char message[s];
-	strncpy(message, inBuffer.data(), s - 1);
-	message[s - 1] = nul;
-	cerr << "Received `" << message << '`' << endl;
 }

 void Socket::flushOut() {


Clang: Suppress printing diagnostics by default

Triggering completion happens often on invalid code, which leads to
diagnostics from libclang. Suppress those by default, but allow to
inspect them with the logging category:

    qtc.clangbackend.verboselib=true

Change-Id: I802ae58fe1b5244f3228ee73a181ea362de20608
Reviewed-by: Erik Verbruggen <5edfe905d082749f2ac3f4e6b42937f39f083771@theqtcompany.com>

--- src/tools/clangbackend/ipcsource/translationunit.cpp
+++ src/tools/clangbackend/ipcsource/translationunit.cpp
@@ -40,6 +40,9 @@
 #include <utf8string.h>

 #include <QFileInfo>
+#include <QLoggingCategory>
+
+static Q_LOGGING_CATEGORY(verboseLibLog, "qtc.clangbackend.verboselib");

 namespace ClangBackEnd {

@@ -107,8 +110,10 @@
 {
     checkIfNull();

-    if (!d->index)
-        d->index = clang_createIndex(1, 1);
+    if (!d->index) {
+        const bool displayDiagnostics = verboseLibLog().isDebugEnabled();
+        d->index = clang_createIndex(1, displayDiagnostics);
+    }

     return d->index;
 }


PRD: Row Repair adjust for MBA Port 1 inversion

Change-Id: Idfc88610830942ebc89c5587cb91ca62d957c13b
CQ: SW450182
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/68192
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Reviewed-by: Zane C. Shelley <fc96e127d170d6ac0b2af86a8a56f95974ff36e8@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/68217
Tested-by: Jenkins OP Build CI <e610bd72261d3c0a48f1e8ae36832ab00774d426@us.ibm.com>
Tested-by: FSP CI Jenkins <aa9e4d9ac7cd25905e9c0dd36d4150516e73dd86@us.ibm.com>
Tested-by: Jenkins OP HW <0eb0fff262f74a65a832afbcc7b153e391c9a3fd@us.ibm.com>

--- src/usr/diag/prdf/common/plat/mem/prdfMemRowRepair.C
+++ src/usr/diag/prdf/common/plat/mem/prdfMemRowRepair.C
@@ -280,6 +280,16 @@

         // validity - 1 bit
         l_tmp = ( l_tmp << 1 ) | 0x1;
+
+        // Adjust for mba port 1 address inversion if necessary
+        if ( (1 == getDimmPort<T>(i_dimm) % 2) && (T == TYPE_MBA) )
+        {
+            // Bits flipped in port 1 inversion: (10:12, 16:22, 24, 26:28)
+            // mask:
+            // 0000 0000 0011 1000 1111 1110 1011 1000
+            uint32_t mask = 0x0038FEB8;
+            l_tmp ^= mask;
+        }

         // ROW_REPAIR_SIZE = 4
         uint8_t l_data[ROW_REPAIR::ROW_REPAIR_SIZE] = {0};


[FIX] disabled line breaking

[FIX] disabled line breaking

--- core/apps/fiona/fiona.cpp
+++ core/apps/fiona/fiona.cpp
@@ -5048,7 +5048,7 @@

     numCorrected = 0;
     // disable linebreak in output file
-    outStream.outputOptions.lineLength = -1;
+    outStream.outputOptions.lineLength = 0;

     for (unsigned i = 0; i < length(store.readSeqStore); ++i)
     {


Properly handle VK_OPERATION_NOT_DEFERRED_KHR

According to spec, any operation that is requested to be deferred can return
VK_OPERATION_NOT_DEFERRED_KHR if an implementation "chooses not to
defer any of the requested operations and instead executesall of them
immediately"

This fixes the test to properly handle the VK_OPERATION_NOT_DEFERRED_KHR status,
by immediately checking the operation status and returning, skipping invalid check
for max concurency being greater than 0 and skipping not needed thread joins.

Components: Vulkan

VK-GL-CTS Issue: 2780

Affects:
dEQP-VK.ray_tracing_pipeline.*host_threading*
dEQP-VK.ray_query.*host_threading*
dEQP-VK.ray_tracing_pipeline.*cpuht*

Change-Id: If72351e2deada8d03c3e7b2c642cb641ae69febd

--- external/vulkancts/framework/vulkan/vkRayTracingUtil.cpp
+++ external/vulkancts/framework/vulkan/vkRayTracingUtil.cpp
@@ -472,8 +472,22 @@
 void finishDeferredOperation (const DeviceInterface&	vk,
 							  VkDevice					device,
 							  VkDeferredOperationKHR	deferredOperation,
-							  const deUint32			workerThreadCount)
-{
+							  const deUint32			workerThreadCount,
+							  const bool				operationNotDeferred)
+{
+
+	if (operationNotDeferred)
+	{
+		// when the operation deferral returns VK_OPERATION_NOT_DEFERRED_KHR,
+		// the deferred operation should act as if no command was deferred
+		VK_CHECK(vk.getDeferredOperationResultKHR(device, deferredOperation));
+
+
+		// there is not need to join any threads to the deferred operation,
+		// so below can be skipped.
+		return;
+	}
+
 	if (workerThreadCount == 0)
 	{
 		VK_CHECK(finishDeferredOperation(vk, device, deferredOperation));
@@ -1070,9 +1084,8 @@
 			VkResult result = vk.buildAccelerationStructuresKHR(device, deferredOperation, 1u, &accelerationStructureBuildGeometryInfoKHR, (const VkAccelerationStructureBuildRangeInfoKHR**)&accelerationStructureBuildRangeInfoKHRPtr);

 			DE_ASSERT(result == VK_OPERATION_DEFERRED_KHR || result == VK_OPERATION_NOT_DEFERRED_KHR || result == VK_SUCCESS);
-			DE_UNREF(result);
-
-			finishDeferredOperation(vk, device, deferredOperation, m_workerThreadCount);
+
+			finishDeferredOperation(vk, device, deferredOperation, m_workerThreadCount, result == VK_OPERATION_NOT_DEFERRED_KHR);
 		}
 	}

@@ -1119,9 +1132,8 @@
 		VkResult result = vk.copyAccelerationStructureKHR(device, deferredOperation, &copyAccelerationStructureInfo);

 		DE_ASSERT(result == VK_OPERATION_DEFERRED_KHR || result == VK_OPERATION_NOT_DEFERRED_KHR || result == VK_SUCCESS);
-		DE_UNREF(result);
-
-		finishDeferredOperation(vk, device, deferredOperation, m_workerThreadCount);
+
+		finishDeferredOperation(vk, device, deferredOperation, m_workerThreadCount, result == VK_OPERATION_NOT_DEFERRED_KHR);
 	}

 	if (m_buildType == VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR)
@@ -1166,9 +1178,8 @@
 		const VkResult result = vk.copyAccelerationStructureToMemoryKHR(device, deferredOperation, &copyAccelerationStructureInfo);

 		DE_ASSERT(result == VK_OPERATION_DEFERRED_KHR || result == VK_OPERATION_NOT_DEFERRED_KHR || result == VK_SUCCESS);
-		DE_UNREF(result);
-
-		finishDeferredOperation(vk, device, deferredOperation, m_workerThreadCount);
+
+		finishDeferredOperation(vk, device, deferredOperation, m_workerThreadCount, result == VK_OPERATION_NOT_DEFERRED_KHR);
 	}
 }

@@ -1205,9 +1216,8 @@
 		const VkResult result = vk.copyMemoryToAccelerationStructureKHR(device, deferredOperation, &copyAccelerationStructureInfo);

 		DE_ASSERT(result == VK_OPERATION_DEFERRED_KHR || result == VK_OPERATION_NOT_DEFERRED_KHR || result == VK_SUCCESS);
-		DE_UNREF(result);
-
-		finishDeferredOperation(vk, device, deferredOperation, m_workerThreadCount);
+
+		finishDeferredOperation(vk, device, deferredOperation, m_workerThreadCount, result == VK_OPERATION_NOT_DEFERRED_KHR);
 	}

 	if (m_buildType == VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR)
@@ -1843,9 +1853,8 @@
 		VkResult result = vk.buildAccelerationStructuresKHR(device, deferredOperation, 1u, &accelerationStructureBuildGeometryInfoKHR, (const VkAccelerationStructureBuildRangeInfoKHR**)&accelerationStructureBuildRangeInfoKHRPtr);

 		DE_ASSERT(result == VK_OPERATION_DEFERRED_KHR || result == VK_OPERATION_NOT_DEFERRED_KHR || result == VK_SUCCESS);
-		DE_UNREF(result);
-
-		finishDeferredOperation(vk, device, deferredOperation, m_workerThreadCount);
+
+		finishDeferredOperation(vk, device, deferredOperation, m_workerThreadCount, result == VK_OPERATION_NOT_DEFERRED_KHR);

 		accelerationStructureBuildGeometryInfoKHR.pNext = DE_NULL;
 	}
@@ -1893,9 +1902,8 @@
 		VkResult result = vk.copyAccelerationStructureKHR(device, deferredOperation, &copyAccelerationStructureInfo);

 		DE_ASSERT(result == VK_OPERATION_DEFERRED_KHR || result == VK_OPERATION_NOT_DEFERRED_KHR || result == VK_SUCCESS);
-		DE_UNREF(result);
-
-		finishDeferredOperation(vk, device, deferredOperation, m_workerThreadCount);
+
+		finishDeferredOperation(vk, device, deferredOperation, m_workerThreadCount, result == VK_OPERATION_NOT_DEFERRED_KHR);
 	}

 	if (m_buildType == VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR)
@@ -1941,9 +1949,8 @@
 		const VkResult result = vk.copyAccelerationStructureToMemoryKHR(device, deferredOperation, &copyAccelerationStructureInfo);

 		DE_ASSERT(result == VK_OPERATION_DEFERRED_KHR || result == VK_OPERATION_NOT_DEFERRED_KHR || result == VK_SUCCESS);
-		DE_UNREF(result);
-
-		finishDeferredOperation(vk, device, deferredOperation, m_workerThreadCount);
+
+		finishDeferredOperation(vk, device, deferredOperation, m_workerThreadCount, result == VK_OPERATION_NOT_DEFERRED_KHR);
 	}
 }

@@ -1980,9 +1987,8 @@
 		const VkResult result = vk.copyMemoryToAccelerationStructureKHR(device, deferredOperation, &copyAccelerationStructureInfo);

 		DE_ASSERT(result == VK_OPERATION_DEFERRED_KHR || result == VK_OPERATION_NOT_DEFERRED_KHR || result == VK_SUCCESS);
-		DE_UNREF(result);
-
-		finishDeferredOperation(vk, device, deferredOperation, m_workerThreadCount);
+
+		finishDeferredOperation(vk, device, deferredOperation, m_workerThreadCount, result == VK_OPERATION_NOT_DEFERRED_KHR);
 	}

 	if (m_buildType == VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR)
@@ -2314,9 +2320,8 @@
 	if (m_deferredOperation)
 	{
 		DE_ASSERT(result == VK_OPERATION_DEFERRED_KHR || result == VK_OPERATION_NOT_DEFERRED_KHR || result == VK_SUCCESS);
-		DE_UNREF(result);
-
-		finishDeferredOperation(vk, device, deferredOperation.get(), m_workerThreadCount);
+
+		finishDeferredOperation(vk, device, deferredOperation.get(), m_workerThreadCount, result == VK_OPERATION_NOT_DEFERRED_KHR);
 	}

 	return pipeline;


[FIX] Enabling indel mode in fiona again.

--- core/apps/fiona/fiona.cpp
+++ core/apps/fiona/fiona.cpp
@@ -31,8 +31,8 @@

-//    #define FIONA_ALLOWINDELS	// allow for indels (chooses a less compact FragmentStore)
-//
+#define FIONA_ALLOWINDELS	// allow for indels (chooses a less compact FragmentStore)
+
 //    // currently, consensus works only without indels
 //    #ifndef FIONA_OVERLAP_WITH_EDIT_DISTANCE
 //        #define FIONA_CONSENSUS


Nrf24: use free pins

Nrf24: use free pins

--- nrf24l01/lib/nrf24.cpp
+++ nrf24l01/lib/nrf24.cpp
@@ -16,12 +16,11 @@
 uint8_t payload_len;

 // FIXME: correct pin definitions
-typedef xpcc::stm32::GpioE6 Ce;
-typedef xpcc::stm32::GpioA4 Csn;
-typedef xpcc::stm32::GpioA5 Sck;
-typedef xpcc::stm32::GpioA7 Mosi;
-typedef xpcc::stm32::GpioA6 Miso;
-
+typedef xpcc::stm32::GpioB11 Ce;
+typedef xpcc::stm32::GpioB12 Csn;
+typedef xpcc::stm32::GpioB13 Sck;
+typedef xpcc::stm32::GpioB14 Miso;
+typedef xpcc::stm32::GpioB15 Mosi;


don't look for helper TSystem's when accessing local files (file:///).

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

--- core/base/src/TSystem.cxx
+++ core/base/src/TSystem.cxx
@@ -742,7 +742,13 @@

    TPluginHandler *h;
    TSystem *helper = 0;
-   TUrl url(path, kTRUE);
+   if (path) {
+      if (!GetDirPtr()) {
+         TUrl url(path, kTRUE);
+         if (!strcmp(url.GetProtocol(), "file"))
+            return 0;
+      }
+   }

    // look for existing helpers
    TIter next(fHelpers);


Reorder the setProjectionMatrix.. mathod

--- examples/osgviewerQT/osgviewerQT.cpp
+++ examples/osgviewerQT/osgviewerQT.cpp
@@ -146,8 +146,8 @@
             AdapterWidget( parent, name, shareWidget, f )
         {
             getCamera()->setViewport(new osg::Viewport(0,0,width(),height()));
+            getCamera()->setProjectionMatrixAsPerspective(30.0f, static_cast<double>(width())/static_cast<double>(height()), 1.0f, 10000.0f);
             getCamera()->setGraphicsContext(getGraphicsWindow());
-            getCamera()->setProjectionMatrixAsPerspective(30.0f, static_cast<double>(width())/static_cast<double>(height()), 1.0f, 10000.0f);

             setThreadingModel(osgViewer::Viewer::SingleThreaded);


update event test as original test was inconsistent with Vulkan spec
am: f093f4b9e4

* commit 'f093f4b9e448947e887868ffc0d23b45c31ee9b0':
  update event test as original test was inconsistent with Vulkan spec

Change-Id: If7066f5cc2cd7c68c6c3b32a578ca3aef656fcfc

--- external/vulkancts/modules/vulkan/vktSynchronization.cpp
+++ external/vulkancts/modules/vulkan/vktSynchronization.cpp
@@ -456,7 +456,6 @@
 	deUint32						mipLevels;
 	const deUint32*					queueFamilyNdxList;
 	deUint32						queueFamilyNdxCount;
-	bool							setEvent;
 	bool							waitEvent;
 	VkEvent							event;
 	vector<VkImageMemoryBarrier>*	barriers;
@@ -483,13 +482,11 @@

 	deviceInterface.cmdBeginRenderPass(renderInfo.commandBuffer, &renderPassBeginState, VK_SUBPASS_CONTENTS_INLINE);
 	if (renderInfo.waitEvent)
-		deviceInterface.cmdWaitEvents(renderInfo.commandBuffer, 1, &renderInfo.event, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, DE_NULL, 0, DE_NULL, 0, DE_NULL);
+		deviceInterface.cmdWaitEvents(renderInfo.commandBuffer, 1, &renderInfo.event, VK_PIPELINE_STAGE_HOST_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, DE_NULL, 0, DE_NULL, 0, DE_NULL);
 	deviceInterface.cmdBindPipeline(renderInfo.commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, renderInfo.pipeline);
 	deviceInterface.cmdBindVertexBuffers(renderInfo.commandBuffer, 0u, 1u, &renderInfo.vertexBuffer, &bindingOffset);
 	deviceInterface.cmdDraw(renderInfo.commandBuffer, renderInfo.vertexBufferSize, 1, 0, 0);
 	deviceInterface.cmdEndRenderPass(renderInfo.commandBuffer);
-	if (renderInfo.setEvent)
-		deviceInterface.cmdSetEvent(renderInfo.commandBuffer, renderInfo.event, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT);

 	deMemset(&renderBarrier, 0xcd, sizeof(renderBarrier));
 	renderBarrier.sType								= VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
@@ -573,7 +570,6 @@
 	MovePtr<Allocation>			vertexBufferAllocation;
 	vk::Move<VkBuffer>			vertexBuffer;
 	vk::Move<VkBuffer>			renderBuffer;
-	bool						setEvent;
 	bool						waitEvent;
 	VkEvent						event;
 	vk::Move<VkImage>			image;
@@ -597,8 +593,7 @@
 		, binaryCollection	(binaryCollection_)
 		, allocator			(allocator_)
 		, numVertices		(0)
-		, setEvent			(DE_FALSE)
-		, waitEvent			(DE_FALSE)
+		, waitEvent			(false)
 	{
 		createFences(vkd, device, false, DE_LENGTH_OF_ARRAY(fences), fences);
 	}
@@ -759,7 +754,7 @@
 	inputAssemblyState.sType					= VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
 	inputAssemblyState.pNext					= DE_NULL;
 	inputAssemblyState.topology					= VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
-	inputAssemblyState.primitiveRestartEnable	= DE_FALSE;
+	inputAssemblyState.primitiveRestartEnable	= false;

 	viewport.x									= 0;
 	viewport.y									= 0;
@@ -913,7 +908,7 @@
 	deviceInterface.cmdPipelineBarrier( testContext.cmdBuffer.get(),
 										VK_PIPELINE_STAGE_HOST_BIT,
 										VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
-										DE_FALSE,
+										false,
 										(deUint32)memoryBarriers.size(), (memoryBarriers.empty() ? DE_NULL : &memoryBarriers[0]),
 										(deUint32)bufferBarriers.size(), (bufferBarriers.empty() ? DE_NULL : &bufferBarriers[0]),
 										(deUint32)imageBarriers.size(), (imageBarriers.empty() ? DE_NULL : &imageBarriers[0]));
@@ -934,7 +929,6 @@
 	renderInfo.mipLevels			= 1;
 	renderInfo.queueFamilyNdxList	= &queueFamilyNdx;
 	renderInfo.queueFamilyNdxCount	= 1;
-	renderInfo.setEvent				= testContext.setEvent;
 	renderInfo.waitEvent			= testContext.waitEvent;
 	renderInfo.event				= testContext.event;
 	renderInfo.barriers				= &imageBarriers;
@@ -943,7 +937,7 @@
 	deviceInterface.cmdPipelineBarrier(	renderInfo.commandBuffer,
 										VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
 										VK_PIPELINE_STAGE_TRANSFER_BIT,
-										DE_FALSE,
+										false,
 										(deUint32)memoryBarriers.size(), (memoryBarriers.empty() ? DE_NULL : &memoryBarriers[0]),
 										(deUint32)bufferBarriers.size(), (bufferBarriers.empty() ? DE_NULL : &bufferBarriers[0]),
 										(deUint32)imageBarriers.size(), (imageBarriers.empty() ? DE_NULL : &imageBarriers[0]));
@@ -968,7 +962,7 @@
 	deviceInterface.cmdPipelineBarrier(	transferInfo.commandBuffer,
 										VK_PIPELINE_STAGE_TRANSFER_BIT,
 										VK_PIPELINE_STAGE_HOST_BIT,
-										DE_FALSE,
+										false,
 										(deUint32)memoryBarriers.size(), (memoryBarriers.empty() ? DE_NULL : &memoryBarriers[0]),
 										(deUint32)bufferBarriers.size(), (bufferBarriers.empty() ? DE_NULL : &bufferBarriers[0]),
 										(deUint32)imageBarriers.size(), (imageBarriers.empty() ? DE_NULL : &imageBarriers[0]));
@@ -1044,7 +1038,7 @@
 	VK_CHECK(deviceInterface.queueSubmit(queue, 1, &submitInfo, testContext.fences[0]));

 	// Wait with timeout = 0
-	waitStatus = deviceInterface.waitForFences(device, 1, &testContext.fences[0], DE_TRUE, 0u);
+	waitStatus = deviceInterface.waitForFences(device, 1, &testContext.fences[0], true, 0u);
 	if (waitStatus != VK_SUCCESS && waitStatus != VK_TIMEOUT)
 	{
 		// Will most likely end with VK_TIMEOUT
@@ -1053,7 +1047,7 @@
 	}

 	// Wait with a reasonable timeout
-	waitStatus = deviceInterface.waitForFences(device, 1, &testContext.fences[0], DE_TRUE, DEFAULT_TIMEOUT);
+	waitStatus = deviceInterface.waitForFences(device, 1, &testContext.fences[0], true, DEFAULT_TIMEOUT);
 	if (waitStatus != VK_SUCCESS && waitStatus != VK_TIMEOUT)
 	{
 		// \note Wait can end with a timeout if DEFAULT_TIMEOUT is not sufficient
@@ -1062,7 +1056,7 @@
 	}

 	// Wait for work on fences[0] to actually complete
-	waitStatus = deviceInterface.waitForFences(device, 1, &testContext.fences[0], DE_TRUE, std::numeric_limits<deUint64>::max());
+	waitStatus = deviceInterface.waitForFences(device, 1, &testContext.fences[0], true, std::numeric_limits<deUint64>::max());
 	if (waitStatus != VK_SUCCESS)
 	{
 		log << TestLog::Message << "testSynchPrimitives failed to wait for a fence" << TestLog::EndMessage;
@@ -1070,7 +1064,7 @@
 	}

 	// Wait until timeout on a fence that has not been submitted
-	waitStatus = deviceInterface.waitForFences(device, 1, &testContext.fences[1], DE_TRUE, DEFAULT_TIMEOUT);
+	waitStatus = deviceInterface.waitForFences(device, 1, &testContext.fences[1], true, 1);
 	if (waitStatus != VK_TIMEOUT)
 	{
 		log << TestLog::Message << "testSyncPrimitives failed to timeout on wait for single fence" << TestLog::EndMessage;
@@ -1188,7 +1182,7 @@

 	VK_CHECK(deviceInterface.queueSubmit(queue[0], 1, &submitInfo[0], testContext1.fences[0]));

-	testStatus  = deviceInterface.waitForFences(device.get(), 1, &testContext1.fences[0], DE_TRUE, DEFAULT_TIMEOUT);
+	testStatus  = deviceInterface.waitForFences(device.get(), 1, &testContext1.fences[0], true, DEFAULT_TIMEOUT);
 	if (testStatus != VK_SUCCESS)
 	{
 		log << TestLog::Message << "testSynchPrimitives failed to wait for a set fence" << TestLog::EndMessage;
@@ -1214,7 +1208,7 @@

 	VK_CHECK(deviceInterface.queueSubmit(queue[1], 1, &submitInfo[1], testContext2.fences[0]));

-	testStatus  = deviceInterface.waitForFences(device.get(), 1, &testContext2.fences[0], DE_TRUE, DEFAULT_TIMEOUT);
+	testStatus  = deviceInterface.waitForFences(device.get(), 1, &testContext2.fences[0], true, DEFAULT_TIMEOUT);
 	if (testStatus != VK_SUCCESS)
 	{
 		log << TestLog::Message << "testSynchPrimitives failed to wait for a set fence" << TestLog::EndMessage;
@@ -1257,26 +1251,18 @@
 tcu::TestStatus testEvents (Context& context)
 {
 	TestLog&					log					= context.getTestContext().getLog();
-	const InstanceInterface&	instanceInterface	= context.getInstanceInterface();
-	const VkPhysicalDevice		physicalDevice		= context.getPhysicalDevice();
-	deUint32					queueFamilyIdx;
-	vk::Move<VkDevice>			device				= createTestDevice(instanceInterface, physicalDevice, &queueFamilyIdx);
-	const DeviceDriver			deviceInterface		(instanceInterface, *device);
-	SimpleAllocator				allocator			(deviceInterface,
-													 *device,
-													 getPhysicalDeviceMemoryProperties(instanceInterface, physicalDevice));
-	VkQueue						queue[2];
+	const DeviceInterface&		deviceInterface		= context.getDeviceInterface();
+	VkDevice					device				= context.getDevice();
+	const deUint32				queueFamilyIdx		= context.getUniversalQueueFamilyIndex();
+	Allocator&					allocator			= context.getDefaultAllocator();
+	VkQueue						queue				= context.getUniversalQueue();
 	VkResult					testStatus;
 	VkResult					eventStatus;
-	TestContext					testContext1		(deviceInterface, device.get(), queueFamilyIdx, context.getBinaryCollection(), allocator);
-	TestContext					testContext2		(deviceInterface, device.get(), queueFamilyIdx, context.getBinaryCollection(), allocator);
-	Unique<VkEvent>				event				(createEvent(deviceInterface, device.get(), (VkAllocationCallbacks*)DE_NULL), Deleter<VkEvent>(deviceInterface, device.get(), DE_NULL));
-	VkSubmitInfo				submitInfo[2];
+	TestContext					testContext			(deviceInterface, device, queueFamilyIdx, context.getBinaryCollection(), allocator);
+	Unique<VkEvent>				event				(createEvent(deviceInterface, device, (VkAllocationCallbacks*)DE_NULL), Deleter<VkEvent>(deviceInterface, device, DE_NULL));
+	VkSubmitInfo				submitInfo;
 	VkMappedMemoryRange			range;
 	void*						resultImage;
-
-	deviceInterface.getDeviceQueue(device.get(), queueFamilyIdx, 0, &queue[0]);
-	deviceInterface.getDeviceQueue(device.get(), queueFamilyIdx, 1, &queue[1]);

 	const tcu::Vec4		vertices1[]			=
 	{
@@ -1285,93 +1271,68 @@
 		tcu::Vec4( 0.0f, -0.5f, 0.0f, 1.0f)
 	};

-	const tcu::Vec4		vertices2[]			=
-	{
-		tcu::Vec4(-0.5f, -0.5f, 0.0f, 1.0f),
-		tcu::Vec4(+0.5f, -0.5f, 0.0f, 1.0f),
-		tcu::Vec4( 0.0f, +0.5f, 0.0f, 1.0f)
-	};
-
-	testContext1.vertices = vertices1;
-	testContext1.numVertices = DE_LENGTH_OF_ARRAY(vertices1);
-	testContext1.renderDimension = tcu::IVec2(256, 256);
-	testContext1.setEvent = DE_TRUE;
-	testContext1.event = event.get();
-	testContext1.renderSize = sizeof(deUint32) * testContext1.renderDimension.x() * testContext1.renderDimension.y();
-
-	testContext2.vertices = vertices2;
-	testContext2.numVertices = DE_LENGTH_OF_ARRAY(vertices2);
-	testContext2.renderDimension = tcu::IVec2(256, 256);
-	testContext2.waitEvent = DE_TRUE;
-	testContext2.event = event.get();
-	testContext2.renderSize = sizeof(deUint32) * testContext2.renderDimension.x() * testContext2.renderDimension.y();
-
-	createCommandBuffer(deviceInterface, device.get(), queueFamilyIdx, &testContext1.cmdBuffer, &testContext1.commandPool);
-	generateWork(testContext1);
-
-	createCommandBuffer(deviceInterface, device.get(), queueFamilyIdx, &testContext2.cmdBuffer, &testContext2.commandPool);
-	generateWork(testContext2);
-
-	initSubmitInfo(submitInfo, DE_LENGTH_OF_ARRAY(submitInfo));
-	submitInfo[0].pCommandBuffers = &testContext1.cmdBuffer.get();
-	submitInfo[1].pCommandBuffers = &testContext2.cmdBuffer.get();
-
-	eventStatus = deviceInterface.getEventStatus(device.get(), event.get());
+	testContext.vertices = vertices1;
+	testContext.numVertices = DE_LENGTH_OF_ARRAY(vertices1);
+	testContext.renderDimension = tcu::IVec2(256, 256);
+	testContext.waitEvent = true;
+	testContext.event = event.get();
+	testContext.renderSize = sizeof(deUint32) * testContext.renderDimension.x() * testContext.renderDimension.y();
+
+	createCommandBuffer(deviceInterface, device, queueFamilyIdx, &testContext.cmdBuffer, &testContext.commandPool);
+	generateWork(testContext);
+
+	initSubmitInfo(&submitInfo, 1);
+	submitInfo.pCommandBuffers = &testContext.cmdBuffer.get();
+
+	// 6.3 An event is initially in the unsignaled state
+	eventStatus = deviceInterface.getEventStatus(device, event.get());
 	if (eventStatus != VK_EVENT_RESET)
 	{
 		log << TestLog::Message << "testSynchronizationPrimitives event should be reset but status is " << getResultName(eventStatus) << TestLog::EndMessage;
 		return tcu::TestStatus::fail("Event in incorrect status");
 	}

-	// Now the two contexts are submitted normally, so, context1 and set the event and context2 can wait for the event
-	VK_CHECK(deviceInterface.queueSubmit(queue[0], 1, &submitInfo[0], testContext1.fences[0]));
-	VK_CHECK(deviceInterface.queueSubmit(queue[1], 1, &submitInfo[1], testContext2.fences[0]));
-
-	testStatus  = deviceInterface.waitForFences(device.get(), 1, &testContext1.fences[0], DE_TRUE, DEFAULT_TIMEOUT);
+	// The recorded command buffer should wait at the top of the graphics pipe for an event signaled by the host and so should not
+	// make forward progress as long as the event is not signaled
+	VK_CHECK(deviceInterface.queueSubmit(queue, 1, &submitInfo, testContext.fences[0]));
+
+	testStatus  = deviceInterface.waitForFences(device, 1, &testContext.fences[0], true, 1);
+	if (testStatus != VK_TIMEOUT)
+	{
+		log << TestLog::Message << "testSynchronizationPrimitives failed to wait for set event from host." << TestLog::EndMessage;
+		return tcu::TestStatus::fail("failed to wait for event set from host");
+	}
+
+	// Should allow the recorded command buffer to finally make progress
+	VK_CHECK(deviceInterface.setEvent(device, event.get()));
+	eventStatus = deviceInterface.getEventStatus(device, event.get());
+	if (eventStatus != VK_EVENT_SET)
+	{
+		log << TestLog::Message << "testEvents failed to transition event to signaled state via setEvent call from host" << TestLog::EndMessage;
+		return tcu::TestStatus::fail("failed to signal event from host");
+	}
+
+	testStatus  = deviceInterface.waitForFences(device, 1, &testContext.fences[0], true, ~(0ull));
 	if (testStatus != VK_SUCCESS)
 	{
-		log << TestLog::Message << "testSynchronizationPrimitives failed to wait for set fence" << TestLog::EndMessage;
-		return tcu::TestStatus::fail("failed to wait for set fence");
+		log << TestLog::Message << "testSynchronizationPrimitives failed to proceed after set event from host." << TestLog::EndMessage;
+		return tcu::TestStatus::fail("failed to proceed after event set from host");
 	}

 	range.sType			= VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE;
 	range.pNext			= DE_NULL;
-	range.memory		= testContext1.renderReadBuffer->getMemory();
+	range.memory		= testContext.renderReadBuffer->getMemory();
 	range.offset		= 0;
-	range.size			= testContext1.renderSize;
-	VK_CHECK(deviceInterface.invalidateMappedMemoryRanges(device.get(), 1, &range));
-	resultImage = testContext1.renderReadBuffer->getHostPtr();
+	range.size			= testContext.renderSize;
+	VK_CHECK(deviceInterface.invalidateMappedMemoryRanges(device, 1, &range));
+	resultImage = testContext.renderReadBuffer->getHostPtr();

 	log << TestLog::Image(	"result",
 							"result",
 							tcu::ConstPixelBufferAccess(tcu::TextureFormat(
 									tcu::TextureFormat::RGBA, tcu::TextureFormat::UNORM_INT8),
-									testContext1.renderDimension.x(),
-									testContext1.renderDimension.y(),
-									1,
-									resultImage));
-
-	testStatus  = deviceInterface.waitForFences(device.get(), 1, &testContext2.fences[0], DE_TRUE, DEFAULT_TIMEOUT);
-	if (testStatus != VK_SUCCESS)
-	{
-		log << TestLog::Message << "testSynchPrimitives failed to wait for a set fence" << TestLog::EndMessage;
-		return tcu::TestStatus::fail("failed to wait for a set fence");
-	}
-
-	range.sType			= VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE;
-	range.pNext			= DE_NULL;
-	range.memory		= testContext2.renderReadBuffer->getMemory();
-	range.offset		= 0;
-	range.size			= testContext2.renderSize;
-	VK_CHECK(deviceInterface.invalidateMappedMemoryRanges(device.get(), 1, &range));
-	resultImage = testContext2.renderReadBuffer->getHostPtr();
-
-	log << TestLog::Image(	"result",
-							"result",
-							tcu::ConstPixelBufferAccess(tcu::TextureFormat(
-									tcu::TextureFormat::RGBA, tcu::TextureFormat::UNORM_INT8),
-									testContext2.renderDimension.x(),
-									testContext2.renderDimension.y(),
+									testContext.renderDimension.x(),
+									testContext.renderDimension.y(),
 									1,
 									resultImage));


Delete old content in gProgName before assign new

Method is overriden in all derived classes,
but should clearly demonstrate ownership

--- core/base/src/TSystem.cxx
+++ core/base/src/TSystem.cxx
@@ -209,7 +209,6 @@
 void TSystem::SetProgname(const char *name)
 {
    delete [] gProgName;
-
    gProgName = StrDup(name);
 }


INTEGRATION: CWS changefileheader (1.5.268); FILE MERGED 2008/03/31 13:39:35 rt 1.5.268.1: #i87441# Change license header to LPGL v3.

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


prevent linker error

prevent linker error

--- include/detail/cyojson.hpp
+++ include/detail/cyojson.hpp
@@ -357,7 +357,7 @@
         };
     }

-    bool Parser::Parse(const char* json, Callbacks& callbacks)
+    inline bool Parser::Parse(const char* json, Callbacks& callbacks)
     {
         if (!json)
             return false;


Added serialisation support for the Bücke-Rastrigin function

--- include/mantella_bits/optimisationProblem/blackBoxOptimisationBenchmark/buecheRastriginFunction.hpp
+++ include/mantella_bits/optimisationProblem/blackBoxOptimisationBenchmark/buecheRastriginFunction.hpp
@@ -19,25 +19,13 @@
         T getObjectiveValueImplementation(
             const arma::Col<T>& parameter) const noexcept override;

-#if defined(MANTELLA_USE_PARALLEL)
-        friend class cereal::access;
-        template <typename Archive>
-        void serialize(
-            Archive& archive) noexcept {
-          archive(cereal::make_nvp("BlackBoxOptimisationBenchmark", cereal::base_class<BlackBoxOptimisationBenchmark>(this)));
-          archive(cereal::make_nvp("numberOfDimensions", numberOfDimensions_));
-        }
+#if defined(MANTELLA_USE_PARALLEL_ALGORITHMS)
+        friend class OptimisationAlgorithm;
+
+        std::vector<long double> serialise() const noexcept;

-        template <typename Archive>
-        static void load_and_construct(
-            Archive& archive,
-            cereal::construct<BuecheRastriginFunction>& construct) noexcept {
-          unsigned int numberOfDimensions;
-          archive(cereal::make_nvp("numberOfDimensions", numberOfDimensions));
-          construct(numberOfDimensions);
-
-          archive(cereal::make_nvp("BlackBoxOptimisationBenchmark", cereal::base_class<BlackBoxOptimisationBenchmark>(construct.ptr())));
-        }
+        void deserialise(
+            const std::vector<long double>& serialisedOptimisationProblem);
 #endif
     };

@@ -80,5 +68,18 @@
     std::string BuecheRastriginFunction<T>::toString() const noexcept {
       return "bbob_bueche_rastrigin_function";
     }
+
+#if defined(MANTELLA_USE_PARALLEL_ALGORITHMS)
+    template <typename T>
+    std::vector<long double> BentCigarFunction<T>::serialise() const noexcept {
+      return BlackBoxOptimisationBenchmark<T, T>::serialise();;
+    }
+
+    template <typename T>
+    void BentCigarFunction<T>::deserialise(
+        const std::vector<long double>& serialisedOptimisationProblem) {
+      BlackBoxOptimisationBenchmark<T, T>::deserialise(serialisedOptimisationProblem);
+    }
+#endif
   }
 }


Breatheing test for 'multiplyByPowerOf10' on negative exponents.

--- groups/bdl/bdldfp/bdldfp_decimalutil.t.cpp
+++ groups/bdl/bdldfp/bdldfp_decimalutil.t.cpp
@@ -2247,8 +2247,14 @@
             ASSERT(!Util::sameQuantum(Util::multiplyByPowerOf10(anInt, 5),
                                       Util::multiplyByPowerOf10(anInt, 4)));

-            ASSERT(Util::quantum(Util::multiplyByPowerOf10(anInt, 5)) ==
-                   Util::quantum(anInt) + 5);
+            ASSERT(Util::sameQuantum(Util::multiplyByPowerOf10(anInt, -4),
+                                     Util::multiplyByPowerOf10(anInt, -4)));
+
+            ASSERT(!Util::sameQuantum(Util::multiplyByPowerOf10(anInt, -5),
+                                      Util::multiplyByPowerOf10(anInt, -4)));
+
+            ASSERT(Util::quantum(Util::multiplyByPowerOf10(anInt, -5)) ==
+                   Util::quantum(anInt) - 5);


tests: Read SSTables for write_composite_clustering_key test after validating write.

Signed-off-by: Vladimir Krivopalov <dc9186a06078733915a6fcbab34e59120be2b484@scylladb.com>

--- tests/sstable_3_x_test.cc
+++ tests/sstable_3_x_test.cc
@@ -3124,9 +3124,10 @@
     mut.partition().apply_insert(*s, ckey, write_timestamp);
     mut.set_cell(ckey, "e", data_value{3}, write_timestamp);
     mut.set_cell(ckey, "f", data_value{"world"}, write_timestamp);
-    mt->apply(std::move(mut));
-
-    write_and_compare_sstables(s, mt, table_name);
+    mt->apply(mut);
+
+    tmpdir tmp = write_and_compare_sstables(s, mt, table_name);
+    validate_read(s, tmp.path, {mut});
 }

 SEASTAR_THREAD_TEST_CASE(test_write_wide_partitions) {


Fix potential use-after-free of `worker_cache` in NewRemoteDevices(). Change: 142623343

--- tensorflow/core/distributed_runtime/remote_device.cc
+++ tensorflow/core/distributed_runtime/remote_device.cc
@@ -77,8 +77,8 @@
         remote_devices.push_back(d);
       }
     }
+    worker_cache->ReleaseWorker(worker_name, wi);
     done(s, &remote_devices);
-    worker_cache->ReleaseWorker(worker_name, wi);
     delete call;
   };
   wi->GetStatusAsync(&call->req, &call->resp, cb);


Minor DimensionOf doc fix

Minor DimensionOf doc fix

--- include/fl/util/traits.hpp
+++ include/fl/util/traits.hpp
@@ -130,6 +130,7 @@
  * Examples
  *
  * static_assert(DimensionOf<MyEigenMatrixType>() > 0, "Dim must be greater 0");
+ *
  * static_assert(DimensionOf<MyEigenMatrixType>::value > 0, "Dim must be .. 0");
  *
  * Eigen::VectorXd vector(DimensionOf<MyEigenMatrixType>());


Allow the events have equal time stamps as it can happen with the time stamp granularity of the ttasim. Its timestamps are not realistic for other events than the kernel execution events.

--- tests/tce/ttasim/host.cpp
+++ tests/tce/ttasim/host.cpp
@@ -195,10 +195,10 @@
             unmapEvent.getProfilingInfo<CL_PROFILING_COMMAND_START>() <=
             unmapEvent.getProfilingInfo<CL_PROFILING_COMMAND_END>());

-        assert (enqEvent.getProfilingInfo<CL_PROFILING_COMMAND_END>() <
+        assert (enqEvent.getProfilingInfo<CL_PROFILING_COMMAND_END>() <=
                 mapEvent.getProfilingInfo<CL_PROFILING_COMMAND_END>());

-        assert (mapEvent.getProfilingInfo<CL_PROFILING_COMMAND_END>() <
+        assert (mapEvent.getProfilingInfo<CL_PROFILING_COMMAND_END>() <=
                 unmapEvent.getProfilingInfo<CL_PROFILING_COMMAND_END>());

     }


Replace std::shared_ptr to std::unique_ptr

--- include/ghc/filesystem.hpp
+++ include/ghc/filesystem.hpp
@@ -2043,7 +2043,13 @@
 #endif
 #endif

-GHC_INLINE std::shared_ptr<REPARSE_DATA_BUFFER> getReparseData(const path& p, std::error_code& ec)
+template <class T>
+struct free_deleter
+{
+    void operator()(T* p) const { std::free(p); }
+};
+
+GHC_INLINE std::unique_ptr<REPARSE_DATA_BUFFER, free_deleter<REPARSE_DATA_BUFFER>> getReparseData(const path& p, std::error_code& ec)
 {
     std::shared_ptr<void> file(CreateFileW(GHC_NATIVEWP(p), 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 0, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, 0), CloseHandle);
     if (file.get() == INVALID_HANDLE_VALUE) {
@@ -2051,7 +2057,7 @@
         return nullptr;
     }

-    std::shared_ptr<REPARSE_DATA_BUFFER> reparseData((REPARSE_DATA_BUFFER*)std::calloc(1, MAXIMUM_REPARSE_DATA_BUFFER_SIZE), std::free);
+    std::unique_ptr<REPARSE_DATA_BUFFER, free_deleter<REPARSE_DATA_BUFFER>> reparseData(reinterpret_cast<REPARSE_DATA_BUFFER*>(std::calloc(1, MAXIMUM_REPARSE_DATA_BUFFER_SIZE)));
     ULONG bufferUsed;
     if (DeviceIoControl(file.get(), FSCTL_GET_REPARSE_POINT, 0, 0, reparseData.get(), MAXIMUM_REPARSE_DATA_BUFFER_SIZE, &bufferUsed, 0)) {
         return reparseData;


Complete sync of all changes

Complete sync of all changes

In its current state, GCC is showing some odd bugs compiling this code.
Parameters to functions are randomly being destroyed to 0. This sync is
to guarantee we’re all on the same page with the WiFi library code.

--- hardware/cc3200/libraries/WiFi/WiFiUdp.cpp
+++ hardware/cc3200/libraries/WiFi/WiFiUdp.cpp
@@ -288,7 +288,7 @@
     //Since we've reached this point, the sl_select command has indicated
     //that either we're going to get an error, or an immediate read
     //
-    SlSockAddrIn_t  address;
+    SlSockAddrIn_t  address = {0};
     int AddrSize = sizeof(address);
     int bytes = sl_RecvFrom(socketHandle, rx_buf, UDP_RX_PACKET_MAX_SIZE, NULL, (SlSockAddr_t*)&address, (SlSocklen_t*)&AddrSize);

@@ -297,7 +297,7 @@
     //!! Although this follows some examples (upd_socket), it goes agains the
     //!! API documentation. The API maintains that the 5th arg to RecvFrom is not in/out
     //
-    _remoteIP = sl_Htonl(address.sin_addr.s_addr);
+    _remoteIP = address.sin_addr.s_addr;
     _remotePort = sl_Htons(address.sin_port);

     //
@@ -370,7 +370,9 @@
     //
     //this value is maintained by ParsePacket method
     //
-    return _remoteIP;
+    IPAddress retIP;
+    retIP = _remoteIP;
+    return retIP;
 }

 uint16_t  WiFiUDP::remotePort()
@@ -378,6 +380,7 @@
     //
     //this value is maintained by ParsePacket method
     //
-    return _remotePort;
-}
-
+    uint16_t retPort = _remotePort;
+    return retPort;
+}
+


refs #75, avoid messing with long namespaced path on windows

--- include/ghc/filesystem.hpp
+++ include/ghc/filesystem.hpp
@@ -2549,8 +2549,8 @@
 {
     impl_string_type result;
     if (is_absolute() && _path.length() > MAX_PATH - 10) {
-        // expand long Windows filenames with marker
-        if (has_root_name() && _path[0] == '/') {
+        // expand absolute non namespaced long Windows filenames with marker
+        if (has_root_name() && _path[0] == '/' && _path[1] != '/') {
             result = "\\\\?\\" + _path.substr(1);
         }
         else {


(UNet): подправил текст help-а.

(UNet): подправил текст help-а.

--- extensions/UniNetwork/UniExchange.cc
+++ extensions/UniNetwork/UniExchange.cc
@@ -482,7 +482,7 @@
 // ------------------------------------------------------------------------------------------
 void UniExchange::help_print( int argc, const char** argv )
 {
-	cout << "--unet-polltime msec     - Пауза между опросаом карт. По умолчанию 200 мсек." << endl;
+	cout << "--unet-polltime msec     - Пауза между опросами узлов. По умолчанию 200 мсек." << endl;
 //	cout << "--unet-heartbeat-id      - Данный процесс связан с указанным аналоговым heartbeat-дачиком." << endl;
 //	cout << "--unet-heartbeat-max     - Максимальное значение heartbeat-счётчика для данного процесса. По умолчанию 10." << endl;
 	cout << "--unet-sm-ready-timeout - время на ожидание старта SM" << endl;


Implemented method replace only if old value in map

--- include/map-threadsafe.hpp
+++ include/map-threadsafe.hpp
@@ -83,13 +83,23 @@
 			}
 		}

-		bool replace(const K& key,const V& value,V &output){
+		bool replace(const K& key,const V& value){
 			std::unique_lock<std::shared_mutex> lock(mutex);

 			auto it = internal_map.find(key);
 			if (it != internal_map.end()){
-				output = it-> second;
 				it->second = value;
+				return true;
+			}
+			return false;
+		}
+
+		bool replace(const K& key,V& oldValue,V& newValue){
+			std::unique_lock<std::shared_mutex> lock(mutex);
+
+			auto it = internal_map.find(key);
+			if (it != internal_map.end() && it->second == oldValue){
+				it->second = newValue;
 				return true;
 			}
 			return false;


watchers for connect/disconnect events

watchers for connect/disconnect events

--- include/ten/http/server.hh
+++ include/ten/http/server.hh
@@ -160,6 +160,8 @@
         _log_func = f;
     }

+    std::function<void ()> connect_watch;
+    std::function<void ()> disconnect_watch;
 private:
     std::shared_ptr<std::vector<route> > _routes;
     callback_type _log_func;
@@ -176,6 +178,9 @@
         buffer buf(4*1024);
         http_parser parser;

+        if (connect_watch) {
+            connect_watch();
+        }
         // TODO: might want to enable this later after
         // we know this will be a long-lived connection
         // otherwise the overhead of the syscall hurts concurrency
@@ -190,7 +195,7 @@
                 ssize_t nr = -1;
                 if (buf.size() == 0) {
                     nr = s.recv(buf.back(), buf.available(), timeout_ms);
-                    if (nr < 0) return;
+                    if (nr < 0) goto done;
                     buf.commit(nr);
                 }
                 size_t nparse = buf.size();
@@ -201,7 +206,7 @@
                     handle_request(req, s);
                     break;
                 }
-                if (nr == 0) return;
+                if (nr == 0) goto done;
                 if (!got_headers && !req.method.empty()) {
                     got_headers = true;
                     if (req.get("Expect") == "100-continue") {
@@ -212,6 +217,10 @@
                     }
                 }
             }
+        }
+done:
+        if (disconnect_watch) {
+            disconnect_watch();
         }
     }


[tests/unit/spawn] Reduce no. of iterations.

--- tests/unit/spawn/spawn.cc
+++ tests/unit/spawn/spawn.cc
@@ -26,8 +26,9 @@
    int i = 0;
    CarbonStartSim(argc, argv);

-   for(i = 0; i < 120; i++)
+   for(i = 0; i < 20; i++)
    {
+       fprintf(stderr, "%d...", i);
        do_a_sim();
    }
    CarbonStopSim();


get_uri() const

get_uri() const

--- include/ten/http/server.hh
+++ include/ten/http/server.hh
@@ -34,7 +34,7 @@
               start(std::chrono::steady_clock::now()) {}

         //! compose a uri from the request uri
-        uri get_uri(std::string host="") {
+        uri get_uri(std::string host="") const {
             if (host.empty()) {
                 host = req.get("Host");
                 // TODO: transform to preserve passed in host


added waits in between threads to fix wierd bug

setting duty cycles failed without this fix

--- firmware/robot2015/src-ctrl/main.cpp
+++ firmware/robot2015/src-ctrl/main.cpp
@@ -118,6 +118,7 @@
     FPGA::Instance = new FPGA(sharedSPI, RJ_FPGA_nCS, RJ_FPGA_INIT_B,
                               RJ_FPGA_PROG_B, RJ_FPGA_DONE);
     const bool fpgaInitialized = FPGA::Instance->configure("/local/rj-fpga.nib");
+    Thread::wait(10);
     uint8_t fpgaLastStatus = 0;
     bool fpgaError = false; // set based on status byte reading in main loop

@@ -181,6 +182,7 @@
     // a multi-core system.

     // Start the thread task for the on-board control loop
+    Thread::wait(10);
     Thread controller_task(Task_Controller, mainID, osPriorityHigh,
                            DEFAULT_STACK_SIZE / 2);
     Thread::signal_wait(MAIN_TASK_CONTINUE, osWaitForever);


fixing pointer type traits in xadapt.

fixing pointer type traits in xadapt.

--- include/xtensor/xadapt.hpp
+++ include/xtensor/xadapt.hpp
@@ -89,7 +89,7 @@
      */
     template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class C, class SC,
               XTL_REQUIRES(detail::not_an_array<std::decay_t<SC>>,
-                           std::is_pointer<C>)>
+                           std::is_pointer<std::remove_reference_t<C>>)>
     inline auto adapt(C&& pointer, const SC& shape, layout_type l = L)
     {
         static_assert(!xtl::is_integral<SC>::value, "shape cannot be a integer");
@@ -247,7 +247,7 @@
      */
     template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class C, class SC,
               XTL_REQUIRES(detail::is_array<std::decay_t<SC>>,
-                           std::is_pointer<C>)>
+                           std::is_pointer<std::remove_reference_t<C>>)>
     inline auto adapt(C&& pointer, const SC& shape, layout_type l = L)
     {
         static_assert(!xtl::is_integral<SC>::value, "shape cannot be a integer");
@@ -390,7 +390,7 @@
      * @param shape the shape of the xtensor_fixed_adaptor
      */
     template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class C, std::size_t... X,
-              XTL_REQUIRES(std::is_pointer<C>)>
+              XTL_REQUIRES(std::is_pointer<std::remove_reference_t<C>>)>
     inline auto adapt(C&& pointer, const fixed_shape<X...>& /*shape*/)
     {
         using buffer_type = xbuffer_adaptor<C, xt::no_ownership, detail::default_allocator_for_ptr_t<C>>;


tests: Need space for two persistent buffer structs

--- tests/vktestframework.cpp
+++ tests/vktestframework.cpp
@@ -697,7 +697,7 @@
     assert(!err);

     VkSwapChainImageInfoWSI infos[2];
-    size_t size = sizeof(VkSwapChainImageInfoWSI) * m_images.size();
+    size_t size = sizeof(VkSwapChainImageInfoWSI) * m_images.size() * 2;
     std::vector<VkSwapChainImageInfoWSI> persistent_images;
     persistent_images.resize(m_images.size());
     err = m_fpGetSwapChainInfoWSI(m_swap_chain,


[generator] Fixed logic error in WikiChecker::NeedFeature.

--- indexer/ftypes_matcher.hpp
+++ indexer/ftypes_matcher.hpp
@@ -204,10 +204,10 @@
    {
      bool need = true;
      feature.ForEachType([&](uint32_t type) {
-       if (need && !IsMatched(type))
+       if (need && IsMatched(type))
          need = false;
      });
-     return need;
+     return !need;
    }
 };


Better parsing for comments and empty lines in AO notecards

--- indra/newview/aoengine.cpp
+++ indra/newview/aoengine.cpp
@@ -1484,10 +1484,14 @@
 		if(index==lines.size()-1)
 			line=line.substr(0,line.size()-1);

-		if( line.size() > 0 && line[0] == '#' ) // <ND/> FIRE-3801; skip comments to reduce spam to local chat.
+		LLStringUtil::trim(line);
+
+		if(line.empty())
 			continue;

-		LLStringUtil::trim(line);
+		if(line[0]=='#') // <ND/> FIRE-3801; skip comments to reduce spam to local chat.
+			continue;
+
 		if(line.find("[")!=0)
 		{
 			LLSD args;


SH-940 FIX crash on startup

SH-940 FIX crash on startup

Setting the lighting detail happens when we force a graphics level on startup.
This got added with handleRenderLocalLightsChanged, which got added recently.
setLightingDetail is safe to call with the pipeline uninitialized.
Removing the assert to stop the crash.

Fix verified to be safe by davep.

--- indra/newview/pipeline.cpp
+++ indra/newview/pipeline.cpp
@@ -1021,7 +1021,6 @@
 S32 LLPipeline::setLightingDetail(S32 level)
 {
 	LLMemType mt_ld(LLMemType::MTYPE_PIPELINE_LIGHTING_DETAIL);
-	assertInitialized();

 	if (level < 0)
 	{


Reshuffling sequence of methods for improved pragma marks

--- implementations/MaxMSP/jcom.parameter/jcom.parameter.cpp
+++ implementations/MaxMSP/jcom.parameter/jcom.parameter.cpp
@@ -213,9 +213,9 @@
 		x->rampParameterNames = new TTHash;

 		// TODO: we shouldn't really allocate this much memory unless we actually need it...
-		x->atom_list		 = new Atom[JAMOMA_LISTSIZE];
-		x->atom_listTemp = new Atom[JAMOMA_LISTSIZE];
-		x->atom_listDefault  = new Atom[JAMOMA_LISTSIZE];
+		x->atom_list		= new Atom[JAMOMA_LISTSIZE];
+		x->atom_listTemp	= new Atom[JAMOMA_LISTSIZE];
+		x->atom_listDefault = new Atom[JAMOMA_LISTSIZE];

 		TTObjectInstantiate(TT("dataspace"), &x->dataspace_override2unit, kTTValNONE);
 		TTObjectInstantiate(TT("dataspace"), &x->dataspace_unit2override, kTTValNONE);
@@ -911,9 +911,212 @@

 /************************************************************************************/
-// Methods bound to input/inlets
+
 #pragma mark -
-#pragma mark methods
+#pragma mark optimized output methods
+
+// Actual bang functions
+void param_output_generic(void *z)
+{
+	t_param *x = (t_param *)z;
+
+	x->isSending = YES;
+	if (x->list_size == 1) {
+		param_clip_generic(x);
+		if (x->attr_value.a_type == A_LONG)
+			outlet_int(x->outlets[k_outlet_direct], x->attr_value.a_w.w_long);
+		else if (x->attr_value.a_type == A_FLOAT)
+			outlet_float(x->outlets[k_outlet_direct], x->attr_value.a_w.w_float);
+		else if (x->attr_value.a_type == A_SYM)
+			outlet_anything(x->outlets[k_outlet_direct], x->attr_value.a_w.w_sym, 0, NULL);
+		param_send_feedback(x);
+	}
+	else if (x->list_size > 1) {
+		if (param_clip_generic(x) && x->ramper)
+			x->ramper->stop();
+		outlet_anything(x->outlets[k_outlet_direct], _sym_list, x->list_size, x->atom_list);
+		param_send_feedback(x);
+	}
+	else {	// zero args
+		param_output_none(x);
+	}
+	x->isSending = NO;
+	x->isInitialised = YES;	// We have had our value set at least once
+}
+
+void param_output_int(void *z)
+{
+	t_param *x = (t_param *)z;
+	TTBoolean	didClip;
+
+	long oldVal = atom_getlong(&x->attr_value);
+	float newValAsFloat = atom_getfloat(&x->attr_valueTemp);
+
+	// Dataspace conversion
+	if (x->isOverriding)
+	{
+		Atom	a;
+		long	ac = 0;
+		AtomPtr	av = NULL;
+		bool	alloc = false;
+
+		atom_setfloat(&a, newValAsFloat);
+		param_convert_units(x, 1, &a, &ac, &av, &alloc);
+		newValAsFloat = atom_getfloat(av);
+		if (alloc)
+			delete[] av;
+	}
+
+	// Round to integer and store
+	atom_setlong(&x->attr_value, round(newValAsFloat));
+
+	// Clipping
+	if (param_clip_int(x) && x->ramper)
+		x->ramper->stop();
+
+	// Test for repetitions before outputting
+	if (x->common.attr_repetitions || (atom_getlong(&x->attr_value) != oldVal)) {
+		x->isSending = YES;
+		outlet_int(x->outlets[k_outlet_direct], x->attr_value.a_w.w_long);
+		param_send_feedback(x);
+		x->isSending = NO;
+		x->isInitialised = YES;	// We have had our value set at least once
+	}
+}
+
+
+void param_output_float(void *z)
+{
+	t_param *x = (t_param *)z;
+	TTBoolean	didClip;
+
+	float oldval = atom_getfloat(&x->attr_value);
+	float newval = atom_getfloat(&x->attr_valueTemp);
+
+	// Dataspace conversion
+	if (x->isOverriding)
+	{
+		Atom	a;
+		long	ac = 0;
+		AtomPtr	av = NULL;
+		bool	alloc = false;
+
+		atom_setfloat(&a, newval);
+		param_convert_units(x, 1, &a, &ac, &av, &alloc);
+		newval = atom_getfloat(av);
+		if (alloc)
+			delete[] av;
+	}
+
+	// Filter repetitions
+	// TODO: Filtering need to happen after clipping, or we might output same value several times at the outer limits of the clip range
+	if (x->common.attr_repetitions || (newval != oldval)) {
+
+		// Update stored value
+		atom_setfloat(&x->attr_value, newval);
+
+		// Clip to specified range, depending on clipmode
+		didClip = param_clip_float(x);
+
+		x->isSending = YES;
+		outlet_float(x->outlets[k_outlet_direct], x->attr_value.a_w.w_float);
+		param_send_feedback(x);
+		x->isSending = NO;
+
+		x->isInitialised = YES;	// We have had our value set at least once
+
+		// TODO: This test need to be more sofisticated to cater for wrap and fold clip modes - Redmine issue 47
+		if (didClip && x->ramper)
+			x->ramper->stop();
+	}
+}
+
+void param_output_symbol(void *z)
+{
+	t_param *x = (t_param *)z;
+
+	char string[24];
+	t_symbol *mySymbol;
+
+	if (atom_gettype(&x->attr_value) == A_SYM) {
+		x->isSending = YES;
+		outlet_anything(x->outlets[k_outlet_direct], atom_getsym(&x->attr_value), 0, NULL);
+		param_send_feedback(x);
+		x->isSending = NO;
+		x->isInitialised = YES;	// We have had our value set at least once
+	}
+	else if (atom_gettype(&x->attr_value) == A_FLOAT) {
+
+		// Convert float to string
+		sprintf (string, "%f", atom_getfloat(&x->attr_value));
+		mySymbol = gensym(string);
+		atom_setsym(&x->attr_value, mySymbol);
+
+		x->isSending = YES;
+		outlet_anything(x->outlets[k_outlet_direct], atom_getsym(&x->attr_value), 0, NULL);
+		param_send_feedback(x);
+		x->isSending = NO;
+		x->isInitialised = YES;	// We have had our value set at least once
+	}
+	else if (atom_gettype(&x->attr_value) == A_LONG) {
+
+		//Convert int to string
+		sprintf (string, "%ld", atom_getlong(&x->attr_value));
+		mySymbol = gensym(string);
+		atom_setsym(&x->attr_value, mySymbol);
+
+		x->isSending = YES;
+		outlet_anything(x->outlets[k_outlet_direct], atom_getsym(&x->attr_value), 0, NULL);
+		param_send_feedback(x);
+		x->isSending = NO;
+		x->isInitialised = YES;	// We have had our value set at least once
+	}
+}
+
+void param_output_list(void *z)
+{
+	t_param *x = (t_param *)z;
+
+	if (param_clip_list(x) && x->ramper)
+		x->ramper->stop();
+	x->isSending = YES;
+	outlet_anything(x->outlets[k_outlet_direct], _sym_list, x->list_size, x->atom_list);
+	param_send_feedback(x);
+	x->isSending = NO;
+	x->isInitialised = YES;	// We have had our value set at least once
+}
+
+
+void param_output_none(void *z)
+{
+	t_param *x = (t_param *)z;
+	Atom output[1];
+	AtomPtr out = (AtomPtr )(&output);
+
+	x->isSending = YES;
+
+	// bang direct output
+	outlet_bang(x->outlets[k_outlet_direct]);
+
+	// call on the hub to pass our data onward
+	// We can not use (method)param_send_feedback here as it assumes an additional argument
+	if (x->common.hub != NULL) {
+
+		// send to the object in which this parameter is embedded
+		if (x->callback)
+			x->callback(x->callbackArg, x->common.attr_name, x->list_size, x->atom_list);
+
+		atom_setsym(out, x->common.attr_name);
+		object_method_typed(x->common.hub, jps_feedback, 1, out, NULL);
+	}
+
+	x->isSending = NO;
+	x->isInitialised = YES;	// We have had our value set at least once
+}
+
+
+#pragma mark -
+#pragma mark methods bound to input/inlets

 // Method for Assistance Messages
 void param_assist(t_param *x, void *b, long msg, long arg, char *dst)
@@ -936,7 +1139,7 @@
 }

-// receive messages from our internal jcom.receive external
+// Receive messages from our internal jcom.receive external
 void param_receive_callback(t_param *x, SymbolPtr msg, AtomCount argc, AtomPtr argv)
 {
 	if (msg == _sym_int)
@@ -1107,207 +1310,6 @@
 	if (x->callback)
 		x->callback(x, x->common.attr_name, x->list_size, x->atom_list);
 }
-
-
-// Actual bang functions
-void param_output_generic(void *z)
-{
-	t_param *x = (t_param *)z;
-
-	x->isSending = YES;
-	if (x->list_size == 1) {
-		param_clip_generic(x);
-		if (x->attr_value.a_type == A_LONG)
-			outlet_int(x->outlets[k_outlet_direct], x->attr_value.a_w.w_long);
-		else if (x->attr_value.a_type == A_FLOAT)
-			outlet_float(x->outlets[k_outlet_direct], x->attr_value.a_w.w_float);
-		else if (x->attr_value.a_type == A_SYM)
-			outlet_anything(x->outlets[k_outlet_direct], x->attr_value.a_w.w_sym, 0, NULL);
-		param_send_feedback(x);
-	}
-	else if (x->list_size > 1) {
-		if (param_clip_generic(x) && x->ramper)
-			x->ramper->stop();
-		outlet_anything(x->outlets[k_outlet_direct], _sym_list, x->list_size, x->atom_list);
-		param_send_feedback(x);
-	}
-	else {	// zero args
-		param_output_none(x);
-	}
-	x->isSending = NO;
-	x->isInitialised = YES;	// We have had our value set at least once
-}
-
-void param_output_int(void *z)
-{
-	t_param *x = (t_param *)z;
-	TTBoolean	didClip;
-
-	long oldVal = atom_getlong(&x->attr_value);
-	float newValAsFloat = atom_getfloat(&x->attr_valueTemp);
-
-	// Dataspace conversion
-	if (x->isOverriding)
-	{
-		Atom	a;
-		long	ac = 0;
-		AtomPtr	av = NULL;
-		bool	alloc = false;
-
-		atom_setfloat(&a, newValAsFloat);
-		param_convert_units(x, 1, &a, &ac, &av, &alloc);
-		newValAsFloat = atom_getfloat(av);
-		if (alloc)
-			delete[] av;
-	}
-
-	// Round to integer and store
-	atom_setlong(&x->attr_value, round(newValAsFloat));
-
-	// Clipping
-	if (param_clip_int(x) && x->ramper)
-		x->ramper->stop();
-
-	// Test for repetitions before outputting
-	if (x->common.attr_repetitions || (atom_getlong(&x->attr_value) != oldVal)) {
-		x->isSending = YES;
-		outlet_int(x->outlets[k_outlet_direct], x->attr_value.a_w.w_long);
-		param_send_feedback(x);
-		x->isSending = NO;
-		x->isInitialised = YES;	// We have had our value set at least once
-	}
-}
-
-
-void param_output_float(void *z)
-{
-	t_param *x = (t_param *)z;
-	TTBoolean	didClip;
-
-	float oldval = atom_getfloat(&x->attr_value);
-	float newval = atom_getfloat(&x->attr_valueTemp);
-
-	// Dataspace conversion
-	if (x->isOverriding)
-	{
-		Atom	a;
-		long	ac = 0;
-		AtomPtr	av = NULL;
-		bool	alloc = false;
-
-		atom_setfloat(&a, newval);
-		param_convert_units(x, 1, &a, &ac, &av, &alloc);
-		newval = atom_getfloat(av);
-		if (alloc)
-			delete[] av;
-	}
-
-	// Filter repetitions
-	// TODO: Filtering need to happen after clipping, or we might output same value several times at the outer limits of the clip range
-	if (x->common.attr_repetitions || (newval != oldval)) {
-
-		// Update stored value
-		atom_setfloat(&x->attr_value, newval);
-
-		// Clip to specified range, depending on clipmode
-		didClip = param_clip_float(x);
-
-		x->isSending = YES;
-		outlet_float(x->outlets[k_outlet_direct], x->attr_value.a_w.w_float);
-		param_send_feedback(x);
-		x->isSending = NO;
-
-		x->isInitialised = YES;	// We have had our value set at least once
-
-		// TODO: This test need to be more sofisticated to cater for wrap and fold clip modes - Redmine issue 47
-		if (didClip && x->ramper)
-			x->ramper->stop();
-	}
-}
-
-void param_output_symbol(void *z)
-{
-	t_param *x = (t_param *)z;
-
-	char string[24];
-	t_symbol *mySymbol;
-
-	if (atom_gettype(&x->attr_value) == A_SYM) {
-		x->isSending = YES;
-		outlet_anything(x->outlets[k_outlet_direct], atom_getsym(&x->attr_value), 0, NULL);
-		param_send_feedback(x);
-		x->isSending = NO;
-		x->isInitialised = YES;	// We have had our value set at least once
-	}
-	else if (atom_gettype(&x->attr_value) == A_FLOAT) {
-
-		// Convert float to string
-		sprintf (string, "%f", atom_getfloat(&x->attr_value));
-		mySymbol = gensym(string);
-		atom_setsym(&x->attr_value, mySymbol);
-
-		x->isSending = YES;
-		outlet_anything(x->outlets[k_outlet_direct], atom_getsym(&x->attr_value), 0, NULL);
-		param_send_feedback(x);
-		x->isSending = NO;
-		x->isInitialised = YES;	// We have had our value set at least once
-	}
-	else if (atom_gettype(&x->attr_value) == A_LONG) {
-
-		//Convert int to string
-		sprintf (string, "%ld", atom_getlong(&x->attr_value));
-		mySymbol = gensym(string);
-		atom_setsym(&x->attr_value, mySymbol);
-
-		x->isSending = YES;
-		outlet_anything(x->outlets[k_outlet_direct], atom_getsym(&x->attr_value), 0, NULL);
-		param_send_feedback(x);
-		x->isSending = NO;
-		x->isInitialised = YES;	// We have had our value set at least once
-	}
-}
-
-void param_output_list(void *z)
-{
-	t_param *x = (t_param *)z;
-
-	if (param_clip_list(x) && x->ramper)
-		x->ramper->stop();
-	x->isSending = YES;
-	outlet_anything(x->outlets[k_outlet_direct], _sym_list, x->list_size, x->atom_list);
-	param_send_feedback(x);
-	x->isSending = NO;
-	x->isInitialised = YES;	// We have had our value set at least once
-}
-
-
-void param_output_none(void *z)
-{
-	t_param *x = (t_param *)z;
-	Atom output[1];
-	AtomPtr out = (AtomPtr )(&output);
-
-	x->isSending = YES;
-
-	// bang direct output
-	outlet_bang(x->outlets[k_outlet_direct]);
-
-	// call on the hub to pass our data onward
-	// We can not use (method)param_send_feedback here as it assumes an additional argument
-	if (x->common.hub != NULL) {
-
-		// send to the object in which this parameter is embedded
-		if (x->callback)
-			x->callback(x->callbackArg, x->common.attr_name, x->list_size, x->atom_list);
-
-		atom_setsym(out, x->common.attr_name);
-		object_method_typed(x->common.hub, jps_feedback, 1, out, NULL);
-	}
-
-	x->isSending = NO;
-	x->isInitialised = YES;	// We have had our value set at least once
-}
-

 // INC & DEC
 void param_inc(t_param *x, SymbolPtr msg, AtomCount argc, AtomPtr argv)


Try and protect the Indic grapheme/cell skipping with a unit test.

--- i18npool/qa/cppunit/test_breakiterator.cxx
+++ i18npool/qa/cppunit/test_breakiterator.cxx
@@ -36,6 +36,7 @@
 #include <cppuhelper/bootstrap.hxx>
 #include <cppuhelper/basemutex.hxx>
 #include <com/sun/star/i18n/XBreakIterator.hpp>
+#include <com/sun/star/i18n/CharacterIteratorMode.hpp>

 #include <string.h>

@@ -51,24 +52,23 @@
     virtual void tearDown();

     void testLineBreaking();
+    void testGraphemeIteration();

     CPPUNIT_TEST_SUITE(TestBreakIterator);
     CPPUNIT_TEST(testLineBreaking);
+    CPPUNIT_TEST(testGraphemeIteration);
     CPPUNIT_TEST_SUITE_END();

 private:
     uno::Reference<uno::XComponentContext> m_xContext;
     uno::Reference<lang::XMultiComponentFactory> m_xFactory;
     uno::Reference<lang::XMultiServiceFactory> m_xMSF;
+    uno::Reference<i18n::XBreakIterator> m_xBreak;
 };

 //See https://bugs.freedesktop.org/show_bug.cgi?id=31271 for motivation
 void TestBreakIterator::testLineBreaking()
 {
-    uno::Reference< i18n::XBreakIterator > xBreak(m_xMSF->createInstance(
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator"))),uno::UNO_QUERY);
-    CPPUNIT_ASSERT_MESSAGE("Expected Break Iterator", xBreak.is());
-
     ::rtl::OUString aTest1(RTL_CONSTASCII_USTRINGPARAM("(some text here)"));

     i18n::LineBreakHyphenationOptions aHyphOptions;
@@ -80,14 +80,64 @@

     {
         //Here we want the line break to leave text here) on the next line
-        i18n::LineBreakResults aResult = xBreak->getLineBreak(aTest1, strlen("(some tex"), aLocale, 0, aHyphOptions, aUserOptions);
+        i18n::LineBreakResults aResult = m_xBreak->getLineBreak(aTest1, strlen("(some tex"), aLocale, 0, aHyphOptions, aUserOptions);
         CPPUNIT_ASSERT_MESSAGE("Expected a break at the the start of the word", aResult.breakIndex == 6);
     }

     {
         //Here we want the line break to leave "here)" on the next line
-        i18n::LineBreakResults aResult = xBreak->getLineBreak(aTest1, strlen("(some text here"), aLocale, 0, aHyphOptions, aUserOptions);
+        i18n::LineBreakResults aResult = m_xBreak->getLineBreak(aTest1, strlen("(some text here"), aLocale, 0, aHyphOptions, aUserOptions);
         CPPUNIT_ASSERT_MESSAGE("Expected a break at the the start of the word", aResult.breakIndex == 11);
+    }
+}
+
+//See http://qa.openoffice.org/issues/show_bug.cgi?id=111152 for motivation
+void TestBreakIterator::testGraphemeIteration()
+{
+    lang::Locale aLocale;
+    aLocale.Language = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("bn"));
+    aLocale.Country = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IN"));
+
+    {
+        sal_Unicode BA_HALANT_LA[] = { 0x09AC, 0x09CD, 0x09AF };
+        ::rtl::OUString aTest1(BA_HALANT_LA, SAL_N_ELEMENTS(BA_HALANT_LA));
+
+        sal_Int32 nDone=0;
+        sal_Int32 nPos;
+        nPos = m_xBreak->nextCharacters(aTest1, 0, aLocale,
+            i18n::CharacterIteratorMode::SKIPCELL, 1, nDone);
+        CPPUNIT_ASSERT_MESSAGE("Should skip full grapheme", nPos == SAL_N_ELEMENTS(BA_HALANT_LA));
+        nPos = m_xBreak->previousCharacters(aTest1, SAL_N_ELEMENTS(BA_HALANT_LA), aLocale,
+            i18n::CharacterIteratorMode::SKIPCELL, 1, nDone);
+        CPPUNIT_ASSERT_MESSAGE("Should skip full grapheme", nPos == 0);
+    }
+
+    {
+        sal_Unicode HA_HALANT_NA_VOWELSIGNI[] = { 0x09B9, 0x09CD, 0x09A3, 0x09BF };
+        ::rtl::OUString aTest1(HA_HALANT_NA_VOWELSIGNI, SAL_N_ELEMENTS(HA_HALANT_NA_VOWELSIGNI));
+
+        sal_Int32 nDone=0;
+        sal_Int32 nPos;
+        nPos = m_xBreak->nextCharacters(aTest1, 0, aLocale,
+            i18n::CharacterIteratorMode::SKIPCELL, 1, nDone);
+        CPPUNIT_ASSERT_MESSAGE("Should skip full grapheme", nPos == SAL_N_ELEMENTS(HA_HALANT_NA_VOWELSIGNI));
+        nPos = m_xBreak->previousCharacters(aTest1, SAL_N_ELEMENTS(HA_HALANT_NA_VOWELSIGNI), aLocale,
+            i18n::CharacterIteratorMode::SKIPCELL, 1, nDone);
+        CPPUNIT_ASSERT_MESSAGE("Should skip full grapheme", nPos == 0);
+    }
+
+    {
+        sal_Unicode TA_HALANT_MA_HALANT_YA  [] = { 0x09A4, 0x09CD, 0x09AE, 0x09CD, 0x09AF };
+        ::rtl::OUString aTest1(TA_HALANT_MA_HALANT_YA, SAL_N_ELEMENTS(TA_HALANT_MA_HALANT_YA));
+
+        sal_Int32 nDone=0;
+        sal_Int32 nPos;
+        nPos = m_xBreak->nextCharacters(aTest1, 0, aLocale,
+            i18n::CharacterIteratorMode::SKIPCELL, 1, nDone);
+        CPPUNIT_ASSERT_MESSAGE("Should skip full grapheme", nPos == SAL_N_ELEMENTS(TA_HALANT_MA_HALANT_YA));
+        nPos = m_xBreak->previousCharacters(aTest1, SAL_N_ELEMENTS(TA_HALANT_MA_HALANT_YA), aLocale,
+            i18n::CharacterIteratorMode::SKIPCELL, 1, nDone);
+        CPPUNIT_ASSERT_MESSAGE("Should skip full grapheme", nPos == 0);
     }
 }

@@ -96,6 +146,9 @@
     m_xContext = cppu::defaultBootstrap_InitialComponentContext();
     m_xFactory = m_xContext->getServiceManager();
     m_xMSF = uno::Reference<lang::XMultiServiceFactory>(m_xFactory, uno::UNO_QUERY_THROW);
+    m_xBreak = uno::Reference< i18n::XBreakIterator >(m_xMSF->createInstance(
+        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator"))),
+        uno::UNO_QUERY_THROW);
 }

 void TestBreakIterator::setUp()


level_manager: autoload

level_manager: autoload

--- include/rectojump/shared/level_manager/level_manager.hpp
+++ include/rectojump/shared/level_manager/level_manager.hpp
@@ -13,42 +13,74 @@

 #include <mlk/filesystem/filesystem.h>

+#include <map>
 #include <string>

 namespace rj
 {
+	using level_id = std::string;
+
 	class level_manager
 	{
+		mlk::fs::dir_handle m_dirh;
 		mlk::fs::file_handle m_filemgr;
-		std::string m_abs_path;
+		const std::string& m_abs_path;
+
+		std::map<std::string, level> m_loaded_levels;

 	public:
 		level_manager(const std::string& abs_level_path) :
-			m_abs_path{mlk::fs::dir_handle{abs_level_path}.get_path()}
-		{ }
+			m_dirh{abs_level_path},
+			m_abs_path{m_dirh.get_path()}
+		{this->init();}

-		level open_level(const std::string& level_name)
+		const level& open_level(const level_id& id)
 		{
-			if(!m_filemgr.reopen(this->make_path(level_name), std::ios::in))
-				return level{};
-
-			auto data(m_filemgr.read_all());
-			level_packer<packer_mode::unpack> unpacker{data};
-			return unpacker.get_level();
+			this->load_to_mgr(id, this->make_path(id));
+			if(m_loaded_levels.find(id) == std::end(m_loaded_levels))
+				throw std::runtime_error{"error while open level"};
+			return m_loaded_levels[id];
 		}

-		bool save_level(const level_packer<packer_mode::pack>& lv, const std::string& level_name)
+		bool save_level(const level_packer<packer_mode::pack>& lv, const std::string& id)
 		{
-			if(!m_filemgr.reopen(this->make_path(level_name), std::ios::out | std::ios::trunc))
+			if(!m_filemgr.reopen(this->make_path(id), std::ios::out | std::ios::trunc))
 				return false;
 			m_filemgr.write(lv.packed_data());
 			return true;
 		}

+		std::size_t num_levels() const noexcept
+		{return m_loaded_levels.size();}
+
 	private:
-		std::string make_path(const std::string& level_name)
-		{return m_abs_path + level_name + ".rjl";}
+		void init()
+		{
+			mlk::lout("rj::level_manager") << "loading levels recursive from directory '" << m_abs_path << "'...";
+			auto content(m_dirh.get_content<true>());
+			auto count(0);
+			for(auto& a : content)
+				if(a.type == mlk::fs::item_type::file)
+				{
+					this->load_to_mgr(a.name, a.path);
+					++count;
+				}
+			mlk::lout("rj::level_manager") << "loaded " << count << " levels";
+		}
+
+		void load_to_mgr(const level_id& id, const std::string& path)
+		{
+			if(!m_filemgr.reopen(path, std::ios::in))
+				return;
+
+			auto data(m_filemgr.read_all());
+			level_packer<packer_mode::unpack> unpacker{data};
+			m_loaded_levels[id] = unpacker.get_level();
+		}
+
+		std::string make_path(const level_id& id) const noexcept
+		{return m_abs_path + id + ".rjl";}
 	};
 }


BUG#33057 mysql command line client slows down and uses 100% CPU when restoring dump

client/mysql.cc:
  BUG#33057, avoid calling strlen() *for every single character* in the client's input

--- client/mysql.cc
+++ client/mysql.cc
@@ -1272,9 +1272,7 @@
   if (status.add_to_history && line[0] && not_in_history(line))
     add_history(line);
 #endif
-#ifdef USE_MB
   char *end_of_line=line+(uint) strlen(line);
-#endif

   for (pos=out=line ; (inchar= (uchar) *pos) ; pos++)
   {
@@ -1364,7 +1362,7 @@
       }
     }
     else if (!*ml_comment && !*in_string &&
-             strlen(pos) >= 10 &&
+             (end_of_line - pos) >= 10 &&
              !my_strnncoll(charset_info, (uchar*) pos, 10,
                            (const uchar*) "delimiter ", 10))
     {


5.0-bugteam->5.1-bugteam merge

5.0-bugteam->5.1-bugteam merge

--- client/mysql.cc
+++ client/mysql.cc
@@ -248,7 +248,7 @@

 static COMMANDS commands[] = {
   { "?",      '?', com_help,   1, "Synonym for `help'." },
-  { "clear",  'c', com_clear,  0, "Clear command."},
+  { "clear",  'c', com_clear,  0, "Clear the current input statement."},
   { "connect",'r', com_connect,1,
     "Reconnect to the server. Optional arguments are db and host." },
   { "delimiter", 'd', com_delimiter,    1,


ir_constant_visitor: Use 'union ir_constant_data' in expression handler

--- ir_constant_expression.cpp
+++ ir_constant_expression.cpp
@@ -131,10 +131,7 @@
    value = NULL;
    ir_constant *op[2];
    unsigned int operand, c;
-   unsigned u[16];
-   int i[16];
-   float f[16];
-   bool b[16];
+   ir_constant_data data;
    const glsl_type *type = NULL;

    for (operand = 0; operand < ir->get_num_operands(); operand++) {
@@ -148,14 +145,14 @@
       type = ir->operands[0]->type;
       assert(type->base_type == GLSL_TYPE_BOOL);
       for (c = 0; c < ir->operands[0]->type->components(); c++)
-	 b[c] = !op[0]->value.b[c];
+	 data.b[c] = !op[0]->value.b[c];
       break;

    case ir_unop_f2i:
       assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
       type = ir->type;
       for (c = 0; c < ir->operands[0]->type->components(); c++) {
-	 i[c] = op[0]->value.f[c];
+	 data.i[c] = op[0]->value.f[c];
       }
       break;
    case ir_unop_i2f:
@@ -164,38 +161,37 @@
       type = ir->type;
       for (c = 0; c < ir->operands[0]->type->components(); c++) {
 	 if (op[0]->type->base_type == GLSL_TYPE_INT)
-	    f[c] = op[0]->value.i[c];
+	    data.f[c] = op[0]->value.i[c];
 	 else
-	    f[c] = op[0]->value.u[c];
+	    data.f[c] = op[0]->value.u[c];
       }
       break;
    case ir_unop_b2f:
       assert(op[0]->type->base_type == GLSL_TYPE_BOOL);
       type = ir->type;
       for (c = 0; c < ir->operands[0]->type->components(); c++) {
-	 f[c] = op[0]->value.b[c] ? 1.0 : 0.0;
+	 data.f[c] = op[0]->value.b[c] ? 1.0 : 0.0;
       }
       break;
    case ir_unop_f2b:
       assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
       type = ir->type;
       for (c = 0; c < ir->operands[0]->type->components(); c++) {
-	 b[c] = bool(op[0]->value.f[c]);
+	 data.b[c] = bool(op[0]->value.f[c]);
       }
       break;
    case ir_unop_b2i:
       assert(op[0]->type->base_type == GLSL_TYPE_BOOL);
       type = ir->type;
       for (c = 0; c < ir->operands[0]->type->components(); c++) {
-	 u[c] = op[0]->value.b[c] ? 1 : 0;
-	 i[c] = u[c];
+	 data.u[c] = op[0]->value.b[c] ? 1 : 0;
       }
       break;
    case ir_unop_i2b:
       assert(op[0]->type->is_integer());
       type = ir->type;
       for (c = 0; c < ir->operands[0]->type->components(); c++) {
-	 b[c] = bool(op[0]->value.u[c]);
+	 data.b[c] = bool(op[0]->value.u[c]);
       }
       break;

@@ -204,13 +200,13 @@
       for (c = 0; c < ir->operands[0]->type->components(); c++) {
 	 switch (type->base_type) {
 	 case GLSL_TYPE_UINT:
-	    u[c] = -op[0]->value.u[c];
+	    data.u[c] = -op[0]->value.u[c];
 	    break;
 	 case GLSL_TYPE_INT:
-	    i[c] = -op[0]->value.i[c];
+	    data.i[c] = -op[0]->value.i[c];
 	    break;
 	 case GLSL_TYPE_FLOAT:
-	    f[c] = -op[0]->value.f[c];
+	    data.f[c] = -op[0]->value.f[c];
 	    break;
 	 default:
 	    assert(0);
@@ -224,15 +220,15 @@
       for (c = 0; c < ir->operands[0]->type->components(); c++) {
 	 switch (type->base_type) {
 	 case GLSL_TYPE_UINT:
-	    u[c] = op[0]->value.u[c];
+	    data.u[c] = op[0]->value.u[c];
 	    break;
 	 case GLSL_TYPE_INT:
-	    i[c] = op[0]->value.i[c];
-	    if (i[c] < 0)
-	       i[c] = -i[c];
+	    data.i[c] = op[0]->value.i[c];
+	    if (data.i[c] < 0)
+	       data.i[c] = -data.i[c];
 	    break;
 	 case GLSL_TYPE_FLOAT:
-	    f[c] = fabs(op[0]->value.f[c]);
+	    data.f[c] = fabs(op[0]->value.f[c]);
 	    break;
 	 default:
 	    assert(0);
@@ -247,15 +243,15 @@
 	 switch (type->base_type) {
 	 case GLSL_TYPE_UINT:
 	    if (op[0]->value.u[c] != 0.0)
-	       u[c] = 1 / op[0]->value.u[c];
+	       data.u[c] = 1 / op[0]->value.u[c];
 	    break;
 	 case GLSL_TYPE_INT:
 	    if (op[0]->value.i[c] != 0.0)
-	       i[c] = 1 / op[0]->value.i[c];
+	       data.i[c] = 1 / op[0]->value.i[c];
 	    break;
 	 case GLSL_TYPE_FLOAT:
 	    if (op[0]->value.f[c] != 0.0)
-	       f[c] = 1.0 / op[0]->value.f[c];
+	       data.f[c] = 1.0 / op[0]->value.f[c];
 	    break;
 	 default:
 	    assert(0);
@@ -267,7 +263,7 @@
       assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
       type = ir->type;
       for (c = 0; c < ir->operands[0]->type->components(); c++) {
-	 f[c] = 1.0 / sqrtf(op[0]->value.f[c]);
+	 data.f[c] = 1.0 / sqrtf(op[0]->value.f[c]);
       }
       break;

@@ -275,7 +271,7 @@
       assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
       type = ir->type;
       for (c = 0; c < ir->operands[0]->type->components(); c++) {
-	 f[c] = sqrtf(op[0]->value.f[c]);
+	 data.f[c] = sqrtf(op[0]->value.f[c]);
       }
       break;

@@ -283,7 +279,7 @@
       assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
       type = ir->type;
       for (c = 0; c < ir->operands[0]->type->components(); c++) {
-	 f[c] = expf(op[0]->value.f[c]);
+	 data.f[c] = expf(op[0]->value.f[c]);
       }
       break;

@@ -291,7 +287,7 @@
       assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
       type = ir->type;
       for (c = 0; c < ir->operands[0]->type->components(); c++) {
-	 f[c] = logf(op[0]->value.f[c]);
+	 data.f[c] = logf(op[0]->value.f[c]);
       }
       break;

@@ -300,7 +296,7 @@
       assert(op[0]->type->base_type == GLSL_TYPE_FLOAT);
       type = ir->type;
       for (c = 0; c < ir->operands[0]->type->components(); c++) {
-	 f[c] = 0.0;
+	 data.f[c] = 0.0;
       }
       break;

@@ -310,13 +306,13 @@
 	 for (c = 0; c < ir->operands[0]->type->components(); c++) {
 	    switch (ir->operands[0]->type->base_type) {
 	    case GLSL_TYPE_UINT:
-	       u[c] = op[0]->value.u[c] + op[1]->value.u[c];
+	       data.u[c] = op[0]->value.u[c] + op[1]->value.u[c];
 	       break;
 	    case GLSL_TYPE_INT:
-	       i[c] = op[0]->value.i[c] + op[1]->value.i[c];
+	       data.i[c] = op[0]->value.i[c] + op[1]->value.i[c];
 	       break;
 	    case GLSL_TYPE_FLOAT:
-	       f[c] = op[0]->value.f[c] + op[1]->value.f[c];
+	       data.f[c] = op[0]->value.f[c] + op[1]->value.f[c];
 	       break;
 	    default:
 	       assert(0);
@@ -330,13 +326,13 @@
 	 for (c = 0; c < ir->operands[0]->type->components(); c++) {
 	    switch (ir->operands[0]->type->base_type) {
 	    case GLSL_TYPE_UINT:
-	       u[c] = op[0]->value.u[c] - op[1]->value.u[c];
+	       data.u[c] = op[0]->value.u[c] - op[1]->value.u[c];
 	       break;
 	    case GLSL_TYPE_INT:
-	       i[c] = op[0]->value.i[c] - op[1]->value.i[c];
+	       data.i[c] = op[0]->value.i[c] - op[1]->value.i[c];
 	       break;
 	    case GLSL_TYPE_FLOAT:
-	       f[c] = op[0]->value.f[c] - op[1]->value.f[c];
+	       data.f[c] = op[0]->value.f[c] - op[1]->value.f[c];
 	       break;
 	    default:
 	       assert(0);
@@ -351,13 +347,13 @@
 	 for (c = 0; c < ir->operands[0]->type->components(); c++) {
 	    switch (ir->operands[0]->type->base_type) {
 	    case GLSL_TYPE_UINT:
-	       u[c] = op[0]->value.u[c] * op[1]->value.u[c];
+	       data.u[c] = op[0]->value.u[c] * op[1]->value.u[c];
 	       break;
 	    case GLSL_TYPE_INT:
-	       i[c] = op[0]->value.i[c] * op[1]->value.i[c];
+	       data.i[c] = op[0]->value.i[c] * op[1]->value.i[c];
 	       break;
 	    case GLSL_TYPE_FLOAT:
-	       f[c] = op[0]->value.f[c] * op[1]->value.f[c];
+	       data.f[c] = op[0]->value.f[c] * op[1]->value.f[c];
 	       break;
 	    default:
 	       assert(0);
@@ -371,13 +367,13 @@
 	 for (c = 0; c < ir->operands[0]->type->components(); c++) {
 	    switch (ir->operands[0]->type->base_type) {
 	    case GLSL_TYPE_UINT:
-	       u[c] = op[0]->value.u[c] / op[1]->value.u[c];
+	       data.u[c] = op[0]->value.u[c] / op[1]->value.u[c];
 	       break;
 	    case GLSL_TYPE_INT:
-	       i[c] = op[0]->value.i[c] / op[1]->value.i[c];
+	       data.i[c] = op[0]->value.i[c] / op[1]->value.i[c];
 	       break;
 	    case GLSL_TYPE_FLOAT:
-	       f[c] = op[0]->value.f[c] / op[1]->value.f[c];
+	       data.f[c] = op[0]->value.f[c] / op[1]->value.f[c];
 	       break;
 	    default:
 	       assert(0);
@@ -389,32 +385,32 @@
       type = ir->operands[0]->type;
       assert(type->base_type == GLSL_TYPE_BOOL);
       for (c = 0; c < ir->operands[0]->type->components(); c++)
-	 b[c] = op[0]->value.b[c] && op[1]->value.b[c];
+	 data.b[c] = op[0]->value.b[c] && op[1]->value.b[c];
       break;
    case ir_binop_logic_xor:
       type = ir->operands[0]->type;
       assert(type->base_type == GLSL_TYPE_BOOL);
       for (c = 0; c < ir->operands[0]->type->components(); c++)
-	 b[c] = op[0]->value.b[c] ^ op[1]->value.b[c];
+	 data.b[c] = op[0]->value.b[c] ^ op[1]->value.b[c];
       break;
    case ir_binop_logic_or:
       type = ir->operands[0]->type;
       assert(type->base_type == GLSL_TYPE_BOOL);
       for (c = 0; c < ir->operands[0]->type->components(); c++)
-	 b[c] = op[0]->value.b[c] || op[1]->value.b[c];
+	 data.b[c] = op[0]->value.b[c] || op[1]->value.b[c];
       break;

    case ir_binop_less:
       type = glsl_type::bool_type;
       switch (ir->operands[0]->type->base_type) {
       case GLSL_TYPE_UINT:
-	 b[0] = op[0]->value.u[0] < op[1]->value.u[0];
+	 data.b[0] = op[0]->value.u[0] < op[1]->value.u[0];
 	 break;
       case GLSL_TYPE_INT:
-	 b[0] = op[0]->value.i[0] < op[1]->value.i[0];
+	 data.b[0] = op[0]->value.i[0] < op[1]->value.i[0];
 	 break;
       case GLSL_TYPE_FLOAT:
-	 b[0] = op[0]->value.f[0] < op[1]->value.f[0];
+	 data.b[0] = op[0]->value.f[0] < op[1]->value.f[0];
 	 break;
       default:
 	 assert(0);
@@ -424,13 +420,13 @@
       type = glsl_type::bool_type;
       switch (ir->operands[0]->type->base_type) {
       case GLSL_TYPE_UINT:
-	 b[0] = op[0]->value.u[0] > op[1]->value.u[0];
+	 data.b[0] = op[0]->value.u[0] > op[1]->value.u[0];
 	 break;
       case GLSL_TYPE_INT:
-	 b[0] = op[0]->value.i[0] > op[1]->value.i[0];
+	 data.b[0] = op[0]->value.i[0] > op[1]->value.i[0];
 	 break;
       case GLSL_TYPE_FLOAT:
-	 b[0] = op[0]->value.f[0] > op[1]->value.f[0];
+	 data.b[0] = op[0]->value.f[0] > op[1]->value.f[0];
 	 break;
       default:
 	 assert(0);
@@ -440,13 +436,13 @@
       type = glsl_type::bool_type;
       switch (ir->operands[0]->type->base_type) {
       case GLSL_TYPE_UINT:
-	 b[0] = op[0]->value.u[0] <= op[1]->value.u[0];
+	 data.b[0] = op[0]->value.u[0] <= op[1]->value.u[0];
 	 break;
       case GLSL_TYPE_INT:
-	 b[0] = op[0]->value.i[0] <= op[1]->value.i[0];
+	 data.b[0] = op[0]->value.i[0] <= op[1]->value.i[0];
 	 break;
       case GLSL_TYPE_FLOAT:
-	 b[0] = op[0]->value.f[0] <= op[1]->value.f[0];
+	 data.b[0] = op[0]->value.f[0] <= op[1]->value.f[0];
 	 break;
       default:
 	 assert(0);
@@ -456,13 +452,13 @@
       type = glsl_type::bool_type;
       switch (ir->operands[0]->type->base_type) {
       case GLSL_TYPE_UINT:
-	 b[0] = op[0]->value.u[0] >= op[1]->value.u[0];
+	 data.b[0] = op[0]->value.u[0] >= op[1]->value.u[0];
 	 break;
       case GLSL_TYPE_INT:
-	 b[0] = op[0]->value.i[0] >= op[1]->value.i[0];
+	 data.b[0] = op[0]->value.i[0] >= op[1]->value.i[0];
 	 break;
       case GLSL_TYPE_FLOAT:
-	 b[0] = op[0]->value.f[0] >= op[1]->value.f[0];
+	 data.b[0] = op[0]->value.f[0] >= op[1]->value.f[0];
 	 break;
       default:
 	 assert(0);
@@ -472,20 +468,20 @@
    case ir_binop_equal:
       if (ir->operands[0]->type == ir->operands[1]->type) {
 	 type = glsl_type::bool_type;
-	 b[0] = true;
+	 data.b[0] = true;
 	 for (c = 0; c < ir->operands[0]->type->components(); c++) {
 	    switch (ir->operands[0]->type->base_type) {
 	    case GLSL_TYPE_UINT:
-	       b[0] = b[0] && op[0]->value.u[c] == op[1]->value.u[c];
+	       data.b[0] = data.b[0] && op[0]->value.u[c] == op[1]->value.u[c];
 	       break;
 	    case GLSL_TYPE_INT:
-	       b[0] = b[0] && op[0]->value.i[c] == op[1]->value.i[c];
+	       data.b[0] = data.b[0] && op[0]->value.i[c] == op[1]->value.i[c];
 	       break;
 	    case GLSL_TYPE_FLOAT:
-	       b[0] = b[0] && op[0]->value.f[c] == op[1]->value.f[c];
+	       data.b[0] = data.b[0] && op[0]->value.f[c] == op[1]->value.f[c];
 	       break;
 	    case GLSL_TYPE_BOOL:
-	       b[0] = b[0] && op[0]->value.b[c] == op[1]->value.b[c];
+	       data.b[0] = data.b[0] && op[0]->value.b[c] == op[1]->value.b[c];
 	       break;
 	    default:
 	       assert(0);
@@ -496,20 +492,20 @@
    case ir_binop_nequal:
       if (ir->operands[0]->type == ir->operands[1]->type) {
 	 type = glsl_type::bool_type;
-	 b[0] = false;
+	 data.b[0] = false;
 	 for (c = 0; c < ir->operands[0]->type->components(); c++) {
 	    switch (ir->operands[0]->type->base_type) {
 	    case GLSL_TYPE_UINT:
-	       b[0] = b[0] || op[0]->value.u[c] != op[1]->value.u[c];
+	       data.b[0] = data.b[0] || op[0]->value.u[c] != op[1]->value.u[c];
 	       break;
 	    case GLSL_TYPE_INT:
-	       b[0] = b[0] || op[0]->value.i[c] != op[1]->value.i[c];
+	       data.b[0] = data.b[0] || op[0]->value.i[c] != op[1]->value.i[c];
 	       break;
 	    case GLSL_TYPE_FLOAT:
-	       b[0] = b[0] || op[0]->value.f[c] != op[1]->value.f[c];
+	       data.b[0] = data.b[0] || op[0]->value.f[c] != op[1]->value.f[c];
 	       break;
 	    case GLSL_TYPE_BOOL:
-	       b[0] = b[0] || op[0]->value.b[c] != op[1]->value.b[c];
+	       data.b[0] = data.b[0] || op[0]->value.b[c] != op[1]->value.b[c];
 	       break;
 	    default:
 	       assert(0);
@@ -523,20 +519,7 @@
    }

    if (type) {
-      switch (type->base_type) {
-      case GLSL_TYPE_UINT:
-	 value = new ir_constant(type, u);
-	 break;
-      case GLSL_TYPE_INT:
-	 value = new ir_constant(type, i);
-	 break;
-      case GLSL_TYPE_FLOAT:
-	 value = new ir_constant(type, f);
-	 break;
-      case GLSL_TYPE_BOOL:
-	 value = new ir_constant(type, b);
-	 break;
-      }
+      this->value = new ir_constant(type, &data);
    }
 }