[GL3+] Further cleanup of OgreGL3PlusRenderSystem.cpp

--HG--
branch : v2-0

--- RenderSystems/GL3Plus/src/OgreGL3PlusRenderSystem.cpp
+++ RenderSystems/GL3Plus/src/OgreGL3PlusRenderSystem.cpp
@@ -221,7 +221,7 @@
         rsc->setDriverVersion(mDriverVersion);

         const char* deviceName = (const char*)glGetString(GL_RENDERER);
-        const char* vendorName = (const char*)glGetString(GL_VENDOR);
+        const char* vendorName = (const char*)glGetString(GL_VENDOR);
         if (deviceName)
         {
             rsc->setDeviceName(deviceName);
@@ -250,7 +250,7 @@
             disableAutoMip = true;
 #endif
         // The Intel 915G frequently corrupts textures when using hardware mip generation
-        // I'm not currently sure how many generations of hardware this affects,
+        // I'm not currently sure how many generations of hardware this affects,
         // so for now, be safe.
         if (rsc->getVendor() == GPU_INTEL)
             disableAutoMip = true;
@@ -420,7 +420,7 @@

         OGRE_CHECK_GL_ERROR(glGetFloatv(GL_MAX_GEOMETRY_UNIFORM_COMPONENTS, &floatConstantCount));
         rsc->setGeometryProgramConstantFloatCount(floatConstantCount);
-
+
         GLint maxOutputVertices;
         OGRE_CHECK_GL_ERROR(glGetIntegerv(GL_MAX_GEOMETRY_OUTPUT_VERTICES, &maxOutputVertices));
         rsc->setGeometryProgramNumOutputVertices(maxOutputVertices);
@@ -433,7 +433,7 @@
         {
             rsc->setCapability(RSC_TESSELATION_HULL_PROGRAM);
             rsc->setCapability(RSC_TESSELATION_DOMAIN_PROGRAM);
-
+
             OGRE_CHECK_GL_ERROR(glGetFloatv(GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS, &floatConstantCount));

             // 16 boolean params allowed
@@ -467,7 +467,7 @@

         // OpenGL 3.0 requires a minimum of 16 texture image units
         units = std::max<GLint>(16, units);
-
+
         rsc->setNumVertexTextureUnits(static_cast<ushort>(units));
         if (units > 0)
         {
@@ -480,7 +480,7 @@
         // Alpha to coverage always 'supported' when MSAA is available
         // although card may ignore it if it doesn't specifically support A2C
         rsc->setCapability(RSC_ALPHA_TO_COVERAGE);
-
+
         // Check if render to vertex buffer (transform feedback in OpenGL)
         rsc->setCapability(RSC_HWRENDER_TO_VERTEX_BUFFER);

@@ -520,7 +520,7 @@
             caps->log(defaultLog);
         }

-        // Create the texture manager
+        // Create the texture manager
         mTextureManager = new GL3PlusTextureManager(*mGLSupport);

         if (caps->hasCapability(RSC_CAN_GET_COMPILED_SHADER_BUFFER))
@@ -564,13 +564,13 @@
         mTextureManager = 0;

         // Delete extra threads contexts
-        for (GL3PlusContextList::iterator i = mBackgroundContextList.begin();
+        for (GL3PlusContextList::iterator i = mBackgroundContextList.begin();
              i != mBackgroundContextList.end(); ++i)
         {
             GL3PlusContext* pCurContext = *i;
-
+
             pCurContext->releaseContext();
-
+
             delete pCurContext;
         }
         mBackgroundContextList.clear();
@@ -579,32 +579,32 @@
         mStopRendering = true;

         mGLInitialised = 0;
-
+
         RenderSystem::shutdown();
     }

-    bool GL3PlusRenderSystem::_createRenderWindows(const RenderWindowDescriptionList& renderWindowDescriptions,
+    bool GL3PlusRenderSystem::_createRenderWindows(const RenderWindowDescriptionList& renderWindowDescriptions,
                                                    RenderWindowList& createdWindows)
-    {
+    {
         // Call base render system method.
         if (false == RenderSystem::_createRenderWindows(renderWindowDescriptions, createdWindows))
             return false;
-
+
         // Simply call _createRenderWindow in a loop.
         for (size_t i = 0; i < renderWindowDescriptions.size(); ++i)
         {
-            const RenderWindowDescription& curRenderWindowDescription = renderWindowDescriptions[i];
+            const RenderWindowDescription& curRenderWindowDescription = renderWindowDescriptions[i];
             RenderWindow* curWindow = NULL;
-
-            curWindow = _createRenderWindow(curRenderWindowDescription.name,
-                                            curRenderWindowDescription.width,
-                                            curRenderWindowDescription.height,
-                                            curRenderWindowDescription.useFullScreen,
+
+            curWindow = _createRenderWindow(curRenderWindowDescription.name,
+                                            curRenderWindowDescription.width,
+                                            curRenderWindowDescription.height,
+                                            curRenderWindowDescription.useFullScreen,
                                             &curRenderWindowDescription.miscParams);
-
-            createdWindows.push_back(curWindow);
-        }
-
+
+            createdWindows.push_back(curWindow);
+        }
+
         return true;
     }

@@ -646,7 +646,7 @@
         if (!mGLInitialised)
         {
             initialiseContext(win);
-
+
             StringVector tokens = StringUtil::split(mGLSupport->getGLVersion(), ".");
             if (!tokens.empty())
             {
@@ -656,7 +656,7 @@
                 if (tokens.size() > 2)
                     mDriverVersion.release = StringConverter::parseInt(tokens[2]);
             }
-
+
             if(mDriverVersion.major < 3)
                 OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR,
                             "Driver does not support at least OpenGL 3.0.",
@@ -842,13 +842,13 @@
             mClipPlanesDirty = true;
     }

-    void GL3PlusRenderSystem::_setPointParameters(Real size,
+    void GL3PlusRenderSystem::_setPointParameters(Real size,
                                                   bool attenuationEnabled, Real constant, Real linear, Real quadratic,
                                                   Real minSize, Real maxSize)
     {
         float val[4] = {1, 0, 0, 1};
-
-        if(attenuationEnabled)
+
+        if(attenuationEnabled)
         {
             // Point size is still calculated in pixels even when attenuation is
             // enabled, which is pretty awkward, since you typically want a viewport
@@ -865,7 +865,7 @@
             val[1] = linear * correction;
             val[2] = quadratic * correction;
             val[3] = 1;
-
+
             if (mCurrentCapabilities->hasCapability(RSC_VERTEX_PROGRAM))
             {
                 if(gl3wIsSupported(3, 2))
@@ -892,7 +892,7 @@
                 }
             }
         }
-
+
         // no scaling required
         // GL has no disabled flag for this so just set to constant
         OGRE_CHECK_GL_ERROR(glPointSize(size));
@@ -1039,7 +1039,7 @@
             OGRE_CHECK_GL_ERROR(glEnable(GL_BLEND));
             OGRE_CHECK_GL_ERROR(glBlendFunc(sourceBlend, destBlend));
         }
-
+
         GLint func = GL_FUNC_ADD;
         switch(op)
         {
@@ -1072,8 +1072,8 @@
         GLenum destBlend = getBlendMode(destFactor);
         GLenum sourceBlendAlpha = getBlendMode(sourceFactorAlpha);
         GLenum destBlendAlpha = getBlendMode(destFactorAlpha);
-
-        if(sourceFactor == SBF_ONE && destFactor == SBF_ZERO &&
+
+        if(sourceFactor == SBF_ONE && destFactor == SBF_ZERO &&
            sourceFactorAlpha == SBF_ONE && destFactorAlpha == SBF_ZERO)
         {
             OGRE_CHECK_GL_ERROR(glDisable(GL_BLEND));
@@ -1083,9 +1083,9 @@
             OGRE_CHECK_GL_ERROR(glEnable(GL_BLEND));
             OGRE_CHECK_GL_ERROR(glBlendFuncSeparate(sourceBlend, destBlend, sourceBlendAlpha, destBlendAlpha));
         }
-
+
         GLint func = GL_FUNC_ADD, alphaFunc = GL_FUNC_ADD;
-
+
         switch(op)
         {
         case SBO_ADD:
@@ -1104,7 +1104,7 @@
             func = GL_MAX;
             break;
         }
-
+
         switch(alphaOp)
         {
         case SBO_ADD:
@@ -1123,7 +1123,7 @@
             alphaFunc = GL_MAX;
             break;
         }
-
+
         OGRE_CHECK_GL_ERROR(glBlendEquationSeparate(func, alphaFunc));
     }

@@ -1163,25 +1163,25 @@
         else if (vp != mActiveViewport || vp->_isUpdated())
         {
             RenderTarget* target;
-
+
             target = vp->getTarget();
             _setRenderTarget(target);
             mActiveViewport = vp;
-
+
             GLsizei x, y, w, h;
-
+
             // Calculate the "lower-left" corner of the viewport
             w = vp->getActualWidth();
             h = vp->getActualHeight();
             x = vp->getActualLeft();
             y = vp->getActualTop();
-
+
             if (target && !target->requiresTextureFlipping())
             {
                 // Convert "upper-left" corner to "lower-left"
                 y = target->getHeight() - h - y;
             }
-
+
             OGRE_CHECK_GL_ERROR(glViewport(x, y, w, h));

             // Configure the viewport clipping
@@ -1214,7 +1214,7 @@
         unbindGpuProgram(GPT_VERTEX_PROGRAM);
         unbindGpuProgram(GPT_FRAGMENT_PROGRAM);
         unbindGpuProgram(GPT_GEOMETRY_PROGRAM);
-
+
         if(mDriverVersion.major >= 4)
         {
             unbindGpuProgram(GPT_HULL_PROGRAM);
@@ -1255,7 +1255,7 @@
             }
             break;
         case CULL_ANTICLOCKWISE:
-            if (mActiveRenderTarget &&
+            if (mActiveRenderTarget &&
                 ((mActiveRenderTarget->requiresTextureFlipping() && !mInvertVertexWinding) ||
                  (!mActiveRenderTarget->requiresTextureFlipping() && mInvertVertexWinding)))
             {
@@ -1449,7 +1449,7 @@
                                                            bool forGpuProgram)
     {
         // Thanks to Eric Lenyel for posting this calculation at www.terathon.com
-
+
         // Calculate the clip-space corner point opposite the clipping plane
         // as (sgn(clipPlane.x), sgn(clipPlane.y), 1, 1) and
         // transform it into camera space by multiplying it
@@ -1469,12 +1469,12 @@
         matrix[2][0] = c.x;
         matrix[2][1] = c.y;
         matrix[2][2] = c.z + 1.0F;
-        matrix[2][3] = c.w;
+        matrix[2][3] = c.w;
     }

     HardwareOcclusionQuery* GL3PlusRenderSystem::createHardwareOcclusionQuery(void)
     {
-        GL3PlusHardwareOcclusionQuery* ret = new GL3PlusHardwareOcclusionQuery();
+        GL3PlusHardwareOcclusionQuery* ret = new GL3PlusHardwareOcclusionQuery();
         mHwOcclusionQueries.push_back(ret);
         return ret;
     }
@@ -1676,12 +1676,12 @@

         if (!activateGLTextureUnit(unit))
             return;
-
+
         GLfloat largest_supported_anisotropy = 0;
         OGRE_CHECK_GL_ERROR(glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &largest_supported_anisotropy));

         if (maxAnisotropy > largest_supported_anisotropy)
-            maxAnisotropy = largest_supported_anisotropy ?
+            maxAnisotropy = largest_supported_anisotropy ?
                 static_cast<uint>(largest_supported_anisotropy) : 1;
         if (_getCurrentAnisotropy(unit) != maxAnisotropy)
             OGRE_CHECK_GL_ERROR(glTexParameterf(mTextureTypes[unit], GL_TEXTURE_MAX_ANISOTROPY_EXT, maxAnisotropy));
@@ -1697,11 +1697,11 @@
         HardwareVertexBufferSharedPtr globalInstanceVertexBuffer = getGlobalInstanceVertexBuffer();
         VertexDeclaration* globalVertexDeclaration = getGlobalInstanceVertexBufferVertexDeclaration();
         bool hasInstanceData = (op.useGlobalInstancingVertexBufferIsAvailable &&
-                                !globalInstanceVertexBuffer.isNull() && (globalVertexDeclaration != NULL))
+                                !globalInstanceVertexBuffer.isNull() && (globalVertexDeclaration != NULL))
             || op.vertexData->vertexBufferBinding->hasInstanceData();
-
+
         size_t numberOfInstances = op.numberOfInstances;
-
+
         if (op.useGlobalInstancingVertexBufferIsAvailable)
         {
             numberOfInstances *= getGlobalNumberOfInstances();
@@ -1745,20 +1745,20 @@
             if (!op.vertexData->vertexBufferBinding->isBufferBound(source))
                 continue; // skip unbound elements

-            HardwareVertexBufferSharedPtr vertexBuffer =
+            HardwareVertexBufferSharedPtr vertexBuffer =
                 op.vertexData->vertexBufferBinding->getBuffer(source);
-
-            bindVertexElementToGpu(elem, vertexBuffer, op.vertexData->vertexStart,
+
+            bindVertexElementToGpu(elem, vertexBuffer, op.vertexData->vertexStart,
                                    mRenderAttribsBound, mRenderInstanceAttribsBound, updateVAO);
         }
-
+
         if( !globalInstanceVertexBuffer.isNull() && globalVertexDeclaration != NULL )
         {
             elemEnd = globalVertexDeclaration->getElements().end();
             for (elemIter = globalVertexDeclaration->getElements().begin(); elemIter != elemEnd; ++elemIter)
             {
                 const VertexElement & elem = *elemIter;
-                bindVertexElementToGpu(elem, globalInstanceVertexBuffer, 0,
+                bindVertexElementToGpu(elem, globalInstanceVertexBuffer, 0,
                                        mRenderAttribsBound, mRenderInstanceAttribsBound, updateVAO);
             }
         }
@@ -1794,9 +1794,10 @@

         if (mCurrentGeometryProgram) {
             printf("useAdjacency: %.1u \n", useAdjacency);
-            printf("primType == %.1u \n", primType == GL_LINES_ADJACENCY);
-        }
-
+            printf("primType == GL_LINES_ADJACENCY: %.1u \n", primType == GL_LINES_ADJACENCY);
+            printf("primType == GL_TRIANGLES: %.1u \n", primType == GL_TRIANGLES);
+        }
+

         // TODO: Bind atomic counter buffers here

@@ -1837,7 +1838,7 @@
             //TODO Find better solution for showing tessellated mesh.
             //OGRE_CHECK_GL_ERROR(glPolygonMode(GL_FRONT_AND_BACK, mPolygonMode == GL_LINE_STRIP ? GL_LINE : mPolygonMode));
             //OGRE_CHECK_GL_ERROR(glPolygonMode(GL_FRONT_AND_BACK, mPolygonMode));
-
+
             if(op.useIndexes)
             {
                 //printf("YES INDEX\n");
@@ -2110,7 +2111,7 @@
             mCurrentGeometryProgram->unbindProgram();
         if (mCurrentFragmentProgram)
             mCurrentFragmentProgram->unbindProgram();
-
+
         // Disable textures
         _disableTextureUnitsFrom(0);

@@ -2134,7 +2135,7 @@
             mCurrentGeometryProgram->bindProgram();
         if (mCurrentFragmentProgram)
             mCurrentFragmentProgram->bindProgram();
-
+
         // Must reset depth/colour write mask to according with user desired, otherwise,
         // clearFrameBuffer would be wrong because the value we are recorded may be
         // difference with the really state stored in GL context.
@@ -2177,7 +2178,7 @@
             OGRE_CHECK_GL_ERROR(glEnable(GL_MULTISAMPLE));
             LogManager::getSingleton().logMessage("Using FSAA.");
         }
-
+
         if (mGLSupport->checkExtension("GL_ARB_seamless_cube_map") || gl3wIsSupported(3, 2))
         {
 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
@@ -2272,7 +2273,7 @@
             if (target->isHardwareGammaEnabled())
             {
                 OGRE_CHECK_GL_ERROR(glEnable(GL_FRAMEBUFFER_SRGB));
-
+
                 // Note: could test GL_FRAMEBUFFER_SRGB_CAPABLE here before
                 // enabling, but GL spec says incapable surfaces ignore the setting
                 // anyway. We test the capability to enable isHardwareGammaEnabled.
@@ -2338,23 +2339,23 @@
     void GL3PlusRenderSystem::bindGpuProgram(GpuProgram* prg)
     {
         GL3PlusGpuProgram* glprg = static_cast<GL3PlusGpuProgram*>(prg);
-
-        // Unbind previous gpu program first.
+
+        // Unbind previous GPU program first.
         //
         // Note:
         //  1. Even if both previous and current are the same object, we can't
         //     bypass re-bind completely since the object itself may be modified.
-        //     But we can bypass unbind based on the assumption that object
-        //     internally GL program type shouldn't be changed after it has
-        //     been created. The behavior of bind to a GL program type twice
-        //     should be same as unbind and rebind that GL program type, even
-        //     for different objects.
+        //     But we can bypass unbind based on the assumption that the object's
+        //     internal GL program type shouldn't change after object creation.
+        //     The behavior of binding to a GL program type twice
+        //     should be the same as unbinding and rebinding that GL program type,
+        //     even for different objects.
         //  2. We also assumed that the program's type (vertex or fragment) should
-        //     not be changed during it's in using. If not, the following switch
+        //     not change during its use. If not, the following switch
         //     statement will confuse GL state completely, and we can't fix it
-        //     here. To fix this case, we must coding the program implementation
-        //     itself, if type is changing (during load/unload, etc), and it's in use,
-        //     unbind and notify render system to correct for its state.
+        //     here. To fix this case we must code the program implementation
+        //     itself: if type is changing (during load/unload, etc), and it's in
+        //     use, unbind and notify render system to correct for its state.
         //
         switch (glprg->getType())
         {
@@ -2366,7 +2367,7 @@
                 mCurrentVertexProgram = glprg;
             }
             break;
-
+
         case GPT_FRAGMENT_PROGRAM:
             if (mCurrentFragmentProgram != glprg)
             {
@@ -2410,7 +2411,7 @@
         default:
             break;
         }
-
+
         // Bind the program
         glprg->bindProgram();

@@ -2570,22 +2571,22 @@
         // This is only valid once we've created the main context
         if (!mMainContext)
         {
-            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
+            OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
                         "Cannot register a background thread before the main context "
-                        "has been created.",
+                        "has been created.",
                         "GL3PlusRenderSystem::registerThread");
         }
-
+
         // Create a new context for this thread. Cloning from the main context
         // will ensure that resources are shared with the main context
         // We want a separate context so that we can safely create GL
         // objects in parallel with the main thread
         GL3PlusContext* newContext = mMainContext->clone();
         mBackgroundContextList.push_back(newContext);
-
-        // Bind this new context to this thread.
+
+        // Bind this new context to this thread.
         newContext->setCurrent();
-
+
         _oneTimeContextInitialization();
         newContext->setInitialized();
     }
@@ -2677,12 +2678,12 @@

     void GL3PlusRenderSystem::bindVertexElementToGpu( const VertexElement &elem,
                                                       HardwareVertexBufferSharedPtr vertexBuffer, const size_t vertexStart,
-                                                      vector<GLuint>::type &attribsBound,
+                                                      vector<GLuint>::type &attribsBound,
                                                       vector<GLuint>::type &instanceAttribsBound,
                                                       bool updateVAO)
     {
         void* pBufferData = 0;
-        const GL3PlusHardwareVertexBuffer* hwGlBuffer = static_cast<const GL3PlusHardwareVertexBuffer*>(vertexBuffer.get());
+        const GL3PlusHardwareVertexBuffer* hwGlBuffer = static_cast<const GL3PlusHardwareVertexBuffer*>(vertexBuffer.get());

         // FIXME: Having this commented out fixes some rendering issues but leaves VAO's useless
         //        if (updateVAO)


translation/Client: eliminate duplicate GrowingBufferReader attribute

--- src/translation/Client.cxx
+++ src/translation/Client.cxx
@@ -37,7 +37,6 @@

     /** the marshalled translate request */
-    GrowingBufferReader request_buffer;
     GrowingBufferReader request;

     const TranslateHandler &handler;
@@ -257,8 +256,7 @@
     :pool(p),
      stopwatch(stopwatch_fd_new(&p, fd, request2.GetDiagnosticName())),
      socket(event_loop),
-     request_buffer(std::move(_request)),
-     request(request_buffer),
+     request(std::move(_request)),
      handler(_handler), handler_ctx(_ctx),
      parser(p, request2)
 {


win: Fix the resizable flag, closed #316.

--- atom/browser/native_window_win.cc
+++ atom/browser/native_window_win.cc
@@ -205,6 +205,8 @@
       web_view_(new views::WebView(NULL)),
       use_content_size_(false),
       resizable_(true) {
+  options->GetBoolean(switches::kResizable, &resizable_);
+
   views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
   params.delegate = this;
   params.native_widget = new MenuCommandNativeWidget(this);
@@ -327,6 +329,15 @@

 void NativeWindowWin::SetResizable(bool resizable) {
   resizable_ = resizable;
+
+  // WS_MAXIMIZEBOX => Maximize/Minimize button
+  // WS_THICKFRAME => Resize handle
+  DWORD style = ::GetWindowLong(GetNativeWindow(), GWL_STYLE);
+  if (resizable)
+    style |= WS_MAXIMIZEBOX | WS_THICKFRAME;
+  else
+    style &= ~(WS_MAXIMIZEBOX | WS_THICKFRAME);
+  ::SetWindowLong(GetNativeWindow(), GWL_STYLE, style);
 }

 bool NativeWindowWin::IsResizable() {


GLSupport: fix crash in Win32Window::create (#816)

The crash was at the line:

```
        // Pass pointer to self as WM_CREATE parameter
        mHWnd = CreateWindowEx(dwStyleEx, "OgreGLWindow", title.c_str(),
            getWindowStyle(fullScreen), mLeft, mTop, mWidth, mHeight, parent, 0, hInst, this);
```

Introduced in commit aa90530a586d1c484abdf8be316838afe27c7bd1

--- RenderSystems/GLSupport/src/win32/OgreWin32Window.cpp
+++ RenderSystems/GLSupport/src/win32/OgreWin32Window.cpp
@@ -380,7 +380,7 @@
                 classStyle |= CS_DBLCLKS;

             // register class and create window
-            WNDCLASS wc = { classStyle, NULL, 0, 0, hInst,
+            WNDCLASS wc = { classStyle, DefWindowProc, 0, 0, hInst,
                 LoadIcon(NULL, IDI_APPLICATION), LoadCursor(NULL, IDC_ARROW),
                 (HBRUSH)GetStockObject(BLACK_BRUSH), NULL, "OgreGLWindow" };
             RegisterClass(&wc);


Restore file that was accidentally changed

Change-Id: I262b5e05433c1677c5c8fc5e14aaabc07ec0d68c

--- Rendering/OpenGL/Testing/Cxx/TestGaussianBlurPass.cxx
+++ Rendering/OpenGL/Testing/Cxx/TestGaussianBlurPass.cxx
@@ -50,6 +50,10 @@
 #include "vtkGaussianBlurPass.h"
 #include "vtkConeSource.h"

+// Make sure to have a valid OpenGL context current on the calling thread
+// before calling it. Defined in TestGenericVertexAttributesGLSLAlphaBlending.
+bool MesaHasVTKBug8135(vtkRenderWindow *);
+
 int TestGaussianBlurPass(int argc, char* argv[])
 {
   vtkSmartPointer<vtkRenderWindowInteractor> iren=
@@ -75,14 +79,14 @@
     vtkSmartPointer<vtkSequencePass>::New();
   vtkSmartPointer<vtkOpaquePass> opaque=
     vtkSmartPointer<vtkOpaquePass>::New();
-//  vtkSmartPointer<vtkDepthPeelingPass> peeling=
-//    vtkSmartPointer<vtkDepthPeelingPass>::New();
-//  peeling->SetMaximumNumberOfPeels(200);
-//  peeling->SetOcclusionRatio(0.1);
+  vtkSmartPointer<vtkDepthPeelingPass> peeling=
+    vtkSmartPointer<vtkDepthPeelingPass>::New();
+  peeling->SetMaximumNumberOfPeels(200);
+  peeling->SetOcclusionRatio(0.1);

   vtkSmartPointer<vtkTranslucentPass> translucent=
     vtkSmartPointer<vtkTranslucentPass>::New();
-//  peeling->SetTranslucentPass(translucent);
+  peeling->SetTranslucentPass(translucent);

   vtkSmartPointer<vtkVolumetricPass> volume=
     vtkSmartPointer<vtkVolumetricPass>::New();
@@ -97,8 +101,8 @@
   passes->AddItem(lights);
   passes->AddItem(opaque);

-//  passes->AddItem(peeling);
-  passes->AddItem(translucent);
+  passes->AddItem(peeling);
+//  passes->AddItem(translucent);

   passes->AddItem(volume);
   passes->AddItem(overlay);
@@ -172,27 +176,36 @@
   renWin->Render();

   int retVal;
-  actor->SetVisibility(1);
-  coneActor->SetVisibility(1);
-  renderer->ResetCamera();
-  vtkCamera *camera=renderer->GetActiveCamera();
-  camera->Azimuth(-40.0);
-  camera->Elevation(20.0);
-  renWin->Render();
-
-  if(peeling->GetLastRenderingUsedDepthPeeling())
+  if(MesaHasVTKBug8135(renWin))
     {
-    cout<<"depth peeling was used"<<endl;
+    // Mesa will crash if version<7.3
+    cout<<"This version of Mesa would crash. Skip the test."<<endl;
+    retVal=vtkRegressionTester::PASSED;
     }
   else
     {
-    cout<<"depth peeling was not used (alpha blending instead)"<<endl;
-    }
-
-  retVal = vtkRegressionTestImage( renWin );
-  if ( retVal == vtkRegressionTester::DO_INTERACTOR)
-    {
-    iren->Start();
+    actor->SetVisibility(1);
+    coneActor->SetVisibility(1);
+    renderer->ResetCamera();
+    vtkCamera *camera=renderer->GetActiveCamera();
+    camera->Azimuth(-40.0);
+    camera->Elevation(20.0);
+    renWin->Render();
+
+    if(peeling->GetLastRenderingUsedDepthPeeling())
+      {
+      cout<<"depth peeling was used"<<endl;
+      }
+    else
+      {
+      cout<<"depth peeling was not used (alpha blending instead)"<<endl;
+      }
+
+    retVal = vtkRegressionTestImage( renWin );
+    if ( retVal == vtkRegressionTester::DO_INTERACTOR)
+      {
+      iren->Start();
+      }
     }
   return !retVal;
 }


Better help

Better help

--- analyzeDataVsMCP.cxx
+++ analyzeDataVsMCP.cxx
@@ -32,6 +32,8 @@
         std::cout << "-h [ --help ]                         produce help message" << std::endl;
         std::cout << "-f [ --channel ] arg (=0)             channel to analyze" << std::endl;
         std::cout << "-c [ --cfd_threshold ] arg (=0.4)     CFD fraction" << std::endl;
+        std::cout << "                                      a negative value will start a scan with" << std::endl;
+        std::cout << "                                      a step equal to |cfd_threshold|" << std::endl;
         std::cout << "-t [ --threshold ] arg (=-0.1)        Threshold, negative for" << std::endl;
         std::cout << "                                      negative signals (V)" << std::endl;
         std::cout << "-p [ --lowpass ] arg (=0)             Lowpass filter frequency (Hz)" << std::endl;


INTEGRATION: CWS changefileheader (1.3.14); FILE MERGED 2008/03/28 16:00:58 rt 1.3.14.1: #i87441# Change license header to LPGL v3.

--- autodoc/inc/ary/segmentedname.hxx
+++ autodoc/inc/ary/segmentedname.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: segmentedname.hxx,v $
+ * Copyright 2008 by Sun Microsystems, Inc.
  *
- *  $Revision: 1.3 $
+ * OpenOffice.org - a multi-platform office productivity suite
  *
- *  last change: $Author: kz $ $Date: 2007-12-12 14:56:07 $
+ * $RCSfile: segmentedname.hxx,v $
+ * $Revision: 1.4 $
  *
- *  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.
  *
  ************************************************************************/


Fix build with ZORBA_NO_XMLSCHEMA flag.

Fix build with ZORBA_NO_XMLSCHEMA flag.

--- src/types/schema/Utils.cpp
+++ src/types/schema/Utils.cpp
@@ -74,12 +74,15 @@
     DelegatingTypeManager* delegatingTypeManager, static_context* staticContext,
     const QueryLoc& loc, bool isLax)
 {
+#ifndef ZORBA_NO_XMLSCHEMA
     for ( unsigned int i = 0; i<nodes.size() ; i++)
     {
         validateAfterUpdate(nodes[i], pul, delegatingTypeManager, staticContext, loc, isLax);
     }
-}
-
+#endif //ZORBA_NO_XMLSCHEMA
+}
+
+#ifndef ZORBA_NO_XMLSCHEMA
 void validateAfterUpdate(store::Item* item, zorba::store::Item_t& pul,
     DelegatingTypeManager* delegatingTypeManager, static_context* staticContext,
     const QueryLoc& loc, bool isLax)
@@ -400,5 +403,6 @@
     ZORBA_ASSERT(false);
     return NULL;
 }
+#endif //ZORBA_NO_XMLSCHEMA

 }// namespace zorba


Handle WM_COMMAND with code=0x1000 to handle an OK button pressed in Pocket PC. <BTS:543>

git-svn-id: 12ae5aeef08fd453d75833463da4cc20df82a94e@774 8af8166b-12a6-a448-a533-9086ace3f9f6

--- q3/qs/src/ui/dialog.cpp
+++ q3/qs/src/ui/dialog.cpp
@@ -531,6 +531,10 @@
 	BEGIN_COMMAND_HANDLER()
 		HANDLE_COMMAND_ID_CODE(IDCANCEL, BN_CLICKED, onCancel)
 		HANDLE_COMMAND_ID_CODE(IDOK, BN_CLICKED, onOk)
+#ifdef _WIN32_WCE_PSPC
+		HANDLE_COMMAND_ID_CODE(IDCANCEL, 0x1000, onCancel)
+		HANDLE_COMMAND_ID_CODE(IDOK, 0x1000, onOk)
+#endif
 	END_COMMAND_HANDLER()
 	return 1;
 }


Comment out unused variable.

Comment out unused variable.

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

--- core/meta/src/TCintWithCling.cxx
+++ core/meta/src/TCintWithCling.cxx
@@ -3313,8 +3313,8 @@
 void tcling_CallFunc::SetFuncProto(tcling_ClassInfo* info, const char* method, const char* proto, long* offset) const
 {
    fCallFunc->SetFuncProto(info->GetClassInfo(), method, proto, offset);
-   const clang::Decl* decl =
-      fInterp->lookupFunctionProto(info->GetDecl(), method, proto);
+   //const clang::Decl* decl =
+   //   fInterp->lookupFunctionProto(info->GetDecl(), method, proto);
 }

 //______________________________________________________________________________


add ttree for local efficiency

add ttree for local efficiency


nv50/ir/opt: fix combineSt access to wrong instruction

--- src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp
+++ src/gallium/drivers/nv50/codegen/nv50_ir_peephole.cpp
@@ -1316,7 +1316,7 @@
       }
       // set record's values as low sources of @st
       for (j = 1; sizeRc; ++j) {
-         sizeRc -= st->getSrc(j)->reg.size;
+         sizeRc -= rec->insn->getSrc(j)->reg.size;
          st->setSrc(j, rec->insn->getSrc(j));
       }
       // set saved values as high sources of @st


clover: Don't use llvm's global context

clover: Don't use llvm's global context

An LLVMContext should only be accessed by a single and using the global
context was causing crashes in multi-threaded environments.  Now we use
a separate context for each compile.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>

CC: "10.1 10.2" <59f39c0db42d4479a46b02d4d2bc11120e37bb44@lists.freedesktop.org>

--- src/gallium/state_trackers/clover/llvm/invocation.cpp
+++ src/gallium/state_trackers/clover/llvm/invocation.cpp
@@ -117,12 +117,13 @@
 #endif

    llvm::Module *
-   compile(const std::string &source, const std::string &name,
-           const std::string &triple, const std::string &processor,
-           const std::string &opts, clang::LangAS::Map& address_spaces) {
+   compile(llvm::LLVMContext &llvm_ctx, const std::string &source,
+           const std::string &name, const std::string &triple,
+           const std::string &processor, const std::string &opts,
+           clang::LangAS::Map& address_spaces) {

       clang::CompilerInstance c;
-      clang::EmitLLVMOnlyAction act(&llvm::getGlobalContext());
+      clang::EmitLLVMOnlyAction act(&llvm_ctx);
       std::string log;
       llvm::raw_string_ostream s_log(log);
       std::string libclc_path = LIBCLC_LIBEXECDIR + processor + "-"
@@ -399,10 +400,12 @@
                       target.size() - processor_str_len - 1);
    clang::LangAS::Map address_spaces;

+   llvm::LLVMContext llvm_ctx;
+
    // The input file name must have the .cl extension in order for the
    // CompilerInvocation class to recognize it as an OpenCL source file.
-   llvm::Module *mod = compile(source, "input.cl", triple, processor, opts,
-                                                                address_spaces);
+   llvm::Module *mod = compile(llvm_ctx, source, "input.cl", triple, processor,
+                               opts, address_spaces);

    find_kernels(mod, kernels);


Simplify highlightCodeBlock() func for readibility

--- markdownhighlighter.cpp
+++ markdownhighlighter.cpp
@@ -730,38 +730,35 @@
 void MarkdownHighlighter::highlightCodeBlock(const QString& text) {

     if (text.startsWith(QLatin1String("```"))) {
-        if (previousBlockState() != HighlighterState::CodeBlock &&
-            previousBlockState() < HighlighterState::CodeCpp) {
+        if (previousBlockState() != CodeBlock &&
+            previousBlockState() < CodeCpp) {
             QString lang = text.mid(3, text.length()).toLower();
-            MarkdownHighlighter::HighlighterState progLang = _langStringToEnum.value(lang);
-
-            if (progLang >= HighlighterState::CodeCpp) {
+            HighlighterState progLang = _langStringToEnum.value(lang);
+
+            if (progLang >= CodeCpp) {
                 setCurrentBlockState(progLang);
             } else {
-                previousBlockState() == HighlighterState::CodeBlock ?
-                            setCurrentBlockState(CodeBlockEnd) : setCurrentBlockState(CodeBlock);
-            }
-        } else if (previousBlockState() == HighlighterState::CodeBlock ||
-                   previousBlockState() >= HighlighterState::CodeCpp) {
-            setCurrentBlockState(HighlighterState::CodeBlockEnd);
+                setCurrentBlockState(CodeBlock);
+            }
+        } else if (previousBlockState() == CodeBlock ||
+                   previousBlockState() >= CodeCpp) {
+            setCurrentBlockState(CodeBlockEnd);
         }

         // set the font size from the current rule's font format
-        QTextCharFormat &maskedFormat =
-                _formats[HighlighterState::MaskedSyntax];
-        maskedFormat.setFontPointSize(
-                    _formats[HighlighterState::CodeBlock].fontPointSize());
+        QTextCharFormat &maskedFormat = _formats[MaskedSyntax];
+        maskedFormat.setFontPointSize(_formats[CodeBlock].fontPointSize());

         setFormat(0, text.length(), maskedFormat);
-    } else if (previousBlockState() == HighlighterState::CodeBlock ||
-               previousBlockState() >= HighlighterState::CodeCpp) {
-
-        if (previousBlockState() >= HighlighterState::CodeCpp) {
+    } else if (previousBlockState() == CodeBlock ||
+               previousBlockState() >= CodeCpp) {
+
+        if (previousBlockState() >= CodeCpp) {
             setCurrentBlockState(previousBlockState());
             highlightSyntax(text);
         } else {
-            setFormat(0, text.length(), _formats[HighlighterState::CodeBlock]);
-            setCurrentBlockState(HighlighterState::CodeBlock);
+            setFormat(0, text.length(), _formats[CodeBlock]);
+            setCurrentBlockState(CodeBlock);
         }
     }
 }


fixed a highlighting issue with images and tables

--- markdownhighlighter.cpp
+++ markdownhighlighter.cpp
@@ -71,6 +71,62 @@
 void MarkdownHighlighter::initHighlightingRules() {
     HighlightingRule rule;

+    // highlight the reference of reference links
+    rule = HighlightingRule();
+    rule.pattern = QRegularExpression("^\\[\\d+?\\]: .+://.+$");
+    rule.state = HighlighterState::Comment;
+    _highlightingRulesPre.append(rule);
+
+    // highlight unordered lists
+    rule = HighlightingRule();
+    rule.pattern = QRegularExpression("^\\s*[-*+]\\s");
+    rule.state = HighlighterState::List;
+    rule.useStateAsCurrentBlockState = true;
+    _highlightingRulesPre.append(rule);
+
+    // highlight ordered lists
+    rule.pattern = QRegularExpression("^\\s*\\d\\.\\s");
+    _highlightingRulesPre.append(rule);
+
+    // highlight inline code
+    rule = HighlightingRule();
+    rule.pattern = QRegularExpression("`.+?`");
+    rule.state = HighlighterState::InlineCodeBlock;
+    _highlightingRulesPre.append(rule);
+
+    // highlight code blocks with four spaces or tabs in front of them
+    // and no list character after that
+    rule = HighlightingRule();
+    rule.pattern = QRegularExpression("^((\\t)|( {4,})).+$");
+    rule.state = HighlighterState::CodeBlock;
+    rule.disableIfCurrentStateIsSet = true;
+    _highlightingRulesPre.append(rule);
+
+    // highlight block quotes
+    rule = HighlightingRule();
+    rule.pattern = QRegularExpression("^> ");
+    rule.state = HighlighterState::BlockQuote;
+    _highlightingRulesPre.append(rule);
+
+    // highlight inline comments
+    rule = HighlightingRule();
+    rule.pattern = QRegularExpression("<!\\-\\-.+?\\-\\->");
+    rule.state = HighlighterState::Comment;
+    _highlightingRulesPre.append(rule);
+
+    // highlight horizontal rulers
+    rule = HighlightingRule();
+    rule.pattern = QRegularExpression("^([*\\-_]\\s?){3,}$");
+    rule.state = HighlighterState::HorizontalRuler;
+    _highlightingRulesPre.append(rule);
+
+    // highlight tables without starting |
+    rule = HighlightingRule();
+    rule.pattern = QRegularExpression("^.+? \\| .+? \\| .+$");
+    rule.state = HighlighterState::Table;
+    _highlightingRulesPre.append(rule);
+
+
     // highlight bold
     rule.pattern = QRegularExpression("\\B\\*{2}.+?\\*{2}\\B");
     rule.state = HighlighterState::Bold;
@@ -108,68 +164,17 @@
     rule.pattern = QRegularExpression("\\[.+?\\]\\[\\d+\\]");
     _highlightingRulesAfter.append(rule);

-    // highlight the reference of reference links
-    rule = HighlightingRule();
-    rule.pattern = QRegularExpression("^\\[\\d+?\\]: .+://.+$");
-    rule.state = HighlighterState::Comment;
-    _highlightingRulesPre.append(rule);
-
-    // highlight unordered lists
-    rule = HighlightingRule();
-    rule.pattern = QRegularExpression("^\\s*[-*+]\\s");
-    rule.state = HighlighterState::List;
-    rule.useStateAsCurrentBlockState = true;
-    _highlightingRulesPre.append(rule);
-
-    // highlight ordered lists
-    rule.pattern = QRegularExpression("^\\s*\\d\\.\\s");
-    _highlightingRulesPre.append(rule);
-
-    // highlight inline code
-    rule = HighlightingRule();
-    rule.pattern = QRegularExpression("`.+?`");
-    rule.state = HighlighterState::InlineCodeBlock;
-    _highlightingRulesPre.append(rule);
-
-    // highlight code blocks with four spaces or tabs in front of them
-    // and no list character after that
-    rule = HighlightingRule();
-    rule.pattern = QRegularExpression("^((\\t)|( {4,})).+$");
-    rule.state = HighlighterState::CodeBlock;
-    rule.disableIfCurrentStateIsSet = true;
-    _highlightingRulesPre.append(rule);
-
     // highlight images
     rule = HighlightingRule();
     rule.pattern = QRegularExpression("!\\[.*?\\]\\(.+?\\)");
     rule.state = HighlighterState::Image;
-    _highlightingRulesPre.append(rule);
-
-    // highlight block quotes
-    rule = HighlightingRule();
-    rule.pattern = QRegularExpression("^> ");
-    rule.state = HighlighterState::BlockQuote;
-    _highlightingRulesPre.append(rule);
-
-    // highlight inline comments
-    rule = HighlightingRule();
-    rule.pattern = QRegularExpression("<!\\-\\-.+?\\-\\->");
-    rule.state = HighlighterState::Comment;
-    _highlightingRulesPre.append(rule);
-
-    // highlight horizontal rulers
-    rule = HighlightingRule();
-    rule.pattern = QRegularExpression("^([*\\-_]\\s?){3,}$");
-    rule.state = HighlighterState::HorizontalRuler;
-    _highlightingRulesPre.append(rule);
-
-    // highlight tables
+    _highlightingRulesAfter.append(rule);
+
+    // highlight tables with starting |
     rule = HighlightingRule();
     rule.pattern = QRegularExpression("^\\|.+?\\|$");
     rule.state = HighlighterState::Table;
-    _highlightingRulesPre.append(rule);
-    rule.pattern = QRegularExpression("^.+? \\| .+? \\| .+$");
-    _highlightingRulesPre.append(rule);
+    _highlightingRulesAfter.append(rule);
 }

 /**


INTEGRATION: CWS tbe13 (1.3.52); FILE MERGED 2004/11/03 17:03:34 tbe 1.3.52.1: #i36073# Insert Controls Toolbar disappears if Properties Window has been opened

--- basctl/source/basicide/tbxctl.hxx
+++ basctl/source/basicide/tbxctl.hxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: tbxctl.hxx,v $
  *
- *  $Revision: 1.3 $
+ *  $Revision: 1.4 $
  *
- *  last change: $Author: obo $ $Date: 2004-07-06 12:19:41 $
+ *  last change: $Author: obo $ $Date: 2004-11-15 13:41:45 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -61,14 +61,17 @@
 #ifndef _BASIDE_TBXCTL_HXX
 #define _BASIDE_TBXCTL_HXX

-
 #ifndef _SFXTBXCTRL_HXX //autogen
 #include <sfx2/tbxctrl.hxx>
 #endif
-
 #ifndef _SFXTBXMGR_HXX
 #include <sfx2/tbxmgr.hxx>
 #endif
+
+#ifndef _DRAFTS_COM_SUN_STAR_FRAME_XLAYOUTMANAGER_HPP_
+#include <drafts/com/sun/star/frame/XLayoutManager.hpp>
+#endif
+
 /*
 #ifdef _BASIDE_POPUPWINDOWTBX

@@ -101,7 +104,17 @@
 //-------------------
 class TbxControls : public SfxToolBoxControl
 {
+private:
+
+    struct StateChangedInfo
+    {
+        ::com::sun::star::uno::Reference< ::drafts::com::sun::star::frame::XLayoutManager > xLayoutManager;
+        bool bDisabled;
+    };
+
     USHORT                  nLastSlot;
+
+    DECL_STATIC_LINK( TbxControls, StateChangedHdl_Impl, StateChangedInfo* );

 protected:
     virtual void            StateChanged( USHORT nSID, SfxItemState eState,


Fix a race condition in directory_watcher_inotify.cc: release lock before signaling the event dtor waits on.

http://crbug.com/15055
Review URL: http://codereview.chromium.org/147052

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

--- base/directory_watcher_inotify.cc
+++ base/directory_watcher_inotify.cc
@@ -397,24 +397,32 @@
   }

   bool success = true;
-  AutoLock auto_lock(lock_);
-  for (FilePathSet::iterator subdirectory = subtree.begin();
-       subdirectory != subtree.end();
-       ++subdirectory) {
-    ino_t inode;
-    if (!file_util::GetInode(*subdirectory, &inode)) {
-      success = false;
-      continue;
+
+  {
+    // Limit the scope of auto_lock so it releases lock_ before we signal
+    // recursive_setup_finished_. Our dtor waits on recursive_setup_finished_
+    // and could otherwise destroy the lock before we release it.
+    AutoLock auto_lock(lock_);
+
+    for (FilePathSet::iterator subdirectory = subtree.begin();
+         subdirectory != subtree.end();
+         ++subdirectory) {
+      ino_t inode;
+      if (!file_util::GetInode(*subdirectory, &inode)) {
+        success = false;
+        continue;
+      }
+      if (IsInodeWatched(inode))
+        continue;
+      InotifyReader::Watch watch =
+        Singleton<InotifyReader>::get()->AddWatch(*subdirectory, this);
+      if (watch != InotifyReader::kInvalidWatch) {
+        watches_.insert(watch);
+        inodes_watched_.insert(inode);
+      }
     }
-    if (IsInodeWatched(inode))
-      continue;
-    InotifyReader::Watch watch =
-      Singleton<InotifyReader>::get()->AddWatch(*subdirectory, this);
-    if (watch != InotifyReader::kInvalidWatch) {
-      watches_.insert(watch);
-      inodes_watched_.insert(inode);
-    }
-  }
+  }
+
   recursive_setup_finished_.Signal();
   return success;
 }


Fix rounding for negative numbers

Fix rounding for negative numbers

Forgot about that. Thanks, unit test.

Contributes to issue CURA-7970.

--- src/utils/VoronoiUtils.cpp
+++ src/utils/VoronoiUtils.cpp
@@ -13,7 +13,9 @@

 Point VoronoiUtils::p(const vd_t::vertex_type* node)
 {
-    return Point(node->x() + 0.5d, node->y() + 0.5d); //Round to nearest integer coordinates.
+    const double x = node->x();
+    const double y = node->y();
+    return Point(x + 0.5d - (x < 0), y + 0.5d - (y < 0)); //Round to nearest integer coordinates.
 }

 bool VoronoiUtils::isSourcePoint(Point p, const vd_t::cell_type& cell, const std::vector<Point>& points, const std::vector<Segment>& segments, coord_t snap_dist)


Updated to latest kNet API.

Updated to latest kNet API.

--- KristalliProtocolModule/KristalliProtocolModule.cpp
+++ KristalliProtocolModule/KristalliProtocolModule.cpp
@@ -185,7 +185,7 @@

 void KristalliProtocolModule::Connect(const char *ip, unsigned short port, SocketTransportLayer transport)
 {
-    if (Connected() && serverConnection && serverConnection->GetEndPoint().ToString() != serverIp)
+    if (Connected() && serverConnection && serverConnection->RemoteEndPoint().IPToString() != serverIp)
         Disconnect();

     serverIp = ip;
@@ -236,7 +236,8 @@
 {
     StopServer();

-    server = network.StartServer(port, transport, this);
+    const bool allowAddressReuse = true;
+    server = network.StartServer(port, transport, this, allowAddressReuse);
     if (!server)
     {
         LogError("Failed to start server on port " + ToString((int)port));
@@ -269,7 +270,7 @@
     connection->connection = source;
     connections.push_back(connection);

-    LogInfo("User connected from " + source->GetEndPoint().ToString() + ", connection ID " + ToString((int)connection->userID));
+    LogInfo("User connected from " + source->RemoteEndPoint().ToString() + ", connection ID " + ToString((int)connection->userID));

     Events::KristalliUserConnected msg(connection);
     framework_->GetEventManager()->SendEvent(networkEventCategory, Events::USER_CONNECTED, &msg);


fixed serious bug in Math::Overlap/4 overload

--- Library/Sources/Stroika/Foundation/Math/Overlap.inl
+++ Library/Sources/Stroika/Foundation/Math/Overlap.inl
@@ -65,7 +65,7 @@
             template    <typename T>
             inline  bool    Overlaps (T p1Start, T p1End, T p2Start, T p2End)
             {
-                return Overlaps (pair<T, T> (p1Start, p1Start), pair<T, T> (p2Start, p2End));
+                return Overlaps (pair<T, T> (p1Start, p1End), pair<T, T> (p2Start, p2End));
             }


Shadow copy sharing between servers did not work. Poked a little bit in this pile of ****

--- urbackupclient/client.cpp
+++ urbackupclient/client.cpp
@@ -1171,8 +1171,6 @@
 {
 #ifdef _WIN32
 #ifdef ENABLE_VSS
-	std::map<std::wstring, SCDirs*>& scdirs_server = scdirs[starttoken];
-
 	cleanup_saved_shadowcopies(true);

 	WCHAR volume_path[MAX_PATH];
@@ -1245,16 +1243,12 @@
 						VSSLog("Removing reference because of reference timeout", LL_WARNING);
 					}

-					std::vector<std::wstring> m_keys;
-					for(std::map<std::wstring, SCDirs*>::iterator lit=scdirs_server.begin();lit!=scdirs_server.end();++lit)
+					SCRef *curr=sc_refs[i];
+					std::map<std::wstring, SCDirs*>& scdirs_server = scdirs[starttoken];
+					for(std::map<std::wstring, SCDirs*>::iterator it=scdirs_server.begin();
+						it!=scdirs_server.end();++it)
 					{
-						m_keys.push_back(lit->first);
-					}
-					SCRef *curr=sc_refs[i];
-					for(size_t k=0;k<m_keys.size();++k)
-					{
-						std::map<std::wstring, SCDirs*>::iterator it=scdirs_server.find(m_keys[k]);
-						if(it!=scdirs_server.end() && it->second->ref==curr)
+						if(it->second->ref==curr)
 						{
 							VSSLog(L"Releasing "+it->first+L" orig_target="+it->second->orig_target+L" target="+it->second->target, LL_DEBUG);
 							release_shadowcopy(it->second, false, -1, dir);
@@ -1628,7 +1622,7 @@
 #endif
 	}

-	std::map<std::wstring, SCDirs*>& scdirs_server = scdirs[starttoken];
+

 	bool r=true;
 	while(r)
@@ -1643,26 +1637,31 @@
 				while(c)
 				{
 					c=false;
-					for(std::map<std::wstring, SCDirs*>::iterator it=scdirs_server.begin();it!=scdirs_server.end();++it)
+					for(std::map<std::string, std::map<std::wstring, SCDirs*> >::iterator server_it = scdirs.begin();
+						server_it!=scdirs.end();++server_it)
 					{
-						if(it->second->ref==sc_refs[i])
+						for(std::map<std::wstring, SCDirs*>::iterator it=server_it->second.begin();
+							it!=server_it->second.end();++it)
 						{
-							if(it->second->fileserv)
+							if(it->second->ref==sc_refs[i])
 							{
-								shareDir(it->second->dir, it->second->orig_target);
-							}
-							it->second->target=it->second->orig_target;
-
-							it->second->ref=NULL;
-							if(dontdel==NULL || it->second!=dontdel )
-							{
-								delete it->second;
-								scdirs_server.erase(it);
-								c=true;
-								break;
+								if(it->second->fileserv)
+								{
+									shareDir(it->second->dir, it->second->orig_target);
+								}
+								it->second->target=it->second->orig_target;
+
+								it->second->ref=NULL;
+								if(dontdel==NULL || it->second!=dontdel )
+								{
+									delete it->second;
+									server_it->second.erase(it);
+									c=true;
+									break;
+								}
 							}
 						}
-					}
+					}
 				}
 				delete sc_refs[i];
 				sc_refs.erase(sc_refs.begin()+i);


MMDevice: Fix unit test to work with current code

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@16077 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

--- MMDevice/unittest/FloatPropertyTruncation-Tests.cpp
+++ MMDevice/unittest/FloatPropertyTruncation-Tests.cpp
@@ -7,7 +7,7 @@

 TEST(FloatPropertyTruncationTests, SetValueIsTruncatedTo4Digits)
 {
-   FloatProperty fp;
+   FloatProperty fp("TestProp");
    double v;

    ASSERT_TRUE(fp.Set(0.00004));
@@ -30,7 +30,7 @@

 TEST(FloatPropertyTruncationTests, LowerLimitIsTruncatedUp)
 {
-   FloatProperty fp;
+   FloatProperty fp("TestProp");

    ASSERT_TRUE(fp.SetLimits(0.0, 1000.0));
    ASSERT_DOUBLE_EQ(0.0, fp.GetLowerLimit());
@@ -50,7 +50,7 @@

 TEST(FloatPropertyTruncationTests, UpperLimitIsTruncatedDown)
 {
-   FloatProperty fp;
+   FloatProperty fp("TestProp");

    ASSERT_TRUE(fp.SetLimits(-1000.0, 0.0));
    ASSERT_DOUBLE_EQ(0.0, fp.GetUpperLimit());


Drop era metadata snap when resetting CBT

--- urbackupclient/client.cpp
+++ urbackupclient/client.cpp
@@ -7080,6 +7080,13 @@
 				{
 					current_era = watoi64(toks[2]);
 				}
+			}
+
+			std::string era_err;
+			if (os_popen("dmsetup message \"" + orig_dev + "\" 0 drop_metadata_snap 2>&1", era_err) != 0)
+			{
+				VSSLog("Error dropping dm-era metadata snapshot of volume \"" + dev_file + "\" (2): " + trim(era_err), LL_WARNING);
+				return false;
 			}
 		}


Fix typename build error in ArmatureWeightWriter

When the template is known at compile time, there is no need for the
typename keyword

--- Modules/CLI/ArmatureWeight/ArmatureWeightWriter.cxx
+++ Modules/CLI/ArmatureWeight/ArmatureWeightWriter.cxx
@@ -427,10 +427,10 @@
   // Only downsample when not using weights
   bool downsample = !this->BinaryWeight && this->ScaleFactor != 1.0;

-  const typename LabelImageType::SizeType& inputSize =
+  const LabelImageType::SizeType& inputSize =
     this->BodyPartition->GetLargestPossibleRegion().GetSize();
-  typename LabelImageType::SizeType outSize;
-  typedef typename LabelImageType::SizeType::SizeValueType SizeValueType;
+  LabelImageType::SizeType outSize;
+  typedef LabelImageType::SizeType::SizeValueType SizeValueType;
   outSize[0] = static_cast<SizeValueType>(ceil(inputSize[0] / this->ScaleFactor));
   outSize[1] = static_cast<SizeValueType>(ceil(inputSize[1] / this->ScaleFactor));
   outSize[2] = static_cast<SizeValueType>(ceil(inputSize[2] / this->ScaleFactor));


bugfix: moveInside always moved in the positive direction for the corner case (CURA-579)

--- src/utils/polygonUtils.cpp
+++ src/utils/polygonUtils.cpp
@@ -125,8 +125,8 @@
                         if (distance == 0) { ret = x; }
                         else
                         {
-                            Point inward_dir = crossZ(normal(ab,distance * 4) + normal(p1 - p0,distance * 4));
-                            ret = x + normal(inward_dir, distance); // *4 to retain more precision for the eventual normalization
+                            Point inward_dir = crossZ(normal(ab,distance * 4) + normal(p1 - p0,distance * 4)); // *4 to retain more precision for the eventual normalization
+                            ret = x + normal(inward_dir, std::abs(distance)); // abs cause the sign already got applied in the line above
                             is_inside = dot(inward_dir, p - x) >= 0;
                         }
                     }
@@ -231,8 +231,8 @@
             }
         }
         Point& p0 = poly[p0_idx];
-        Point inward_dir = crossZ(normal(p2 - p1, distance * 4) + normal(p1 - p0, distance * 4));
-        return p1 + normal(inward_dir, distance); // *4 to retain more precision for the eventual normalization
+        Point inward_dir = crossZ(normal(p2 - p1, distance * 4) + normal(p1 - p0, distance * 4)); // *4 to retain more precision for the eventual normalization
+        return p1 + normal(inward_dir, std::abs(distance)); // abs cause the sign already got applied in the line above
     }
     else if (on_boundary == p2)
     {
@@ -250,9 +250,10 @@
         }
         Point& p3 = poly[p3_idx];

-        Point& x = p1;
-        Point inward_dir = crossZ(normal(p3 - p2, distance * 4) + normal(p2 - p1, distance * 4));
-        return x + normal(inward_dir, distance); // *4 to retain more precision for the eventual normalization
+        Point& x = p2;
+        Point inward_dir = crossZ(normal(p3 - p2, distance * 4) + normal(p2 - p1, distance * 4)); // *4 to retain more precision for the eventual normalization
+        Point inward_vec = normal(inward_dir, std::abs(distance)); // abs cause the sign already got applied in the line above
+        return x + inward_vec;
     }
     else
     {


p9_ppe_commands : Enhanced single step

p9_ppe_commands : Enhanced single step

Change-Id: I7dfd4a1cde9147b011584a8404a3f73f2412ff24
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30086
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Reviewed-by: Brian T. Vanderpool <80bf54c65fef5142bcd6ac0d0b8f1646681d56b8@us.ibm.com>
Reviewed-by: Gregory S. Still <4249770c9038596e9483266bcd48707ac69ee60b@us.ibm.com>

--- src/import/chips/p9/procedures/hwp/lib/p9_ppe_utils.H
+++ src/import/chips/p9/procedures/hwp/lib/p9_ppe_utils.H
@@ -38,15 +38,22 @@
 #define __P9_PPE_UTILS_H__
 typedef struct
 {
-    uint16_t     number;
+    uint16_t    number;
+    uint32_t    value;
+} PPERegValue_t;
+
+typedef struct
+{
+    PPERegValue_t     reg;
     std::string  name;
 } PPEReg_t;

 typedef struct
 {
-    PPEReg_t    reg;
-    uint32_t    value;
-} PPERegValue_t;
+    uint16_t     number;
+    std::string  name;
+} PPEReg_num_name_t;
+

 typedef struct
 {
@@ -100,17 +107,18 @@
     XIR_SPRG0,
 };

-enum PPE_SPECIAL_ACCESS
-{
-    MSR,
-    CR,
-};
+//enum PPE_SPECIAL_ACCESS
+//{
+//    MSR,
+//    CR,
+//};
 enum PPE_SPRS
 {
     CTR     = 9,
     DACR    = 316,
     DBCR    = 308,
     DEC     = 22,
+    EDR     = 61,
     IVPR    = 63,
     ISR     = 62,
     LR      = 8,
@@ -121,7 +129,14 @@
     SRR1    = 27,
     TCR     = 340,
     TSR     = 336,
-    XER     = 1, //336,
+    XER     = 1,
+    //Some unique identification no. FOR OTHER REGS(non sprn)
+    XSR     = 4200,
+    IAR     = 2,
+    IR      = 3,
+    MSR     = 42,
+    CR      = 420,
+
 };


fixed a bug found by Red5_StandingBy -
the problem was when that controls updating the source address for shader parameters. After the first render for the first mesh, the second time getConstantBuffer() is called for the vertex program, the iter->src variable is not updated. So for example, same world matrices are applied to all meshes, etc. When I remove the "if" check, everything is fine.

--HG--
extra : convert_revision : svn%3A8631bf8a-c64b-0410-883c-f3eb003322f7/trunk%40460

--- RenderSystems/Direct3D10/src/OgreD3D10HLSLProgram.cpp
+++ RenderSystems/Direct3D10/src/OgreD3D10HLSLProgram.cpp
@@ -729,23 +729,20 @@
 			ShaderVarWithPosInBuf * iter = &mShaderVars[0];
 			for (size_t i = 0 ; i < mConstantBufferDesc.Variables ; i++, iter++)
 			{
-				if (!iter->wasInit)
-				{
-					const GpuConstantDefinition& def = params->getConstantDefinition(iter->var.Name);
-					iter->isFloat = def.isFloat();
-					iter->physicalIndex = def.physicalIndex;
-					iter->wasInit = true;
-
-					if(iter->isFloat)
-					{
-						iter->src = (void *)&(*(params->getFloatConstantList().begin()+iter->physicalIndex));
-					}
-					else
-					{
-						iter->src = (void *)&(*(params->getIntConstantList().begin()+iter->physicalIndex));
-					}
-
+				const GpuConstantDefinition& def = params->getConstantDefinition(iter->var.Name);
+				iter->isFloat = def.isFloat();
+				iter->physicalIndex = def.physicalIndex;
+				iter->wasInit = true;
+
+				if(iter->isFloat)
+				{
+					iter->src = (void *)&(*(params->getFloatConstantList().begin()+iter->physicalIndex));
 				}
+				else
+				{
+					iter->src = (void *)&(*(params->getIntConstantList().begin()+iter->physicalIndex));
+				}
+

 				memcpy( &pConstData[iter->var.StartOffset], iter->src , iter->var.Size);


STOP_Recovery: Added hwp changes to support error log parser.

Commit updates STOP recovery HWP to be able to support error log
parsing. STOP recovery HWP incorporates an idea of section id for
various sub-sections of STOP recovery summary section. In case of
PM Malfunction, p9_pm_callout adds those sub-section to an error
log in form of user data sub-section.

Key_Cronus_Test=PM_REGRESS

Change-Id: I45dc8063822eededaab4692f1020696c1d8d1c7c
Original-Change-Id: I3210921fd64d27b58c6ee6319da6d9090e61f5e0
CQ: SW438713
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/57967
Tested-by: FSP CI Jenkins <aa9e4d9ac7cd25905e9c0dd36d4150516e73dd86@us.ibm.com>
Reviewed-by: AMIT J. TENDOLKAR <dbb26baba4b5f8b9f96883027867d8ea93350b6c@in.ibm.com>
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Tested-by: Hostboot CI <52521565bd8ea18a2b112942dce4f4220a97c2c8@us.ibm.com>
Tested-by: Cronus HW CI <a731a82009671cd8b97b45874b464801949fbbb7@us.ibm.com>
Reviewed-by: RANGANATHPRASAD G. BRAHMASAMUDRA <95a9682e5bdc1ccf6e82d516bbb3db21526dc713@in.ibm.com>
Reviewed-by: Gregory S. Still <4249770c9038596e9483266bcd48707ac69ee60b@us.ibm.com>

--- src/import/chips/p9/procedures/hwp/pm/p9_pm_callout.H
+++ src/import/chips/p9/procedures/hwp/pm/p9_pm_callout.H
@@ -48,23 +48,7 @@
 // Includes
 // ------------------------------------------------------------------------------
 #include <fapi2.H>
-
-///@brief models a sub-section of STOP Recovery summary.
-///@note  caller of HWP passes in an empty vector however,
-///HWP populates it with pointers to all summary sub-section.
-struct StopErrLogSectn
-{
-    uint8_t*    iv_pBufPtr;
-    uint16_t    iv_bufSize;
-    StopErrLogSectn( uint8_t* i_bufPtr, uint16_t i_bufSize )
-        : iv_pBufPtr( i_bufPtr ), iv_bufSize( i_bufSize )
-    { }
-
-    StopErrLogSectn( )
-        : iv_pBufPtr( NULL ),
-          iv_bufSize( 0 )
-    { }
-};
+#include <p9_pm_recovery_ffdc_defines.H>

 enum RasAction
 {


Add formats support in nearest_edge tests

Add RGBA_10_10_10_2 and RGBA_F16 support to pixelFormatMap

Affects:

KHR-GLES32.core.nearest_edge.*

Components: OpenGL

VK-GL-CTS issue: 2547

Change-Id: I6a96f4e5c87967b06bbfed1566df7e784009ad50
(cherry picked from commit dea39590d12bf91ac37e66460a0aa908c5816216)

--- external/openglcts/modules/common/glcNearestEdgeTests.cpp
+++ external/openglcts/modules/common/glcNearestEdgeTests.cpp
@@ -131,11 +131,13 @@
 		tcu::TextureFormat	texFmt;
 	} pixelFormatMap[] =
 	{
-		{ tcu::PixelFormat(8,8,8,8),	tcu::TextureFormat(tcu::TextureFormat::RGBA,	tcu::TextureFormat::UNORM_INT8)			},
-		{ tcu::PixelFormat(8,8,8,0),	tcu::TextureFormat(tcu::TextureFormat::RGB,		tcu::TextureFormat::UNORM_INT8)			},
-		{ tcu::PixelFormat(4,4,4,4),	tcu::TextureFormat(tcu::TextureFormat::RGBA,	tcu::TextureFormat::UNORM_SHORT_4444)	},
-		{ tcu::PixelFormat(5,5,5,1),	tcu::TextureFormat(tcu::TextureFormat::RGBA,	tcu::TextureFormat::UNORM_SHORT_5551)	},
-		{ tcu::PixelFormat(5,6,5,0),	tcu::TextureFormat(tcu::TextureFormat::RGB,		tcu::TextureFormat::UNORM_SHORT_565)	}
+		{ tcu::PixelFormat(8,8,8,8),	tcu::TextureFormat(tcu::TextureFormat::RGBA,	tcu::TextureFormat::UNORM_INT8)				},
+		{ tcu::PixelFormat(8,8,8,0),	tcu::TextureFormat(tcu::TextureFormat::RGB,		tcu::TextureFormat::UNORM_INT8)				},
+		{ tcu::PixelFormat(4,4,4,4),	tcu::TextureFormat(tcu::TextureFormat::RGBA,	tcu::TextureFormat::UNORM_SHORT_4444)		},
+		{ tcu::PixelFormat(5,5,5,1),	tcu::TextureFormat(tcu::TextureFormat::RGBA,	tcu::TextureFormat::UNORM_SHORT_5551)		},
+		{ tcu::PixelFormat(5,6,5,0),	tcu::TextureFormat(tcu::TextureFormat::RGB,		tcu::TextureFormat::UNORM_SHORT_565)		},
+		{ tcu::PixelFormat(10,10,10,2), tcu::TextureFormat(tcu::TextureFormat::RGBA,	tcu::TextureFormat::UNORM_INT_1010102_REV)	},
+		{ tcu::PixelFormat(16,16,16,16), tcu::TextureFormat(tcu::TextureFormat::RGBA,	tcu::TextureFormat::HALF_FLOAT)				},
 	};

 	for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(pixelFormatMap); ndx++)


Added shader filename to the call to D3DCompile if OGRE_DEBUG_MODE is set.  This allows us to debug the graphics pipeline with Visual Studio. Also beautified the comments for the call to D3DCompile.

--- RenderSystems/Direct3D11/src/OgreD3D11HLSLProgram.cpp
+++ RenderSystems/Direct3D11/src/OgreD3D11HLSLProgram.cpp
@@ -457,19 +457,24 @@

         ID3DBlob * pMicroCode;

+#ifdef OGRE_DEBUG_MODE
+		const char* filename = mFilename.c_str();
+#else
+		const char* filename = NULL;
+#endif

         HRESULT hr = D3DCompile(
-            mSource.c_str(),	// [in] Pointer to the shader in memory.
-            mSource.size(),		// [in] Size of the shader in memory.
-            NULL,				// [in] The name of the file that contains the shader code.
-            pDefines,			// [in] Optional. Pointer to a NULL-terminated array of macro definitions. See D3D_SHADER_MACRO. If not used, set this to NULL.
-            &includeHandler,	// [in] Optional. Pointer to an ID3DInclude Interface interface for handling include files. Setting this to NULL will cause a compile error if a shader contains a #include.
-            mEntryPoint.c_str(),// [in] Name of the shader-entrypoint function where shader execution begins.
-            target,	// [in] A string that specifies the shader model; can be any profile in shader model 4 or higher.
-            compileFlags,		// [in] Effect compile flags - no D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY at the first try...
-            NULL,				// [in] Effect compile flags
-            &pMicroCode,		// [out] A pointer to an ID3DBlob Interface which contains the compiled shader, as well as any embedded debug and symbol-table information.
-            &errors			// [out] A pointer to an ID3DBlob Interface which contains a listing of errors and warnings that occurred during compilation. These errors and warnings are identical to the the debug output from a debugger.
+            mSource.c_str(),      // [in] Pointer to the shader in memory.
+            mSource.size(),       // [in] Size of the shader in memory.
+            filename,             // [in] The name of the file that contains the shader code.
+            pDefines,             // [in] Optional. Pointer to a NULL-terminated array of macro definitions. See D3D_SHADER_MACRO. If not used, set this to NULL.
+            &includeHandler,      // [in] Optional. Pointer to an ID3DInclude Interface interface for handling include files. Setting this to NULL will cause a compile error if a shader contains a #include.
+            mEntryPoint.c_str(),  // [in] Name of the shader-entrypoint function where shader execution begins.
+            target,               // [in] A string that specifies the shader model; can be any profile in shader model 4 or higher.
+            compileFlags,         // [in] Effect compile flags - no D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY at the first try...
+            NULL,                 // [in] Effect compile flags
+            &pMicroCode,          // [out] A pointer to an ID3DBlob Interface which contains the compiled shader, as well as any embedded debug and symbol-table information.
+            &errors               // [out] A pointer to an ID3DBlob Interface which contains a listing of errors and warnings that occurred during compilation. These errors and warnings are identical to the the debug output from a debugger.
             );

 #if 0 // this is how you disassemble


[wxhaskell-from-cvs @ 2003-11-01 18:04:26 by dleijen]

removed debug output

darcs-hash:20031101180426-deb31-5b03dd2a132dacb9e0cab3c897d1116e2fa87db7.gz

--- wxc/src/db.cpp
+++ wxc/src/db.cpp
@@ -604,9 +604,8 @@

   if (ctime)    *ctime = -1;
   if (fraction) *fraction = -1;
-printf("get timestamp\n" );
+
   ok = db->GetData( column, SQL_C_TYPE_TIMESTAMP, &date, sizeof(date), &used );
-printf("result: %i, year: %i\n", (ok ? 1 : 0), date.year );
   if (usedLen) *usedLen = used;
   if (ok && used != SQL_NULL_DATA) {
     struct tm datetm;


Use generator in range method of TestStreamServiceMock

Summary:
Use generator instead of publisher in range. For most tests this should make no difference but there are some tests (thrift/lib/cpp2/transport/rocket/test:streaming_tests - StreamingTest.SetMaxRequests) that use range and setChunkBufferSize(0) to simulate an ongoing stream. With StreamPublisher all the CPU thread work is done immediately and the results buffered. With generator there is real backpressure so the CPU work doesn't complete until the client consumes the data.

In our future refactoring the definition of active requests will change to requests running on the CPU worker pools so this change means the tests that use this and a requests limit will continue to work.

Reviewed By: praihan

Differential Revision: D33478320

fbshipit-source-id: 78c7dc1a26e105ceb442cb5602710b8f31dcb98b

--- thrift/lib/cpp2/transport/rocket/test/util/TestServiceMock.cpp
+++ thrift/lib/cpp2/transport/rocket/test/util/TestServiceMock.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) Facebook, Inc. and its affiliates.
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -57,12 +57,21 @@
 }

 ServerStream<int32_t> TestStreamServiceMock::range(int32_t from, int32_t to) {
+#if FOLLY_HAS_COROUTINES
+  return folly::coro::co_invoke(
+      [from, to]() mutable -> folly::coro::AsyncGenerator<int32_t&&> {
+        for (; from < to; ++from) {
+          co_yield int(from);
+        }
+      });
+#else
   auto [stream, publisher] = ServerStream<int32_t>::createPublisher();
   for (; from < to; ++from) {
     publisher.next(from);
   }
   std::move(publisher).complete();
   return std::move(stream);
+#endif
 }

 ServerStream<std::string> TestStreamServiceMock::buffers(int32_t count) {


Vulkan: HardwareBuffer - aligning copy region is wrong

--- RenderSystems/Vulkan/src/OgreVulkanHardwareBuffer.cpp
+++ RenderSystems/Vulkan/src/OgreVulkanHardwareBuffer.cpp
@@ -176,8 +176,7 @@
             mDevice->mGraphicsQueue.getCopyEncoderV1Buffer( false );

             VkBuffer srcBuf = srcBuffer->getVkBuffer();
-            VkBufferCopy region = {srcOffset, dstOffset};
-            region.size = alignToNextMultiple( length, 4u );
+            VkBufferCopy region = {srcOffset, dstOffset, length};
             vkCmdCopyBuffer( mDevice->mGraphicsQueue.mCurrentCmdBuffer, srcBuf, mBuffer, 1u, &region );

             //if( this->mDiscardBuffer )


Add missing EncoderConfig field

Add missing EncoderConfig field

This fixes a build warning introduced by the following commit:
7f64b6445ac0154cc967406a8985c0d464d94017

--- demos/pwm_encoder/main.cc
+++ demos/pwm_encoder/main.cc
@@ -28,7 +28,8 @@
     Encoder encoder(&GPTD3, /* CH1, CH2 connected to PC6, PC7 and enabled by board.h */
             {PAL_NOLINE, /* no index channel */
              1024, /* counts per revolution */
-             EncoderConfig::filter_t::CAPTURE_64}); /* 64 * 42 MHz (TIM3 on APB1) = 1.52 us for valid edge */
+             EncoderConfig::filter_t::CAPTURE_64, /* 64 * 42 MHz (TIM3 on APB1) = 1.52 us for valid edge */
+             0});

     const uint32_t pwm_freq = 1000000; /* 1 MHz PWM clock frequency */
     const pwmcnt_t pwm_period = 1000; /* period is 10000 ticks (1 kHz) */


fixed new[]/delete mismatch

fixed new[]/delete mismatch

--- charset.cpp
+++ charset.cpp
@@ -323,12 +323,12 @@
         size = ucsdet_getUChars(self->object, buf, size, &status);
         if (U_FAILURE(status))
         {
-            delete buf;
+            delete[] buf;
             return ICUException(status).reportError();
         }

         u = PyUnicode_FromUnicodeString(buf, size);
-        delete buf;
+        delete[] buf;

         return u;
     }


sessionのPAUSE/STARTせずにRS追加変更削除していたのを修正

sessionのPAUSE/STARTせずにRS追加変更削除していたのを修正

git-svn-id: 86d5d149372f1267c60dfd580dfda829eb58a6de@6922 1ed66053-1c2d-0410-8867-f7571e6e31d3

--- src/virtualservice_tcp.cpp
+++ src/virtualservice_tcp.cpp
@@ -223,6 +223,11 @@
 void	l7vs::virtualservice_tcp::handle_accept(	const l7vs::virtualservice_tcp::session_thread_control_ptr in_session,
 													const boost::system::error_code& err ){
 	if( !err ){
+		//if active session count equal
+		if( ( active_sessions.size() >= static_cast<size_t>( element.sorry_maxconnection ) ) ||
+			( 0 != element.sorry_flag ) ){
+			in_session->get_session()->set_virtual_service_message( l7vs::tcp_session::SORRY_STATE_ENABLE );
+		}
 		//switch status runing, session_thread_control
 		in_session->startupstream();
 		in_session->startdownstream();
@@ -479,6 +484,7 @@
 		err.setter( true, "Virtual Service does not exist." );
 		return;
 	}
+
 	//if change ScueduleModule Name, unload old ScheduleModule and load new ScheduleModule
 	if( element.schedule_module_name != elem.schedule_module_name ){
 		schedule_module_control::getInstance().unload_module( schedmod );
@@ -519,9 +525,21 @@
 		if( elem.sorry_endpoint == boost::asio::ip::tcp::endpoint() ){
 			element.sorry_maxconnection	= 0LL;
 			element.sorry_flag			= false;
+			boost::mutex::scoped_lock lk( sessions_mutex );
+			for( session_map_type::iterator itr = active_sessions.begin();
+				itr != active_sessions.end();
+				++itr ){
+				itr->second->get_session()->set_virtual_service_message( l7vs::tcp_session::SORRY_STATE_DISABLE );
+			}
 		}else{
 			element.sorry_maxconnection	= elem.sorry_maxconnection;
 			element.sorry_flag			= elem.sorry_flag;
+			boost::mutex::scoped_lock lk( sessions_mutex );
+			for( session_map_type::iterator itr = active_sessions.begin();
+				itr != active_sessions.end();
+				++itr ){
+				itr->second->get_session()->set_virtual_service_message( l7vs::tcp_session::SORRY_STATE_ENABLE );
+			}
 		}
 	}

@@ -574,6 +592,16 @@
 			}
 		}
 	}
+
+	//pause active sessions
+	boost::mutex::scoped_lock session_lk( sessions_mutex );
+
+	for( session_map_type::iterator itr = active_sessions.begin();
+		 itr != active_sessions.end();
+		 ++itr ){
+		itr->second->get_session()->set_virtual_service_message( l7vs::tcp_session::SESSION_PAUSE_ON );
+	}
+
 	//add realserver
 	for( std::vector<realserver_element>::iterator itr = in_element.realserver_vector.begin();
 		 itr != in_element.realserver_vector.end();
@@ -590,8 +618,22 @@
 		//fatal case
 		l7vs::Logger::putLogFatal( l7vs::LOG_CAT_L7VSD_VIRTUALSERVICE, 0, "RealServer information data error", __FILE__, __LINE__ );
 		err.setter( true, "RealServer information data error" );
-		return;
-	}
+		//run active sessions
+		for( session_map_type::iterator itr = active_sessions.begin();
+			itr != active_sessions.end();
+			++itr ){
+			itr->second->get_session()->set_virtual_service_message( l7vs::tcp_session::SESSION_PAUSE_OFF );
+		}
+		return;
+	}
+
+	//run active sessions
+	for( session_map_type::iterator itr = active_sessions.begin();
+		 itr != active_sessions.end();
+		 ++itr ){
+		itr->second->get_session()->set_virtual_service_message( l7vs::tcp_session::SESSION_PAUSE_OFF );
+	}
+
 	err.setter( false, "" );
 }

@@ -641,6 +683,16 @@
 			return;
 		}
 	}
+
+	//pause active sessions
+	boost::mutex::scoped_lock session_lk( sessions_mutex );
+
+	for( session_map_type::iterator itr = active_sessions.begin();
+		 itr != active_sessions.end();
+		 ++itr ){
+		itr->second->get_session()->set_virtual_service_message( l7vs::tcp_session::SESSION_PAUSE_ON );
+	}
+
 	//edit realserver
 	for( std::vector<realserver_element>::iterator itr = in_element.realserver_vector.begin();
 		 itr != in_element.realserver_vector.end();
@@ -653,6 +705,14 @@
 			}
 		}
 	}
+
+	//run active sessions
+	for( session_map_type::iterator itr = active_sessions.begin();
+		 itr != active_sessions.end();
+		 ++itr ){
+		itr->second->get_session()->set_virtual_service_message( l7vs::tcp_session::SESSION_PAUSE_OFF );
+	}
+
 	err.setter( false, "" );
 }

@@ -701,6 +761,15 @@
 			err.setter( true, "Real Server does not exist." );
 			return;
 		}
+	}
+
+	//pause active sessions
+	boost::mutex::scoped_lock session_lk( sessions_mutex );
+
+	for( session_map_type::iterator itr = active_sessions.begin();
+		 itr != active_sessions.end();
+		 ++itr ){
+		itr->second->get_session()->set_virtual_service_message( l7vs::tcp_session::SESSION_PAUSE_ON );
 	}

 	//del realserver
@@ -720,8 +789,22 @@
 		//fatal case
 		l7vs::Logger::putLogFatal( l7vs::LOG_CAT_L7VSD_VIRTUALSERVICE, 0, "RealServer information data error", __FILE__, __LINE__ );
 		err.setter( true, "RealServer information data error" );
-		return;
-	}
+		//run active sessions
+		for( session_map_type::iterator itr = active_sessions.begin();
+			itr != active_sessions.end();
+			++itr ){
+			itr->second->get_session()->set_virtual_service_message( l7vs::tcp_session::SESSION_PAUSE_OFF );
+		}
+		return;
+	}
+
+	//run active sessions
+	for( session_map_type::iterator itr = active_sessions.begin();
+		 itr != active_sessions.end();
+		 ++itr ){
+		itr->second->get_session()->set_virtual_service_message( l7vs::tcp_session::SESSION_PAUSE_OFF );
+	}
+
 	err.setter( false, "" );
 }


Added default vertex attribute semantics enum

--- src/vlCore/vlnamespace.hpp
+++ src/vlCore/vlnamespace.hpp
@@ -1355,6 +1355,15 @@
     VAB_PURE_DOUBLE,  //!< Data will be sent using glVertexAttribLPointer(), that is, it will be associated with a
                       //!< shader attribute variable declared with 64-bit double precision components, data format must be \a double.
   } EVertexAttribBehavior;
+
+  //! Default vertex attribute bindings
+  typedef enum
+  {
+    VA_Position  = 0,
+    VA_Normal    = 1,
+    VA_Color     = 2,
+    VA_TexCoord0 = 3,
+  } EVertexAttribBinding;
 }


initDEM includes computation of the DEM offset; added DEM outlier detection function

--- src/vw/Photometry/Shape.cc
+++ src/vw/Photometry/Shape.cc
@@ -42,8 +42,197 @@
   return error;
 }

-
-
+//initializes the DEM file by getting the average DEM values in the overlapping areas of consecutive DEM files.
+void InitDEM( std::string input_DEM_file, std::string mean_DEM_file, std::string var2_DEM_file, modelParams input_img_params,
+              std::vector<std::string> overlap_DEM_files,  std::vector<modelParams> overlap_img_params, GlobalParams globalParams)
+{
+
+    unsigned i, l, k;
+
+    DiskImageView<PixelGray<float> >  input_DEM_image(input_DEM_file);
+    GeoReference input_DEM_geo;
+    read_georeference(input_DEM_geo, input_DEM_file);
+
+    ImageView<PixelGray<float> > mean_DEM_image(input_DEM_image.cols(), input_DEM_image.rows());
+    ImageView<PixelMask<PixelGray<float> > >var2_DEM_image(input_DEM_image.cols(), input_DEM_image.rows());
+
+    ImageView<PixelGray<int> > numSamples(input_DEM_image.cols(), input_DEM_image.rows());
+    ImageView<PixelGray<float> > norm(input_DEM_image.cols(), input_DEM_image.rows());
+
+
+    int numTiles = overlap_img_params.size()+1;
+    float *meanDEMOffset = new float[numTiles];
+    int *numDEMSamples = new int[numTiles];
+    for (i = 0; i < numTiles; i++){
+        numDEMSamples[i] = 0;
+    }
+
+    //initialize  mean_DEM-image, var2_DEM_image and numSamples
+    for (k = 0 ; k < (unsigned)input_DEM_image.rows(); ++k) {
+      for (l = 0; l < (unsigned)input_DEM_image.cols(); ++l) {
+
+           mean_DEM_image(l, k) = -10000;
+           numSamples(l, k) = 0;
+           Vector2 input_DEM_pix(l,k);
+
+	   if ( input_DEM_image(l,k) != -10000 ) {
+
+              if (globalParams.useWeights == 0){
+                  mean_DEM_image(l, k) = (float)input_DEM_image(l,k);
+	          var2_DEM_image(l, k) = (float)input_DEM_image(l,k)*(float)input_DEM_image(l,k);
+                  numSamples(l, k) = 1;
+
+                  meanDEMOffset[0] = meanDEMOffset[0] + (float)input_DEM_image(l,k);
+                  numDEMSamples[0] = numDEMSamples[0] + 1;
+	      }
+              else{
+                  float weight = ComputeLineWeights(input_DEM_pix, input_img_params.centerLineDEM, input_img_params.maxDistArrayDEM);
+                  mean_DEM_image(l, k) = (float)input_DEM_image(l,k)*weight;
+	          var2_DEM_image(l, k) = (float)input_DEM_image(l,k)*(float)input_DEM_image(l,k);
+                  numSamples(l, k) = 1;
+                  norm(l, k) = weight;
+
+                  meanDEMOffset[0] = meanDEMOffset[0] + (float)input_DEM_image(l,k);
+                  numDEMSamples[0] = numDEMSamples[0] + 1;
+	      }
+              //meanDEM = meanDEM + mean_DEM_image(l,k);
+	      //totalNumSamples++;
+
+	   }
+
+	}
+    }
+
+
+    for (i = 0; i < overlap_DEM_files.size(); i++){
+
+      printf("DEM = %s\n", overlap_DEM_files[i].c_str());
+
+      DiskImageView<PixelGray<float> >  overlap_DEM_image(overlap_DEM_files[i]);
+      GeoReference overlap_DEM_geo;
+      read_georeference(overlap_DEM_geo, overlap_DEM_files[i]);
+
+
+      ImageViewRef<PixelGray<float> >  interp_overlap_DEM_image = interpolate(edge_extend(overlap_DEM_image.impl(),
+                                                                              ConstantEdgeExtension()),
+                                                                              BilinearInterpolation());
+
+      for (k = 0 ; k < (unsigned)input_DEM_image.rows(); ++k) {
+        for (l = 0; l < (unsigned)input_DEM_image.cols(); ++l) {
+
+          Vector2 input_DEM_pix(l,k);
+
+          if ( input_DEM_image(l,k) != -10000 ) {
+
+              //check for overlap between the output image and the input DEM image
+              Vector2 overlap_dem_pix = overlap_DEM_geo.lonlat_to_pixel(input_DEM_geo.pixel_to_lonlat(input_DEM_pix));
+              int x = (int)overlap_dem_pix[0];
+	      int y = (int)overlap_dem_pix[1];
+
+              //check for valid DEM coordinates
+              if ((x>=0) && (x < overlap_DEM_image.cols()) && (y>=0) && (y< overlap_DEM_image.rows())){
+
+		if ( overlap_DEM_image(x, y) != -10000 ) {
+
+                     if (globalParams.useWeights == 0){
+                         mean_DEM_image(l, k) = (float)mean_DEM_image(l, k) + (float)interp_overlap_DEM_image(x, y);
+	                 var2_DEM_image(l, k) = (float)var2_DEM_image(l, k) + (float)interp_overlap_DEM_image(x, y)*(float)interp_overlap_DEM_image(x, y);
+                         numSamples(l, k) = (int)numSamples(l, k) + 1;
+
+                         meanDEMOffset[i+1] = meanDEMOffset[i+1] + (float)interp_overlap_DEM_image(x, y);
+                         numDEMSamples[i+1] = numDEMSamples[i+1] + 1;
+		     }
+                     else{
+                         float weight = ComputeLineWeights(overlap_dem_pix, overlap_img_params[i].centerLineDEM, overlap_img_params[i].maxDistArrayDEM);
+                         mean_DEM_image(l, k) = (float)mean_DEM_image(l, k) + (float)interp_overlap_DEM_image(x, y)*weight;
+	                 var2_DEM_image(l, k) = (float)var2_DEM_image(l, k) + (float)interp_overlap_DEM_image(x, y)*(float)interp_overlap_DEM_image(x, y);
+                         numSamples(l, k) = (int)numSamples(l, k) + 1;
+                         norm(l, k) = norm(l,k) + weight;
+
+                         meanDEMOffset[i+1] = meanDEMOffset[i+1] + (float)interp_overlap_DEM_image(x, y);
+                         numDEMSamples[i+1] = numDEMSamples[i+1] + 1;
+		     }
+		     //meanDEM = meanDEM + mean_DEM_image(l,k);
+                     //totalNumSamples++;
+		  }
+	      }
+	  }
+        }
+      }
+    }
+
+
+    //compute mean and variance
+    float avgStdDevDEM = 0.0;
+    float meanDEM = 0.0;
+    int totalNumSamples = 0;
+
+    for (k = 0 ; k < (unsigned)input_DEM_image.rows(); ++k) {
+      for (l = 0; l < (unsigned)input_DEM_image.cols(); ++l) {
+
+	    if ((globalParams.useWeights == 0) && (numSamples(l,k)!=0)){
+	       mean_DEM_image(l, k) = mean_DEM_image(l, k)/numSamples(l,k);
+	    }
+
+            if ((globalParams.useWeights == 1) && (norm(l,k)!=0)){
+               mean_DEM_image(l, k) = mean_DEM_image(l, k)/norm(l,k);
+	    }
+
+            if ((numSamples(l,k)!=0)){
+               var2_DEM_image(l, k) = var2_DEM_image(l, k)/numSamples(l,k)- mean_DEM_image(l, k)*mean_DEM_image(l,k);
+               if (var2_DEM_image(l,k) < 0){
+	          //printf("var2(%d, %d) =%f\n", l, k,(float)var2_DEM_image(l,k));
+                  var2_DEM_image(l,k) = 0.0;
+	       }
+               //var2_DEM_image(l, k) = 0.02*(float)var2_DEM_image(l,k);
+
+               //compute the DEM standard deviation
+               var2_DEM_image(l, k) = sqrt((float)var2_DEM_image(l,k));
+               avgStdDevDEM = avgStdDevDEM + var2_DEM_image(l,k);
+               meanDEM = meanDEM + mean_DEM_image(l,k);
+               totalNumSamples++;
+	    }
+
+      }
+    }
+
+    //compute the meanDEM and avgStdDevDEM
+    meanDEM = meanDEM/totalNumSamples;
+    avgStdDevDEM = avgStdDevDEM/totalNumSamples;
+    printf("totalNumSamples = %d, meanDEM = %f, avgStdDevDEM = %f\n", totalNumSamples, meanDEM, avgStdDevDEM);
+
+    //compute the mean DEM offset from each DEM tile to mean
+
+    //print the average standard dev for DEM and the mean offsets
+    for (i = 0; i < overlap_img_params.size()+1; i++){
+        //printf("before meanDEMoffset[%d] = %f, meanDEM = %f, numDEMSamples = %d\n", i, meanDEMOffset[i], meanDEM, numDEMSamples[i]);
+        meanDEMOffset[i] = meanDEMOffset[i]/numDEMSamples[i] - meanDEM;
+        printf("meanDEMoffset[%d] = %f\n", i, meanDEMOffset[i]);
+    }
+
+    /*
+    write_georeferenced_image(mean_DEM_file,
+                              //channel_cast<float>(mean_DEM_image),
+                              mean_DEM_image,
+                              input_DEM_geo, TerminalProgressCallback("{Core}","Processing:"));
+
+    write_georeferenced_image(var2_DEM_file,
+                              //channel_cast<float>(var2_DEM_image),
+                              channel_cast<uint8>(clamp(var2_DEM_image,0.0,255.0)),
+                              //var2_DEM_image,
+                              input_DEM_geo, TerminalProgressCallback("{Core}","Processing:"));
+    */
+
+    //write the meanDEMOffset and avgStdDevDEM to file
+    //printf("write info file\n");
+    FILE *fp = fopen(input_img_params.infoFilename.c_str(),"w");
+    fprintf(fp, "%f %f %f %f %f\n", meanDEMOffset[0], meanDEMOffset[1], meanDEMOffset[2], meanDEMOffset[3], avgStdDevDEM);
+    fclose(fp);
+
+    delete meanDEMOffset;
+    delete numDEMSamples;
+}
+/*
 //initializes the DEM file by getting the average DEM values in the overlapping areas of consecutive DEM files.
 void InitDEM( std::string input_DEM_file, std::string mean_DEM_file, std::string var2_DEM_file, modelParams input_img_params,
               std::vector<std::string> overlap_DEM_files,  std::vector<modelParams> overlap_img_params, GlobalParams globalParams)
@@ -211,155 +400,121 @@

 }
+*/
 //initializes the DEM file by getting the average DEM values in the overlapping areas of consecutive DEM files.
-void DetectDEMOutliers( std::string input_DEM_file, std::string mean_DEM_file, std::string var2_DEM_file,
-                        modelParams input_img_params, std::vector<std::string> overlap_DEM_files,
-                        std::vector<modelParams> overlap_img_params, float *meanDEMOffset,
-                        GlobalParams globalParams)
+void DetectDEMOutliers( std::string input_DEM_file, std::string mean_DEM_file, std::string var2_DEM_file,
+                        modelParams input_img_params, std::vector<std::string> overlap_DEM_files,
+                        std::vector<modelParams> overlap_img_params, GlobalParams globalParams)
 {

     int i, l, k;
-
-    DiskImageView<PixelGray<float> >  input_DEM_image(input_DEM_file);
+
+    DiskImageView<PixelGray<float> >  input_DEM_image(input_DEM_file);
     GeoReference input_DEM_geo;
     read_georeference(input_DEM_geo, input_DEM_file);
-
-    ImageView<PixelGray<float> > mean_DEM_image(input_DEM_image.cols(), input_DEM_image.rows());
+
+    DiskImageView<PixelGray<float> >  mean_DEM_image(input_DEM_file);
+
     ImageView<PixelMask<PixelGray<float> > >var2_DEM_image(input_DEM_image.cols(), input_DEM_image.rows());

     ImageView<PixelGray<int> > numSamples(input_DEM_image.cols(), input_DEM_image.rows());
-    ImageView<PixelGray<float> > norm(input_DEM_image.cols(), input_DEM_image.rows());

     float avgStdDevDEM;
+
+    float *meanDEMOffset = new float[5];
+    //read the meanDEMOffset and avgStdDevDEM from file
+    FILE *fp = fopen(input_img_params.infoFilename.c_str(),"r");
+
+    fscanf(fp, "%f %f %f %f %f\n", &meanDEMOffset[0], &meanDEMOffset[1], &meanDEMOffset[2], &meanDEMOffset[3], &avgStdDevDEM);
+    fclose(fp);
+

     //initialize  mean_DEM-image, var2_DEM_image and numSamples
     for (k = 0 ; k < (int)input_DEM_image.rows(); ++k) {
       for (l = 0; l < (int)input_DEM_image.cols(); ++l) {

-           mean_DEM_image(l, k) = -10000;
            numSamples(l, k) = 0;
            Vector2 input_DEM_pix(l,k);

-           if ( input_DEM_image(l,k) != -10000 ) {
-
-              if (globalParams.useWeights == 0){
-                  mean_DEM_image(l, k) = (float)input_DEM_image(l,k);
-                  var2_DEM_image(l, k) = ((float)input_DEM_image(l,k)-meanDEMOffset[0]) *((float)input_DEM_image(l,k)-meanDEMOffset[0]);
-                  numSamples(l, k) = 1;
-              }
-              else{
-                  float weight = ComputeLineWeights(input_DEM_pix, input_img_params.centerLineDEM, input_img_params.maxDistArrayDEM);
-                  mean_DEM_image(l, k) = (float)input_DEM_image(l,k)*weight;
-                  var2_DEM_image(l, k) = ((float)input_DEM_image(l,k)-meanDEMOffset[0]) *((float)input_DEM_image(l,k)-meanDEMOffset[0]);
-                  numSamples(l, k) = 1;
-                  norm(l, k) = weight;
-
-              }
-
-           }
-
-        }
-    }
-
+	   if ( input_DEM_image(l,k) != -10000 ) {
+	       var2_DEM_image(l, k) = ((float)input_DEM_image(l,k)-meanDEMOffset[0]) *((float)input_DEM_image(l,k)-meanDEMOffset[0]);
+               numSamples(l, k) = 1;
+	   }
+
+	}
+    }

     for (i = 0; i < (int)overlap_DEM_files.size(); i++){
-
+
       printf("DEM = %s\n", overlap_DEM_files[i].c_str());

-      DiskImageView<PixelGray<float> >  overlap_DEM_image(overlap_DEM_files[i]);
+      DiskImageView<PixelGray<float> >  overlap_DEM_image(overlap_DEM_files[i]);
       GeoReference overlap_DEM_geo;
       read_georeference(overlap_DEM_geo, overlap_DEM_files[i]);

-
-      ImageViewRef<PixelGray<float> >  interp_overlap_DEM_image = interpolate(edge_extend(overlap_DEM_image.impl(),
-                                                                              ConstantEdgeExtension()),
+
+      ImageViewRef<PixelGray<float> >  interp_overlap_DEM_image = interpolate(edge_extend(overlap_DEM_image.impl(),
+                                                                              ConstantEdgeExtension()),
                                                                               BilinearInterpolation());
-
-      for (k = 0 ; k < input_DEM_image.rows(); ++k) {
-        for (l = 0; l < input_DEM_image.cols(); ++l) {
-
+
+      for (k = 0 ; k < (int)input_DEM_image.rows(); ++k) {
+        for (l = 0; l < (int)input_DEM_image.cols(); ++l) {
+
           Vector2 input_DEM_pix(l,k);
-
+
           if ( input_DEM_image(l,k) != -10000 ) {
-
+
               //check for overlap between the output image and the input DEM image
               Vector2 overlap_dem_pix = overlap_DEM_geo.lonlat_to_pixel(input_DEM_geo.pixel_to_lonlat(input_DEM_pix));
               int x = (int)overlap_dem_pix[0];
-              int y = (int)overlap_dem_pix[1];
-
-              //check for valid DEM coordinates
+	      int y = (int)overlap_dem_pix[1];
+
+              //check for valid DEM coordinates
               if ((x>=0) && (x < overlap_DEM_image.cols()) && (y>=0) && (y< overlap_DEM_image.rows())){

-                if ( overlap_DEM_image(x, y) != -10000 ) {
-
-                     if (globalParams.useWeights == 0){
-                         mean_DEM_image(l, k) = (float)mean_DEM_image(l, k) + (float)interp_overlap_DEM_image(x, y);
-                         var2_DEM_image(l, k) = (float)var2_DEM_image(l, k) + ((float)interp_overlap_DEM_image(x, y)-meanDEMOffset[i+1])*
-                                                                              ((float)interp_overlap_DEM_image(x, y)-meanDEMOffset[i+1]);
-                         numSamples(l, k) = (int)numSamples(l, k) + 1;
-
-                     }
-                     else{
-                         float weight = ComputeLineWeights(overlap_dem_pix, overlap_img_params[i].centerLineDEM, overlap_img_params[i].maxDistArrayDEM);
-                         mean_DEM_image(l, k) = (float)mean_DEM_image(l, k) + (float)interp_overlap_DEM_image(x, y)*weight;
-                         var2_DEM_image(l, k) = (float)var2_DEM_image(l, k) + ((float)interp_overlap_DEM_image(x, y)-meanDEMOffset[i+1])*
-                                                                              ((float)interp_overlap_DEM_image(x, y)-meanDEMOffset[i+1]);
-                         numSamples(l, k) = (int)numSamples(l, k) + 1;
-                         norm(l, k) = norm(l,k) + weight;
-
-                     }
-
-                  }
-              }
-          }
+		if ( overlap_DEM_image(x, y) != -10000 ) {
+
+	            var2_DEM_image(l, k) = (float)var2_DEM_image(l, k) + ((float)interp_overlap_DEM_image(x, y)-meanDEMOffset[i+1])*
+			                                                 ((float)interp_overlap_DEM_image(x, y)-meanDEMOffset[i+1]);
+                    numSamples(l, k) = (int)numSamples(l, k) + 1;
+		}
+	     }
+	  }
         }
       }
     }
-
+

     //compute mean and variance
     int totalNumSamples = 0;
     avgStdDevDEM = 0.0;
-    for (k = 0 ; k < input_DEM_image.rows(); ++k) {
-       for (l = 0; l < input_DEM_image.cols(); ++l) {
-         if (( numSamples(l,k)!=0) && (norm(l,k)!=0)){
-            if (globalParams.useWeights == 0){
-               mean_DEM_image(l, k) = mean_DEM_image(l, k)/numSamples(l,k);
-            }
-            else{
-               mean_DEM_image(l, k) = mean_DEM_image(l, k)/norm(l,k);
-            }
+    for (k = 0 ; k < (int)input_DEM_image.rows(); ++k) {
+      for (l = 0; l < (int)input_DEM_image.cols(); ++l) {
+	 if (numSamples(l,k)!=0){
+
             var2_DEM_image(l, k) = var2_DEM_image(l, k)/numSamples(l,k) - mean_DEM_image(l, k)*mean_DEM_image(l,k);
-            //printf("var2(%d, %d) =%f\n", l, k,(float)var2_DEM_image(l,k));
-            //var2_DEM_image(l, k) = 0.02*(float)var2_DEM_image(l,k);
-
+
             //compute the DEM standard deviation
             var2_DEM_image(l, k) = sqrt((float)var2_DEM_image(l,k));
             avgStdDevDEM = avgStdDevDEM + var2_DEM_image(l,k)/numSamples(l,k);
             totalNumSamples++;
-         }
+	 }
        }
     }
-
+
     //printf("average DEM error = %f\n", totalVar2/(float)numSamples);
-
+
     //write the DEM
-    write_georeferenced_image(mean_DEM_file,
-                              //channel_cast<float>(mean_DEM_image),
-                              mean_DEM_image,
-                              input_DEM_geo, TerminalProgressCallback("{Core}","Processing:"));
-
-    write_georeferenced_image(var2_DEM_file,
+    write_georeferenced_image(var2_DEM_file,
                               //channel_cast<float>(var2_DEM_image),
                               channel_cast<uint8>(clamp(var2_DEM_image,0.0,255.0)),
                               //var2_DEM_image,
                               input_DEM_geo, TerminalProgressCallback("{Core}","Processing:"));
-
-
-    //write_georeferenced_image(output_file, tm_image, geo1, TerminalProgressCallback());
-
-
+
+
+    //write_georeferenced_image(output_file, tm_image, geo1, TerminalProgressCallback());
 }
+

 //input_files[i], input_files[i-1], output_files[i], output_files[i-1]
 //writes the albedo of the current image in the area of overlap with the previous mage


MainWindow: use # tasks instead of _ui.busyWidget status

Relying on the _ui.busyWidget status complicated attempts to detangle
SettingsWidget from MainWindow.

--- src/widgets/mainwindow.cpp
+++ src/widgets/mainwindow.cpp
@@ -1345,7 +1345,7 @@

 void MainWindow::runSetupWizardClicked()
 {
-    if(_ui.busyWidget->isVisible())
+    if((_runningTasks + _queuedTasks) > 0)
     {
         QMessageBox::warning(this, tr("Confirm action"),
                              tr("Tasks are currently running. Please "


automatically display the correct folder when clicking on Icon button

--- desktop-editor/dialog.cpp
+++ desktop-editor/dialog.cpp
@@ -94,6 +94,8 @@

 void Dialog::on_pbCommand_clicked()
 {
+    //TODO: detect Command directory
+
     QString fileName = QFileDialog::getOpenFileName(this,
         tr("Open command"), "~", tr("All Files (*)"));
     ui->lCommand->setText(fileName);
@@ -177,17 +179,14 @@
             tempFile.setAutoRemove(false);
             tempFile.open();
             tempFile.close();
-            qDebug() << "temp file:" << tempFile.fileName();

             //TODO: capture errors
             QString cmd = "mv";
             cmd = cmd + " " + desktopFileName + " " + tempFile.fileName();
-            qDebug() << "cmd:" << cmd;
             int ret = LUtils::runCmd(cmd);

             cmd = "mv";
             cmd = cmd + " " + tempFile.fileName() + " " + desktopFileName;
-            qDebug() << "cmd:" << cmd;
             ret = LUtils::runCmd(cmd);
     }
 }
@@ -195,8 +194,16 @@

 void Dialog::on_pbIcon_clicked()
 {
+	QString iconFolder="~";
+    if (!iconFileName.isEmpty()) {
+		iconFolder = iconFileName.section('/', 0, -2);
+	}
+	else if (!DF.icon.isEmpty()) {
+			iconFolder = DF.icon.section('/', 0, -2);
+	}
+
     QString fileName = QFileDialog::getOpenFileName(this,
-        tr("Open command"), "~", tr("Image Files (*.png *.jpg *.bmp)"));
+        tr("Open command"), iconFolder, tr("Image Files (*.png *.jpg *.bmp)"));
     qDebug() << "icon:" << fileName;
     ui->pbIcon->setIcon(QPixmap(fileName));
     iconFileName=fileName;


Fixed compiler error on clang

Fixed compiler error on clang

--- src/widgets/tabbedarea.cpp
+++ src/widgets/tabbedarea.cpp
@@ -323,7 +323,7 @@
         }

         // Draw the widget from a select tab.
-        std::vector<std::pair<Tab*, Widget*>>::iterator iter;
+        std::vector<std::pair<Tab*, Widget*> >::iterator iter;
         for (iter = mTabs.begin(); iter != mTabs.end(); iter++)
         {
             iter->first->_draw(graphics);


Clarify comments

Clarify comments

--- src/libtatum/analyzers/timing_analyzer_interfaces.hpp
+++ src/libtatum/analyzers/timing_analyzer_interfaces.hpp
@@ -244,6 +244,8 @@
 /**
  * SetupTimingAnalyzer represents an abstract interface for all timing analyzers
  * performing setup (i.e. long-path) analysis.
+ *
+ * Note the use of virtual inheritance to avoid duplicating the base class
  */
 class SetupTimingAnalyzer : public virtual TimingAnalyzer {
     public:
@@ -259,6 +261,8 @@
 /**
  * HoldTimingAnalyzer represents an abstract interface for all timing analyzers
  * performing hold (i.e. short-path) analysis.
+ *
+ * Note the use of virtual inheritance to avoid duplicating the base class
  */
 class HoldTimingAnalyzer : public virtual TimingAnalyzer {
     public:
@@ -282,9 +286,10 @@
 class SetupHoldTimingAnalyzer : public SetupTimingAnalyzer, public HoldTimingAnalyzer {
     //Empty (all behaviour inherited)
     //
-    // Note that we use virtual inheritance to avoid duplicating the common base class
-};
-
-
-
-
+    // Note that SetupTiminganalyzer and HoldTimingAnalyzer used virtual inheritance, so
+    // there is no ambiguity when inheriting from both
+};
+
+
+
+


TEST: Fixed signal/slot connection.

TEST: Fixed signal/slot connection.

--- Testing/Application/mvdMonteverdi2ApplicationTest.cxx
+++ Testing/Application/mvdMonteverdi2ApplicationTest.cxx
@@ -40,7 +40,7 @@

   main_window.show();

-  QTimer::singleShot(1000, &application, SLOT(quit()));
+  QTimer::singleShot(1000, &qtApp, SLOT(quit()));

   return qtApp.exec();
 }