One more fix in case of nested inheritance with the same class used
in the base class and by composition.

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@5661 27541ba8-7e3a-0410-8455-c3a389f83636

--- tree/src/TBranchElement.cxx
+++ tree/src/TBranchElement.cxx
@@ -1,4 +1,4 @@
-// @(#)root/tree:$Name:  $:$Id: TBranchElement.cxx,v 1.94 2002/11/13 17:32:06 rdm Exp $
+// @(#)root/tree:$Name:  $:$Id: TBranchElement.cxx,v 1.95 2002/11/24 14:02:00 brun Exp $
 // Author: Rene Brun   14/01/2001

 /*************************************************************************
@@ -1382,21 +1382,28 @@
       }
    }

+   TClass *clparent = gROOT->GetClass(GetParentName());
+   TClass *clm = gROOT->GetClass(GetClassName());
    if (fType == 31) {
       if (fClassName != fParentName) {
-         TClass *clparent = gROOT->GetClass(GetParentName());
-         TClass *clm = gROOT->GetClass(GetClassName());
          if (clparent != clm) {
             const char *clast = strchr(GetName(),'.');
             if (clast) {
                Int_t *offsets = clm->GetStreamerInfo()->GetOffsets();
                fOffset = clparent->GetDataMemberOffset(clast+1) - offsets[fID];
-               //printf("clast+1=%s, fOffset=%d\n",clast+1,fOffset);
+               //printf("clast+1=%s, fOffset=%d\n",clast,fOffset);
             }
          }
       }
-   }
-   if (nbranches == 0) return;
+      return;
+   }
+   if (nbranches == 0) {
+      if (clparent) {
+         Int_t *offsets = clm->GetStreamerInfo()->GetOffsets();
+         fObject += clparent->GetDataMemberOffset(GetName() -offsets[fID]);
+      }
+      return;
+   }
    for (Int_t i=0;i<nbranches;i++)  {
       TBranch *abranch = (TBranch*)fBranches[i];
       //just in case a TBranch had been added to a TBranchElement!
@@ -1410,9 +1417,9 @@
       Int_t btype = branch->GetType();
       Int_t mOffset = 0;
       Int_t memberOffset = 0;
-      TClass *clparent = gROOT->GetClass(branch->GetParentName());
+      clparent = gROOT->GetClass(branch->GetParentName());
       if (!clparent) clparent = cl;
-      TClass *clm = gROOT->GetClass(branch->GetClassName());
+      clm = gROOT->GetClass(branch->GetClassName());
       TStreamerInfo *info = branch->GetInfo();
 //printf("i=%d, clm=%s,clparent=%s, branch=%s, btype=%d, nb2=%d, info=%s, uuoff=%d\n",i,clm->GetName(),clparent->GetName(),branch->GetName(),btype,nb2,info->GetName(),cinfo->GetOffsets()[id]);


test: do not include <gtest/gtest.h> directly

Summary: Windows will fail to compile if this header is included directly.

Reviewed By: fanzeyi

Differential Revision: D37020913

fbshipit-source-id: d11283e6814757f04f4d7a23eb0cbf6a258530c7

--- watchman/test/SerdeTest.cpp
+++ watchman/test/SerdeTest.cpp
@@ -6,7 +6,7 @@
  */

 #include "watchman/Serde.h"
-#include <gtest/gtest.h>
+#include <folly/portability/GTest.h>

 namespace {
 using namespace watchman;


Fixed A as start button ingame with controller

--- Application.cpp
+++ Application.cpp
@@ -163,8 +163,10 @@
         if(e->type == SDL_JOYBUTTONDOWN){
             switch(e->jbutton.button){
             case 0:
-                newEvent.key.keysym.sym = SDLK_RETURN;
-                this->Event(&newEvent, false);
+                if(this->state == GAME_MENU){
+                    newEvent.key.keysym.sym = SDLK_RETURN;
+                    this->Event(&newEvent, false);
+                }
                 newEvent.key.keysym.sym = SDLK_s;
                 break;
             case 2:


changed a malloc to new

changed a malloc to new

--- tree_traversal/traverse.cpp
+++ tree_traversal/traverse.cpp
@@ -43,7 +43,7 @@
     root = new node;
     root->ID = num_row;
     root->num_children = num_child;
-    root->children = (node**)malloc(sizeof(node)*num_child);
+    root->children = new node*[num_child];
     if (num_row > 0){
         for (int i = 0; i < num_child; ++i){
             create_tree(root->children[i], num_row - 1, num_child);


added comment

added comment

git-svn-id: e171abefef93db0a74257c7d87d5b6400fe00c1f@3260 f22100f3-aa73-48fe-a4fb-fd497bb32605

--- trunk/extension/src/stc.cpp
+++ trunk/extension/src/stc.cpp
@@ -1067,7 +1067,9 @@
     {
       int style = 0; // otherwise CAN_PASTE already on
       if (GetReadOnly()) style |= wxExMenu::MENU_IS_READ_ONLY;
-      if (!GetSelectedText().empty()) style |= wxExMenu::MENU_IS_SELECTED;
+      // TODO added SelectionIsRectangle() to fix assert when sel is rectangle,
+      // however check GetSelectedText() is done quite often
+      if (SelectionIsRectangle() || !GetSelectedText().empty()) style |= wxExMenu::MENU_IS_SELECTED;
       if (GetTextLength() == 0) style |= wxExMenu::MENU_IS_EMPTY;
       if (CanPaste()) style |= wxExMenu::MENU_CAN_PASTE;


dnn(test): re-enable tests which works with OpenVINO 2021.4.x

--- modules/dnn/test/test_onnx_importer.cpp
+++ modules/dnn/test/test_onnx_importer.cpp
@@ -402,77 +402,211 @@

 TEST_P(Test_ONNX_layers, Elementwise_Ceil)
 {
+#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_LT(2021040000)
     if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019)
         applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER);
     if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
         applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH);
+#endif
     testONNXModels("ceil");
 }

 TEST_P(Test_ONNX_layers, Elementwise_Floor)
 {
+#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_LT(2021040000)
     if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019)
         applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER);
     if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
         applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH);
+#endif
     testONNXModels("floor");
 }

 TEST_P(Test_ONNX_layers, Elementwise_Log)
 {
+#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_LT(2021040000)
     if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019)
         applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER);
     if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
         applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH);
+#endif
     testONNXModels("log");
 }

 TEST_P(Test_ONNX_layers, Elementwise_Round)
 {
+#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_LT(2021040000)
     if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019)
         applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER);
     if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
         applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH);
+#endif
     testONNXModels("round");
 }

 TEST_P(Test_ONNX_layers, Elementwise_Sqrt)
 {
+#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_LT(2021040000)
     if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019)
         applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER);
     if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
         applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH);
     testONNXModels("sqrt");
+#endif
 }

 TEST_P(Test_ONNX_layers, Elementwise_not)
 {
+#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_LT(2021040000)
     if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019)
         applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER);
     if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
         applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH);
+#endif
     testONNXModels("not");
 }

-TEST_P(Test_ONNX_layers, Compare)
-{
+TEST_P(Test_ONNX_layers, Compare_EQ)
+{
+#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_LT(2021040000)
     if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019)
         applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER);
     if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
         applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH);
+#endif
+#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2021040000)
+    if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
+    {
+        // IE exception: Function contains several inputs and outputs with one friendly name!
+        if (target == DNN_TARGET_OPENCL || target == DNN_TARGET_OPENCL_FP16)
+            applyTestTag(target == DNN_TARGET_OPENCL ? CV_TEST_TAG_DNN_SKIP_IE_OPENCL : CV_TEST_TAG_DNN_SKIP_IE_OPENCL_FP16,
+                CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_VERSION
+            );
+        // IE exception: Function contains several inputs and outputs with one friendly name!
+        if (target == DNN_TARGET_MYRIAD)
+            applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_VERSION);
+    }
+#endif
     testONNXModels("equal");
+}
+
+TEST_P(Test_ONNX_layers, Compare_GT)
+{
+#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_LT(2021040000)
+    if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019)
+        applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER);
+    if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
+        applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH);
+#endif
+#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2021040000)
+    if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
+    {
+        // IE exception: Function contains several inputs and outputs with one friendly name!
+        if (target == DNN_TARGET_OPENCL || target == DNN_TARGET_OPENCL_FP16)
+            applyTestTag(target == DNN_TARGET_OPENCL ? CV_TEST_TAG_DNN_SKIP_IE_OPENCL : CV_TEST_TAG_DNN_SKIP_IE_OPENCL_FP16,
+                CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_VERSION
+            );
+        // IE exception: Function contains several inputs and outputs with one friendly name!
+        if (target == DNN_TARGET_MYRIAD)
+            applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_VERSION);
+    }
+#endif
     testONNXModels("greater");
+}
+
+TEST_P(Test_ONNX_layers, Compare_LT)
+{
+#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_LT(2021040000)
+    if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019)
+        applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER);
+    if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
+        applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH);
+#endif
+#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2021040000)
+    if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
+    {
+        // IE exception: Function contains several inputs and outputs with one friendly name!
+        if (target == DNN_TARGET_OPENCL || target == DNN_TARGET_OPENCL_FP16)
+            applyTestTag(target == DNN_TARGET_OPENCL ? CV_TEST_TAG_DNN_SKIP_IE_OPENCL : CV_TEST_TAG_DNN_SKIP_IE_OPENCL_FP16,
+                CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_VERSION
+            );
+        // IE exception: Function contains several inputs and outputs with one friendly name!
+        if (target == DNN_TARGET_MYRIAD)
+            applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_VERSION);
+    }
+#endif
     testONNXModels("less");
 }

-TEST_P(Test_ONNX_layers, CompareSameDims)
-{
+TEST_P(Test_ONNX_layers, CompareSameDims_EQ)
+{
+#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_LT(2021040000)
     if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019)
         applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER);
     if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
         applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH);
+#endif
+#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2021040000)
+    if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
+    {
+        // IE exception: Function contains several inputs and outputs with one friendly name!
+        if (target == DNN_TARGET_OPENCL || target == DNN_TARGET_OPENCL_FP16)
+            applyTestTag(target == DNN_TARGET_OPENCL ? CV_TEST_TAG_DNN_SKIP_IE_OPENCL : CV_TEST_TAG_DNN_SKIP_IE_OPENCL_FP16,
+                CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_VERSION
+            );
+        // IE exception: Function contains several inputs and outputs with one friendly name!
+        if (target == DNN_TARGET_MYRIAD)
+            applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_VERSION);
+    }
+#endif
     testONNXModels("equal_same_dims", npy, 0, 0, false, true, 2);
+}
+
+TEST_P(Test_ONNX_layers, CompareSameDims_GT)
+{
+#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_LT(2021040000)
+    if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019)
+        applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER);
+    if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
+        applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH);
+#endif
+#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2021040000)
+    if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
+    {
+        // IE exception: Function contains several inputs and outputs with one friendly name!
+        if (target == DNN_TARGET_OPENCL || target == DNN_TARGET_OPENCL_FP16)
+            applyTestTag(target == DNN_TARGET_OPENCL ? CV_TEST_TAG_DNN_SKIP_IE_OPENCL : CV_TEST_TAG_DNN_SKIP_IE_OPENCL_FP16,
+                CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_VERSION
+            );
+        // IE exception: Function contains several inputs and outputs with one friendly name!
+        if (target == DNN_TARGET_MYRIAD)
+            applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_VERSION);
+    }
+#endif
     testONNXModels("greater_same_dims", npy, 0, 0, false, true, 2);
+}
+
+TEST_P(Test_ONNX_layers, CompareSameDims_LT)
+{
+#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_LT(2021040000)
+    if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019)
+        applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER);
+    if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
+        applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NGRAPH);
+#endif
+#if defined(INF_ENGINE_RELEASE) && INF_ENGINE_VER_MAJOR_EQ(2021040000)
+    if (backend == DNN_BACKEND_INFERENCE_ENGINE_NGRAPH)
+    {
+        // IE exception: Function contains several inputs and outputs with one friendly name!
+        if (target == DNN_TARGET_OPENCL || target == DNN_TARGET_OPENCL_FP16)
+            applyTestTag(target == DNN_TARGET_OPENCL ? CV_TEST_TAG_DNN_SKIP_IE_OPENCL : CV_TEST_TAG_DNN_SKIP_IE_OPENCL_FP16,
+                CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_VERSION
+            );
+        // IE exception: Function contains several inputs and outputs with one friendly name!
+        if (target == DNN_TARGET_MYRIAD)
+            applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_MYRIAD, CV_TEST_TAG_DNN_SKIP_IE_NGRAPH, CV_TEST_TAG_DNN_SKIP_IE_VERSION);
+    }
+#endif
     testONNXModels("less_same_dims", npy, 0, 0, false, true, 2);
 }


ENH: OTB-626 : reproduce the superimposition method specific to PHR, (see Superimpose app)

--- Applications/Projections/otbBundleToPerfectSensor.cxx
+++ Applications/Projections/otbBundleToPerfectSensor.cxx
@@ -23,15 +23,25 @@
 #include "otbBCOInterpolateImageFunction.h"
 #include "otbSimpleRcsPanSharpeningFusionImageFilter.h"
 #include "itkFixedArray.h"
+#include "itkScalableAffineTransform.h"

 // Elevation handler
 #include "otbWrapperElevationParametersHandler.h"
+
+#include "otbDateTimeAdapter.h"
+#include "otbStreamingResampleImageFilter.h"
+#include "otbPleiadesImageMetadataInterface.h"

 namespace otb
 {
 namespace Wrapper
 {

+enum
+{
+  Mode_Default,
+  Mode_PHR
+};

 class BundleToPerfectSensor : public Application
 {
@@ -72,6 +82,19 @@
     // Elevation
     ElevationParametersHandler::AddElevationParameters(this, "elev");

+    // Superposition mode
+    AddParameter(ParameterType_Choice,"mode", "Mode");
+    SetParameterDescription("mode", "Superimposition mode");
+
+    AddChoice("mode.default", "Default mode");
+    SetParameterDescription("mode.default", "Default superimposition mode : "
+      "uses any projection reference or sensor model found in the images");
+
+    AddChoice("mode.phr", "Pleiades mode");
+    SetParameterDescription("mode.phr", "Pleiades superimposition mode, "
+      "designed for the case of a P+XS bundle in SENSOR geometry. It uses"
+      " a simple transform : a scaling and a residual translation.");
+
     AddParameter(ParameterType_Float,        "lms",   "Spacing of the deformation field");
     SetParameterDescription("lms"," Spacing of the deformation field. Default is 10 times the PAN image spacing.");
     AddParameter(ParameterType_OutputImage,  "out",   "Output image");
@@ -89,7 +112,50 @@

   void DoUpdateParameters()
   {
-    // Nothing to do here : all parameters are independent
+    if (!HasUserValue("mode") &&
+        GetParameterInt("mode") == Mode_Default &&
+        HasValue("inp") &&
+        HasValue("inxs"))
+      {
+      FloatVectorImageType* refImage = GetParameterImage("inp");
+      FloatVectorImageType* movingImage = GetParameterImage("inxs");
+      bool isRefPHR = false;
+      bool isMovingPHR = false;
+
+      otb::PleiadesImageMetadataInterface::Pointer phrIMI =
+        otb::PleiadesImageMetadataInterface::New();
+      phrIMI->SetMetaDataDictionary(refImage->GetMetaDataDictionary());
+      isRefPHR = phrIMI->CanRead();
+
+      phrIMI->SetMetaDataDictionary(movingImage->GetMetaDataDictionary());
+      isMovingPHR = phrIMI->CanRead();
+
+      if (isRefPHR && isMovingPHR)
+        {
+        ImageKeywordlist kwlPan;
+        ImageKeywordlist kwlXS;
+
+        itk::ExposeMetaData<ImageKeywordlist>(
+          refImage->GetMetaDataDictionary(),
+          MetaDataKey::OSSIMKeywordlistKey,
+          kwlPan);
+
+        itk::ExposeMetaData<ImageKeywordlist>(
+          movingImage->GetMetaDataDictionary(),
+          MetaDataKey::OSSIMKeywordlistKey,
+          kwlXS);
+
+        // Get geometric processing
+        std::string panProcessing = kwlPan.GetMetadataByKey("support_data.processing_level");
+        std::string xsProcessing = kwlXS.GetMetadataByKey("support_data.processing_level");
+
+        if (panProcessing.compare("SENSOR") == 0 &&
+            xsProcessing.compare("SENSOR") == 0)
+          {
+          SetParameterInt("mode",Mode_PHR);
+          }
+        }
+      }
   }

   void DoExecute()
@@ -116,15 +182,25 @@

     typedef otb::BCOInterpolateImageFunction<FloatVectorImageType> InterpolatorType;
     typedef otb::GenericRSResampleImageFilter<FloatVectorImageType, FloatVectorImageType>  ResamplerType;
+    typedef otb::StreamingResampleImageFilter<FloatVectorImageType, FloatVectorImageType>  BasicResamplerType;
     typedef otb::SimpleRcsPanSharpeningFusionImageFilter<FloatImageType, FloatVectorImageType, FloatVectorImageType> FusionFilterType;

     // Resample filter
     ResamplerType::Pointer    resampler = ResamplerType::New();
     m_Ref.push_back(resampler.GetPointer());
+
+    BasicResamplerType::Pointer basicResampler = BasicResamplerType::New();
+    m_Ref.push_back(basicResampler.GetPointer());

     InterpolatorType::Pointer interpolator = InterpolatorType::New();
     resampler->SetInterpolator(interpolator);
-
+    basicResampler->SetInterpolator(interpolator);
+
+    // Fusion filter
+    FusionFilterType::Pointer  fusionFilter = FusionFilterType::New();
+    m_Ref.push_back(fusionFilter.GetPointer());
+    fusionFilter->SetPanInput(panchro);
+
     // Setup the DEM Handler
     otb::Wrapper::ElevationParametersHandler::SetupDEMHandlerFromElevationParameters(this,"elev");

@@ -134,47 +210,126 @@
     FloatVectorImageType::SizeType    size = panchro->GetLargestPossibleRegion().GetSize();
     FloatVectorImageType::PointType   origin = panchro->GetOrigin();

-    if(IsParameterEnabled("lms") && HasValue("lms"))
-      {
-      double defScalarSpacing = GetParameterFloat("lms");
-      otbAppLogINFO(<< "Generating coarse deformation field (spacing="<<defScalarSpacing<<")" << std::endl);
-      FloatVectorImageType::SpacingType defSpacing;
-
-      defSpacing[0] = defScalarSpacing;
-      defSpacing[1] = defScalarSpacing;
-
-      resampler->SetDisplacementFieldSpacing(defSpacing);
-      }
-    else
-      {
-      FloatVectorImageType::SpacingType defSpacing;
-      defSpacing[0]=10*spacing[0];
-      defSpacing[1]=10*spacing[1];
-      resampler->SetDisplacementFieldSpacing(defSpacing);
-      }
-
     FloatVectorImageType::PixelType defaultValue;
     itk::NumericTraits<FloatVectorImageType::PixelType>::SetLength(defaultValue, xs->GetNumberOfComponentsPerPixel());

-    resampler->SetInput(xs);
-    resampler->SetOutputOrigin(origin);
-    resampler->SetOutputSpacing(spacing);
-    resampler->SetOutputSize(size);
-    resampler->SetOutputStartIndex(start);
-    resampler->SetOutputKeywordList(panchro->GetImageKeywordlist());
-    resampler->SetOutputProjectionRef(panchro->GetProjectionRef());
-    resampler->SetEdgePaddingValue(defaultValue);
-
-    resampler->UpdateOutputInformation();
-    FloatVectorImageType::Pointer xsResample = resampler->GetOutput();
-
-    FusionFilterType::Pointer  fusionFilter = FusionFilterType::New();
-    m_Ref.push_back(fusionFilter.GetPointer());
-
-    fusionFilter->SetPanInput(panchro);
-    fusionFilter->SetXsInput(resampler->GetOutput());
-    fusionFilter->UpdateOutputInformation();
-
+    switch ( GetParameterInt("mode") )
+    {
+    case Mode_Default:
+      {
+      if(IsParameterEnabled("lms") && HasValue("lms"))
+        {
+        double defScalarSpacing = GetParameterFloat("lms");
+        otbAppLogINFO(<< "Generating coarse deformation field (spacing="<<defScalarSpacing<<")" << std::endl);
+        FloatVectorImageType::SpacingType defSpacing;
+
+        defSpacing[0] = defScalarSpacing;
+        defSpacing[1] = defScalarSpacing;
+
+        resampler->SetDisplacementFieldSpacing(defSpacing);
+        }
+      else
+        {
+        FloatVectorImageType::SpacingType defSpacing;
+        defSpacing[0]=10*spacing[0];
+        defSpacing[1]=10*spacing[1];
+        resampler->SetDisplacementFieldSpacing(defSpacing);
+        }
+
+      resampler->SetInput(xs);
+      resampler->SetOutputOrigin(origin);
+      resampler->SetOutputSpacing(spacing);
+      resampler->SetOutputSize(size);
+      resampler->SetOutputStartIndex(start);
+      resampler->SetOutputKeywordList(panchro->GetImageKeywordlist());
+      resampler->SetOutputProjectionRef(panchro->GetProjectionRef());
+      resampler->SetEdgePaddingValue(defaultValue);
+      //resampler->UpdateOutputInformation();
+      // TODO : set the Input keywordlist and ProjRef manually ??
+      fusionFilter->SetXsInput(resampler->GetOutput());
+      //fusionFilter->UpdateOutputInformation();
+      }
+      break;
+    case Mode_PHR:
+      {
+      otbAppLogINFO("Using the PHR mode");
+      // Setup a simple affine transform using PHR support data
+      ImageKeywordlist kwlPan;
+      ImageKeywordlist kwlXS;
+
+      itk::ExposeMetaData<ImageKeywordlist>(
+        panchroV->GetMetaDataDictionary(),
+        MetaDataKey::OSSIMKeywordlistKey,
+        kwlPan);
+
+      itk::ExposeMetaData<ImageKeywordlist>(
+        xs->GetMetaDataDictionary(),
+        MetaDataKey::OSSIMKeywordlistKey,
+        kwlXS);
+
+      // Compute time delta
+      std::string strStartTimePan = kwlPan.GetMetadataByKey("support_data.time_range_start");
+      std::string strStartTimeXS = kwlXS.GetMetadataByKey("support_data.time_range_start");
+
+      DateTimeAdapter::Pointer startTimePan = DateTimeAdapter::New();
+      DateTimeAdapter::Pointer startTimeXS = DateTimeAdapter::New();
+
+      startTimePan->SetFromIso8601(strStartTimePan);
+      startTimeXS->SetFromIso8601(strStartTimeXS);
+
+      double timeDelta = startTimeXS->GetDeltaInSeconds(startTimePan);
+
+      // Retrieve line period in Pan
+      std::string tmpStr = kwlPan.GetMetadataByKey("support_data.line_period");
+      double linePeriodPan = atof(tmpStr.c_str());
+
+      // Retrieve column start
+      tmpStr = kwlPan.GetMetadataByKey("support_data.swath_first_col");
+      int colStartPan = atoi(tmpStr.c_str());
+      tmpStr = kwlXS.GetMetadataByKey("support_data.swath_first_col");
+      int colStartXS = atoi(tmpStr.c_str());
+
+      // Compute shift between MS and P (in Pan pixels)
+      int lineShift_MS_P =int(vcl_floor((timeDelta/(linePeriodPan/1000))  + 0.5));
+      int colShift_MS_P = colStartXS*4 - colStartPan - 4;
+
+      // Apply the scaling
+      typedef itk::ScalableAffineTransform<double, 2>  TransformType;
+      TransformType::Pointer transform = TransformType::New();
+      transform->Scale(4.0);
+
+      // Resample filter assumes the origin is attached to the pixel center
+      // in order to keep the top left corners unchanged, apply a 3/2 pixels
+      // shift in each direction
+      // TODO : clarify formula, the '-1.0' for columns is strange
+      TransformType::OutputVectorType offset;
+      offset[0] = 1.5 + static_cast<double>(colShift_MS_P);
+      offset[1] = 1.5 + static_cast<double>(lineShift_MS_P);
+      transform->Translate(offset);
+
+      // Invert the transform as the resampler filter expect an output-to-input
+      // transform (we have computed the input-to-output transform)
+      TransformType::Pointer realTransform = TransformType::New();
+      transform->GetInverse(realTransform);
+      basicResampler->SetTransform(realTransform);
+
+      basicResampler->SetInput(xs);
+      basicResampler->SetOutputOrigin(origin);
+      basicResampler->SetOutputSpacing(spacing);
+      basicResampler->SetOutputSize(size);
+      basicResampler->SetOutputStartIndex(start);
+      basicResampler->SetEdgePaddingValue(defaultValue);
+
+      fusionFilter->SetXsInput(basicResampler->GetOutput());
+      }
+      break;
+    default:
+      {
+      otbAppLogWARNING("Unknown mode");
+      }
+      break;
+    }
+
     SetParameterOutputImage("out", fusionFilter->GetOutput());
   }


AV_ERROR added

AV_ERROR added

--- AssocVector.hpp
+++ AssocVector.hpp
@@ -40,10 +40,12 @@
     #define AV_PRECONDITION( condition )    if( (bool)( condition ) == false ){int*i=0;*i=0;}
     #define AV_CHECK( condition )           if( (bool)( condition ) == false ){int*i=0;*i=0;}
     #define AV_POSTCONDITION( condition )   if( (bool)( condition ) == false ){int*i=0;*i=0;}
+    #define AV_ERROR()                      if( true )                        {int*i=0;*i=0;}
 #else
     #define AV_PRECONDITION( condition )    (void)( 0 );
     #define AV_CHECK( condition )           (void)( 0 );
     #define AV_POSTCONDITION( condition )   (void)( 0 );
+    #define AV_ERROR()                      (void)( 0 );
 #endif

 namespace util
@@ -229,8 +231,6 @@
         , _OutputPtr first2
     )
     {
-        AV_PRECONDITION( first <= last );
-
         if( first < first2 ){
             util::move_backward( first, last, first2 + ( last - first ) );
         }
@@ -1073,7 +1073,7 @@
                     return true;
                 }

-                AV_CHECK( false );
+                AV_ERROR();

                 return false;
             }
@@ -1193,7 +1193,7 @@
                     return true;
                 }

-                AV_CHECK( false );
+                AV_ERROR();

                 return false;
             }
@@ -1484,7 +1484,7 @@
                     return true;
                 }

-                AV_CHECK( false );
+                AV_ERROR();

                 return false;
             }
@@ -1592,7 +1592,7 @@
                         return true;
                     }

-                    AV_CHECK( false );
+                    AV_ERROR();

                     return false;
                 }
@@ -1603,7 +1603,7 @@
                         return true;
                     }

-                    AV_CHECK( false );
+                    AV_ERROR();

                     return false;
                 }
@@ -1616,7 +1616,7 @@
                     return true;
                 }

-                AV_CHECK( false );
+                AV_ERROR();

                 return false;
             }
@@ -1825,7 +1825,7 @@
                 _currentInBuffer.try_increment( _container );
             }
             else{
-                AV_CHECK( false );
+                AV_ERROR();
             }

             _current.setLower( _currentInStorage, _currentInBuffer, _container );
@@ -1856,6 +1856,7 @@
             )
             {
                 AV_POSTCONDITION( _current.validate( _currentInStorage, _currentInBuffer, _container ) );
+
                 return * this;
             }

@@ -1866,6 +1867,7 @@
                 _current = _currentInBuffer;

                 AV_POSTCONDITION( _current.validate( _currentInStorage, _currentInBuffer, _container ) );
+
                 return * this;
             }

@@ -1876,6 +1878,7 @@
                 _current = _currentInStorage;

                 AV_POSTCONDITION( _current.validate( _currentInStorage, _currentInBuffer, _container ) );
+
                 return * this;
             }

@@ -1907,6 +1910,7 @@
             }

             AV_POSTCONDITION( _current.validate( _currentInStorage, _currentInBuffer, _container ) );
+
             return * this;
         }

@@ -2028,7 +2032,7 @@
             else
             if( _currentInStorage && !_currentInBuffer && _currentInErased && !_current )
             {
-                AV_CHECK( false );
+                AV_ERROR();

                 return false;
             }
@@ -2089,7 +2093,7 @@
             }
             else
             {
-                AV_CHECK( false );
+                AV_ERROR();

                 return false;
             }
@@ -2944,7 +2948,7 @@
                 _currentInBuffer.increment( _container );
             }
             else{
-                AV_CHECK( false );
+                AV_ERROR();
             }

             _current.setGreater( _currentInStorage, _currentInBuffer, _container );
@@ -3014,6 +3018,7 @@
             }

             //AV_POSTCONDITION( _current.validate( _currentInStorage, _currentInBuffer, _container ) );
+
             return * this;
         }

@@ -3215,14 +3220,14 @@
         {
             if( _current == 0 )
             {
-                AV_CHECK( false );
+                AV_ERROR();

                 return false;
             }

             if( _inStorage == 0 && ( _inBuffer == 0 || _inErased == 0 ) )
             {
-                AV_CHECK( false );
+                AV_ERROR();

                 return false;
             }
@@ -3774,7 +3779,6 @@
     }

     AV_POSTCONDITION( _buffer.empty() );
-
     AV_POSTCONDITION( validate() );
 }

@@ -4586,7 +4590,7 @@
 {
     if( util::is_sorted( _storage.begin(), _storage.end(), value_comp() ) == false )
     {
-        AV_CHECK( false );
+        AV_ERROR();

         return false;
     }
@@ -4609,7 +4613,7 @@

     if( util::is_sorted( _buffer.begin(), _buffer.end(), value_comp() ) == false )
     {
-        AV_CHECK( false );
+        AV_ERROR();

         return false;
     }
@@ -4624,7 +4628,7 @@
         )
     )
     {
-        AV_CHECK( false );
+        AV_ERROR();

         return false;
     }
@@ -4653,7 +4657,7 @@
         ) == false
     )
     {
-        AV_CHECK( false );
+        AV_ERROR();

         return false;
     }


change to 0.9.192.

change to 0.9.192.

--- trunk/src/core/srs_core.hpp
+++ trunk/src/core/srs_core.hpp
@@ -31,7 +31,7 @@
 // current release version
 #define VERSION_MAJOR "0"
 #define VERSION_MINOR "9"
-#define VERSION_REVISION "191"
+#define VERSION_REVISION "192"
 #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
 // server info.
 #define RTMP_SIG_SRS_KEY "SRS"


Updated test_video_pos.cpp

Updated test_video_pos.cpp

--- modules/highgui/test/test_video_pos.cpp
+++ modules/highgui/test/test_video_pos.cpp
@@ -66,7 +66,7 @@
  for (int i = 0; i < framecount; ++i)
  {
    cv::Mat mat(480, 640, CV_8UC1);
-   size_t n = 32, tmp = i;
+   size_t n = 8, tmp = i;

    vector<char> tmp_code; tmp_code.clear();

@@ -113,10 +113,12 @@
     size_t n_format = sizeof(format)/sizeof(format[0]),
            n_codec = sizeof(codec)/sizeof(codec[0]);

+    int n_frames = 256;
+
     for (size_t i = 0; i < n_format; ++i)
     for (size_t j = 0; j < n_codec; ++j)
     {
-      CreateTestVideo(format[i], CV_FOURCC(codec[j][0], codec[j][1], codec[j][2], codec[j][3]), 125);
+      CreateTestVideo(format[i], CV_FOURCC(codec[j][0], codec[j][1], codec[j][2], codec[j][3]), n_frames);

       stringstream s; s << CV_FOURCC(codec[j][0], codec[j][1], codec[j][2], codec[j][3]); //codec_bmp_tags[j].tag;

@@ -128,9 +130,9 @@

       if (!cap.isOpened())
       {
-        ts->printf(ts->LOG, "\nFile: %s\n", file_path.c_str());
+        ts->printf(ts->LOG, "\n\nFile: %s\n", file_path.c_str());
         ts->printf(ts->LOG, "\nVideo codec: %s\n", string(&codec[j][0], 4).c_str());
-        ts->printf(ts->LOG, "\nError: cannot read video file.\n");
+        ts->printf(ts->LOG, "\nError: cannot read video file.");
         ts->set_failed_test_info(ts->FAIL_INVALID_TEST_DATA);
         error = true;
       }
@@ -139,11 +141,11 @@

       int N = cap.get(CV_CAP_PROP_FRAME_COUNT);

-      if (N != 125)
+      if (N != n_frames)
       {
         if (!error)
         {
-            ts->printf(ts->LOG, "\nFile: %s\n", file_path.c_str());
+            ts->printf(ts->LOG, "\n\nFile: %s\n", file_path.c_str());
             ts->printf(ts->LOG, "\nVideo codec: %s\n", string(&codec[j][0], 4).c_str());
             error = true;
         }
@@ -170,17 +172,17 @@
         {
             if (!error)
             {
-                ts->printf(ts->LOG, "\nFile: %s\n", file_path.c_str());
+                ts->printf(ts->LOG, "\n\nFile: %s\n", file_path.c_str());
                 ts->printf(ts->LOG, "\nVideo codec: %s\n", string(&codec[j][0], 4).c_str());
                 error = true;
             }
             ts->printf(ts->LOG, "\nError: cannot read a frame in position %d.\n", idx[k]);
-            ts->set_failed_test_info(ts->FAIL_EXCEPTION);
+            ts->set_failed_test_info(ts->FAIL_INVALID_OUTPUT);
         }

         const double thresh = 100;

-        const size_t n = 32, w = img.rows/n;
+        const size_t n = 8, w = img.rows/n;

         int index = 0, deg = n-1;

@@ -199,20 +201,22 @@
         {
             if (!error)
             {
-                ts->printf(ts->LOG, "\nFile: %s\n", file_path.c_str());
+                ts->printf(ts->LOG, "\n\nFile: %s\n", file_path.c_str());
                 ts->printf(ts->LOG, "\nVideo codec: %s\n\n", string(&codec[j][0], 4).c_str());
                 error = true;
             }
-            ts->printf(ts->LOG, "Required position: %d   Returned position: %d FAILED\n", idx[k], index);
+            ts->printf(ts->LOG, "Required position: %d   Returned position: %d\n", idx[k], index);
             ts->set_failed_test_info(ts->FAIL_INVALID_OUTPUT);
             failed++;
         }
       }

-      if (!error) ts->printf(ts->LOG, "\nFile: %s\n", file_path.c_str());
-
-      ts->printf(ts->LOG, "\nSuccessfull iterations: %d(%d%%)   Failed iterations: %d(%d%%)\n", N-failed, (N-failed)*100/N, failed, failed*100/N);
-      ts->printf(ts->LOG, "\n----------\n");
+      if (!error) { ts->printf(ts->LOG, "\n\nFile: %s\n", file_path.c_str());
+                    ts->printf(ts->LOG, "\nVideo codec: %s\n", string(&codec[j][0], 4).c_str()); }
+
+      const string status = failed ? "FAILED" : "OK";
+      ts->printf(ts->LOG, "\nSuccessfull iterations: %d(%d%%)   Failed iterations: %d(%d%%)   %s\n", N-failed, (N-failed)*100/N, failed, failed*100/N, status.c_str());
+      if( i < n_format-1 || j < n_codec-1 ) ts->printf(ts->LOG, "\n----------");
     }

 #endif


Get the NTuple for Lambda-Lambda

Get the NTuple for Lambda-Lambda

--- PWGCF/FEMTOSCOPY/FemtoDream/AliAnalysisTaskGeorgiosNTuple.cxx
+++ PWGCF/FEMTOSCOPY/FemtoDream/AliAnalysisTaskGeorgiosNTuple.cxx
@@ -747,8 +747,8 @@

   }
   //fill Tree
-  if(fTnv0>0&&fTnCascade>0) fGeorgiosTree->Fill(); //Select here events with at least on Xi and one Lambda
-  //if(fTnv0>1) fGeorgiosTree->Fill();
+  //if(fTnv0>0&&fTnCascade>0) fGeorgiosTree->Fill(); //Select here events with at least on Xi and one Lambda
+  if(fTnv0>1) fGeorgiosTree->Fill();

   //pair cleaner
   fPairCleaner->ResetArray();


erase improved

erase improved

--- AssocVector.hpp
+++ AssocVector.hpp
@@ -1396,11 +1396,6 @@
     void merge();

 private:
-    //
-    // find
-    //
-    typename _Storage::iterator find( _Storage & container, key_type const & k );
-    typename _Storage::const_iterator find( _Storage const & container, key_type const & k )const;

     //
     // merge
@@ -2252,7 +2247,8 @@
         }
     }

-    typename _Storage::iterator const foundInStorage = find( _storage, k );
+    typename _Storage::iterator const foundInStorage
+        = array::findInSorted( _storage.begin(), _storage.end(), k, value_comp() );

     {//find or insert to buffer
         if( foundInStorage == _storage.end() ){
@@ -2302,12 +2298,14 @@
 std::size_t
 AssocVector< _Key, _Mapped, _Cmp, _Alloc >::erase( key_type const & k )
 {
-    typename _Storage::iterator const foundInStorage = find( _storage, k );
+    typename _Storage::iterator const foundInStorage
+        = array::findInSorted( _storage.begin(), _storage.end(), k, value_comp() );

     {//erase from _buffer
         if( foundInStorage == _storage.end() )
         {
-            typename _Storage::iterator const foundInBuffer = find( _buffer, k );
+            typename _Storage::iterator const foundInBuffer
+                = array::findInSorted( _buffer.begin(), _buffer.end(), k, value_comp() );

             if( foundInBuffer == _buffer.end() )
             {
@@ -2426,21 +2424,6 @@
     std::swap( _cmp, other._cmp );

     std::swap( _allocator, other._allocator );
-}
-
-template<
-      typename _Key
-    , typename _Mapped
-    , typename _Cmp
-    , typename _Alloc
->
-typename AssocVector< _Key, _Mapped, _Cmp, _Alloc >::_Storage::iterator
-AssocVector< _Key, _Mapped, _Cmp, _Alloc >::find(
-      _Storage & container
-    , key_type const & k
-)
-{
-    return array::findInSorted( container.begin(), container.end(), k, value_comp() );
 }

 template<
@@ -2529,21 +2512,6 @@
     , typename _Cmp
     , typename _Alloc
 >
-typename AssocVector< _Key, _Mapped, _Cmp, _Alloc >::_Storage::const_iterator
-AssocVector< _Key, _Mapped, _Cmp, _Alloc >::find(
-      _Storage const & container
-    , key_type const & k
-)const
-{
-    return array::findInSorted( container.begin(), container.end(), value_type_mutable( k, mapped_type() ), value_comp() );
-}
-
-template<
-      typename _Key
-    , typename _Mapped
-    , typename _Cmp
-    , typename _Alloc
->
 std::pair< typename AssocVector< _Key, _Mapped, _Cmp, _Alloc >::_Storage::iterator, bool >
 AssocVector< _Key, _Mapped, _Cmp, _Alloc >::findOrInsertToBuffer(
       _Key const & k


CLR also follows the NEGX/NEG/NOT pattern.

--- Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp
+++ Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp
@@ -349,13 +349,13 @@
 					}
 				})

-				Duplicate(NEGb, NEGXb)	Duplicate(NOTb, NEGXb)
+				Duplicate(CLRb, NEGXb)	Duplicate(NEGb, NEGXb)	Duplicate(NOTb, NEGXb)
 				StdCASE(NEGXb, 		perform_state_ = Perform_np);

-				Duplicate(NEGw, NEGXw)	Duplicate(NOTw, NEGXw)
+				Duplicate(CLRw, NEGXw)	Duplicate(NEGw, NEGXw)	Duplicate(NOTw, NEGXw)
 				StdCASE(NEGXw, 		perform_state_ = Perform_np);

-				Duplicate(NEGl, NEGXl)	Duplicate(NOTl, NEGXl)
+				Duplicate(CLRl, NEGXl)	Duplicate(NEGl, NEGXl)	Duplicate(NOTl, NEGXl)
 				StdCASE(NEGXl,
 					if(instruction_.mode(0) == Mode::DataRegisterDirect) {
 						perform_state_ = Perform_np_n;


Add enough of state to [sort-of] pass the first test.

i.e. until the processor overruns, as it is permitted to do, and can't handle the second instruction.

--- Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp
+++ Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp
@@ -306,8 +306,8 @@

 void ProcessorBase::did_update_status() {
 	// Shuffle the stack pointers.
-	stack_pointers_[is_supervisor_] = registers_[7];
-	registers_[7] = stack_pointers_[int(status_.is_supervisor)];
+	stack_pointers_[is_supervisor_] = registers_[15];
+	registers_[15] = stack_pointers_[int(status_.is_supervisor)];
 	is_supervisor_ = int(status_.is_supervisor);
 }

@@ -315,11 +315,45 @@

 template <class BusHandler, bool dtack_is_implicit, bool permit_overrun, bool signal_will_perform>
 CPU::MC68000Mk2::State Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perform>::get_state() {
-	return CPU::MC68000Mk2::State();
+	CPU::MC68000Mk2::State state;
+
+	// This isn't true, but will ensure that both stack_pointers_ have their proper values.
+	did_update_status();
+
+	for(int c = 0; c < 7; c++) {
+		state.registers.data[c] = registers_[c].l;
+		state.registers.address[c] = registers_[c + 8].l;
+	}
+	state.registers.data[7] = registers_[7].l;
+
+	state.registers.program_counter = program_counter_.l;
+	state.registers.status = status_.status();
+	state.registers.user_stack_pointer = stack_pointers_[0].l;
+	state.registers.supervisor_stack_pointer = stack_pointers_[1].l;
+
+	return state;
 }

 template <class BusHandler, bool dtack_is_implicit, bool permit_overrun, bool signal_will_perform>
-void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perform>::set_state(const CPU::MC68000Mk2::State &) {
+void Processor<BusHandler, dtack_is_implicit, permit_overrun, signal_will_perform>::set_state(const CPU::MC68000Mk2::State &state) {
+	// Copy registers and the program counter.
+	for(int c = 0; c < 7; c++) {
+		registers_[c].l = state.registers.data[c];
+		registers_[c + 8].l = state.registers.address[c];
+	}
+	registers_[7].l = state.registers.data[7];
+	program_counter_.l = state.registers.program_counter;
+
+	// Set status first in order to get the proper is-supervisor flag in place.
+	status_.set_status(state.registers.status);
+
+	// Update stack pointers, being careful to copy the right one.
+	stack_pointers_[0].l = state.registers.user_stack_pointer;
+	stack_pointers_[1].l = state.registers.supervisor_stack_pointer;
+	registers_[15] = stack_pointers_[is_supervisor_];
+
+	// Ensure the local is-supervisor flag is updated.
+	did_update_status();
 }


Fix interrupt request address.

Fix interrupt request address.

--- Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp
+++ Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp
@@ -531,7 +531,7 @@
 			Access(captured_status_);			// ns

 			// Do the interrupt cycle, to obtain a vector.
-			temporary_address_.l = 0xffff'fff8 | uint32_t(captured_interrupt_level_);
+			temporary_address_.l = 0xffff'fff1 | uint32_t(captured_interrupt_level_ << 1);
 			SetupDataAccess(0, Microcycle::InterruptAcknowledge);
 			SetDataAddress(temporary_address_.l);
 			Access(temporary_value_.low);		// ni
@@ -540,6 +540,8 @@
 			if(vpa_) {
 				temporary_value_.w = uint16_t(InstructionSet::M68k::Exception::InterruptAutovectorBase - 1 + captured_interrupt_level_);
 			}
+
+			// TODO: if bus error is set, treat interrupt as spurious.

 			IdleBus(3);			// n- n


Extend MOVE.b fix to cover MOVE.w.

Extend MOVE.b fix to cover MOVE.w.

--- Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp
+++ Processors/68000Mk2/Implementation/68000Mk2Implementation.hpp
@@ -192,10 +192,16 @@
 	PEA_np_nS_ns,		// Used to complete (An), (d16, [An/PC]) and (d8, [An/PC], Xn).
 	PEA_np_nS_ns_np,	// Used to complete (xxx).w and (xxx).l

-	AddressingDispatch(MOVE_b),	MOVE_b_AbsoluteLong_prefetch_first,
+	MOVE_b, MOVE_w,
+	AddressingDispatch(MOVE_bw),	MOVE_bw_AbsoluteLong_prefetch_first,
 };

 #undef AddressingDispatch
+
+/// @returns The proper select lines for @c instruction's operand size, assuming it is either byte or word.
+template <typename InstructionT> Microcycle::OperationT data_select(const InstructionT &instruction) {
+	return Microcycle::OperationT(1 << int(instruction.operand_size()));
+}

 // MARK: - The state machine.

@@ -748,7 +754,7 @@

 				StdCASE(MOVEb,		perform_state_ = MOVE_b);
 				Duplicate(MOVEAw, MOVEw)
-				StdCASE(MOVEw,		perform_state_ = MOVE);
+				StdCASE(MOVEw,		perform_state_ = MOVE_w);
 				Duplicate(MOVEAl, MOVEl)
 				StdCASE(MOVEl,		perform_state_ = MOVE);

@@ -1115,8 +1121,20 @@
 			operand_[next_operand_] = registers_[instruction_.lreg(next_operand_)];
 		MoveToNextOperand(FetchOperand_l);

-		BeginStateMode(MOVE_b, DataRegisterDirect):
-			registers_[instruction_.lreg(1)].b = operand_[1].b;
+		BeginStateMode(MOVE_bw, AddressRegisterDirect):
+			registers_[instruction_.reg(1)] = operand_[1];
+			Prefetch();
+		MoveToStateSpecific(Decode);
+
+		BeginStateMode(MOVE_bw, DataRegisterDirect): {
+			const uint32_t write_mask = size_masks[int(instruction_.operand_size())];
+			const int reg = instruction_.lreg(1);
+
+			registers_[reg].l =
+				(operand_[1].l & write_mask) |
+				(registers_[reg].l & ~write_mask);
+			}
+
 			Prefetch();
 		MoveToStateSpecific(Decode);

@@ -1141,10 +1159,10 @@
 			Access(operand_[next_operand_].low);	// nr
 		MoveToNextOperand(FetchOperand_bw);

-		BeginStateMode(MOVE_b, AddressRegisterIndirect):
+		BeginStateMode(MOVE_bw, AddressRegisterIndirect):
 			effective_address_[1].l = registers_[8 + instruction_.reg(1)].l;
 			SetDataAddress(effective_address_[1].l);
-			SetupDataAccess(0, Microcycle::SelectByte);
+			SetupDataAccess(0, data_select(instruction_));

 			Access(operand_[next_operand_].low);	// nw
 			Prefetch();								// np
@@ -1186,13 +1204,15 @@
 			Access(operand_[next_operand_].low);	// nr
 		MoveToNextOperand(FetchOperand_bw);

-		BeginStateMode(MOVE_b, AddressRegisterIndirectWithPostincrement):
+		BeginStateMode(MOVE_bw, AddressRegisterIndirectWithPostincrement):
 			effective_address_[1].l = registers_[8 + instruction_.reg(1)].l;
-			registers_[8 + instruction_.reg(1)].l += address_increments[0][instruction_.reg(1)];
+			registers_[8 + instruction_.reg(next_operand_)].l +=
+				address_increments[int(instruction_.operand_size())][instruction_.reg(1)];
+
 			SetDataAddress(effective_address_[1].l);
-			SetupDataAccess(0, Microcycle::SelectByte);
-
+			SetupDataAccess(0, data_select(instruction_));
 			Access(operand_[next_operand_].low);	// nw
+
 			Prefetch();								// np
 		MoveToStateSpecific(Decode);

@@ -1226,11 +1246,12 @@
 			Access(operand_[next_operand_].low);	// nr
 		MoveToNextOperand(FetchOperand_bw);

-		BeginStateMode(MOVE_b, AddressRegisterIndirectWithPredecrement):
-			registers_[8 + instruction_.reg(1)].l -= address_increments[0][instruction_.reg(1)];
+		BeginStateMode(MOVE_bw, AddressRegisterIndirectWithPredecrement):
+			registers_[8 + instruction_.reg(1)].l -= address_increments[int(instruction_.operand_size())][instruction_.reg(1)];
 			effective_address_[1].l = registers_[8 + instruction_.reg(1)].l;
+
 			SetDataAddress(effective_address_[1].l);
-			SetupDataAccess(0, Microcycle::SelectByte);
+			SetupDataAccess(0, data_select(instruction_));

 			Prefetch();								// np
 			Access(operand_[next_operand_].low);	// nw
@@ -1270,13 +1291,13 @@
 			Access(operand_[next_operand_].low);	// nr
 		MoveToNextOperand(FetchOperand_bw);

-		BeginStateMode(MOVE_b, AddressRegisterIndirectWithDisplacement):
+		BeginStateMode(MOVE_bw, AddressRegisterIndirectWithDisplacement):
 			effective_address_[1].l =
 				registers_[8 + instruction_.reg(1)].l +
 				uint32_t(int16_t(prefetch_.w));

 			SetDataAddress(effective_address_[1].l);
-			SetupDataAccess(0, Microcycle::SelectByte);
+			SetupDataAccess(0, data_select(instruction_));

 			Prefetch();								// np
 			Access(operand_[next_operand_].low);	// nw
@@ -1331,13 +1352,13 @@
 			Access(operand_[next_operand_].low);	// nr
 		MoveToNextOperand(FetchOperand_bw);

-		BeginStateMode(MOVE_b, ProgramCounterIndirectWithDisplacement):
+		BeginStateMode(MOVE_bw, ProgramCounterIndirectWithDisplacement):
 			effective_address_[1].l =
 				program_counter_.l - 2 +
 				uint32_t(int16_t(prefetch_.w));

 			SetDataAddress(effective_address_[1].l);
-			SetupDataAccess(0, Microcycle::SelectByte);
+			SetupDataAccess(0, data_select(instruction_));

 			Prefetch();								// np
 			Access(operand_[next_operand_].low);	// nw
@@ -1398,11 +1419,11 @@
 			Access(operand_[next_operand_].low);	// nr
 		MoveToNextOperand(FetchOperand_bw);

-		BeginStateMode(MOVE_b, AddressRegisterIndirectWithIndex8bitDisplacement):
+		BeginStateMode(MOVE_bw, AddressRegisterIndirectWithIndex8bitDisplacement):
 			effective_address_[1].l = d8Xn(registers_[8 + instruction_.reg(1)].l);

 			SetDataAddress(effective_address_[1].l);
-			SetupDataAccess(0, Microcycle::SelectByte);
+			SetupDataAccess(0, data_select(instruction_));

 			IdleBus(1);								// n
 			Prefetch();								// np
@@ -1462,11 +1483,11 @@
 			Access(operand_[next_operand_].low);	// nr
 		MoveToNextOperand(FetchOperand_bw);

-		BeginStateMode(MOVE_b, ProgramCounterIndirectWithIndex8bitDisplacement):
+		BeginStateMode(MOVE_bw, ProgramCounterIndirectWithIndex8bitDisplacement):
 			effective_address_[1].l = d8Xn(program_counter_.l - 2);

 			SetDataAddress(effective_address_[1].l);
-			SetupDataAccess(0, Microcycle::SelectByte);
+			SetupDataAccess(0, data_select(instruction_));

 			IdleBus(1);								// n
 			Prefetch();								// np
@@ -1527,11 +1548,11 @@
 			Access(operand_[next_operand_].low);	// nr
 		MoveToNextOperand(FetchOperand_bw);

-		BeginStateMode(MOVE_b, AbsoluteShort):
+		BeginStateMode(MOVE_bw, AbsoluteShort):
 			effective_address_[1].l = uint32_t(int16_t(prefetch_.w));

 			SetDataAddress(effective_address_[1].l);
-			SetupDataAccess(0, Microcycle::SelectByte);
+			SetupDataAccess(0, data_select(instruction_));

 			Prefetch();								// np
 			Access(operand_[next_operand_].low);	// nw
@@ -1577,19 +1598,19 @@
 			Access(operand_[next_operand_].low);	// nr
 		MoveToNextOperand(FetchOperand_bw);

-		BeginStateMode(MOVE_b, AbsoluteLong):
+		BeginStateMode(MOVE_bw, AbsoluteLong):
 			Prefetch();								// np

 			effective_address_[1].l = prefetch_.l;

 			SetDataAddress(effective_address_[1].l);
-			SetupDataAccess(0, Microcycle::SelectByte);
+			SetupDataAccess(0, data_select(instruction_));

 			switch(instruction_.mode(0)) {
 				case Mode::AddressRegisterDirect:
 				case Mode::DataRegisterDirect:
 				case Mode::ImmediateData:
-					MoveToStateSpecific(MOVE_b_AbsoluteLong_prefetch_first);
+					MoveToStateSpecific(MOVE_bw_AbsoluteLong_prefetch_first);

 				default: break;
 			}
@@ -1599,7 +1620,7 @@
 			Prefetch();								// np
 		MoveToStateSpecific(Decode);

-		BeginState(MOVE_b_AbsoluteLong_prefetch_first):
+		BeginState(MOVE_bw_AbsoluteLong_prefetch_first):
 			Prefetch();								// np
 			Access(operand_[next_operand_].low);	// nw
 			Prefetch();								// np
@@ -1876,7 +1897,11 @@

 		BeginState(MOVE_b):
 			PerformSpecific(MOVEb);
-		MoveToAddressingMode(MOVE_b, instruction_.mode(1));
+		MoveToAddressingMode(MOVE_bw, instruction_.mode(1));
+
+		BeginState(MOVE_w):
+			PerformSpecific(MOVEw);
+		MoveToAddressingMode(MOVE_bw, instruction_.mode(1));

 		//
 		// [ABCD/SBCD/SUBX/ADDX] (An)-, (An)-


- fix error: Function: gaus is not a TF3, is a TF1 - use auto

--- tutorials/eve/glplot_geom.C
+++ tutorials/eve/glplot_geom.C
@@ -13,8 +13,11 @@

    TEveUtil::Macro("show_extract.C");

-   TH3F *h31 = new TH3F("h31", "h31", 20, -3, 3, 20, -3, 3, 20, -3, 3);
-   h31->FillRandom("gaus", 20*20*20);
+   auto h31 = new TH3F("h31", "h31", 20, -3, 3, 20, -3, 3, 20, -3, 3);
+   auto gxy = new TF3("gaus2","xygaus");
+   gxy->SetParameters(1,0,1,0,0.3);
+   h31->FillRandom("gaus2");
+
    h31->SetFillColor(2);
    auto x = new TEvePlot3D("EvePlot - TH3F");
    x->SetPlot(h31, "glbox");


silly typo fixed

silly typo fixed

git-svn-id: 931ab4487dc05a11552de95f7d42b8249ade56b7@1251 a5045d30-4826-4484-9c7f-6e55a06ddc77

--- Code/GraphMol/DistGeomHelpers/BoundsMatrixBuilder.cpp
+++ Code/GraphMol/DistGeomHelpers/BoundsMatrixBuilder.cpp
@@ -564,7 +564,7 @@

       // when we have fused rings, it can happen that this isn't actually a 1-4 contact,
       // (this was the cause of sf.net bug 2835784) check that now:
-      if(mol.getBondBetweenAtoms(aid1,atm3->getIdx()) or
+      if(mol.getBondBetweenAtoms(aid1,atm3->getIdx()) ||
          mol.getBondBetweenAtoms(aid4,atm2->getIdx())) {
         return;
       }


RTSS: setShaderCachePath validate that the given path is writable.

--- Components/RTShaderSystem/src/OgreShaderGenerator.cpp
+++ Components/RTShaderSystem/src/OgreShaderGenerator.cpp
@@ -1244,8 +1244,20 @@
 		// Case this is a valid file path -> add as resource location in order to make sure that
 		// generated shaders could be loaded by the file system archive.
 		if (mShaderCachePath.empty() == false)
-		{
-			ResourceGroupManager::getSingleton().addResourceLocation(cachePath, "FileSystem", GENERATED_SHADERS_GROUP_NAME);
+		{
+			// Make sure this is a valid writable path.
+			String outTestFileName(mShaderCachePath + "ShaderGenerator.tst");
+			std::ofstream outFile(outTestFileName.c_str());
+
+			if (!outFile)
+			{
+				OGRE_EXCEPT(Exception::ERR_CANNOT_WRITE_TO_FILE,
+					"Could create output files in the given shader cache path '" + mShaderCachePath,
+					"ShaderGenerator::setShaderCachePath");
+			}
+			outFile.close();
+
+			ResourceGroupManager::getSingleton().addResourceLocation(mShaderCachePath, "FileSystem", GENERATED_SHADERS_GROUP_NAME);
 		}
 	}
 }


add missing initialize() method to LocalForceField for consistency

--- mjolnir/core/LocalForceField.hpp
+++ mjolnir/core/LocalForceField.hpp
@@ -36,6 +36,14 @@
     void emplace(interaction_ptr&& interaction)
     {
         interactions_.emplace_back(std::move(interaction));
+    }
+
+    void initialize(const system_type& sys, const real_type dt)
+    {
+        for(auto& item : this->interactions_)
+        {
+            item->initialize(sys, dt);
+        }
     }

     // to re-calculate parameters like temperature, ionic concentration, etc...


legion: fixing a typo

legion: fixing a typo

--- runtime/legion/runtime.cc
+++ runtime/legion/runtime.cc
@@ -15136,7 +15136,7 @@
       // Unpack the result
       context->unpack_remote_context(derez);
       // Then register it
-      UniqueID context_uid = context->get_context_id();
+      UniqueID context_uid = context->get_context_uid();
       register_remote_context(context_uid, context);
     }


INTEGRATION: CWS sb5 (1.14.66); FILE MERGED 2003/06/20 10:37:00 sb 1.14.66.1: #110345# Removed remote access content provider and stand-alone ucb executable.

--- ucb/workben/ucb/ucbdemo.cxx
+++ ucb/workben/ucb/ucbdemo.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: ucbdemo.cxx,v $
  *
- *  $Revision: 1.14 $
- *
- *  last change: $Author: kso $ $Date: 2002-10-02 13:53:16 $
+ *  $Revision: 1.15 $
+ *
+ *  last change: $Author: hr $ $Date: 2003-08-07 14:53:41 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -321,10 +321,10 @@
     virtual com::sun::star::uno::Any SAL_CALL queryInterface(
                                 const com::sun::star::uno::Type & rType)
     throw(uno::RuntimeException);
-    virtual void SAL_CALL acquire() throw (uno::RuntimeException)
+    virtual void SAL_CALL acquire() throw ()
     { OWeakObject::acquire(); }

-    virtual void SAL_CALL release() throw (uno::RuntimeException)
+    virtual void SAL_CALL release() throw ()
     { OWeakObject::release(); }

     virtual void SAL_CALL writeBytes(const uno::Sequence< sal_Int8 > & rData)
@@ -396,10 +396,10 @@
                                 const uno::Type & rType)
         throw(uno::RuntimeException);

-    virtual void SAL_CALL acquire() throw (uno::RuntimeException)
+    virtual void SAL_CALL acquire() throw ()
     { OWeakObject::acquire(); }

-    virtual void SAL_CALL release() throw (uno::RuntimeException)
+    virtual void SAL_CALL release() throw ()
     { OWeakObject::release(); }

     virtual void SAL_CALL push(const uno::Any & rStatus)
@@ -501,7 +501,6 @@
     uno::Reference< star::ucb::XContentIdentifierFactory > m_xIdFac;
     rtl::OUString m_aConfigurationKey1;
     rtl::OUString m_aConfigurationKey2;
-    rtl::OUString m_aRapConnect;
     sal_Bool m_bInited : 1;

     static rtl::OUString getUnoURL();
@@ -509,8 +508,7 @@
 public:
     Ucb( uno::Reference< lang::XMultiServiceFactory >& rxFactory,
          rtl::OUString const & rConfigurationKey1,
-         rtl::OUString const & rConfigurationKey2,
-         rtl::OUString const & rRapConnect );
+         rtl::OUString const & rConfigurationKey2 );
     ~Ucb();

     sal_Bool init();
@@ -546,12 +544,10 @@
 //-------------------------------------------------------------------------
 Ucb::Ucb( uno::Reference< lang::XMultiServiceFactory >& rxFactory,
           rtl::OUString const & rConfigurationKey1,
-          rtl::OUString const & rConfigurationKey2,
-          rtl::OUString const & rRapConnect )
+          rtl::OUString const & rConfigurationKey2 )
 : m_xFac( rxFactory ),
   m_aConfigurationKey1( rConfigurationKey1 ),
   m_aConfigurationKey2( rConfigurationKey2 ),
-  m_aRapConnect( rRapConnect ),
   m_bInited( sal_False )
 {
 }
@@ -568,108 +564,54 @@
         return sal_True;

     // Create auto configured UCB:
-    if (m_aRapConnect.getLength() == 0)
-    {
-        if (m_xFac.is())
-            try
+    if (m_xFac.is())
+        try
+        {
+            rtl::OUString aPipe;
+            vos::OSecurity().getUserIdent(aPipe);
+            uno::Sequence< uno::Any > aArgs(4);
+            aArgs[0] <<= m_aConfigurationKey1;
+            aArgs[1] <<= m_aConfigurationKey2;
+            aArgs[2] <<= rtl::OUString::createFromAscii("PIPE");
+            aArgs[3] <<= aPipe;
+#if 0
+            m_xProv
+                = uno::Reference< XContentProvider >(
+                      m_xFac->
+                          createInstanceWithArguments(
+                              rtl::OUString::createFromAscii(
+                                  "com.sun.star.ucb."
+                                      "UniversalContentBroker"),
+                              aArgs),
+                         uno::UNO_QUERY);
+#else
+            ::ucb::ContentBroker::initialize( m_xFac, aArgs );
+            m_xProv
+                = ::ucb::ContentBroker::get()->getContentProviderInterface();
+#endif
+        }
+        catch (uno::Exception const &) {}
+
+    if (m_xProv.is())
+    {
+        print("UCB initialized");
+        uno::Reference< star::ucb::XContentProviderManager > xProvMgr(
+            m_xProv, uno::UNO_QUERY);
+        if (xProvMgr.is())
+        {
+            print("Registered schemes:");
+            uno::Sequence< star::ucb::ContentProviderInfo >
+                aInfos(xProvMgr->queryContentProviders());
+            for (sal_Int32 i = 0; i < aInfos.getLength(); ++i)
             {
-                rtl::OUString aPipe;
-                vos::OSecurity().getUserIdent(aPipe);
-                uno::Sequence< uno::Any > aArgs(4);
-                aArgs[0] <<= m_aConfigurationKey1;
-                aArgs[1] <<= m_aConfigurationKey2;
-                aArgs[2] <<= rtl::OUString::createFromAscii("PIPE");
-                aArgs[3] <<= aPipe;
-#if 0
-                m_xProv
-                    = uno::Reference< XContentProvider >(
-                          m_xFac->
-                              createInstanceWithArguments(
-                                  rtl::OUString::createFromAscii(
-                                      "com.sun.star.ucb."
-                                          "UniversalContentBroker"),
-                                  aArgs),
-                          uno::UNO_QUERY);
-#else
-                ::ucb::ContentBroker::initialize( m_xFac, aArgs );
-                m_xProv
-                    = ::ucb::ContentBroker::get()->getContentProviderInterface();
-#endif
+                String aText(RTL_CONSTASCII_USTRINGPARAM("    "));
+                aText += UniString(aInfos[i].Scheme);
+                print(aText);
             }
-            catch (uno::Exception const &) {}
-
-        if (m_xProv.is())
-        {
-            print("UCB initialized");
-            uno::Reference< star::ucb::XContentProviderManager > xProvMgr(
-                m_xProv, uno::UNO_QUERY);
-            if (xProvMgr.is())
-            {
-                print("Registered schemes:");
-                uno::Sequence< star::ucb::ContentProviderInfo >
-                    aInfos(xProvMgr->queryContentProviders());
-                for (sal_Int32 i = 0; i < aInfos.getLength(); ++i)
-                {
-                    String aText(RTL_CONSTASCII_USTRINGPARAM("    "));
-                    aText += UniString(aInfos[i].Scheme);
-                    print(aText);
-                }
-            }
-        }
-        else
-            print("Error initializing UCB");
+        }
     }
     else
-    {
-        if (m_xFac.is())
-            try
-            {
-                uno::Reference< bridge::XUnoUrlResolver >
-                    xResolver(
-                        m_xFac->
-                            createInstance(
-                                rtl::OUString::createFromAscii(
-                                    "com.sun.star.bridge.UnoUrlResolver")),
-                        uno::UNO_QUERY);
-
-                uno::Reference< lang::XMultiServiceFactory > xRemoteFactory;
-                if (xResolver.is())
-                {
-                    rtl::OUStringBuffer aUrl;
-                    aUrl.appendAscii(RTL_CONSTASCII_STRINGPARAM("uno:"));
-                    aUrl.append(m_aRapConnect);
-                    aUrl.appendAscii(RTL_CONSTASCII_STRINGPARAM(
-                                         ";urp;UCB.Factory"));
-                    xRemoteFactory
-                        = uno::Reference< lang::XMultiServiceFactory >(
-                              xResolver->resolve(aUrl.makeStringAndClear()),
-                              uno::UNO_QUERY);
-                }
-
-                if (xRemoteFactory.is())
-                    xRemoteFactory
-                        = uno::Reference< lang::XMultiServiceFactory >(
-                              xRemoteFactory->
-                                  createInstance(
-                                      rtl::OUString::createFromAscii(
-                                          "com.sun.star.lang."
-                                              "ServiceManager")),
-                              uno::UNO_QUERY);
-
-                if (xRemoteFactory.is())
-                    m_xProv
-                        = uno::Reference< star::ucb::XContentProvider >(
-                              xRemoteFactory->
-                                  createInstance(
-                                      rtl::OUString::createFromAscii(
-                                          "com.sun.star.ucb."
-                                              "RemoteAccessContentProvider")),
-                              uno::UNO_QUERY);
-            }
-            catch (uno::Exception const &) {}
-
-        print(m_xProv.is() ? "RAP initialized" : "Error initializing RAP");
-    }
+        print("Error initializing UCB");

     m_bInited = m_xProv.is();
     return m_bInited;
@@ -724,9 +666,9 @@
     virtual uno::Any SAL_CALL queryInterface( const uno::Type & rType )
         throw( uno::RuntimeException );
     virtual void SAL_CALL acquire()
-        throw( uno::RuntimeException );
+        throw();
     virtual void SAL_CALL release()
-        throw( uno::RuntimeException );
+        throw();

      // XCommandEnvironemnt

@@ -777,7 +719,7 @@
 //----------------------------------------------------------------------------
 // virtual
 void SAL_CALL UcbTaskEnvironment::acquire()
-    throw( uno::RuntimeException )
+    throw()
 {
     OWeakObject::acquire();
 }
@@ -785,7 +727,7 @@
 //----------------------------------------------------------------------------
 // virtual
 void SAL_CALL UcbTaskEnvironment::release()
-    throw( uno::RuntimeException )
+    throw()
 {
     OWeakObject::release();
 }
@@ -991,10 +933,10 @@
         throw( uno::RuntimeException );
     virtual void SAL_CALL
     acquire()
-        throw( uno::RuntimeException );
+        throw();
     virtual void SAL_CALL
     release()
-        throw( uno::RuntimeException );
+        throw();

     // XEventListener
     // ( base interface of XContentEventListener, XPropertiesChangeListener )
@@ -1846,7 +1788,7 @@
 //----------------------------------------------------------------------------
 // virtual
 void SAL_CALL UcbContent::acquire()
-    throw( uno::RuntimeException )
+    throw()
 {
     OWeakObject::acquire();
 }
@@ -1854,7 +1796,7 @@
 //----------------------------------------------------------------------------
 // virtual
 void SAL_CALL UcbContent::release()
-    throw( uno::RuntimeException )
+    throw()
 {
     OWeakObject::release();
 }
@@ -2016,8 +1958,7 @@
     MyWin( Window *pParent, WinBits nWinStyle,
            uno::Reference< lang::XMultiServiceFactory >& rxFactory,
            rtl::OUString const & rConfigurationKey1,
-           rtl::OUString const & rConfigurationKey2,
-           rtl::OUString const & rRapConnect );
+           rtl::OUString const & rConfigurationKey2 );
     virtual ~MyWin();

     void Resize( void );
@@ -2031,12 +1972,11 @@
 MyWin::MyWin( Window *pParent, WinBits nWinStyle,
               uno::Reference< lang::XMultiServiceFactory >& rxFactory,
               rtl::OUString const & rConfigurationKey1,
-              rtl::OUString const & rConfigurationKey2,
-              rtl::OUString const & rRapConnect )
+              rtl::OUString const & rConfigurationKey2 )
 : WorkWindow( pParent, nWinStyle ),
   m_pTool( NULL ),
   m_pOutEdit( NULL ),
-  m_aUCB( rxFactory, rConfigurationKey1, rConfigurationKey2, rRapConnect ),
+  m_aUCB( rxFactory, rConfigurationKey1, rConfigurationKey2 ),
   m_pContent( NULL ),
   m_nFetchSize( 0 ),
   m_bTiming( false ),
@@ -2688,7 +2628,6 @@
                                          UCB_CONFIGURATION_KEY1_LOCAL));
     rtl::OUString aConfigurationKey2(rtl::OUString::createFromAscii(
                                          UCB_CONFIGURATION_KEY2_OFFICE));
-    rtl::OUString aRapConnect;

     USHORT nParams = Application::GetCommandLineParamCount();
     for ( USHORT n = 0; n < nParams; ++n )
@@ -2715,28 +2654,6 @@
                     = aParam.Copy(nSlash + 1);
             }
         }
-        else if (aParam.CompareIgnoreCaseToAscii("-rapconnect=",
-                                                 RTL_CONSTASCII_LENGTH(
-                                                     "-rapconnect="))
-                     == COMPARE_EQUAL)
-        {
-            aRapConnect = aParam.Copy(RTL_CONSTASCII_LENGTH("-rapconnect="));
-            rtl::OUString aUserId;
-            vos::OSecurity().getUserIdent(aUserId);
-            for (sal_Int32 nPos = 0;; nPos += aUserId.getLength())
-            {
-                nPos = aRapConnect.indexOf(rtl::OUString::createFromAscii(
-                                               "$(USERID)"),
-                                           nPos);
-                if (nPos == -1)
-                    break;
-                aRapConnect
-                    = aRapConnect.
-                          replaceAt(nPos,
-                                    RTL_CONSTASCII_LENGTH("$(USERID)"),
-                                    aUserId);
-            }
-        }
     }

     //////////////////////////////////////////////////////////////////////
@@ -2780,8 +2697,7 @@
     Help::EnableBalloonHelp();

     MyWin *pMyWin = new MyWin( NULL, WB_APP | WB_STDWORK, xFac,
-                               aConfigurationKey1, aConfigurationKey2,
-                               aRapConnect );
+                               aConfigurationKey1, aConfigurationKey2 );

     pMyWin->
         SetText(


Fix error threshhold in SolvePnPRansac

Fix error threshhold in SolvePnPRansac

--- modules/calib3d/src/solvepnp.cpp
+++ modules/calib3d/src/solvepnp.cpp
@@ -197,7 +197,7 @@
         float* err = _err.getMat().ptr<float>();

         for ( i = 0; i < count; ++i)
-            err[i] = (float)norm( ipoints_ptr[i] - projpoints_ptr[i] );
+            err[i] = (float)norm( Matx21f(ipoints_ptr[i] - projpoints_ptr[i]), NORM_L2SQR );

     }


[XLA] Run passes in collective_ops_test

[XLA] Run passes in collective_ops_test

PiperOrigin-RevId: 352869692
Change-Id: Ie3131decefa106360456e8727ef16657bb861152

--- tensorflow/compiler/xla/tests/collective_ops_test.cc
+++ tensorflow/compiler/xla/tests/collective_ops_test.cc
@@ -755,9 +755,10 @@
   TF_ASSERT_OK_AND_ASSIGN(auto module,
                           ParseAndReturnVerifiedModule(kModuleStr, config));

-  TF_ASSERT_OK_AND_ASSIGN(std::vector<Literal> results,
-                          ExecuteReplicated(std::move(module), {}, kNumReplicas,
-                                            /*use_threads=*/true));
+  TF_ASSERT_OK_AND_ASSIGN(
+      std::vector<Literal> results,
+      ExecuteReplicated(std::move(module), {}, kNumReplicas,
+                        /*use_threads=*/true, /*run_hlo_passes=*/true));
   ASSERT_EQ(results.size(), kNumReplicas);
   for (const Literal& result : results) {
     LiteralTestUtil::ExpectR1Equal<uint32>({10, 15, 11, 16, 12, 17, 13, 18},
@@ -770,7 +771,7 @@
   ENTRY test_computation {
     id = u32[] replica-id()
     id2 = u32[2, 1] broadcast(id), dimensions={}
-    a0 = u32[2, 1] constant({10}, {15})
+    a0 = u32[2, 1] constant({{10}, {15}})
     a1 = u32[2, 1] add(id2, a0)
     allgather = u32[2, 4] all-gather(a1), dimensions={1}
     ROOT out = u32[8] reshape(allgather)
@@ -781,9 +782,10 @@
   TF_ASSERT_OK_AND_ASSIGN(auto module,
                           ParseAndReturnVerifiedModule(kModuleStr, config));

-  TF_ASSERT_OK_AND_ASSIGN(std::vector<Literal> results,
-                          ExecuteReplicated(std::move(module), {}, kNumReplicas,
-                                            /*use_threads=*/true));
+  TF_ASSERT_OK_AND_ASSIGN(
+      std::vector<Literal> results,
+      ExecuteReplicated(std::move(module), {}, kNumReplicas,
+                        /*use_threads=*/true, /*run_hlo_passes=*/true));
   ASSERT_EQ(results.size(), kNumReplicas);
   for (const Literal& result : results) {
     LiteralTestUtil::ExpectR1Equal<uint32>({10, 15, 11, 16, 12, 17, 13, 18},


Get rid of that egregious serif font in autofill popups on os x by removing NOTIMPLEMENTEDs.

BUG=none
TEST=Go to a page with a form with a text field, enter something, go to the page again, begin entering the same thing. A autofill popup appears. Check that the font in the popup looks like the system font.

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

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

Former-commit-id: a915da7a6cf3e4e87929a7c47d32eecd3c2c5cfb

--- webkit/glue/webview_impl.cc
+++ webkit/glue/webview_impl.cc
@@ -70,8 +70,8 @@
 #include "PopupMenuClient.h"
 #if defined(OS_WIN)
 #include "RenderThemeChromiumWin.h"
-#elif defined(OS_LINUX)
-#include "RenderThemeChromiumLinux.h"
+#else
+#include "RenderTheme.h"
 #endif
 #include "RenderView.h"
 #include "ResourceHandle.h"
@@ -156,11 +156,7 @@
     SetSuggestions(suggestions);

     FontDescription font_description;
-#if defined(OS_WIN) || defined(OS_LINUX)
     theme()->systemFont(CSSValueWebkitControl, font_description);
-#else
-    NOTIMPLEMENTED();
-#endif
     // Use a smaller font size to match IE/Firefox.
     // TODO(jcampan): http://crbug.com/7376 use the system size instead of a
     //                fixed font size value.
@@ -202,24 +198,14 @@
     return 0;
   }
   virtual int clientPaddingLeft() const {
-#if defined(OS_WIN) || defined(OS_LINUX)
     // Bug http://crbug.com/7708 seems to indicate the style can be NULL.
     WebCore::RenderStyle* style = GetTextFieldStyle();
     return style ? theme()->popupInternalPaddingLeft(style) : 0;
-#else
-    NOTIMPLEMENTED();
-    return 0;
-#endif
   }
   virtual int clientPaddingRight() const {
-#if defined(OS_WIN) || defined(OS_LINUX)
     // Bug http://crbug.com/7708 seems to indicate the style can be NULL.
     WebCore::RenderStyle* style = GetTextFieldStyle();
     return style ? theme()->popupInternalPaddingRight(style) : 0;
-#else
-    NOTIMPLEMENTED();
-    return 0;
-#endif
   }
   virtual int listSize() const {
     return suggestions_.size();


Do no use custom gtkrc files in layout test mode.

On desktop environments like KDE, custom gtkrc files prevent test shell from
setting the theme correctly.
Review URL: http://codereview.chromium.org/18769

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

--- webkit/tools/test_shell/test_shell_platform_delegate_gtk.cc
+++ webkit/tools/test_shell/test_shell_platform_delegate_gtk.cc
@@ -14,6 +14,11 @@
 }

 void TestShellPlatformDelegate::SelectUnifiedTheme() {
+  // Stop custom gtkrc files from messing with the theme.
+  gchar* default_gtkrc_files[] = { NULL };
+  gtk_rc_set_default_files(default_gtkrc_files);
+  gtk_rc_reparse_all_for_settings(gtk_settings_get_default(), TRUE);
+
   // Pick a theme that uses Cairo for drawing, since we:
   // 1) currently don't support GTK themes that use the GDK drawing APIs, and
   // 2) need to use a unified theme for layout tests anyway.


legion: remove dead code

legion: remove dead code

--- runtime/legion/runtime.cc
+++ runtime/legion/runtime.cc
@@ -11017,7 +11017,6 @@
 #ifdef DEBUG_LEGION
       assert(utility_group.exists());
 #endif
-      Machine::ProcessorQuery all_procs(machine);
       // For each of the processors in our local set construct a manager
       for (std::set<Processor>::const_iterator it = local_procs.begin();
             it != local_procs.end(); it++)


INTEGRATION: CWS adc18 (1.5.20); FILE MERGED 2007/10/18 12:18:34 np 1.5.20.1: #i81775#

--- udm/inc/udm/xml/xmlitem.hxx
+++ udm/inc/udm/xml/xmlitem.hxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: xmlitem.hxx,v $
  *
- *  $Revision: 1.5 $
- *
- *  last change: $Author: hr $ $Date: 2006-06-19 13:09:01 $
+ *  $Revision: 1.6 $
+ *
+ *  last change: $Author: hr $ $Date: 2007-11-02 17:31:53 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -39,8 +39,8 @@
 // USED SERVICES
     // BASE CLASSES
     // COMPONENTS
-#include <cosv/template/swelist.hxx>
-#include <cosv/template/dyn.hxx>
+#include <cosv/tpl/swelist.hxx>
+#include <cosv/tpl/dyn.hxx>
     // PARAMETERS

 namespace csv


Add insertion sort

Add insertion sort

--- ex32_insertion_sort.cpp
+++ ex32_insertion_sort.cpp
@@ -1,47 +1 @@
-#include <cstdlib>
-#include <ctime>
-#include <iostream>
-
-using namespace std;
-
-int findSmallestRemainingElement (int array[], int size, int index);
-void swap (int array[], int first_index, int second_index);
-
-void sort (int array[], int size)
-{
-    for( int i=0; i<size; i++)
-    {
-        int index = findSmallestRemainingElement
-        (
-           array,
-           size,
-           i
-        );
-        swap( array, i, index );
-    }
-}
-
-void findSmallestRemainingElement
-(
-    int array[],
-    int size,
-    int index
-)
-{
-    int val=0;
-    int index=0;
-    for( int i=0; i<=size; i++)
-    {
-        x=array[i];
-        for( int y=0; y<=size; y++ )
-        {
-            if( x>array[y] )
-            {
-                val=array[y];
-                index=y;
-            }
-        }
-        array[index]=x;
-        array[i]=val;
-    }
-}
+a


Check deallocation in SoftwareTimerPeriodicTestCase

--- test/SoftwareTimer/SoftwareTimerPeriodicTestCase.cpp
+++ test/SoftwareTimer/SoftwareTimerPeriodicTestCase.cpp
@@ -16,6 +16,8 @@

 #include "distortos/DynamicSoftwareTimer.hpp"
 #include "distortos/ThisThread.hpp"
+
+#include <malloc.h>

 namespace distortos
 {
@@ -88,37 +90,47 @@

 bool SoftwareTimerPeriodicTestCase::run_() const
 {
-	SequenceAsserter sequenceAsserter;
-	uint32_t counters[totalSoftwareTimers] {};
-	std::array<DynamicSoftwareTimer, totalSoftwareTimers> softwareTimers
-	{{
-			{softwareTimerFunction, std::ref(sequenceAsserter), std::ref(counters[0]), 1},
-			{softwareTimerFunction, std::ref(sequenceAsserter), std::ref(counters[1]), 2},
-			{softwareTimerFunction, std::ref(sequenceAsserter), std::ref(counters[2]), 3},
-			{softwareTimerFunction, std::ref(sequenceAsserter), std::ref(counters[3]), 4},
-			{softwareTimerFunction, std::ref(sequenceAsserter), std::ref(counters[4]), 5},
-			{softwareTimerFunction, std::ref(sequenceAsserter), std::ref(counters[5]), 6},
-			{softwareTimerFunction, std::ref(sequenceAsserter), std::ref(counters[6]), 7},
-			{softwareTimerFunction, std::ref(sequenceAsserter), std::ref(counters[7]), 8},
-	}};
+	const auto allocatedMemory = mallinfo().uordblks;

-	waitForNextTick();
+	{
+		SequenceAsserter sequenceAsserter;
+		uint32_t counters[totalSoftwareTimers] {};
+		std::array<DynamicSoftwareTimer, totalSoftwareTimers> softwareTimers
+		{{
+				{softwareTimerFunction, std::ref(sequenceAsserter), std::ref(counters[0]), 1},
+				{softwareTimerFunction, std::ref(sequenceAsserter), std::ref(counters[1]), 2},
+				{softwareTimerFunction, std::ref(sequenceAsserter), std::ref(counters[2]), 3},
+				{softwareTimerFunction, std::ref(sequenceAsserter), std::ref(counters[3]), 4},
+				{softwareTimerFunction, std::ref(sequenceAsserter), std::ref(counters[4]), 5},
+				{softwareTimerFunction, std::ref(sequenceAsserter), std::ref(counters[5]), 6},
+				{softwareTimerFunction, std::ref(sequenceAsserter), std::ref(counters[6]), 7},
+				{softwareTimerFunction, std::ref(sequenceAsserter), std::ref(counters[7]), 8},
+		}};

-	TickClock::duration period {1};
-	unsigned int expectedSequencePoint {};
-	for (auto& softwareTimer : softwareTimers)
-	{
-		softwareTimer.start(period, period);
-		expectedSequencePoint += testCaseDuration / period;
-		++period;
+		waitForNextTick();
+
+		TickClock::duration period {1};
+		unsigned int expectedSequencePoint {};
+		for (auto& softwareTimer : softwareTimers)
+		{
+			softwareTimer.start(period, period);
+			expectedSequencePoint += testCaseDuration / period;
+			++period;
+		}
+
+		ThisThread::sleepFor(testCaseDuration);
+
+		for (auto& softwareTimer : softwareTimers)
+			softwareTimer.stop();
+
+		if (sequenceAsserter.assertSequence(expectedSequencePoint) == false)
+			return false;
 	}

-	ThisThread::sleepFor(testCaseDuration);
+	if (mallinfo().uordblks != allocatedMemory)	// dynamic memory must be deallocated after test
+		return false;

-	for (auto& softwareTimer : softwareTimers)
-		softwareTimer.stop();
-
-	return sequenceAsserter.assertSequence(expectedSequencePoint);
+	return true;
 }

 }	// namespace test


Fix documentation generation bug (#3421)

If the comment is left in the code, the html documentation renderer shows it
as part of the next member function which is misleading.


Improved user patcher logging

Improved user patcher logging

--- Lilu/Sources/kern_user.cpp
+++ Lilu/Sources/kern_user.cpp
@@ -369,9 +369,9 @@
 						auto place = modStart+ref->segOffs[k]+slide;
 						auto r = orgVmMapReadUser(taskPort, place, tmp, patch.size);
 						if (!r) {
-							DBGLOG("user @ found %X %X %X %X", tmp[0], tmp[1], tmp[2], tmp[3]);
-							if ((applyChanges && !memcmp(tmp, patch.find, patch.size)) ||
-								(!applyChanges && !memcmp(tmp, patch.replace, patch.size))) {
+							bool comparison = !memcmp(tmp, applyChanges? patch.find : patch.replace, patch.size);
+							DBGLOG("user @ %d/%d found %X %X %X %X", applyChanges, comparison, tmp[0], tmp[1], tmp[2], tmp[3]);
+							if (comparison) {
 								if (vm_protect(taskPort, (place & -PAGE_SIZE), PAGE_SIZE, FALSE, VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE) == KERN_SUCCESS) {
 									DBGLOG("user @ obtained write permssions\n");

@@ -385,6 +385,14 @@

 								} else {
 									SYSLOG("user @ failed to obtain write permissions for patching");
+								}
+							} else if (ADDPR(debugEnabled)) {
+								for (size_t i = 0; i < patch.size; i++) {
+									auto v = (applyChanges? patch.find : patch.replace)[i];
+									if (tmp[i] != v) {
+										DBGLOG("user @ miss at %zu: %0.2X vs %0.2X", i, tmp[i], v);
+										break;
+									}
 								}
 							}
 						}


Add check for joining thread so it is joinable

--- modules/skybrowser/skybrowsermodule.cpp
+++ modules/skybrowser/skybrowsermodule.cpp
@@ -90,11 +90,13 @@
 }

 void SkyBrowserModule::internalDeinitialize() {
-    ZoneScoped
-    // Set flag to false so the thread can exit
+        // Set flag to false so the thread can exit
     _camIsSyncedWWT = false;
-    _thread.join();
-    LINFO("Joined thread");
+    if (_thread.joinable()) {
+        _thread.join();
+        LINFO("Joined thread");
+    }
+
 }

 scripting::LuaLibrary SkyBrowserModule::luaLibrary() const {


legion: fixing mpi interop

legion: fixing mpi interop

--- runtime/legion/runtime.cc
+++ runtime/legion/runtime.cc
@@ -1564,6 +1564,8 @@
       // we can set the inditial participants to 1
       if (participating)
         stage_notifications.resize(Runtime::legion_collective_stages, 1);
+      if (runtime->total_address_spaces > 1)
+        done_event = Runtime::create_rt_user_event();
     }

     //--------------------------------------------------------------------------
@@ -1608,7 +1610,6 @@
       // We can skip this part if there are not multiple nodes
       if (runtime->total_address_spaces > 1)
       {
-        done_event = Runtime::create_rt_user_event();
         // See if we are participating node or not
         if (participating)
         {


Render draw test reference lines with MSAA in MSAA configs.

Bug: 20011740
Change-Id: I1147e9b4a1943f2fb0d2f7b1a2ebb858d75d9376

--- modules/glshared/glsDrawTest.cpp
+++ modules/glshared/glsDrawTest.cpp
@@ -3067,6 +3067,52 @@
 		return COMPATIBILITY_NONE;
 }

+enum PrimitiveClass
+{
+	PRIMITIVECLASS_POINT = 0,
+	PRIMITIVECLASS_LINE,
+	PRIMITIVECLASS_TRIANGLE,
+
+	PRIMITIVECLASS_LAST
+};
+
+static PrimitiveClass getDrawPrimitiveClass (gls::DrawTestSpec::Primitive primitiveType)
+{
+	switch (primitiveType)
+	{
+		case gls::DrawTestSpec::PRIMITIVE_POINTS:
+			return PRIMITIVECLASS_POINT;
+
+		case gls::DrawTestSpec::PRIMITIVE_LINES:
+		case gls::DrawTestSpec::PRIMITIVE_LINE_STRIP:
+		case gls::DrawTestSpec::PRIMITIVE_LINE_LOOP:
+		case gls::DrawTestSpec::PRIMITIVE_LINES_ADJACENCY:
+		case gls::DrawTestSpec::PRIMITIVE_LINE_STRIP_ADJACENCY:
+			return PRIMITIVECLASS_LINE;
+
+		case gls::DrawTestSpec::PRIMITIVE_TRIANGLES:
+		case gls::DrawTestSpec::PRIMITIVE_TRIANGLE_FAN:
+		case gls::DrawTestSpec::PRIMITIVE_TRIANGLE_STRIP:
+		case gls::DrawTestSpec::PRIMITIVE_TRIANGLES_ADJACENCY:
+		case gls::DrawTestSpec::PRIMITIVE_TRIANGLE_STRIP_ADJACENCY:
+			return PRIMITIVECLASS_TRIANGLE;
+
+		default:
+			DE_ASSERT(false);
+			return PRIMITIVECLASS_LAST;
+	}
+}
+
+static bool containsLineCases (const std::vector<DrawTestSpec>& m_specs)
+{
+	for (int ndx = 0; ndx < (int)m_specs.size(); ++ndx)
+	{
+		if (getDrawPrimitiveClass(m_specs[ndx].primitive) == PRIMITIVECLASS_LINE)
+			return true;
+	}
+	return false;
+}
+
 // DrawTest

 DrawTest::DrawTest (tcu::TestContext& testCtx, glu::RenderContext& renderCtx, const DrawTestSpec& spec, const char* name, const char* desc)
@@ -3136,8 +3182,17 @@

 void DrawTest::init (void)
 {
+	DE_ASSERT(!m_specs.empty());
+	DE_ASSERT(contextSupports(m_renderCtx.getType(), m_specs[0].apiType));
+
 	const int						renderTargetWidth	= de::min(MAX_RENDER_TARGET_SIZE, m_renderCtx.getRenderTarget().getWidth());
 	const int						renderTargetHeight	= de::min(MAX_RENDER_TARGET_SIZE, m_renderCtx.getRenderTarget().getHeight());
+
+	// lines have significantly different rasterization in MSAA mode
+	const bool						isLineCase			= containsLineCases(m_specs);
+	const bool						isMSAACase			= m_renderCtx.getRenderTarget().getNumSamples() > 1;
+	const int						renderTargetSamples	= (isMSAACase && isLineCase) ? (4) : (1);
+
 	sglr::ReferenceContextLimits	limits				(m_renderCtx);
 	bool							useVao				= false;

@@ -3150,10 +3205,7 @@
 	else
 		DE_ASSERT(!"Unknown context type");

-	DE_ASSERT(!m_specs.empty());
-	DE_ASSERT(contextSupports(m_renderCtx.getType(), m_specs[0].apiType));
-
-	m_refBuffers	= new sglr::ReferenceContextBuffers(m_renderCtx.getRenderTarget().getPixelFormat(), 0, 0, renderTargetWidth, renderTargetHeight);
+	m_refBuffers	= new sglr::ReferenceContextBuffers(m_renderCtx.getRenderTarget().getPixelFormat(), 0, 0, renderTargetWidth, renderTargetHeight, renderTargetSamples);
 	m_refContext	= new sglr::ReferenceContext(limits, m_refBuffers->getColorbuffer(), m_refBuffers->getDepthbuffer(), m_refBuffers->getStencilbuffer());

 	m_glArrayPack	= new AttributePack(m_testCtx, m_renderCtx, *m_glesContext, tcu::UVec2(renderTargetWidth, renderTargetHeight), useVao, true);
@@ -3356,42 +3408,6 @@
 	return iterateResult;
 }

-enum PrimitiveClass
-{
-	PRIMITIVECLASS_POINT = 0,
-	PRIMITIVECLASS_LINE,
-	PRIMITIVECLASS_TRIANGLE,
-
-	PRIMITIVECLASS_LAST
-};
-
-static PrimitiveClass getDrawPrimitiveClass (gls::DrawTestSpec::Primitive primitiveType)
-{
-	switch (primitiveType)
-	{
-		case gls::DrawTestSpec::PRIMITIVE_POINTS:
-			return PRIMITIVECLASS_POINT;
-
-		case gls::DrawTestSpec::PRIMITIVE_LINES:
-		case gls::DrawTestSpec::PRIMITIVE_LINE_STRIP:
-		case gls::DrawTestSpec::PRIMITIVE_LINE_LOOP:
-		case gls::DrawTestSpec::PRIMITIVE_LINES_ADJACENCY:
-		case gls::DrawTestSpec::PRIMITIVE_LINE_STRIP_ADJACENCY:
-			return PRIMITIVECLASS_LINE;
-
-		case gls::DrawTestSpec::PRIMITIVE_TRIANGLES:
-		case gls::DrawTestSpec::PRIMITIVE_TRIANGLE_FAN:
-		case gls::DrawTestSpec::PRIMITIVE_TRIANGLE_STRIP:
-		case gls::DrawTestSpec::PRIMITIVE_TRIANGLES_ADJACENCY:
-		case gls::DrawTestSpec::PRIMITIVE_TRIANGLE_STRIP_ADJACENCY:
-			return PRIMITIVECLASS_TRIANGLE;
-
-		default:
-			DE_ASSERT(false);
-			return PRIMITIVECLASS_LAST;
-	}
-}
-
 static bool isBlack (const tcu::RGBA& c)
 {
 	// ignore alpha channel
@@ -3753,14 +3769,16 @@
 	}
 	else
 	{
-		const PrimitiveClass primitiveClass = getDrawPrimitiveClass(primitiveType);
+		const PrimitiveClass	primitiveClass							= getDrawPrimitiveClass(primitiveType);
+		const int				maxAllowedInvalidPixelsWithPoints		= 0;	//!< points are unlikely to have overlapping fragments
+		const int				maxAllowedInvalidPixelsWithLines		= 5;	//!< line are allowed to have a few bad pixels
+		const int				maxAllowedInvalidPixelsWithTriangles	= 10;

 		switch (primitiveClass)
 		{
 			case PRIMITIVECLASS_POINT:
 			{
 				// Point are extremely unlikely to have overlapping regions, don't allow any no extra / missing pixels
-				const int maxAllowedInvalidPixelsWithPoints = 0;
 				return tcu::intThresholdPositionDeviationErrorThresholdCompare(m_testCtx.getLog(),
 																			   "CompareResult",
 																			   "Result of rendering",
@@ -3779,7 +3797,6 @@
 				// false negatives in such pixels if for example the pixel in question is overdrawn by another line in the
 				// reference image but not in the resultin image. Relax comparison near line intersection points (areas) and
 				// compare only coverage, not color, in such pixels
-				const int maxAllowedInvalidPixelsWithLines = 5; // line are allowed to have a few bad pixels
 				return intersectionRelaxedLineImageCompare(m_testCtx.getLog(),
 														   "CompareResult",
 														   "Result of rendering",
@@ -3795,7 +3812,6 @@
 				// where there could be potential overlapping since the  pixels might be covered by one triangle in the
 				// reference image and by the other in the result image. Relax comparsion near primitive edges and
 				// compare only coverage, not color, in such pixels.
-				const int			maxAllowedInvalidPixelsWithTriangles	= 10;
 				const tcu::IVec3	renderTargetThreshold					= m_renderCtx.getRenderTarget().getPixelFormat().getColorThreshold().toIVec().xyz();

 				return edgeRelaxedImageCompare(m_testCtx.getLog(),


Remove typo/repeated code block

Remove typo/repeated code block

--- modules/videoio/src/cap_ffmpeg_impl.hpp
+++ modules/videoio/src/cap_ffmpeg_impl.hpp
@@ -1113,11 +1113,6 @@
         sec = (double)ic->streams[video_stream]->duration * r2d(ic->streams[video_stream]->time_base);
     }

-    if (sec < eps_zero)
-    {
-        sec = (double)ic->streams[video_stream]->duration * r2d(ic->streams[video_stream]->time_base);
-    }
-
     return sec;
 }


Fix alpha typo in code completion color

Fix alpha typo in code completion color

--- editor/editor_settings.cpp
+++ editor/editor_settings.cpp
@@ -710,7 +710,7 @@
 	_initial_set("text_editor/theme/highlighting/background_color", Color(0.13, 0.12, 0.15));
 	_initial_set("text_editor/theme/highlighting/completion_background_color", Color(0.17, 0.16, 0.2));
 	_initial_set("text_editor/theme/highlighting/completion_selected_color", Color(0.26, 0.26, 0.27));
-	_initial_set("text_editor/theme/highlighting/completion_existing_color", Color(0.13, 0.87, 0.87, 0.87));
+	_initial_set("text_editor/theme/highlighting/completion_existing_color", Color(0.87, 0.87, 0.87, 0.13));
 	_initial_set("text_editor/theme/highlighting/completion_scroll_color", Color(1, 1, 1));
 	_initial_set("text_editor/theme/highlighting/completion_font_color", Color(0.67, 0.67, 0.67));
 	_initial_set("text_editor/theme/highlighting/text_color", Color(0.67, 0.67, 0.67));


ENH: OTB-608 : reading RPC coefficients in TIFF tag

--- Code/UtilitiesAdapters/OssimAdapters/otbImageKeywordlist.cxx
+++ Code/UtilitiesAdapters/OssimAdapters/otbImageKeywordlist.cxx
@@ -27,6 +27,10 @@
 #include "ossim/imaging/ossimImageHandlerRegistry.h"
 #include "ossim/ossimTileMapModel.h"
 #include "ossim/projection/ossimProjectionFactoryRegistry.h"
+
+#include "ossim/imaging/ossimTiffTileSource.h"
+#include "ossim/projection/ossimRpcModel.h"
+#include "tiffio.h"

 #include "otbSensorModelAdapter.h"

@@ -233,7 +237,98 @@
           otb_kwl.SetKeywordlist(geom_kwl);
           }
         }
-
+
+      //  try to use GeoTiff RPC tag if present. They will override the
+      // standard projection found before
+      ossimRefPtr<ossimTiffTileSource> tiffHandler = new ossimTiffTileSource;
+      tiffHandler->setOpenOverviewFlag(true);
+      if ( tiffHandler->open(handler->getFilename()) )
+        {
+        TIFF* tiffPtr = tiffHandler->tiffPtr();
+        unsigned short  count     = 0;
+        void            *tagData  = 0;
+
+        if (TIFFGetField( tiffPtr, 50844, &count, &tagData) && (count == 92) )
+          {
+          otbMsgDevMacro(<<"RPC Coeff tag found");
+          // read RPC coefficients
+          double *tagValues = static_cast<double*>(tagData);
+
+          std::vector<double> lineNumCoefs;
+          std::vector<double> lineDenCoefs;
+          std::vector<double> sampNumCoefs;
+          std::vector<double> sampDenCoefs;
+
+          for (unsigned int k=0 ; k<20 ; ++k)
+            {
+            lineNumCoefs.push_back(*(tagValues + 12 + k));
+            lineDenCoefs.push_back(*(tagValues + 32 + k));
+            sampNumCoefs.push_back(*(tagValues + 52 + k));
+            sampDenCoefs.push_back(*(tagValues + 72 + k));
+            }
+
+          ossimRefPtr<ossimRpcModel> rpcModel = new ossimRpcModel;
+          rpcModel->setAttributes( *(tagValues + 3),
+                                   *(tagValues + 2),
+                                   *(tagValues + 8),
+                                   *(tagValues + 7),
+                                   *(tagValues + 4),
+                                   *(tagValues + 5),
+                                   *(tagValues + 6),
+                                   *(tagValues + 9),
+                                   *(tagValues + 10),
+                                   *(tagValues + 11),
+                                   sampNumCoefs,
+                                   sampDenCoefs,
+                                   lineNumCoefs,
+                                   lineDenCoefs);
+
+          double errorBias = 0.0;
+          double errorRand = 0.0;
+          if (*(tagValues) >= 0.0) errorBias = *(tagValues);
+          if (*(tagValues+1) >= 0.0) errorRand = *(tagValues+1);
+
+          // setup other metadata
+          rpcModel->setPositionError(errorBias,errorRand,true);
+          ossimDrect rectangle = tiffHandler->getImageRectangle();
+          rpcModel->setImageRect(rectangle);
+
+          ossimDpt size;
+          size.line = rectangle.height();
+          size.samp = rectangle.width();
+          rpcModel->setImageSize(size);
+
+          // Compute 4 corners and reference point
+          rpcModel->updateModel();
+          double heightOffset = *(tagValues + 6);
+          ossimGpt ulGpt, urGpt, lrGpt, llGpt;
+          ossimGpt refGndPt;
+
+          rpcModel->lineSampleHeightToWorld(rectangle.ul(), heightOffset, ulGpt);
+          rpcModel->lineSampleHeightToWorld(rectangle.ur(), heightOffset, urGpt);
+          rpcModel->lineSampleHeightToWorld(rectangle.lr(), heightOffset, lrGpt);
+          rpcModel->lineSampleHeightToWorld(rectangle.ll(), heightOffset, llGpt);
+          rpcModel->setGroundRect(ulGpt,urGpt,lrGpt,llGpt);
+
+          rpcModel->lineSampleHeightToWorld(rectangle.midPoint(), heightOffset, refGndPt);
+          rpcModel->setRefGndPt(refGndPt);
+
+          // compute ground sampling distance
+          try
+            {
+            // Method can throw ossimException.
+            rpcModel->computeGsd();
+            }
+          catch (const ossimException& e)
+            {
+            otbMsgDevMacro(<< "OSSIM Compute ground sampling distance FAILED ! ");
+            }
+
+          hasMetaData = rpcModel->saveState(geom_kwl);
+          otb_kwl.SetKeywordlist(geom_kwl);
+          }
+        }
+
       // If still no metadata, try the ".geom" file
       if (!hasMetaData && otb_kwl.GetSize() == 0)
         {


[fixed] better toughness formula

[fixed] better toughness formula

git-svn-id: c34995188cc7e843f8a799edec2d9d4b36f36456@4857 c3d1530f-68f5-4bd0-87dc-8ef779617e40

--- MMOCoreORB/src/server/zone/managers/combat/CombatManager.cpp
+++ MMOCoreORB/src/server/zone/managers/combat/CombatManager.cpp
@@ -452,24 +452,27 @@
 }

 int CombatManager::getDefenderToughnessModifier(CreatureObject* defender, int damType) {
-	int toughness = 1;
+	int toughness = 0;
 	ManagedReference<WeaponObject*> weapon = defender->getWeapon();

 	Vector<String>* defenseToughMods = weapon->getDefenderToughnessModifiers();

 	for (int i = 0; i < defenseToughMods->size(); ++i) {
 		int toughMod = defender->getSkillMod(defenseToughMods->get(i));
-		if (toughMod > 0) toughness *= toughMod;
+		if (toughness == 0) toughness += toughMod;
+		else if (toughMod > 0) toughness *= toughMod;
 	}

 	// According to the Jedi FAQ, Jedi Toughness is multiplicative with LS toughness.
 	int jediToughness = defender->getSkillMod("jedi_toughness");
-	if (damType != WeaponObject::LIGHTSABER && jediToughness > 0) toughness *= jediToughness;
+	if (damType != WeaponObject::LIGHTSABER && toughness == 0) toughness += jediToughness;
+	else if (damType != WeaponObject::LIGHTSABER && jediToughness > 0) toughness *= jediToughness;

 	int foodBonus = defender->getSkillMod("mitigate_damage");
-	if (foodBonus > 0) toughness *= foodBonus;
-
-	return toughness == 1 ? 0 : toughness;
+	if (toughness == 0) toughness += foodBonus;
+	else if (foodBonus > 0) toughness *= foodBonus;
+
+	return toughness;
 }


BUG: If QVTKWIdget has a parent, set it on the RenderWindow as well. Otherwise, RenderWindow thinks that it is a toplevel window which has bad side effects for methods such as SetSize() which depend on whether parent window exists.

--- GUISupport/Qt/QVTKWidget.cxx
+++ GUISupport/Qt/QVTKWidget.cxx
@@ -220,7 +220,17 @@

     // give the qt window id to the vtk window
     this->mRenWin->SetWindowId( reinterpret_cast<void*>(this->winId()));
-
+
+#if defined(WIN32)
+    // If this widget has a parent, we must set the parent Id for the render
+    // window, otherwise SetSize on renderwindow produces incorrect
+    // results.
+    if (this->parentWidget())
+      {
+      this->mRenWin->SetParentId(reinterpret_cast<void*>(
+        this->parentWidget()->winId()));
+      }
+#endif // defined (WIN32)
     // mac compatibility issues
 #ifdef Q_WS_MAC
 # ifdef QVTK_HAVE_VTK_4_5


Respect the chapter hidden flag, and add a parent chapter if all of its children are hidden.

--- MatroskaImportPrivate.cpp
+++ MatroskaImportPrivate.cpp
@@ -568,14 +568,21 @@
 void MatroskaImport::AddChapterAtom(KaxChapterAtom *atom, Track chapterTrack)
 {
 	KaxChapterAtom *subChapter = FindChild<KaxChapterAtom>(*atom);
+	bool addThisChapter = true;

 	// since QuickTime only supports linear chapter tracks (no nesting), only add chapter leaves
 	if (subChapter && subChapter->GetSize() > 0) {
 		while (subChapter && subChapter->GetSize() > 0) {
-			AddChapterAtom(subChapter, chapterTrack);
+			KaxChapterFlagHidden &hideChapter = GetChild<KaxChapterFlagHidden>(*subChapter);
+
+			if (!uint8_t(hideChapter)) {
+				AddChapterAtom(subChapter, chapterTrack);
+				addThisChapter = false;
+			}
 			subChapter = &GetNextChild(*atom, *subChapter);
 		}
-	} else {
+	}
+	if (addThisChapter) {
 		// add the chapter to the track if it has no children
 		KaxChapterTimeStart & startTime = GetChild<KaxChapterTimeStart>(*atom);
 		KaxChapterDisplay & chapDisplay = GetChild<KaxChapterDisplay>(*atom);


Index validation added to CReader::goToWord

--- core/reader/creader.cpp
+++ core/reader/creader.cpp
@@ -11,6 +11,11 @@
 #include <map>
 #include <iterator>

+DISABLE_COMPILER_WARNINGS
+#include <QDebug>
+#include <QTime>
+RESTORE_COMPILER_WARNINGS
+
 CReader::CReader(ReaderInterface* interface) : _interface(interface)
 {
 	assert_r(_interface);
@@ -39,7 +44,11 @@
 {
 	CTextParser parser;
 	parser.setAddEmptyFragmentAfterSentence(_clearScreenAfterSentenceEnd);
+
+	QTime timer;
+	timer.start();
 	load(parser.parse(CFileDecoder::readDataAndDecodeText(filePath)));
+	qDebug() << "Parsing" << filePath << "took" << QString::number(timer.elapsed() / 1000.0f, 'f', 1) << "seconds";

 	if (!_textFragments.empty())
 	{
@@ -143,6 +152,9 @@

 void CReader::goToWord(size_t wordIndex)
 {
+	if (_position >= _textFragments.size())
+		return;
+
 	_position = wordIndex;
 	_interface->updateDisplay(_position);
 	_interface->updateInfo();


Make blank project name create an error, not a warning

--- editor/project_manager.cpp
+++ editor/project_manager.cpp
@@ -412,7 +412,7 @@
 		_test_path();

 		if (p_text == "") {
-			set_message(TTR("It would be a good idea to name your project."), MESSAGE_WARNING);
+			set_message(TTR("It would be a good idea to name your project."), MESSAGE_ERROR);
 		}
 	}