INTEGRATION: CWS changefileheader (1.10.24); FILE MERGED 2008/04/01 15:16:01 thb 1.10.24.3: #i85898# Stripping all external header guards 2008/04/01 10:56:20 thb 1.10.24.2: #i85898# Stripping all external header guards 2008/03/28 15:31:54 rt 1.10.24.1: #i87441# Change license header to LPGL v3.

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

 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_filter.hxx"
-
-#ifndef _OSL_MUTEX_HXX_
 #include <osl/mutex.hxx>
-#endif
-#ifndef _VOS_MUTEX_HXX_
 #include <vos/mutex.hxx>
-#endif
-
-#ifndef _TOOLKIT_AWT_VCLXWINDOW_HXX_
 #include <toolkit/awt/vclxwindow.hxx>
-#endif

 #include <osl/thread.h>
 #include <cppuhelper/factory.hxx>
-
-#ifndef _CPPUHELPER_TYPEPROVIDER_HXX_
 #include <cppuhelper/typeprovider.hxx>
-#endif
-
-#ifndef _CPPUHELPER_COMPONENT_HXX_
 #include <cppuhelper/component.hxx>
-#endif
-
-#ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_
 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#endif
-
-#ifndef _COM_SUN_STAR_FRAME_XDESKTOP_HPP_
 #include <com/sun/star/frame/XDesktop.hpp>
-#endif
-
-#ifndef _COM_SUN_STAR_FRAME_XTERMINATELISTENER_HPP_
 #include <com/sun/star/frame/XTerminateListener.hpp>
-#endif
-
-#ifndef _CPPUHELPER_IMPLBASE4_HXX_
 #include <cppuhelper/implbase4.hxx>
-#endif
-
-#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
 #include <com/sun/star/lang/XServiceInfo.hpp>
-#endif
-#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
 #include <com/sun/star/lang/XInitialization.hpp>
-#endif
-#ifndef _COM_SUN_STAR_AWT_XWINDOW_HPP_
 #include <com/sun/star/awt/XWindow.hpp>
-#endif
-#ifndef _COM_SUN_STAR_UI_DIALOGS_XEXECUTABLEDIALOG_HPP_
 #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
-#endif
-#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
 #include <com/sun/star/beans/PropertyValue.hpp>
-#endif
-
-#ifndef _TOOLKIT_AWT_VCLXWINDOW_HXX_
 #include <toolkit/awt/vclxwindow.hxx>
-#endif
-
-#ifndef _TOOLS_RESMGR_HXX
 #include <tools/resmgr.hxx>
-#endif
-
-#ifndef _SV_SVAPP_HXX
 #include <vcl/svapp.hxx>
-#endif

 #include <svtools/solar.hrc>


Fix (Zaida)

Fix (Zaida)

--- PWG3/vertexingHF/AliHFPtSpectrum.cxx
+++ PWG3/vertexingHF/AliHFPtSpectrum.cxx
@@ -487,10 +487,10 @@
   //

   // Check the compatibility with the reconstructed spectrum
-  Double_t gbinwidth = fgRECSystematics->GetErrorXlow(1) + fgRECSystematics->GetErrorXhigh(1) ;
+  Double_t gbinwidth = gRec->GetErrorXlow(1) + gRec->GetErrorXhigh(1) ;
   Double_t hbinwidth = fhRECpt->GetBinWidth(1);
   Double_t gxbincenter=0., gybincenter=0.;
-  fgRECSystematics->GetPoint(1,gxbincenter,gybincenter);
+  gRec->GetPoint(1,gxbincenter,gybincenter);
   Double_t hbincenter = fhRECpt->GetBinCenter(1);
   if ( TMath::Abs(gbinwidth - hbinwidth)>0.0001 || TMath::Abs(gxbincenter - hbincenter)>0.0001 ) {
     AliError(" The reconstructed spectrum and its systematics don't seem compatible");
@@ -1044,6 +1044,7 @@
 	  errvalueMax = value * ( fgRECSystematics->GetErrorYhigh(ibin) / fhRECpt->GetBinContent(ibin) );
 	  errvalueMin = value * ( fgRECSystematics->GetErrorYlow(ibin) / fhRECpt->GetBinContent(ibin) );
 	}
+	else { errvalueMax = 0.; errvalueMin = 0.; }

 	// Extreme feed-down systematics
 	valueExtremeMax = fhRECpt->GetBinContent(ibin) * ( fhFc->GetBinContent(ibin) + fgFcExtreme->GetErrorYhigh(ibin) ) / fhRECpt->GetBinWidth(ibin) ;
@@ -1148,6 +1149,7 @@
 	errvalueMax = fgRECSystematics->GetErrorYhigh(ibin) / fhRECpt->GetBinWidth(ibin) ;
 	errvalueMin = fgRECSystematics->GetErrorYlow(ibin) / fhRECpt->GetBinWidth(ibin);
       }
+      else { errvalueMax = 0.; errvalueMin = 0.; }

       // Feed-down systematics
       // min value with the maximum Nb


Set the nice name for Color parameters

Set the nice name for Color parameters

--- SyncAttribute.C
+++ SyncAttribute.C
@@ -369,6 +369,7 @@
             && parm.size == 3)
     {
         result = nAttr.createColor(attrName, attrName);
+        nAttr.setNiceNameOverride(niceName);
         return result;
     }


In GetWeightForMeson replace CompareTo for Contains for the MC data sample LHC12i3, LHC12f1a and LHC12f1b

--- PWGGA/GammaConv/AliConvEventCuts.cxx
+++ PWGGA/GammaConv/AliConvEventCuts.cxx
@@ -2456,14 +2456,14 @@
 //_________________________________________________________________________
 Float_t AliConvEventCuts::GetWeightForMeson(TString period, Int_t index, AliStack *MCStack, AliVEvent *InputEvent){
 	if (!( period.Contains("LHC13d2")			|| period.Contains("LHC14a1") 					|| period.CompareTo("LHC13e7") == 0 		|| period.Contains("LHC13b2_efix") 		||
-		   period.CompareTo("LHC14b2") == 0 	|| period.Contains("LHC14e2")					|| period.CompareTo("LHC12f1a") == 0 		|| period.CompareTo("LHC12f1b") == 0  	||
-		   period.CompareTo("LHC12i3") == 0)) return 1.;
+		   period.CompareTo("LHC14b2") == 0 	|| period.Contains("LHC14e2")					|| period.Contains("LHC12f1a")  		|| period.Contains("LHC12f1b")  ||
+		   period.Contains("LHC12i3") )) return 1.;
 	Int_t kCaseGen = 0;

 	if (IsParticleFromBGEvent(index, MCStack, InputEvent)){
 		if (period.Contains("LHC13d2") 		|| period.CompareTo("LHC13e7") == 0 			|| period.Contains("LHC13b2_efix")  		|| period.Contains("LHC14a1") 			||
-			period.CompareTo("LHC14b2") == 0 || period.Contains("LHC14e2")					|| period.CompareTo("LHC12f1a") == 0 		|| period.CompareTo("LHC12f1b") == 0  	||
-			period.CompareTo("LHC12i3") == 0){
+			period.CompareTo("LHC14b2") == 0 || period.Contains("LHC14e2")					|| period.Contains("LHC12f1a") 	|| period.Contains("LHC12f1b") 	||
+			period.Contains("LHC12i3")){
 			kCaseGen = 1;
 		}
 	}


Simplify code and correct the erroneous length parameter for "macro:///" and align text

Change-Id: Id9eef27636c5c74857ed05b891514bee70903c3b


Account for elem deletion in unique id numbering

--- framework/src/constraints/AutomaticMortarGeneration.C
+++ framework/src/constraints/AutomaticMortarGeneration.C
@@ -129,8 +129,10 @@
   dof_id_type local_id_index = 0;
   std::size_t node_unique_id_offset = 0;

-  // Create an offset by the maximum number of mortar segment elements that can be created. Recall
-  // that the number of mortar segments created is a function of node projection
+  // Create an offset by the maximum number of mortar segment elements that can be created *plus*
+  // the number of lower-dimensional secondary subdomain elements. Recall that the number of mortar
+  // segments created is a function of node projection, *and* that if we split elems we will delete
+  // that elem which has already taken a unique id
   for (const auto & pr : primary_secondary_boundary_id_pairs)
   {
     const auto primary_bnd_id = pr.first;
@@ -140,7 +142,7 @@
     const auto num_secondary_nodes =
         std::distance(mesh.bid_nodes_begin(secondary_bnd_id), mesh.bid_nodes_end(secondary_bnd_id));

-    node_unique_id_offset += num_primary_nodes + num_secondary_nodes;
+    node_unique_id_offset += num_primary_nodes + 2 * num_secondary_nodes;
   }

   // 1.) Add all lower-dimensional secondary side elements as the "initial" mortar segments.


Fixing variable shadowing warning.

Fixing variable shadowing warning.

Refs #000.

--- framework/src/vectorpostprocessors/PointSamplerBase.C
+++ framework/src/vectorpostprocessors/PointSamplerBase.C
@@ -69,8 +69,8 @@
     {
       _subproblem.reinitElemPhys(elem, _point_vec, 0); // Zero is for tid

-      for (unsigned int i=0; i<_coupled_moose_vars.size(); i++)
-        _values[i] = _coupled_moose_vars[i]->sln()[0]; // The zero is for the "qp"
+      for (unsigned int j=0; j<_coupled_moose_vars.size(); j++)
+        _values[j] = _coupled_moose_vars[j]->sln()[0]; // The zero is for the "qp"

       SamplerBase::addSample(p, _ids[i], _values);
     }


BUG: Make ident colored painter draw VERTICES. This allows them to be selected and makes sure that the vtkOriginalCellIds array matches the rendered id numbers of each cell. Fixes bug # 4733.

--- Rendering/vtkIdentColoredPainter.cxx
+++ Rendering/vtkIdentColoredPainter.cxx
@@ -37,7 +37,7 @@
 #endif

 //-----------------------------------------------------------------------------
-vtkCxxRevisionMacro(vtkIdentColoredPainter, "1.14");
+vtkCxxRevisionMacro(vtkIdentColoredPainter, "1.15");
 vtkStandardNewMacro(vtkIdentColoredPainter);

 //-----------------------------------------------------------------------------
@@ -45,6 +45,8 @@
   unsigned long typeflags)
 {
   int total_cells = 0;
+  total_cells += (typeflags & vtkPainter::VERTS)?
+    pd->GetNumberOfVerts() : 0;
   total_cells += (typeflags & vtkPainter::LINES)?
     pd->GetNumberOfLines() : 0;
   total_cells += (typeflags & vtkPainter::POLYS)?
@@ -269,6 +271,11 @@
   device->MakeBlending(0);

   vtkIdType startCell = 0;
+  if (typeflags & vtkPainter::VERTS)
+    {
+    this->DrawCells(VTK_POLY_VERTEX, this->PolyData->GetVerts(), startCell,
+      renderer);
+    }
   startCell += this->PolyData->GetNumberOfVerts();

   if (typeflags & vtkPainter::LINES)


ERR ouch, left in debugging statements

ERR ouch, left in debugging statements

--- Rendering/vtkXOpenGLRenderWindow.cxx
+++ Rendering/vtkXOpenGLRenderWindow.cxx
@@ -86,7 +86,7 @@

 #ifndef VTK_IMPLEMENT_MESA_CXX
-vtkCxxRevisionMacro(vtkXOpenGLRenderWindow, "1.25");
+vtkCxxRevisionMacro(vtkXOpenGLRenderWindow, "1.26");
 vtkStandardNewMacro(vtkXOpenGLRenderWindow);
 #endif

@@ -354,7 +354,6 @@
 // Initialize the window for rendering.
 void vtkXOpenGLRenderWindow::WindowInitialize (void)
 {
-  cout << "WINDOWINITIALIZE" << endl;
   XVisualInfo  *v, matcher;
   XSetWindowAttributes  attr;
   int x, y, width, height, nItems;
@@ -540,7 +539,6 @@
 // Initialize the rendering window.
 void vtkXOpenGLRenderWindow::Initialize (void)
 {
-  cout << "INITIALIZE" << endl;
   // make sure we havent already been initialized
   if (this->Internal->ContextId
 #ifdef VTK_OPENGL_HAS_OSMESA
@@ -683,7 +681,6 @@
 // Begin the rendering process.
 void vtkXOpenGLRenderWindow::Start(void)
 {
-  cout << "START" << endl;
   // if the renderer has not been initialized, do so now
   if (!this->Internal->ContextId
 #ifdef VTK_OPENGL_HAS_OSMESA
@@ -867,7 +864,6 @@
     {
     if (this->Internal->ContextId && (this->Internal->ContextId != glXGetCurrentContext()) || this->ForceMakeCurrent)
       {
-        cout << "MAKING CURRENT" << endl;
       glXMakeCurrent(this->DisplayId,this->WindowId,this->Internal->ContextId);
       this->ForceMakeCurrent = 0;
       }


RenderSystem: Temporary fix for lights not changing positions

--- SDK/src/NDK/Systems/RenderSystem.cpp
+++ SDK/src/NDK/Systems/RenderSystem.cpp
@@ -206,7 +206,7 @@
 			std::size_t visibilityHash = m_drawableCulling.Cull(camComponent.GetFrustum(), &forceInvalidation);

 			// Always regenerate renderqueue if particle groups are present for now (FIXME)
-			if (!m_particleGroups.empty())
+			if (!m_lights.empty() || !m_particleGroups.empty())
 				forceInvalidation = true;

 			if (camComponent.UpdateVisibility(visibilityHash) || m_forceRenderQueueInvalidation || forceInvalidation)


fboss/lib/usb/WedgeI2CBus.cpp: avoid shadowing warnings

Summary:
Fix warnings exposed by gcc-4.9.x's -Wshadow-compatible-local
I plan to enable this for all of fbcode, soon.
See https://fburl.com/bad-shadow for justification.

Rename inner "ex" to "ex2".

This avoids the following errors:

Reviewed By: tfangit

Differential Revision: D4656608

fbshipit-source-id: 0ad86561937ba43f20a611fe1170d38df4671830

--- fboss/lib/usb/WedgeI2CBus.cpp
+++ fboss/lib/usb/WedgeI2CBus.cpp
@@ -49,7 +49,7 @@
     if (autoReset) {
       try {
         dev_.resetDevice();
-      } catch (const UsbDeviceResetError& ex) {
+      } catch (const UsbDeviceResetError& ex2) {
       }
     } else {
       VLOG(1) << "initial read from CP2112 failed; I2C bus appears hung";


Remove irrelevant code.

Remove irrelevant code.

--- fem/libceed/pa_integrator.hpp
+++ fem/libceed/pa_integrator.hpp
@@ -85,10 +85,6 @@
                      CoeffType *Q)
    {
       mfem::Mesh &mesh = *fes.GetMesh();
-      // Perform checks for some assumptions made in the Q-functions.
-      MFEM_VERIFY(mesh.Dimension() == mesh.SpaceDimension(), "case not supported");
-      MFEM_VERIFY(fes.GetVDim() == 1 || fes.GetVDim() == mesh.Dimension(),
-                  "case not supported");
       InitCoefficient(Q, mesh, irm, coeff, info.ctx);
       bool const_coeff = coeff->IsConstant();
       std::string build_func = const_coeff ? info.build_func_const


fix core when host #0 has collnum that other host does not.

--- Parms.cpp
+++ Parms.cpp
@@ -144,6 +144,10 @@
 	}
 	// need this
 	CollectionRec *cr = g_collectiondb.getRec ( collnum );
+	if ( ! cr ) {
+		log("parms: no cr for collnum %li to update",(long)collnum);
+		return true;
+	}
 	// get the sitelist
 	char *data = getDataFromParmRec ( rec );
 	// update the table that maps site to whether we should spider it


Do not use pointer value after deleting it

Pointer value is undefined after 'delete'.

Change-Id: I30dab519db61073932e3e35cd87809bf89b18dfc

--- external/vulkancts/framework/vulkan/vkNullDriver.cpp
+++ external/vulkancts/framework/vulkan/vkNullDriver.cpp
@@ -361,14 +361,13 @@
 {
 	CommandBuffer* const	impl	= reinterpret_cast<CommandBuffer*>(buffer);

-	delete impl;
-
 	for (size_t ndx = 0; ndx < m_buffers.size(); ++ndx)
 	{
 		if (m_buffers[ndx] == impl)
 		{
 			std::swap(m_buffers[ndx], m_buffers.back());
 			m_buffers.pop_back();
+			delete impl;
 			return;
 		}
 	}
@@ -430,14 +429,13 @@
 	DE_ASSERT(m_flags & VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT);
 	DE_UNREF(m_flags);

-	delete impl;
-
 	for (size_t ndx = 0; ndx < m_managedSets.size(); ++ndx)
 	{
 		if (m_managedSets[ndx] == impl)
 		{
 			std::swap(m_managedSets[ndx], m_managedSets.back());
 			m_managedSets.pop_back();
+			delete impl;
 			return;
 		}
 	}


changed Xtal length from 22cm to 18cm

changed Xtal length from 22cm to 18cm

--- PHOS/AliPHOSEMCAGeometry.cxx
+++ PHOS/AliPHOSEMCAGeometry.cxx
@@ -39,7 +39,7 @@
   fNZ         = 64 ;

   fXtlSize[0] =  2.2 ;
-  fXtlSize[1] = 22.0 ;
+  fXtlSize[1] = 18.0 ;
   fXtlSize[2] =  2.2 ;

   // all these numbers coming next are subject to changes
@@ -60,13 +60,13 @@
   fIPtoCrystalSurface     = 460.0 ;

   //fPinDiodeSize[0] = 1.71 ;   //Values of ame PIN diode
-  //fPinDiodeSize[1] = 0.0280 ; // 0.0280 is the depth of active layer
+  //fPinDiodeSize[1] = 0.0280 ; // OHO 0.0280 is the depth of active layer
   //fPinDiodeSize[2] = 1.61 ;

   fPinDiodeSize[0] = 0.5000 ;    // APD 5 mm side
   //fPinDiodeSize[1] = 0.0200 ;  // APD bulk thickness
   fPinDiodeSize[1] = 0.0100 ;    // APD bulk thickness
-  //According to Y. M. (cms) is it 50 micrometer I use 100 micrometers
+  //According to Y. M. (cms) is it 50 micrometer I use 100 micrometers OHO
   fPinDiodeSize[2] = 0.5000 ;    // APD 5 mm side

   fUpperCoolingPlateThickness   = 0.06 ;


Remove unneeded instantatiation. Refs #181.

git-svn-id: 1001b6e0dd469eaa302a741812f7f5d223cf35f7@1264 ff5d1e40-2be0-497f-93bd-dc18237bd3c7

--- bindings/cpp/NeXusFile.cpp
+++ bindings/cpp/NeXusFile.cpp
@@ -1169,5 +1169,3 @@
 NXDLL_EXPORT void File::getAttr(const std::string& name, double& value);
 template
 NXDLL_EXPORT void File::getAttr(const std::string& name, int& value);
-template
-NXDLL_EXPORT void File::getAttr(const std::string& name, std::string& value);


Bugfix in QuaternionTests, must typedef the AngleAxis for YamlConvert.

--- SurgSim/Math/UnitTests/QuaternionTests.cpp
+++ SurgSim/Math/UnitTests/QuaternionTests.cpp
@@ -173,6 +173,7 @@
 // Test conversion to and from yaml node
 TYPED_TEST(QuaternionTests, YamlConvert)
 {
+	typedef typename TestFixture::AngleAxis AngleAxis;
 	typedef typename TestFixture::Quaternion Quaternion;
 	typedef typename TestFixture::Scalar T;


Fixed warning with incompatible arguments

Change-Id: Id39143163a570a06020eecc5ddc5ec82c8d12f2c

--- drawinglayer/source/dumper/EnhancedShapeDumper.cxx
+++ drawinglayer/source/dumper/EnhancedShapeDumper.cxx
@@ -201,7 +201,8 @@
             xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s",
                 rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr());
         }
-        xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%" SAL_PRIdINT32, aParameterPair.First.Type);
+        sal_Int32 aType = aParameterPair.First.Type;
+        xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%" SAL_PRIdINT32, aType);
         xmlTextWriterEndElement( xmlWriter );
     }
     {
@@ -213,7 +214,8 @@
             xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("value"), "%s",
                 rtl::OUStringToOString(sValue, RTL_TEXTENCODING_UTF8).getStr());
         }
-        xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%" SAL_PRIdINT32, aParameterPair.Second.Type);
+        sal_Int32 aType = aParameterPair.First.Type;
+        xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%" SAL_PRIdINT32, aType);
         xmlTextWriterEndElement( xmlWriter );
     }
 }


fix: generate DataContainer highmult data only it is needed

--- PWG4/macros/AddTaskMinijet.C
+++ PWG4/macros/AddTaskMinijet.C
@@ -64,17 +64,21 @@
   if(runNumber>0){
     output1  =  mgr->CreateContainer("MiniJets",TList::Class(),
 				  AliAnalysisManager::kOutputContainer, Form("run%d.root",runNumber));
-    outputHM =  mgr->CreateContainer("MiniJets_HighMult",TList::Class(),
-				  AliAnalysisManager::kOutputContainer, Form("run%d.root",runNumber));
+    if(!format.CompareTo("esd") && IsHighMult){
+      outputHM =  mgr->CreateContainer("MiniJets_HighMult",TList::Class(),
+				       AliAnalysisManager::kOutputContainer, Form("run%d.root",runNumber));
+    }
    }

    else{
      output1  = mgr->CreateContainer("MiniJets",TList::Class(),
 				 AliAnalysisManager::kOutputContainer,
 				 Form("%s:PWG4_MiniJets",AliAnalysisManager::GetCommonFileName()));
-     outputHM = mgr->CreateContainer("MiniJets_HighMult",TList::Class(),
-				     AliAnalysisManager::kOutputContainer,
-				     Form("%s:PWG4_MiniJets",AliAnalysisManager::GetCommonFileName()));
+     if(!format.CompareTo("esd") && IsHighMult){
+       outputHM = mgr->CreateContainer("MiniJets_HighMult",TList::Class(),
+				       AliAnalysisManager::kOutputContainer,
+				       Form("%s:PWG4_MiniJets",AliAnalysisManager::GetCommonFileName()));
+     }

    }


ENH (#3111): ResetPerspective after toggling ImageNavigator

--- Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.cpp
+++ Modules/Bundles/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.cpp
@@ -475,6 +475,7 @@
     }
   }
   cherry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->ShowView("org.mitk.views.imagenavigator");
+  cherry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->ResetPerspective();
 }

 void QmitkExtWorkbenchWindowAdvisorHack::onEditPreferences()


COMP: Fix compilation warning.

COMP: Fix compilation warning.

--- Parallel/vtkCommunicator.cxx
+++ Parallel/vtkCommunicator.cxx
@@ -40,7 +40,7 @@
 #define VTK_CREATE(type, name) \
   vtkSmartPointer<type> name = vtkSmartPointer<type>::New()

-vtkCxxRevisionMacro(vtkCommunicator, "1.37");
+vtkCxxRevisionMacro(vtkCommunicator, "1.38");

 vtkCommunicator::vtkCommunicator()
@@ -295,6 +295,7 @@
     case VTK_GENERIC_DATA_SET:
     case VTK_HYPER_OCTREE:
     case VTK_COMPOSITE_DATA_SET:
+    default:
       vtkWarningMacro(
         << "Cannot receive "
         << vtkDataObjectTypes::GetClassNameFromTypeId(data_type));


STYLE: Fixed line lengths.

STYLE: Fixed line lengths.

--- Parallel/vtkPProbeFilter.cxx
+++ Parallel/vtkPProbeFilter.cxx
@@ -26,7 +26,7 @@
 #include "vtkPolyData.h"
 #include "vtkStreamingDemandDrivenPipeline.h"

-vtkCxxRevisionMacro(vtkPProbeFilter, "1.20");
+vtkCxxRevisionMacro(vtkPProbeFilter, "1.21");
 vtkStandardNewMacro(vtkPProbeFilter);

 vtkCxxSetObjectMacro(vtkPProbeFilter, Controller, vtkMultiProcessController);
@@ -150,12 +150,15 @@
   inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES(), 1);
   inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS(),
               0);
-  sourceInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER(),
-                  outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER()));
-  sourceInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES(),
-                  outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES()));
-  sourceInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS(),
-                  outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS()));
+  sourceInfo->Set(
+    vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER(),
+    outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER()));
+  sourceInfo->Set(
+    vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES(),
+    outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES()));
+  sourceInfo->Set(
+    vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS(),
+    outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS()));

   return 1;
 }


fix android compile

fix android compile

--- src/Common/FileSystem.cpp
+++ src/Common/FileSystem.cpp
@@ -27,7 +27,6 @@

 #include <dirent.h>
 #include <sys/types.h>
-#include <sys/dir.h>
 #include <sys/errno.h>

 #define FUNC_ACCESS(x) access(x, F_OK)


OSSIM: SensorModel before Nitf (ProjectionFactory)

--- Utilities/otbossim/src/ossim/projection/ossimProjectionFactoryRegistry.cpp
+++ Utilities/otbossim/src/ossim/projection/ossimProjectionFactoryRegistry.cpp
@@ -140,8 +140,8 @@

 void ossimProjectionFactoryRegistry::initializeDefaults()
 {
+   registerFactory(ossimSensorModelFactory::instance());
    registerFactory(ossimNitfProjectionFactory::instance());
-   registerFactory(ossimSensorModelFactory::instance());
    registerFactory(ossimTiffProjectionFactory::instance());
    registerFactory(ossimMapProjectionFactory::instance());
    registerFactory(ossimSrsProjectionFactory::instance());


fix wrap mode in pmfx demo for d3d

fix wrap mode in pmfx demo for d3d

--- examples/code/pmfx_renderer/pmfx_renderer_demo.cpp
+++ examples/code/pmfx_renderer/pmfx_renderer_demo.cpp
@@ -133,7 +133,6 @@
     u32 normal_tex = put::load_texture("data/textures/pbr/metalgrid2_normal.dds");
     u32 matallic_tex = put::load_texture("data/textures/pbr/metalgrid2_metallic.dds");
     u32 roughness_tex = put::load_texture("data/textures/pbr/metalgrid2_roughness.dds");
-    u32 wrap_linear = pmfx::get_render_state(PEN_HASH("wrap_linear"), pmfx::RS_SAMPLER);

     // add some pillars for overdraw and illumination
     f32   num_pillar_rows = 20;
@@ -181,7 +180,7 @@
             scene->samplers[pillar].sb[3].handle = matallic_tex;

             for(u32 j = 0; j < 4; ++j)
-                scene->samplers[pillar].sb[j].id_sampler_state = wrap_linear;
+                scene->samplers[pillar].sb[j].id_sampler_state = PEN_HASH("wrap_linear");

             pos.z += d * 2.0f;
         }


http/url: Don't add extra `/` when there is no host

--- poseidon/src/http/url.cpp
+++ poseidon/src/http/url.cpp
@@ -353,11 +353,18 @@
       // If a port field is present, write it.
       if(this->m_port)
         fmt << ':' << *(this->m_port);
+
+      /* Some URLs contain no host and no extra slash, for example:
+       *
+       *   file:///usr/include/stdio.h
+       *   ^~~~   ^~~~~~~~~~~~~~~~~~~~
+       *    \      \
+       *    scheme path
+      **/
+      fmt << '/';
     }

     // Write the path.
-    fmt << '/';
-
     for(char ch : this->m_path)
       if(do_is_url_ctype(ch, url_ctype_pchar))
         fmt << ch;


INTEGRATION: CWS xmlfix2 (1.3.112); FILE MERGED 2008/05/15 17:30:15 mst 1.3.112.2: RESYNC: (1.3-1.5); FILE MERGED 2008/03/31 14:37:06 mst 1.3.112.1: #i81678#: interface change: XXPathAPI - desktop/source/deployment/registry/package/dp_package.cxx,   desktop/source/deployment/misc/dp_descriptioninfoset.cxx,   desktop/source/deployment/gui/dp_gui_update{,install}dialog.cxx:   + adapt to changes in css.xml.xpath.XXPathAPI

--- desktop/source/deployment/misc/dp_descriptioninfoset.cxx
+++ desktop/source/deployment/misc/dp_descriptioninfoset.cxx
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: dp_descriptioninfoset.cxx,v $
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -152,9 +152,12 @@
 ::rtl::OUString DescriptionInfoset::getNodeValueFromExpression(::rtl::OUString const & expression) const
 {
     css::uno::Reference< css::xml::dom::XNode > n;
-    if (m_element.is())
-    {
-        n = m_xpath->selectSingleNode(m_element, expression);
+    if (m_element.is()) {
+        try {
+            n = m_xpath->selectSingleNode(m_element, expression);
+        } catch (css::xml::xpath::XPathException &) {
+            // ignore
+        }
     }
     return n.is() ? getNodeValue(n) : ::rtl::OUString();
 }
@@ -206,11 +209,15 @@

 css::uno::Reference< css::xml::dom::XNodeList >
 DescriptionInfoset::getDependencies() const {
-    return m_element.is()
-        ? m_xpath->selectNodeList(
-            m_element,
-            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("desc:dependencies/*")))
-        : new EmptyNodeList;
+    if (m_element.is()) {
+        try {
+            return m_xpath->selectNodeList(m_element, ::rtl::OUString(
+                        RTL_CONSTASCII_USTRINGPARAM("desc:dependencies/*")));
+        } catch (css::xml::xpath::XPathException &) {
+            // ignore
+        }
+    }
+    return new EmptyNodeList;
 }

 css::uno::Sequence< ::rtl::OUString >
@@ -255,7 +262,11 @@
 {
     css::uno::Reference< css::xml::dom::XNode > n;
     if (m_element.is()) {
-        n = m_xpath->selectSingleNode(m_element, expression);
+        try {
+            n = m_xpath->selectSingleNode(m_element, expression);
+        } catch (css::xml::xpath::XPathException &) {
+            // ignore
+        }
     }
     return n.is()
         ? ::boost::optional< ::rtl::OUString >(getNodeValue(n))
@@ -267,7 +278,11 @@
 {
     css::uno::Reference< css::xml::dom::XNodeList > ns;
     if (m_element.is()) {
-        ns = m_xpath->selectNodeList(m_element, expression);
+        try {
+            ns = m_xpath->selectNodeList(m_element, expression);
+        } catch (css::xml::xpath::XPathException &) {
+            // ignore
+        }
     }
     css::uno::Sequence< ::rtl::OUString > urls(ns.is() ? ns->getLength() : 0);
     for (::sal_Int32 i = 0; i < urls.getLength(); ++i) {
@@ -286,13 +301,23 @@
     if (node.is())
     {
         const ::rtl::OUString exp1(RTL_CONSTASCII_USTRINGPARAM("text()"));
-        css::uno::Reference< css::xml::dom::XNode > xPathName = m_xpath->selectSingleNode(node, exp1);
+        css::uno::Reference< css::xml::dom::XNode > xPathName;
+        try {
+            xPathName = m_xpath->selectSingleNode(node, exp1);
+        } catch (css::xml::xpath::XPathException &) {
+            // ignore
+        }
         OSL_ASSERT(xPathName.is());
         if (xPathName.is())
             sPublisherName = xPathName->getNodeValue();

         const ::rtl::OUString exp2(RTL_CONSTASCII_USTRINGPARAM("@xlink:href"));
-        css::uno::Reference< css::xml::dom::XNode > xURL = m_xpath->selectSingleNode(node, exp2);
+        css::uno::Reference< css::xml::dom::XNode > xURL;
+        try {
+            xURL = m_xpath->selectSingleNode(node, exp2);
+        } catch (css::xml::xpath::XPathException &) {
+            // ignore
+        }
         OSL_ASSERT(xURL.is());
         if (xURL.is())
            sURL = xURL->getNodeValue();
@@ -313,7 +338,12 @@
     if (node.is())
     {
         const ::rtl::OUString exp(RTL_CONSTASCII_USTRINGPARAM("text()"));
-        css::uno::Reference< css::xml::dom::XNode > xtext = m_xpath->selectSingleNode(node, exp);
+        css::uno::Reference< css::xml::dom::XNode > xtext;
+        try {
+            xtext = m_xpath->selectSingleNode(node, exp);
+        } catch (css::xml::xpath::XPathException &) {
+            // ignore
+        }
         if (xtext.is())
             return xtext->getNodeValue();
     }
@@ -333,8 +363,12 @@
     if ( ! m_element.is() || !sParent.getLength())
         return css::uno::Reference< css::xml::dom::XNode > ();

-    css::uno::Reference< css::xml::dom::XNode > xParent =
-        m_xpath->selectSingleNode(m_element, sParent);
+    css::uno::Reference< css::xml::dom::XNode > xParent;
+    try {
+        xParent = m_xpath->selectSingleNode(m_element, sParent);
+    } catch (css::xml::xpath::XPathException &) {
+        // ignore
+    }
     css::uno::Reference<css::xml::dom::XNode> nodeMatch;
     if (xParent.is())
     {
@@ -367,7 +401,12 @@
         ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*[@lang=\""))
         + sLocale +
         ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"]")));
-    return m_xpath->selectSingleNode(xParent, exp1);
+    try {
+        return m_xpath->selectSingleNode(xParent, exp1);
+    } catch (css::xml::xpath::XPathException &) {
+        // ignore
+        return 0;
+    }
 }

 css::uno::Reference<css::xml::dom::XNode>
@@ -387,7 +426,11 @@
             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*[@lang=\""))
             + sLangCountry +
             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"]")));
-        nodeMatch = m_xpath->selectSingleNode(xParent, exp1);
+        try {
+            nodeMatch = m_xpath->selectSingleNode(xParent, exp1);
+        } catch (css::xml::xpath::XPathException &) {
+            // ignore
+        }

         //try to match in strings that also have a variant, for example en-US matches in
         //en-US-montana
@@ -397,7 +440,11 @@
                 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*[starts-with(@lang,\""))
                 + sLangCountry +
                 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-\")]")));
-            nodeMatch = m_xpath->selectSingleNode(xParent, exp2);
+            try {
+                nodeMatch = m_xpath->selectSingleNode(xParent, exp2);
+            } catch (css::xml::xpath::XPathException &) {
+                // ignore
+            }
         }
     }

@@ -417,7 +464,11 @@
         ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*[@lang=\""))
         + officeLocale.Language
         + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"]")));
-    nodeMatch = m_xpath->selectSingleNode(xParent, exp1);
+    try {
+        nodeMatch = m_xpath->selectSingleNode(xParent, exp1);
+    } catch (css::xml::xpath::XPathException &) {
+        // ignore
+    }

     //try to match in strings that also have a country and/orvariant, for example en  matches in
     //en-US-montana, en-US, en-montana
@@ -427,7 +478,11 @@
             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*[starts-with(@lang,\""))
             + officeLocale.Language
             + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-\")]")));
-        nodeMatch = m_xpath->selectSingleNode(xParent, exp2);
+        try {
+            nodeMatch = m_xpath->selectSingleNode(xParent, exp2);
+        } catch (css::xml::xpath::XPathException &) {
+            // ignore
+        }
     }
     return nodeMatch;
 }
@@ -439,9 +494,13 @@
     OSL_ASSERT(xParent.is());
     if (xParent->getNodeName().equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("simple-license"))))
     {
-        css::uno::Reference<css::xml::dom::XNode> nodeDefault =
-            m_xpath->selectSingleNode(xParent, ::rtl::OUString(
+        css::uno::Reference<css::xml::dom::XNode> nodeDefault;
+        try {
+            nodeDefault = m_xpath->selectSingleNode(xParent, ::rtl::OUString(
                 RTL_CONSTASCII_USTRINGPARAM("@default-license-id")));
+        } catch (css::xml::xpath::XPathException &) {
+            // ignore
+        }
         if (nodeDefault.is())
         {
             //The old way
@@ -449,12 +508,21 @@
                 ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("desc:license-text[@license-id = \""))
                 + nodeDefault->getNodeValue()
                 + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"]")));
-            return m_xpath->selectSingleNode(xParent, exp1);
+            try {
+                return m_xpath->selectSingleNode(xParent, exp1);
+            } catch (css::xml::xpath::XPathException &) {
+                // ignore
+            }
         }
     }

     const ::rtl::OUString exp2(RTL_CONSTASCII_USTRINGPARAM("*[1]"));
-    return m_xpath->selectSingleNode(xParent, exp2);
+    try {
+        return m_xpath->selectSingleNode(xParent, exp2);
+    } catch (css::xml::xpath::XPathException &) {
+        // ignore
+        return 0;
+    }
 }

 ::rtl::OUString DescriptionInfoset::getLocalizedHREFAttrFromChild(
@@ -470,7 +538,12 @@
         if (out_bParentExists)
             *out_bParentExists = true;
         const ::rtl::OUString exp(RTL_CONSTASCII_USTRINGPARAM("@xlink:href"));
-        css::uno::Reference< css::xml::dom::XNode > xURL = m_xpath->selectSingleNode(node, exp);
+        css::uno::Reference< css::xml::dom::XNode > xURL;
+        try {
+            xURL = m_xpath->selectSingleNode(node, exp);
+        } catch (css::xml::xpath::XPathException &) {
+            // ignore
+        }
         OSL_ASSERT(xURL.is());
         if (xURL.is())
             sURL = xURL->getNodeValue();


Refactored osgsimpleviewerQT4 to implement a GraphicsWindowQT, and then use multiple inheritance to build the final SimpleViewerQT.

--- examples/osgsimpleviewerQT4/osgsimpleviewerQT4.cpp
+++ examples/osgsimpleviewerQT4/osgsimpleviewerQT4.cpp
@@ -14,17 +14,14 @@

 #include <iostream>

-class OSGWidget : public QGLWidget, public osgGA::SimpleViewer
+class GraphicsWindowQT : public QGLWidget,  virtual osgGA::GraphicsWindow
 {
 public:

-    OSGWidget( QWidget * parent = 0, const char * name = 0, const QGLWidget * shareWidget = 0, Qt::WFlags f = 0 );
-    virtual ~OSGWidget() {}
+    GraphicsWindowQT( QWidget * parent = 0, const char * name = 0, const QGLWidget * shareWidget = 0, Qt::WFlags f = 0 );
+    virtual ~GraphicsWindowQT() {}

 protected:
-
-    virtual void initializeGL();
-    virtual void paintGL();

     virtual void resizeGL( int width, int height );
     virtual void keyPressEvent( QKeyEvent* event );
@@ -36,39 +33,29 @@
     QTimer _timer;
 };

-OSGWidget::OSGWidget( QWidget * parent, const char * /*name*/, const QGLWidget * shareWidget, Qt::WFlags f):
+GraphicsWindowQT::GraphicsWindowQT( QWidget * parent, const char * /*name*/, const QGLWidget * shareWidget, Qt::WFlags f):
     QGLWidget(parent, shareWidget, f)
 {
     connect(&_timer, SIGNAL(timeout()), this, SLOT(updateGL()));
     _timer.start(10);
 }

-void OSGWidget::initializeGL()
-{
-    QGLWidget::initializeGL();
-}
-
-void OSGWidget::paintGL()
-{
-    frame();
-}
-
-void OSGWidget::resizeGL( int width, int height )
+void GraphicsWindowQT::resizeGL( int width, int height )
 {
     getEventQueue()->windowResize(0, 0, width, height );
 }

-void OSGWidget::keyPressEvent( QKeyEvent* event )
+void GraphicsWindowQT::keyPressEvent( QKeyEvent* event )
 {
     getEventQueue()->keyPress( (osgGA::GUIEventAdapter::KeySymbol) event->key() );
 }

-void OSGWidget::keyReleaseEvent( QKeyEvent* event )
+void GraphicsWindowQT::keyReleaseEvent( QKeyEvent* event )
 {
     getEventQueue()->keyRelease( (osgGA::GUIEventAdapter::KeySymbol) event->key() );
 }

-void OSGWidget::mousePressEvent( QMouseEvent* event )
+void GraphicsWindowQT::mousePressEvent( QMouseEvent* event )
 {
     int button = 0;
     switch(event->button())
@@ -82,7 +69,7 @@
     getEventQueue()->mouseButtonPress(event->x(), event->y(), button);
 }

-void OSGWidget::mouseReleaseEvent( QMouseEvent* event )
+void GraphicsWindowQT::mouseReleaseEvent( QMouseEvent* event )
 {
     int button = 0;
     switch(event->button())
@@ -96,10 +83,30 @@
     getEventQueue()->mouseButtonRelease(event->x(), event->y(), button);
 }

-void OSGWidget::mouseMoveEvent( QMouseEvent* event )
+void GraphicsWindowQT::mouseMoveEvent( QMouseEvent* event )
 {
     getEventQueue()->mouseMotion(event->x(), event->y());
 }
+
+
+class SimpleViewerQT : public osgGA::SimpleViewer, public GraphicsWindowQT
+{
+    public:
+        SimpleViewerQT() {}
+
+
+        virtual void initializeGL()
+        {
+            QGLWidget::initializeGL();
+        }
+
+        virtual void paintGL()
+        {
+            frame();
+        }
+
+};
+

 int main( int argc, char **argv )
 {
@@ -120,7 +127,7 @@
     }

-    OSGWidget* viewerWindow = new OSGWidget;
+    SimpleViewerQT* viewerWindow = new SimpleViewerQT;

     viewerWindow->setSceneData(loadedModel.get());
     viewerWindow->setCameraManipulator(new osgGA::TrackballManipulator);


Restructuring quire operators to be usable as stand-alone type

--- posit/quire_operators.hpp
+++ posit/quire_operators.hpp
@@ -5,63 +5,4 @@
 //
 // This file is part of the universal numbers project, which is released under an MIT Open Source license.

-#include <limits>
-
-#define NOW 0
-
-#if NOW
-// QUIRE BINARY ARITHMETIC OPERATORS
-template<size_t nbits, size_t es, size_t capacity>
-inline quire<nbits,es,capacity> operator+(const quire<nbits, es, capacity>& lhs, const quire<nbits, es, capacity>& rhs) {
-	quire<nbits, es> sum = lhs;
-	sum += rhs;
-	return sum;
-}
-
-template<size_t nbits, size_t es, size_t capacity>
-inline quire<nbits, es, capacity> operator-(const quire<nbits, es, capacity>& lhs, const quire<nbits, es, capacity>& rhs) {
-	quire<nbits, es, capacity> diff = lhs;
-	diff -= rhs;
-	return diff;
-}
-
-template<size_t nbits, size_t es, size_t capacity>
-inline quire<nbits, es, capacity> operator*(const quire<nbits, es, capacity>& lhs, const quire<nbits, es, capacity>& rhs) {
-	quire<nbits, es, capacity> mul = lhs;
-	mul *= rhs;
-	return mul;
-}
-
-template<size_t nbits, size_t es, size_t capacity>
-inline quire<nbits, es, capacity> operator/(const quire<nbits, es, capacity>& lhs, const quire<nbits, es, capacity>& rhs) {
-	quire<nbits, es, capacity> ratio = lhs;
-	ratio /= rhs;
-	return ratio;
-}
-#endif
-
-////////////////// QUIRE
-template<size_t nbits, size_t es, size_t capacity>
-inline std::ostream& operator<<(std::ostream& ostr, const quire<nbits, es, capacity>& q) {
-	ostr << q.sign_value << ": " << q._accu;
-	return ostr;
-}
-
-template<size_t nbits, size_t es, size_t capacity>
-inline std::istream& operator>> (std::istream& istr, const quire<nbits, es, capacity>& q) {
-	istr >> q._accu;
-	return istr;
-}
-
-template<size_t nbits, size_t es, size_t capacity>
-inline bool operator==(const quire<nbits, es, capacity>& lhs, const quire<nbits, es, capacity>& rhs) { return lhs._accu == rhs._accu; }
-template<size_t nbits, size_t es, size_t capacity>
-inline bool operator!=(const quire<nbits, es, capacity>& lhs, const quire<nbits, es, capacity>& rhs) { return !operator==(lhs, rhs); }
-template<size_t nbits, size_t es, size_t capacity>
-inline bool operator< (const quire<nbits, es, capacity>& lhs, const quire<nbits, es, capacity>& rhs) { return lhs._accu < rhs._accu; }
-template<size_t nbits, size_t es, size_t capacity>
-inline bool operator> (const quire<nbits, es, capacity>& lhs, const quire<nbits, es, capacity>& rhs) { return  operator< (rhs, lhs); }
-template<size_t nbits, size_t es, size_t capacity>
-inline bool operator<=(const quire<nbits, es, capacity>& lhs, const quire<nbits, es, capacity>& rhs) { return !operator> (lhs, rhs); }
-template<size_t nbits, size_t es, size_t capacity>
-inline bool operator>=(const quire<nbits, es, capacity>& lhs, const quire<nbits, es, capacity>& rhs) { return !operator< (lhs, rhs); }
+#include <limits>


Delete pigeonholeSort.cpp

Delete pigeonholeSort.cpp

--- Searching-Sorting/pigeonholeSort.cpp
+++ Searching-Sorting/pigeonholeSort.cpp
@@ -1,65 +0,0 @@
-#include <iostream>
-#include <vector>
-using namespace std;
-/*
-the number of elements (n) and
-the length of the range of possible key values (Range)
-are approximately the same
-Ex: if n=10, min=90, max=100, Range = max-min-1 = 100-90-1= 9
-so, n & Range are approximately the same
-It requires O(n + Range) time
-*/
-
-/* Sorts the array using pigeonhole algorithm */
-void pigeonholeSort(int arr[], int n)
-{
-	// step-1: find max,min in the input array
-	int max=arr[0];
-	int min=arr[0];
-	for(int i=0; i<n; i++){
-		if(arr[i]<min)
-			min = arr[i];
-		if(arr[i]>max)
-			max = arr[i];
-	}
-
-	// step-2: find range from max,min
-	/*
-		to index from 0......to [max-min] = max-min+1
-		that is why range = max-min+1;
-	*/
-	int range = max-min+1;
-
-	// step-3 create pigeonhole of size range
-	vector<int>pigeonhole[range];
-
-	/* Traverse through input array and put every
-       element in its respective hole
-       arr[i]-min is mapping from min-based index into 0-based index
-
-    */
-	for(int i=0; i<n; i++){
-		pigeonhole[arr[i]-min].push_back(arr[i]);
-	}
-
-	/* Traverse through all holes one by one. For
-       every hole, take its elements and put in array.
-    */
-	int index = 0;
-	for(int i=0; i<range; i++){
-		vector<int>::iterator it; // :: is for global scope
-		for(it=pigeonhole[i].begin(); it !=pigeonhole[i].end();  it++)
-			arr[index++] = *it;
-	}
-}
-int main() {
-	// your code goes here
-	int arr[] = {8, 3, 2, 7, 4, 6, 8};
-	int size = sizeof(arr)/sizeof(arr[0]);
-	pigeonholeSort(arr, size);
-	cout<<"Sorted order is : ";
-    for (int i = 0; i < size; i++)
-    	cout<<arr[i]<<" ";
-
-	return 0;
-}


Measure save time.

Measure save time.

--- SelfieSelfie/src/SelfieSelfieApp.cpp
+++ SelfieSelfie/src/SelfieSelfieApp.cpp
@@ -155,6 +155,7 @@

 	if( doSaveImage )
 	{
+		ci::Timer timer(true);
 		doSaveImage = false;

 		auto future = std::async(std::launch::async, [this] (const Surface &s) {
@@ -172,6 +173,9 @@
 		}, copyWindowSurface());

 		saveActions.emplace_back(std::move(future));
+
+		timer.stop();
+		CI_LOG_I( "Save time on main thread: " << timer.getSeconds() * 1000 << "ms" );
 	}

 	introduction.draw();


Added mss::get/putScom

Added mss::get/putScom

Change-Id: I8c48b52b9e7e6107f5b7af10d6016f841a993a62
Original-Change-Id: Ib6571e6e9e374c6d8995235e2553bce149b0113b
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/22988
Tested-by: Jenkins Server
Reviewed-by: Craig C. Hamilton <c9d2e9b2a86d9079d28120673a486feea14472c9@us.ibm.com>
Reviewed-by: Christian Geddes <f397583a9caa8163a06ad1128784fb67413f2fe6@us.ibm.com>
Reviewed-by: Brian Silver <af0eed78d989d9597decc8b92fa6db01ef8b58e0@us.ibm.com>

--- src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs.C
+++ src/import/chips/p9/procedures/hwp/memory/lib/ccs/ccs.C
@@ -62,10 +62,10 @@
     fapi2::buffer<uint64_t> l_buf;

     // Do we need to read this? We are setting the only bit defined in the scomdef? BRS
-    FAPI_TRY(fapi2::getScom(i_target, TT::CNTLQ_REG, l_buf));
-
-    FAPI_TRY( fapi2::putScom(i_target, TT::CNTLQ_REG,
-                             i_start_stop ? l_buf.setBit<TT::CCS_START>() : l_buf.setBit<TT::CCS_STOP>()) );
+    FAPI_TRY(mss::getScom(i_target, TT::CNTLQ_REG, l_buf));
+
+    FAPI_TRY( mss::putScom(i_target, TT::CNTLQ_REG,
+                           i_start_stop ? l_buf.setBit<TT::CCS_START>() : l_buf.setBit<TT::CCS_STOP>()) );

 fapi_try_exit:
     return fapi2::current_err;
@@ -181,8 +181,8 @@
             // simple (straight line) CCS programs. Anything with a loop or such will need another mechanism.
             l_inst_iter->arr1.insertFromRight<MCBIST_CCS_INST_ARR1_00_GOTO_CMD,
                         MCBIST_CCS_INST_ARR1_00_GOTO_CMD_LEN>(l_inst_count + 1);
-            FAPI_TRY( fapi2::putScom(i_target, CCS_ARR0_ZERO + l_inst_count, l_inst_iter->arr0) );
-            FAPI_TRY( fapi2::putScom(i_target, CCS_ARR1_ZERO + l_inst_count, l_inst_iter->arr1) );
+            FAPI_TRY( mss::putScom(i_target, CCS_ARR0_ZERO + l_inst_count, l_inst_iter->arr0) );
+            FAPI_TRY( mss::putScom(i_target, CCS_ARR1_ZERO + l_inst_count, l_inst_iter->arr1) );

             // arr1 contains a specification of the delay and repeat after this instruction, as well
             // as a repeat. Total up the delays as we go so we know how long to wait before polling
@@ -218,8 +218,8 @@
         // here as an instruction forces the CCS engine to wait the delay specified in
         // the last instruction in this array (which it otherwise doesn't do.)
         l_des.arr1.setBit<MCBIST_CCS_INST_ARR1_00_END>();
-        FAPI_TRY( fapi2::putScom(i_target, CCS_ARR0_ZERO + l_inst_count, l_des.arr0) );
-        FAPI_TRY( fapi2::putScom(i_target, CCS_ARR1_ZERO + l_inst_count, l_des.arr1) );
+        FAPI_TRY( mss::putScom(i_target, CCS_ARR0_ZERO + l_inst_count, l_des.arr0) );
+        FAPI_TRY( mss::putScom(i_target, CCS_ARR1_ZERO + l_inst_count, l_des.arr1) );

         FAPI_DBG("css inst %d fixup: 0x%016lX 0x%016lX (0x%lx, 0x%lx) %s",
                  l_inst_count, l_des.arr0, l_des.arr1,


Fix multiple definition of PMFir specialized templates

Change-Id: I0a7d9c4c9f48b911aa81737b8a37560f5812dc68
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25876
Tested-by: Jenkins Server
Tested-by: Hostboot CI
Reviewed-by: Sangeetha T S <76c3d694858156d88d821c78cffa3638992f16de@in.ibm.com>
Reviewed-by: Daniel M. Crowell <912029ca9254ac7b5854e56910561d682e1fa2d0@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/26082
Tested-by: FSP CI Jenkins

--- src/import/chips/p9/procedures/hwp/pm/p9_pm_fir_class.H
+++ src/import/chips/p9/procedures/hwp/pm/p9_pm_fir_class.H
@@ -182,7 +182,7 @@
 /// @param [in] <FIRTYPE_OCC_LFIR>  FIR Type for OCC
 /// @param [in] i_target            Chip Target
 ///
-template <>
+template <> inline
 PMFir<FIRTYPE_OCC_LFIR>::PMFir(
     const fapi2::Target < fapi2::TARGET_TYPE_PROC_CHIP >& i_target)
 {
@@ -203,7 +203,7 @@
 /// @param [in] <FIRTYPE_PBA_LFIR>  FIR Type for PBA
 /// @param [in] i_target            Chip Target
 ///
-template <>
+template <> inline
 PMFir<FIRTYPE_PBA_LFIR>::PMFir(
     const fapi2::Target < fapi2::TARGET_TYPE_PROC_CHIP >& i_target)
 {
@@ -235,7 +235,7 @@
 /// @param [in] <FIRTYPE_CME_LFIR>  FIR Type for CME
 /// @param [in] i_target            EX Target
 ///
-template <>
+template <> inline
 PMFir<FIRTYPE_CME_LFIR>::PMFir(
     const fapi2::Target < fapi2::TARGET_TYPE_EX >& i_target)
 {
@@ -274,7 +274,7 @@
 /// @param [in] <FIRTYPE_PPM_LFIR>  FIR Type for PPM
 /// @param [in] i_target            EQ Target
 ///
-template <>
+template <> inline
 PMFir<FIRTYPE_PPM_LFIR>::PMFir(
     const fapi2::Target < fapi2::TARGET_TYPE_EQ >& i_target)
 {
@@ -310,7 +310,7 @@
 /// @param [in] <FIRTYPE_PPM_LFIR>  FIR Type for PPM
 /// @param [in] i_target            Core Target
 ///
-template <>
+template <> inline
 PMFir<FIRTYPE_PPM_LFIR>::PMFir(
     const fapi2::Target < fapi2::TARGET_TYPE_CORE >& i_target)
 {
@@ -691,7 +691,7 @@
 ///
 /// @return FAPI2_RC_SUCCESS if success, else error code
 ///
-template <>
+template <> inline
 fapi2::ReturnCode PMFir<FIRTYPE_OCC_LFIR>::saveMask()
 {
     uint32_t l_mask;
@@ -709,7 +709,7 @@
 ///
 /// @return FAPI2_RC_SUCCESS if success, else error code
 ///
-template <>
+template <> inline
 fapi2::ReturnCode PMFir<FIRTYPE_PBA_LFIR>::saveMask()
 {
     uint32_t l_mask;
@@ -726,7 +726,7 @@
 ///
 /// @return FAPI2_RC_SUCCESS if success, else error code
 ///
-template <>
+template <> inline
 fapi2::ReturnCode PMFir<FIRTYPE_CME_LFIR>::saveMask()
 {
     uint32_t l_mask;
@@ -743,7 +743,7 @@
 ///
 /// @return FAPI2_RC_SUCCESS if success, else error code
 ///
-template <>
+template <> inline
 fapi2::ReturnCode PMFir<FIRTYPE_PPM_LFIR>::saveMask()
 {
     uint32_t l_mask;
@@ -782,7 +782,7 @@
 ///
 /// @return FAPI2_RC_SUCCESS if success, else error code
 ///
-template <>
+template <> inline
 fapi2::ReturnCode PMFir<FIRTYPE_OCC_LFIR>::restoreSavedMask()
 {
     uint32_t l_mask;
@@ -805,7 +805,7 @@
 ///
 /// @return FAPI2_RC_SUCCESS if success, else error code
 ///
-template <>
+template <> inline
 fapi2::ReturnCode PMFir<FIRTYPE_PBA_LFIR>::restoreSavedMask()
 {
     uint32_t l_mask;
@@ -828,7 +828,7 @@
 ///
 /// @return FAPI2_RC_SUCCESS if success, else error code
 ///
-template <>
+template <> inline
 fapi2::ReturnCode PMFir<FIRTYPE_CME_LFIR>::restoreSavedMask()
 {
     uint32_t l_mask;
@@ -851,7 +851,7 @@
 ///
 /// @return FAPI2_RC_SUCCESS if success, else error code
 ///
-template <>
+template <> inline
 fapi2::ReturnCode PMFir<FIRTYPE_PPM_LFIR>::restoreSavedMask()
 {
     uint32_t l_mask;


implemented flipY option for fcExrContext

--- Plugin/Encoder/fcExrFile.cpp
+++ Plugin/Encoder/fcExrFile.cpp
@@ -108,6 +108,22 @@
     return true;
 }

+
+// pitch: width * pixel size
+static void fcImageFlipY(void *image_, int width, int height, int pitch)
+{
+    std::vector<char> buf_(pitch);
+    char *image = (char*)image_;
+    char *buf = &buf_[0];
+
+    for (int y = 0; y < height / 2; ++y) {
+        int iy = height - y - 1;
+        memcpy(buf, image + (pitch*y), pitch);
+        memcpy(image + (pitch*y), image + (pitch*iy), pitch);
+        memcpy(image + (pitch*iy), buf, pitch);
+    }
+}
+
 bool fcExrContext::addLayerTexture(void *tex, fcTextureFormat fmt, int channel, const char *name, bool flipY)
 {
     std::string *raw_frame = nullptr;
@@ -129,10 +145,12 @@
             m_exr->raw_frames.pop_back();
             return false;
         }
-    }
-
-    {
-        char *raw_data = &(*raw_frame)[0];
+        if (flipY) {
+            fcImageFlipY(&(*raw_frame)[0], m_exr->width, m_exr->height, m_exr->width * fcGetPixelSize(fmt));
+        }
+    }
+
+    {
         Imf::PixelType pixel_type = Imf::HALF;
         int channels = 0;
         int tsize = 0;
@@ -148,13 +166,12 @@
         case fcTextureFormat_RGInt:     pixel_type = Imf::UINT; channels = 2; tsize = 4; break;
         case fcTextureFormat_RInt:      pixel_type = Imf::UINT; channels = 1; tsize = 4; break;
         default:
-        {
             m_exr->raw_frames.pop_back();
             return false;
         }
-        }
         int psize = tsize * channels;

+        char *raw_data = &(*raw_frame)[0];
         m_exr->header.channels().insert(name, Imf::Channel(pixel_type));
         m_exr->frame_buffer.insert(name, Imf::Slice(pixel_type, raw_data + (tsize * channel), psize, psize * m_exr->width));
     }
@@ -178,10 +195,12 @@
         raw_frame = &m_exr->raw_frames.back();
         raw_frame->resize(m_exr->width * m_exr->height * fcGetPixelSize(fmt));
         memcpy(&(*raw_frame)[0], pixels, raw_frame->size());
-    }
-
-    {
-        char *raw_data = &(*raw_frame)[0];
+        if (flipY) {
+            fcImageFlipY(&(*raw_frame)[0], m_exr->width, m_exr->height, m_exr->width * fcGetPixelSize(fmt));
+        }
+    }
+
+    {
         Imf::PixelType pixel_type = Imf::HALF;
         int channels = 0;
         int tsize = 0;
@@ -200,13 +219,12 @@
         case fcPixelFormat_RGInt:     pixel_type = Imf::UINT; channels = 2; tsize = 4; break;
         case fcPixelFormat_RInt:      pixel_type = Imf::UINT; channels = 1; tsize = 4; break;
         default:
-        {
             m_exr->raw_frames.pop_back();
             return false;
         }
-        }
         int psize = tsize * channels;

+        char *raw_data = &(*raw_frame)[0];
         m_exr->header.channels().insert(name, Imf::Channel(pixel_type));
         m_exr->frame_buffer.insert(name, Imf::Slice(pixel_type, raw_data + (tsize * channel), psize, psize * m_exr->width));
     }


Corrigido

Corrigido

--- Reduction/src/Otimizator.cpp
+++ Reduction/src/Otimizator.cpp
@@ -18,7 +18,7 @@
 	bool isToStop = false;
 	while (!isToStop) {

-		std::pair<int,int> pair = this->generateAllPairs();
+		std::pair<int, int> pair = this->generateAllPairs();
 		if (pair.first == -1) {
 			isToStop = true;
 			break;
@@ -26,20 +26,29 @@
 		this->changePair(pair);

 	}
+
+	std::map<int, std::pair<int, int> >::iterator iter;
+
+	for (iter = this->m.begin(); iter != this->m.end(); ++iter) {
+		cout << " variavel " << iter->first << " pair : " << iter->second.first
+				<< "," << iter->second.second << endl;
+	}
+
 	return this->M;
 }

-void Otimizator::changePair(std::pair<int,int> p) {
+void Otimizator::changePair(std::pair<int, int> p) {

 	this->m[this->variable] = p;
 	this->findAndChange(p);
 	this->variable++;
 }

-void Otimizator::findAndChange(std::pair<int,int> p) {
+void Otimizator::findAndChange(std::pair<int, int> p) {
 	int cols_size = this->M.n_cols;
 	for (int i = 0; i < cols_size; i++) {
-		vector<std::pair<int,int> > result = this->generatePairs(this->M.col(i));
+		vector<std::pair<int, int> > result = this->generatePairs(
+				this->M.col(i));
 		if (std::find(result.begin(), result.end(), p) != result.end()) {
 			arma::Col<int> c = this->removePair(p, this->M.col(i));
 			this->M.shed_col(i);
@@ -48,7 +57,8 @@
 	}
 }

-arma::Col<int> Otimizator::removePair(std::pair<int,int> p, arma::Col<int> column) {
+arma::Col<int> Otimizator::removePair(std::pair<int, int> p,
+		arma::Col<int> column) {
 	int col_size = column.size();
 	for (int i = 0; i < col_size; i++) {
 		if (column[i] == p.first) {
@@ -66,14 +76,15 @@
 	return column;
 }

-std::pair<int,int> Otimizator::generateAllPairs() {
-	std::map<std::pair<int,int>, int> allPairs;
+std::pair<int, int> Otimizator::generateAllPairs() {
+	std::map<std::pair<int, int>, int> allPairs;
 	int cols_size = this->M.n_cols;
 	for (int i = 0; i < cols_size; i++) {
-		vector<std::pair<int,int> > pairs = this->generatePairs(this->M.col(i));
-		vector<std::pair<int,int> >::const_iterator cii = pairs.begin();
+		vector<std::pair<int, int> > pairs = this->generatePairs(
+				this->M.col(i));
+		vector<std::pair<int, int> >::const_iterator cii = pairs.begin();
 		while (cii != pairs.end()) {
-			std::pair<int,int> p = *cii;
+			std::pair<int, int> p = *cii;
 			if (allPairs.count(p)) {
 				allPairs[p] = allPairs[p] + 1;
 			} else {
@@ -82,9 +93,9 @@
 			cii++;
 		}
 	}
-	std::pair<int,int> toReturn(-1, -1);
+	std::pair<int, int> toReturn(-1, -1);
 	int index = 0;
-	std::map<std::pair<int,int>, int>::iterator iter;
+	std::map<std::pair<int, int>, int>::iterator iter;

 	for (iter = allPairs.begin(); iter != allPairs.end(); ++iter) {
 		if (iter->second > index) {
@@ -96,8 +107,8 @@
 	return toReturn;
 }

-vector<std::pair<int,int> > Otimizator::generatePairs(arma::Col<int> column) {
-	vector<std::pair<int,int> > result;
+vector<std::pair<int, int> > Otimizator::generatePairs(arma::Col<int> column) {
+	vector<std::pair<int, int> > result;
 	int column_size = column.size();
 	for (int i = 1; i < column_size; i++) {
 		if (column[i] != -1) {
@@ -106,9 +117,9 @@
 				int p2 = column[j];
 				if (p2 != -1) {
 					if (p1 > p2) {
-						result.push_back(std::pair<int,int>(p1, p2));
+						result.push_back(std::pair<int, int>(p1, p2));
 					} else {
-						result.push_back(std::pair<int,int>(p2, p1));
+						result.push_back(std::pair<int, int>(p2, p1));
 					}
 				}
 			}


CPatterned: Mark CMaterialList instance in CollidedWith as constexpr

This isn't ever modified, so we can mark it constexpr to eliminate
potential runtime initializers.

--- Runtime/World/CPatterned.cpp
+++ Runtime/World/CPatterned.cpp
@@ -357,8 +357,8 @@
       }
     }
   }
-  static CMaterialList testList(EMaterialTypes::Solid, EMaterialTypes::Ceiling, EMaterialTypes::Wall,
-                                EMaterialTypes::Floor, EMaterialTypes::Character);
+  static constexpr CMaterialList testList(EMaterialTypes::Solid, EMaterialTypes::Ceiling, EMaterialTypes::Wall,
+                                          EMaterialTypes::Floor, EMaterialTypes::Character);
   for (const CCollisionInfo& info : list) {
     if (info.GetMaterialLeft().Intersection(testList)) {
       if (!info.GetMaterialLeft().HasMaterial(EMaterialTypes::Floor)) {


Fix compilation on c++11. Auto&& not needed here

--- Rx/v2/test/operators/map.cpp
+++ Rx/v2/test/operators/map.cpp
@@ -246,16 +246,16 @@
         auto          empty_on_next = [](copy_verifier) {};
         auto          sub           = rx::make_observer<copy_verifier>(empty_on_next);
         copy_verifier verifier{};
-        auto          obs = verifier.get_observable().map([](auto&& v) { return std::forward<decltype(v)>(v); });
+        auto          obs = verifier.get_observable().map([](copy_verifier v) { return v; });
         WHEN("subscribe")
         {
             obs.subscribe(sub);
             THEN("no extra copies")
             {
-                // 1 copy from map lambda
+                // 1 copy to map lambda
                 REQUIRE(verifier.get_copy_count() == 1);
-                 // 1 move to final lambda
-                REQUIRE(verifier.get_move_count() == 1);
+                 // 1 move from map lambda + 1 move to final lambda
+                REQUIRE(verifier.get_move_count() == 2);
             }
         }
     }
@@ -269,16 +269,16 @@
         auto          empty_on_next = [](copy_verifier) {};
         auto          sub           = rx::make_observer<copy_verifier>(empty_on_next);
         copy_verifier verifier{};
-        auto          obs = verifier.get_observable_for_move().map([](auto&& v) { return std::forward<decltype(v)>(v); });
+        auto          obs = verifier.get_observable_for_move().map([](copy_verifier v) { return v; });
         WHEN("subscribe")
         {
             obs.subscribe(sub);
             THEN("no extra copies")
             {
                 REQUIRE(verifier.get_copy_count() == 0);
-                // 1 move from map lambda +  1 move to final lambda
-                REQUIRE(verifier.get_move_count() == 2);
-            }
-        }
-    }
-}
+                // 1 move to map lambda  + 1 move from map lambda +  1 move to final lambda
+                REQUIRE(verifier.get_move_count() == 3);
+            }
+        }
+    }
+}


minor changes

minor changes

--- examples/mandelbrot.cpp
+++ examples/mandelbrot.cpp
@@ -16,6 +16,7 @@
 #include <iostream>
 #include <string>
 #include <vector>
+#include <typeinfo>       // operator typeid

 #include "pico_bench.hpp"

@@ -52,26 +53,31 @@

 namespace xsimd {

-  template <std::size_t N>
-  inline batch<int, N> mandel(const batch_bool<float, N> &_active,
-                              const batch<float, N> &c_re,
-                              const batch<float, N> &c_im,
+  template <class arch>
+  inline batch<int, arch> mandel(const batch_bool<float, arch> &_active,
+                              const batch<float, arch> &c_re,
+                              const batch<float, arch> &c_im,
                               int maxIters)
   {
-      batch<float, N> z_re = c_re;
-      batch<float, N> z_im = c_im;
-      batch<int,   N> vi(0);
+      using float_batch_type = batch<float, arch>;
+      using int_batch_type = batch<int, arch>;
+
+      constexpr std::size_t N = float_batch_type::size;
+
+      float_batch_type z_re = c_re;
+      float_batch_type z_im = c_im;
+      int_batch_type vi(0);

       for (int i = 0; i < maxIters; ++i)
       {
-          auto active = _active & ((z_re * z_re + z_im * z_im) <= batch<float, N>(4.f));
+          auto active = _active & ((z_re * z_re + z_im * z_im) <= float_batch_type(4.f));
           if (!xsimd::any(active))
           {
               break;
           }

-          batch<float, N> new_re = z_re * z_re - z_im * z_im;
-          batch<float, N> new_im = 2.f * z_re * z_im;
+          float_batch_type new_re = z_re * z_re - z_im * z_im;
+          float_batch_type new_im = 2.f * z_re * z_im;

           z_re = c_re + new_re;
           z_im = c_im + new_im;
@@ -82,7 +88,7 @@
       return vi;
   }

-  template <std::size_t N>
+  template <class arch>
   void mandelbrot(float x0,
                   float y0,
                   float x1,
@@ -92,29 +98,35 @@
                   int maxIters,
                   int output[])
   {
+      using float_batch_type = batch<float, arch>;
+      using int_batch_type = batch<int, arch>;
+
+      constexpr std::size_t N = float_batch_type::size;
       float dx = (x1 - x0) / width;
       float dy = (y1 - y0) / height;

       float arange[N];
       std::iota(&arange[0], &arange[N], 0.f);
-      batch<float, N> programIndex(&arange[0], xsimd::aligned_mode());
+      //float_batch_type programIndex(&arange[0], xsimd::aligned_mode());
+
+      auto programIndex = float_batch_type::load(&arange[0], xsimd::aligned_mode());
       // std::iota(programIndex.begin(), programIndex.end(), 0.f);

       for (int j = 0; j < height; j++)
       {
           for (int i = 0; i < width; i += N)
           {
-              batch<float, N> x(x0 + (i + programIndex) * dx);
-              batch<float, N> y(y0 + j * dy);
-
-              auto active = x < batch<float, N>(width);
+              float_batch_type x(x0 + (i + programIndex) * dx);
+              float_batch_type y(y0 + j * dy);
+
+              auto active = x < float_batch_type(width);

               int base_index = (j * width + i);
-              auto result    = mandel(active, x, y, maxIters);
+              auto result    = mandel<arch>(active, x, y, maxIters);

               // implement masked store!
               // xsimd::store_aligned(result, output + base_index, active);
-              batch<int, N> prev_data(output + base_index);
+              int_batch_type prev_data(output + base_index);
               select(bool_cast(active), result, prev_data)
                     .store_aligned(output + base_index);
           }
@@ -216,6 +228,58 @@
     }

 }  // namespace scalar
+
+
+
+template<class arch, class bencher_t>
+void run_arch(
+              bencher_t & bencher,
+              float x0,
+              float y0,
+              float x1,
+              float y1,
+              int width,
+              int height,
+              int maxIters,
+              std::vector<int, xsimd::aligned_allocator<int>> & buffer)
+{
+  std::fill(buffer.begin(), buffer.end(), 0);
+  auto stats = bencher([&]() {
+    xsimd::mandelbrot<arch>(x0, y0, x1, y1, width, height, maxIters, buffer.data());
+  });
+
+
+  const float scalar_min = stats.min().count();
+
+  std::cout << '\n' << typeid(arch).name() <<" "<< stats << '\n';
+  auto filename = std::string("mandelbrot_") + std::string(typeid(arch).name()) + std::string(".ppm");
+  writePPM(filename.c_str(), width, height, buffer.data());
+
+}
+
+template<class T>
+struct RunMandelbrot;
+
+template<class ... Arch>
+struct RunMandelbrot<xsimd::arch_list<Arch ...>>
+{
+    template<class bencher_t>
+    static void run(
+                  bencher_t & bencher,
+                  float x0,
+                  float y0,
+                  float x1,
+                  float y1,
+                  int width,
+                  int height,
+                  int maxIters,
+                  std::vector<int, xsimd::aligned_allocator<int>> & buffer)
+    {
+      using expand_type = int[];
+      expand_type{(run_arch<Arch>(bencher, x0, y0,x1,x1,width,height, maxIters, buffer),0)...};
+    }
+};
+

 int main()
 {
@@ -263,12 +327,20 @@

     writePPM("mandelbrot_omp.ppm", width, height, buf.data());

+
+
+    RunMandelbrot<xsimd::supported_architectures>::run(bencher, x0, y0, x1, y1, width, height, maxIters, buf);
+
+
+
+
+
     // xsimd_1 run //////////////////////////////////////////////////////////////

     std::fill(buf.begin(), buf.end(), 0);

     auto stats_1 = bencher([&]() {
-      xsimd::mandelbrot<1>(x0, y0, x1, y1, width, height, maxIters, buf.data());
+      xsimd::mandelbrot<xsimd::avx>(x0, y0, x1, y1, width, height, maxIters, buf.data());
     });

     const float xsimd1_min = stats_1.min().count();
@@ -282,7 +354,7 @@
     std::fill(buf.begin(), buf.end(), 0);

     auto stats_4 = bencher([&]() {
-      xsimd::mandelbrot<4>(x0, y0, x1, y1, width, height, maxIters, buf.data());
+      xsimd::mandelbrot<xsimd::avx>(x0, y0, x1, y1, width, height, maxIters, buf.data());
     });

     const float xsimd4_min = stats_4.min().count();
@@ -296,7 +368,7 @@
     std::fill(buf.begin(), buf.end(), 0);

     auto stats_8 = bencher([&]() {
-      xsimd::mandelbrot<8>(x0, y0, x1, y1, width, height, maxIters, buf.data());
+      xsimd::mandelbrot<xsimd::avx>(x0, y0, x1, y1, width, height, maxIters, buf.data());
     });

     const float xsimd8_min = stats_8.min().count();
@@ -305,157 +377,7 @@

     writePPM("mandelbrot_xsimd8.ppm", width, height, buf.data());

-    // xsimd_16 run /////////////////////////////////////////////////////////////
-
-    std::fill(buf.begin(), buf.end(), 0);
-
-    auto stats_16 = bencher([&]() {
-      xsimd::mandelbrot<16>(x0, y0, x1, y1, width, height, maxIters, buf.data());
-    });
-
-    const float xsimd16_min = stats_16.min().count();
-
-    std::cout << '\n' << "xsimd_16 " << stats_16 << '\n';
-
-    writePPM("mandelbrot_xsimd16.ppm", width, height, buf.data());
-
-    // conclusions //////////////////////////////////////////////////////////////
-
-    std::cout << '\n' << "Conclusions: " << '\n';
-
-    // scalar //
-
-    std::cout << '\n'
-              << "--> scalar was " << omp_min / scalar_min
-              << "x the speed of omp";
-
-    std::cout << '\n'
-              << "--> scalar was " << xsimd1_min / scalar_min
-              << "x the speed of xsimd_1";
-
-    std::cout << '\n'
-              << "--> scalar was " << xsimd4_min / scalar_min
-              << "x the speed of xsimd_4";
-
-    std::cout << '\n'
-              << "--> scalar was " << xsimd8_min / scalar_min
-              << "x the speed of xsimd_8";
-
-    std::cout << '\n'
-              << "--> scalar was " << xsimd16_min / scalar_min
-              << "x the speed of xsimd_16" << '\n';
-
-    // omp //
-
-    std::cout << '\n'
-              << "--> omp was " << scalar_min / omp_min
-              << "x the speed of scalar";
-
-    std::cout << '\n'
-              << "--> omp was " << xsimd1_min / omp_min
-              << "x the speed of xsimd_1";
-
-    std::cout << '\n'
-              << "--> omp was " << xsimd4_min / omp_min
-              << "x the speed of xsimd_4";
-
-    std::cout << '\n'
-              << "--> omp was " << xsimd8_min / omp_min
-              << "x the speed of xsimd_8";
-
-    std::cout << '\n'
-              << "--> omp was " << xsimd16_min / omp_min
-              << "x the speed of xsimd_16" << '\n';
-
-    // xsimd1 //
-
-    std::cout << '\n'
-              << "--> xsimd1 was " << scalar_min / xsimd1_min
-              << "x the speed of scalar";
-
-    std::cout << '\n'
-              << "--> xsimd1 was " << omp_min / xsimd1_min
-              << "x the speed of omp";
-
-    std::cout << '\n'
-              << "--> xsimd1 was " << xsimd4_min / xsimd1_min
-              << "x the speed of xsimd_4";
-
-    std::cout << '\n'
-              << "--> xsimd1 was " << xsimd8_min / xsimd1_min
-              << "x the speed of xsimd_8";
-
-    std::cout << '\n'
-              << "--> xsimd1 was " << xsimd16_min / xsimd1_min
-              << "x the speed of xsimd_16" << '\n';
-
-    // xsimd4 //
-
-    std::cout << '\n'
-              << "--> xsimd4 was " << scalar_min / xsimd4_min
-              << "x the speed of scalar";
-
-    std::cout << '\n'
-              << "--> xsimd4 was " << omp_min / xsimd4_min
-              << "x the speed of omp";
-
-    std::cout << '\n'
-              << "--> xsimd4 was " << xsimd1_min / xsimd4_min
-              << "x the speed of xsimd_1";
-
-    std::cout << '\n'
-              << "--> xsimd4 was " << xsimd8_min / xsimd4_min
-              << "x the speed of xsimd_8";
-
-    std::cout << '\n'
-              << "--> xsimd4 was " << xsimd16_min / xsimd4_min
-              << "x the speed of xsimd_16" << '\n';
-
-    // xsimd8 //
-
-    std::cout << '\n'
-              << "--> xsimd8 was " << scalar_min / xsimd8_min
-              << "x the speed of scalar";
-
-    std::cout << '\n'
-              << "--> xsimd8 was " << omp_min / xsimd8_min
-              << "x the speed of omp";
-
-    std::cout << '\n'
-              << "--> xsimd8 was " << xsimd1_min / xsimd8_min
-              << "x the speed of xsimd_1";
-
-    std::cout << '\n'
-              << "--> xsimd8 was " << xsimd4_min / xsimd8_min
-              << "x the speed of xsimd_4";
-
-    std::cout << '\n'
-              << "--> xsimd8 was " << xsimd16_min / xsimd8_min
-              << "x the speed of xsimd_16" << '\n';
-
-    // xsimd16 //
-
-    std::cout << '\n'
-              << "--> xsimd16 was " << scalar_min / xsimd16_min
-              << "x the speed of scalar";
-
-    std::cout << '\n'
-              << "--> xsimd16 was " << omp_min / xsimd16_min
-              << "x the speed of omp";
-
-    std::cout << '\n'
-              << "--> xsimd16 was " << xsimd1_min / xsimd16_min
-              << "x the speed of xsimd_1";
-
-    std::cout << '\n'
-              << "--> xsimd16 was " << xsimd4_min / xsimd16_min
-              << "x the speed of xsimd_4";
-
-    std::cout << '\n'
-              << "--> xsimd16 was " << xsimd8_min / xsimd16_min
-              << "x the speed of xsimd_8" << '\n';
-
-    std::cout << '\n' << "wrote output images to 'mandelbrot_[type].ppm'" << '\n';
+

     return 0;
 }


Fatal will be produced if the field is requested w/o having been initialized

--- STEER/ESD/AliTrackerBase.cxx
+++ STEER/ESD/AliTrackerBase.cxx
@@ -71,7 +71,11 @@
 Double_t AliTrackerBase::GetBz()
 {
   AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
-  if (!fld) return 0.5*kAlmost0Field;
+  if (!fld) {
+    AliFatalClass("Field is not loaded");
+    //if (!fld)
+    return  0.5*kAlmost0Field;
+  }
   Double_t bz = fld->SolenoidField();
   return TMath::Sign(0.5*kAlmost0Field,bz) + bz;
 }
@@ -82,7 +86,11 @@
   // Returns Bz (kG) at the point "r" .
   //------------------------------------------------------------------
   AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
-  if (!fld) return  0.5*kAlmost0Field;
+  if (!fld) {
+    AliFatalClass("Field is not loaded");
+    //  if (!fld)
+    return  0.5*kAlmost0Field;
+  }
   Double_t bz = fld->GetBz(r);
   return  TMath::Sign(0.5*kAlmost0Field,bz) + bz;
 }
@@ -94,9 +102,10 @@
   //------------------------------------------------------------------
   AliMagF* fld = (AliMagF*)TGeoGlobalMagField::Instance()->GetField();
   if (!fld) {
-     b[0] = b[1] = 0.;
-     b[2] = 0.5*kAlmost0Field;
-     return;
+    AliFatalClass("Field is not loaded");
+    // b[0] = b[1] = 0.;
+    // b[2] = 0.5*kAlmost0Field;
+    return;
   }

   if (fld->IsUniform()) {


Fix a bug receiving unknown character

Fix a bug receiving unknown character

On timeout in receiving, treat a invalid character as valid.

--- SerialPortReceiverThread.cpp
+++ SerialPortReceiverThread.cpp
@@ -14,7 +14,7 @@
 {
 	uint8_t data;
 	if (serialPort.IsOpen()) {
-		if (serialPort.Read(&data, 0, 1)) {
+		if (serialPort.Read(&data, 0, 1) == 1) {
 			this->onByteReceived(data);
 		}
 		else {


add the using namespace.

add the using namespace.

for convinience.

--- Shared/Scenes/TitleScene.cpp
+++ Shared/Scenes/TitleScene.cpp
@@ -3,25 +3,29 @@

 namespace SunnySideUp {

-  class TitleScene : public Mai::Scene {
+  using namespace Mai;
+
+  class TitleScene : public Scene {
   public:
-	TitleScene() : result(Mai::SCENEID_CONTINUE), loaded(false) {}
+	TitleScene() : result(SCENEID_CONTINUE), loaded(false) {}
 	virtual ~TitleScene() {}
-	virtual bool Load(Mai::Engine& engine) {
+	virtual bool Load(Engine& engine) {
 	  if (!loaded) {
 		objList.reserve(8);
-		Mai::Renderer& r = engine.GetRenderer();
-		auto obj = r.CreateObject("TitleLogo", Mai::Material(Mai::Color4B(255, 255, 255, 255), 0, 0), "default");
-		obj->SetTranslation(Mai::Vector3F(0, -5, 0));
-		//obj->SetRotation(degreeToRadian<float>(0), degreeToRadian<float>(0), degreeToRadian<float>(0));
-		//obj->SetScale(Vector3F(5, 5, 5));
-		objList.push_back(obj);
+		Renderer& r = engine.GetRenderer();
+		{
+		  auto obj = r.CreateObject("TitleLogo", Material(Color4B(255, 255, 255, 255), 0, 0), "default");
+		  obj->SetTranslation(Vector3F(0, -5, 0));
+		  //obj->SetRotation(degreeToRadian<float>(0), degreeToRadian<float>(0), degreeToRadian<float>(0));
+		  //obj->SetScale(Vector3F(5, 5, 5));
+		  objList.push_back(obj);
+		}
 		loaded = true;
 	  }
 	  status = STATUSCODE_RUNNABLE;
 	  return true;
 	}
-	virtual bool Unload(Mai::Engine&) {
+	virtual bool Unload(Engine&) {
 	  if (loaded) {
 		objList.clear();
 		loaded = false;
@@ -29,14 +33,14 @@
 	  status = STATUSCODE_STOPPED;
 	  return true;
 	}
-	virtual int Update(Mai::Engine& engine, float tick) {
-	  Mai::Renderer& r = engine.GetRenderer();
-	  r.Update(tick, Mai::Position3F(0, 0, 0), Mai::Vector3F(0, -1, 0), Mai::Vector3F(0, 0, -1));
+	virtual int Update(Engine& engine, float tick) {
+	  Renderer& r = engine.GetRenderer();
+	  r.Update(tick, Position3F(0, 0, 0), Vector3F(0, -1, 0), Vector3F(0, 0, -1));
 	  return result;
 	}
-	virtual void ProcessWindowEvent(Mai::Engine& engine, const Mai::Event& e) {
+	virtual void ProcessWindowEvent(Engine& engine, const Event& e) {
 	  switch (e.Type) {
-	  case Mai::Event::EVENT_MOUSE_BUTTON_PRESSED:
+	  case Event::EVENT_MOUSE_BUTTON_PRESSED:
 		if (e.MouseButton.Button == MOUSEBUTTON_LEFT) {
 		  result = SCENEID_STARTEVENT;
 		}
@@ -45,18 +49,18 @@
 		break;
 	  }
 	}
-	virtual void Draw(Mai::Engine& engine) {
-	  Mai::Renderer& r = engine.GetRenderer();
+	virtual void Draw(Engine& engine) {
+	  Renderer& r = engine.GetRenderer();
 	  r.Render(&objList[0], &objList[0] + objList.size());
 	}
   private:
-	std::vector<Mai::ObjectPtr> objList;
+	std::vector<ObjectPtr> objList;
 	int result;
 	bool loaded;
   };

-  Mai::ScenePtr CreateTitleScene(Mai::Engine&) {
-	return Mai::ScenePtr(new TitleScene());
+  ScenePtr CreateTitleScene(Engine&) {
+	return ScenePtr(new TitleScene());
   }

 } // namespace SunnySideUp


Doc doxygen documentation to class Reader

--- Simulator/include/Reader.hpp
+++ Simulator/include/Reader.hpp
@@ -27,14 +27,59 @@
 #include <boost/filesystem/fstream.hpp>
 #include <boost/thread.hpp>

+/**
+*  /struct   Reader
+*  /brief    Take an .csv .dat input file and simulated and EASEA node
+*  /details  Used the communication modules from EASEA programs. Each Reader
+*            object run in a separated thread.
+**/
 class Reader {
 public:
+  /**
+  * /brief    Constructor of Reader
+  * /details  Use a pre-existing AudioMonitorModule which initialized the
+  *           communication to the central server.
+  *
+  * @param    path          Path to a data file (currently supported : EASEA formated .csv and
+  *                         .dat)
+  * @param    sendingModule An AudioMonitorModule correctly linked to a monitoring server.
+  * @param    params        A MonitorParameter derived object
+  **/
   Reader (char* path,AudioMonitorModule* sendingModule,MonitorParameter* params);
+  /**
+  * /brief    Destructor of Reader
+  * /details  Free the associated AudioMonitorModule and MonitorParameter
+  *
+  **/
   virtual ~Reader ();

+  /**
+  * /brief    Start the simulation in an encapsulated thread
+  * /details  Call readAndSend() in a boost::thread.
+  *
+  **/
   void start();
+  /**
+  * /brief    Join the encapsulated thread.
+  * /details  Wrap boost::thread join() on the encapsulated thread.
+  *
+  **/
   void join();
+  /**
+  * /brief    The main loop, read from the input file to send a
+  *           monitoring message.
+  * /details
+  **/
   void readAndSend();
+  /**
+  * /brief    Test if the given buffer correspond to a data line or not
+  * /details  Check if '#' if the first letter of a .dat line, or if the first
+  *           element is a letter in case of a .csv file
+  *
+  * @param    extension The input file path extension
+  * @param    buffer    A buffer corresponding to a line of the file
+  * @return   bool      True if it's a data line, false otherwise.
+  **/
   bool testLine(boost::filesystem::path extension,std::string buffer);
 private:
   boost::filesystem::path mPathTo;


Patched up a bug in the backend receive code.

--- SlimTuneCLR/SocketServer.cpp
+++ SlimTuneCLR/SocketServer.cpp
@@ -109,6 +109,12 @@
 		wcscpy_s(mapping.Signature, Messages::MapFunction::MaxSignatureSize, func->Signature.c_str());
 		mapping.Write(m_server, func->Name.size(), func->Signature.size());
 	}
+	else
+	{
+#ifdef DEBUG
+		__debugbreak();
+#endif
+	}
 }

 bool TcpConnection::ContinueRead(const boost::system::error_code&, size_t bytesRead)
@@ -117,9 +123,9 @@
 		return false;

 	size_t prevBytes = kBufferSize - m_recvSize;
+	size_t bytesToParse = bytesRead + prevBytes - m_parseOffset;

 	char* bufPtr = &m_recvBuffer[m_parseOffset];
-	size_t bytesToParse = bytesRead + prevBytes;
 	while(bytesToParse > 0)
 	{
 		size_t bytesParsed = 0;
@@ -134,7 +140,12 @@
 				break;
 			}
 		default:
-			goto FinishRead;
+#ifdef DEBUG
+			__debugbreak();
+#endif
+			//this is considered catastrophic corruption, so terminate the connection
+			m_socket.close();
+			return true;
 		}

 		bufPtr += bytesParsed;


Added missing semicolons

Added missing semicolons

--- Source/RTEngine/Vector3D.hpp
+++ Source/RTEngine/Vector3D.hpp
@@ -22,9 +22,9 @@

             float K(void) const;

-            Vector3D Add(const Vector3D &v) const
+            Vector3D Add(const Vector3D &v) const;

-            Vector3D Subtract(const Vector3D &v) const
+            Vector3D Subtract(const Vector3D &v) const;

             Vector3D Normalize(void) const;

@@ -36,7 +36,7 @@

             Vector3D Clip(float maxVal) const;

-            Vector3D Weight(Vector3D dimWeights) const
+            Vector3D Weight(Vector3D dimWeights) const;

             float Dot(const Vector3D &rhs) const;


Added Lua bindings to the mode manager system

--- Source/Scripting/LuaBind.cpp
+++ Source/Scripting/LuaBind.cpp
@@ -2,9 +2,23 @@
 #include "Utilities/ResourceManager.h"
 #include "Sound/Sound.h"
 #include "Graphics/Graphics.h"
+#include "Modes/ModeManager.h"

 namespace
 {
+
+int MM_Switch ( lua_State* L )
+{
+	const char* newmode = luaL_checkstring(L, 1);
+	SwitchMode(std::string(newmode));
+	return 0;
+}
+
+luaL_Reg registryModeManager[] =
+{
+	"switch", MM_Switch,
+	NULL, NULL
+};

 int RM_Load ( lua_State* L )
 {
@@ -157,6 +171,7 @@

 void __LuaBind ( lua_State* L )
 {
+	luaL_register(L, "mode_manager", registryModeManager);
     luaL_register(L, "resource_manager", registryResourceManager);
     luaL_register(L, "graphics", registryGraphics);
     luaL_register(L, "sound", registrySound);


Expose the number of elements in the recalcStyle trace macro.

Make it easier to debug recalcStyle traces.

Review URL: https://codereview.chromium.org/395133007

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@178316 bbb929c8-8fbe-4397-9dbb-9b2b20218538

--- Source/core/dom/Document.cpp
+++ Source/core/dom/Document.cpp
@@ -1795,9 +1795,10 @@
     // UpdateSuspendScope::performDeferredWidgetTreeOperations() ?
     RefPtr<LocalFrame> protect(m_frame);

-    TRACE_EVENT0("blink", "Document::updateRenderTree");
+    TRACE_EVENT_BEGIN0("blink", "Document::updateRenderTree");
     TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "UpdateRenderTree");

+    // FIXME: Remove m_styleRecalcElementCounter, we should just use the accessCount() on the resolver.
     m_styleRecalcElementCounter = 0;
     TRACE_EVENT_BEGIN1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "RecalculateStyles", "frame", frame());
     TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"), "CallStack", "stack", InspectorCallStackEvent::currentCallStack());
@@ -1839,6 +1840,7 @@
     ASSERT(!m_timeline->hasOutdatedAnimationPlayer());

     TRACE_EVENT_END1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "RecalculateStyles", "elementCount", m_styleRecalcElementCounter);
+    TRACE_EVENT_END1("blink", "Document::updateRenderTree", "elementCount", m_styleRecalcElementCounter);
     // FIXME(361045): remove InspectorInstrumentation calls once DevTools Timeline migrates to tracing.
     InspectorInstrumentation::didRecalculateStyle(cookie, m_styleRecalcElementCounter);
 }


Document should not use confusingAndOftenMisusedAttached()

Switch all the callers of confusingAndOftenMisusedAttached() in Document.cpp
to something more specific. I tried this once, but I changed too many things
in the same patch like changing the nulling out of the RenderView inside
Document::detach: https://codereview.chromium.org/26347002

This patch changes fewer things and only switches the callers inside
Document.cpp. Future patches will attempt to clean up Documen::detach
like I did in the original patch.

Review URL: https://codereview.chromium.org/54233004

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@161087 bbb929c8-8fbe-4397-9dbb-9b2b20218538

--- Source/core/dom/Document.cpp
+++ Source/core/dom/Document.cpp
@@ -1532,7 +1532,7 @@

 void Document::unscheduleStyleRecalc()
 {
-    ASSERT(!confusingAndOftenMisusedAttached() || (!needsStyleRecalc() && !childNeedsStyleRecalc()));
+    ASSERT(!isActive() || (!needsStyleRecalc() && !childNeedsStyleRecalc()));
     m_styleRecalcTimer.stop();
 }

@@ -1946,7 +1946,7 @@

 void Document::attach(const AttachContext& context)
 {
-    ASSERT(!confusingAndOftenMisusedAttached());
+    ASSERT(m_lifecyle.state() == DocumentLifecycle::Inactive);
     ASSERT(!m_axObjectCache || this != topDocument());

     m_renderView = new RenderView(this);
@@ -1965,9 +1965,8 @@

 void Document::detach(const AttachContext& context)
 {
+    ASSERT(isActive());
     m_lifecyle.advanceTo(DocumentLifecycle::Stopping);
-
-    ASSERT(confusingAndOftenMisusedAttached());

     if (page())
         page()->documentDetached(this);
@@ -2036,9 +2035,8 @@
 {
     disconnectDescendantFrames();

-    // The process of disconnecting descendant frames could have already
-    // detached us.
-    if (!confusingAndOftenMisusedAttached())
+    // The process of disconnecting descendant frames could have already detached us.
+    if (!isActive())
         return;

     if (DOMWindow* window = this->domWindow())
@@ -3162,7 +3160,7 @@
 {
     // Don't bother updating, since we haven't loaded all our style info yet
     // and haven't calculated the style selector for the first time.
-    if (!confusingAndOftenMisusedAttached() || (!m_didCalculateStyleResolver && !haveStylesheetsLoaded())) {
+    if (!isActive() || (!m_didCalculateStyleResolver && !haveStylesheetsLoaded())) {
         m_styleResolver.clear();
         return;
     }


Add more AIM datatypes to ScancoCTReader.

--- Source/vtkScancoCTReader.cxx
+++ Source/vtkScancoCTReader.cxx
@@ -565,37 +565,63 @@
     h += 4;
     }

-  // only short and char are supported
-  if (dataType == 0x00020002)
-    {
-    this->SetDataScalarType(VTK_SHORT);
-    }
-  else if (dataType == 0x00010001)
-    {
-    this->SetDataScalarType(VTK_SIGNED_CHAR);
-    }
-  else if (dataType == 0x00150001)
-    {
-    this->Compression = 0x00b2; // run-length compressed bits
-    this->SetDataScalarType(VTK_SIGNED_CHAR);
-    }
-  else if (dataType == 0x00080002)
-    {
-    this->Compression = 0x00c2; // run-length compressed signed char
-    this->SetDataScalarType(VTK_SIGNED_CHAR);
-    }
-  else if (dataType == 0x00060001)
-    {
-    this->Compression = 0x00b1; // packed bits
-    this->SetDataScalarType(VTK_SIGNED_CHAR);
-    }
-  else
-    {
-    vtkErrorMacro("Unrecognized data type in AIM file: " << dataType);
-    return 0;
-    }
-
-  this->SetNumberOfScalarComponents(1);
+  // number of components per pixel is 1 by default
+  int scalarType = VTK_UNSIGNED_CHAR;
+  int scalarComponents = 1;
+  this->Compression = 0;
+
+  // a limited selection of data types are supported
+  // (only 0x00010001 (char) and 0x00020002 (short) are fully tested)
+  switch (dataType)
+    {
+    case 0x00160001:
+      scalarType = VTK_UNSIGNED_CHAR;
+      break;
+    case 0x000d0001:
+      scalarType = VTK_UNSIGNED_CHAR;
+      break;
+    case 0x00120003:
+      scalarType = VTK_UNSIGNED_CHAR;
+      scalarComponents = 3;
+      break;
+    case 0x00010001:
+      scalarType = VTK_SIGNED_CHAR;
+      break;
+    case 0x00060003:
+      scalarType = VTK_SIGNED_CHAR;
+      scalarComponents = 3;
+      break;
+    case 0x00170002:
+      scalarType = VTK_UNSIGNED_SHORT;
+      break;
+    case 0x00020002:
+      scalarType = VTK_SHORT;
+      break;
+    case 0x00030004:
+      scalarType = VTK_INT;
+      break;
+    case 0x001a0004:
+      scalarType = VTK_FLOAT;
+      break;
+    case 0x00150001:
+      this->Compression = 0x00b2; // run-length compressed bits
+      scalarType = VTK_SIGNED_CHAR;
+      break;
+    case 0x00080002:
+      this->Compression = 0x00c2; // run-length compressed signed char
+      scalarType = VTK_SIGNED_CHAR;
+      break;
+    case 0x00060001:
+      this->Compression = 0x00b1; // packed bits
+      scalarType = VTK_SIGNED_CHAR;
+      break;
+    default:
+      vtkErrorMacro("Unrecognized data type in AIM file: " << dataType);
+      return 0;
+    }
+
+  this->SetDataScalarType(scalarType);
+  this->SetNumberOfScalarComponents(scalarComponents);
   this->SetDataByteOrderToLittleEndian();
   this->SetFileDimensionality(3);


Restore null checks to fix LinkHighlight crashes

LinkHighlight assumes that its paint invalidation container
is composited, but crash reports show that this isn't always the
case.

This restores the null check in
LinkHighlight::attachLinkHighlightToCompositingLayer
that was removed in http://crrev.com/757933003.

This also adds a null check to
LinkHighlight::computeHighlightLayerPathAndPosition,
effectively restoring the check removed in
http://crrev.com/809113002 (but adding a check in
the caller of mapPointToPaintBackingCoordinates rather
than in that function).

BUG=431961

Review URL: https://codereview.chromium.org/929353003

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@190361 bbb929c8-8fbe-4397-9dbb-9b2b20218538

--- Source/web/LinkHighlight.cpp
+++ Source/web/LinkHighlight.cpp
@@ -109,7 +109,8 @@
 void LinkHighlight::attachLinkHighlightToCompositingLayer(const LayoutLayerModelObject* paintInvalidationContainer)
 {
     GraphicsLayer* newGraphicsLayer = paintInvalidationContainer->layer()->graphicsLayerBacking();
-    if (!newGraphicsLayer->drawsContent())
+    // FIXME: There should always be a GraphicsLayer. See crbug.com/431961.
+    if (newGraphicsLayer && !newGraphicsLayer->drawsContent())
         newGraphicsLayer = paintInvalidationContainer->layer()->graphicsLayerBackingForScrolling();
     if (!newGraphicsLayer)
         return;
@@ -190,6 +191,12 @@
         return false;
     ASSERT(paintInvalidationContainer);

+    // FIXME: This is defensive code to avoid crashes such as those described in
+    // crbug.com/440887. This should be cleaned up once we fix the root cause of
+    // of the paint invalidation container not being composited.
+    if (!paintInvalidationContainer->layer()->compositedLayerMapping() && !paintInvalidationContainer->layer()->groupedMapping())
+        return false;
+
     // Get quads for node in absolute coordinates.
     Vector<FloatQuad> quads;
     computeQuads(*m_node, quads);


Fixes black images on android on startup

(the glitch where sprites are black on startup if you use a texture twice)

--- StarEngine/jni/EventLoop.cpp
+++ StarEngine/jni/EventLoop.cpp
@@ -139,7 +139,7 @@
 			Logger::GetInstance()->Log(LogLevel::Info,
 					_T("Eventloop : APP CMD GAINED FOXUS, Initited MainGame"),
 					STARENGINE_LOG_TAG);
-			TextureManager::GetInstance()->ReloadAllTextures();
+			//TextureManager::GetInstance()->ReloadAllTextures();
 			SceneManager::GetInstance()->processActivityEvent(pCommand,
 					pApplication);
 		}


Fix for bug #55291 Memory leak in the TRD QA

--- TRD/AliTRDQADataMakerRec.cxx
+++ TRD/AliTRDQADataMakerRec.cxx
@@ -802,6 +802,7 @@

   // clean up

+  delete data;
   AliInfo("sucessfull execution of QA for TRD raw data");
   //printf("sucessfull execution of QA for TRD raw data\n");


Fixed bugs with Boots of Speed

Fixed bugs with Boots of Speed

--- TemplePlus/ability_fixes.cpp
+++ TemplePlus/ability_fixes.cpp
@@ -23,6 +23,9 @@
 	static int MonsterSubtypeFire(DispatcherCallbackArgs args);
 	static int GrappledMoveSpeed(DispatcherCallbackArgs args);
 	static int DiplomacySkillSynergy(DispatcherCallbackArgs args);
+
+	static int BootsOfSpeedNewday(DispatcherCallbackArgs args);
+	static int BootsOfSpeedBeginRound(DispatcherCallbackArgs args);

 	void apply() override {

@@ -53,6 +56,9 @@

 		}

+		replaceFunction(0x10101EB0, BootsOfSpeedNewday);
+		replaceFunction(0x101020A0, BootsOfSpeedBeginRound);
+
 		replaceFunction(0x100FDE00, MonsterSubtypeFire); // fixes 2x damage factor for vulnerability to cold (should be 1.5)

 		replaceFunction(0x100EA040, PoisonedOnBeginRound);
@@ -282,3 +288,29 @@
 		dispIo->bonOut->AddBonus(2, 0, 302);
 	return 0;
 }
+
+int AbilityConditionFixes::BootsOfSpeedNewday(DispatcherCallbackArgs args){
+	auto arg1 = args.GetCondArg(1);
+	args.SetCondArg(0, arg1);
+	return 0;
+}
+
+int AbilityConditionFixes::BootsOfSpeedBeginRound(DispatcherCallbackArgs args){
+
+	auto roundsRem = args.GetCondArg(0);
+	auto isOn = args.GetCondArg(3);
+	if (!isOn)
+		return 0;
+	GET_DISPIO(dispIoTypeSendSignal, DispIoD20Signal);
+	int roundsNew = roundsRem - (int)dispIo->data1;
+	if (roundsNew >= 0){
+		args.SetCondArg(0, roundsNew);
+		return 1;
+	}
+	// conds.ConditionRemove(args.objHndCaller, args.subDispNode->condNode); // this was a bug in vanilla! should just reset the isOn arg, as below
+	args.SetCondArg(3, 0);
+
+	auto partsysId = args.GetCondArg(4);
+	gameSystems->GetParticleSys().End(partsysId);
+	return 0;
+}


doc for GetSpecies methods

doc for GetSpecies methods

--- TerrainSDK/vtdata/Plants.cpp
+++ TerrainSDK/vtdata/Plants.cpp
@@ -188,6 +188,14 @@
 	}
 }*/

+/**
+ * Find the index of a species by scientific name.
+ * Example:
+	\code
+	short index = pSpeciesList->GetSpeciesIdByName("Cocos nucifera");
+	\endcode
+ * \return The 0-based index, or -1 if not found.
+ */
 short vtSpeciesList::GetSpeciesIdByName(const char *name) const
 {
 	for (unsigned int j = 0; j < NumSpecies(); j++)
@@ -198,6 +206,14 @@
 	return -1;
 }

+/**
+ * Find the index of a species by common name.
+ * Example:
+	\code
+	short index = pSpeciesList->GetSpeciesIdByName("Coconut Palm");
+	\endcode
+ * \return The 0-based index, or -1 if not found.
+ */
 short vtSpeciesList::GetSpeciesIdByCommonName(const char *name) const
 {
 	unsigned int i, j;


Revert "Optimieren update_force"

Revert "Optimieren update_force"

das ist keine optimierung.  schlechtere performance und
unverständlicher, wirrer code.
Revert "Optimieren update_force"

This reverts commit
5f4b60dc9e1654c9e45ee8c85a1fc74ded1261fa.

--- Thermostaten/src/Polymer.cpp
+++ Thermostaten/src/Polymer.cpp
@@ -11,7 +11,6 @@

 void Polymer::initiate_monomers_random() {
 	double av_velocity = 0.0;
-
 	for (auto& m : monomers) {
 		m.velocity = drand48() - 0.5;
 		av_velocity += m.velocity;
@@ -26,7 +25,6 @@
 void Polymer::initiate_monomers_one() { //erstes Monomer großteil der Energie
 	double max_vel = sqrt((monomers.size() - 1)*ref_k*temp() / monomer_mass);
 	double speed = -max_vel / (monomers.size() - 1);
-
 	for (auto& m : monomers) m.velocity = speed;
 	monomers[0].velocity = max_vel;
 }
@@ -58,30 +56,25 @@
 double Polymer::force(double r) { return -r*m_feder_konst; }

 void Polymer::update_forces() {
-        double force_buf = 0;
-        auto mi=monomers.begin(), mj=monomers.begin();
-        mj->force=0;
-
-        for (mi=monomers.begin(), mj=mi, ++mj ; mi!=monomers.end() ; ++mi, ++mj) {
-                if ( mj==monomers.end() ) mj = monomers.begin();
-                else mj->force=0;
-
-                force_buf = force(*mi - *mj);
-                mi->force += force_buf;
-                mj->force -= force_buf;
-        }
+	//wahrscheinlich durch Optimierung der nächsten Schleife unnötig
+	for (auto& m : monomers) m.force = 0;
+	unsigned int size = monomers.size();
+	for (unsigned int i = 1; i <= size; i++) {
+		double force_buf = force(monomers[i - 1] - monomers[i % size]);
+		monomers[i - 1].force += force_buf; //bin mir da mit dem Vorzeichen nicht sicher!
+		monomers[i % size].force -= force_buf;
+	}
 }

 double Polymer::update_ekin(){
 	ekin = 0.0;
-	for (auto& m : monomers) ekin += m.velocity*m.velocity;
+	for (auto& m : monomers) ekin += m.velocity*m.velocity; //mass = 1
 	ekin *= monomer_mass*0.5;
 	return ekin;
 }

 double Polymer::calculate_temp() const {
 	double av_velocity = 0, av_energy = 0;
-
 	for (auto& m : monomers) av_velocity += m.velocity;
 	av_velocity /= monomers.size();
 	for (auto& m : monomers) av_energy += pow(m.velocity - av_velocity, 2);


uhd: cleanup startup timestamp alignment

At startup, instead of flushing initial packets blindly,
send a stop streaming command, flush, and start. The same
procedure is used in the event of a runtime timestamp
validity error.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: 504cad4147f1e500be0a169b9f46375eaf875953@2651 19bc5d8c-e614-43d4-8b26-e1612bc8e597

--- Transceiver52M/UHDDevice.cpp
+++ Transceiver52M/UHDDevice.cpp
@@ -228,7 +228,7 @@
 	  tx_gain(0.0), tx_gain_min(0.0), tx_gain_max(0.0),
 	  rx_gain(0.0), rx_gain_min(0.0), rx_gain_max(0.0),
 	  tx_freq(0.0), rx_freq(0.0), tx_spp(0), rx_spp(0),
-	  started(false), aligned(true), rx_pkt_cnt(0), drop_cnt(0),
+	  started(false), aligned(false), rx_pkt_cnt(0), drop_cnt(0),
 	  prev_ts(0,0), ts_offset(0), rx_smpl_buf(NULL)
 {
 	this->skip_rx = skip_rx;
@@ -371,6 +371,10 @@
 	uhd::rx_metadata_t metadata;
 	size_t num_smpls;
 	uint32_t buff[rx_spp];
+	float timeout;
+
+	// Use .01 sec instead of the default .1 sec
+	timeout = .01;

 	for (size_t i = 0; i < num_pkts; i++) {
 		num_smpls = usrp_dev->get_device()->recv(
@@ -378,7 +382,8 @@
 					rx_spp,
 					metadata,
 					uhd::io_type_t::COMPLEX_INT16,
-					uhd::device::RECV_MODE_ONE_PACKET);
+					uhd::device::RECV_MODE_ONE_PACKET,
+					timeout);

 		if (!num_smpls)
 			return false;
@@ -417,16 +422,7 @@
 	async_event_thrd.start((void * (*)(void*))async_event_loop, (void*)this);

 	// Start streaming
-	uhd::stream_cmd_t cmd = uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS;
-	cmd.stream_now = true;
-	usrp_dev->set_time_now(uhd::time_spec_t(0.0));
-
-	if (!skip_rx)
-		usrp_dev->issue_stream_cmd(cmd);
-
-	// Flush out any early garbage
-	if (!flush_recv(20))
-		return false;
+	restart(uhd::time_spec_t(0.0));

 	// Display usrp time
 	double time_now = usrp_dev->get_time_now().get_real_secs();


Code review feedback

Code review feedback

--- UVAtlas/isochart/UVAtlas.cpp
+++ UVAtlas/isochart/UVAtlas.cpp
@@ -471,10 +471,8 @@
         if (!width || !height)
             return E_INVALIDARG;

-#ifdef _M_X64
-        if ((width > 0xFFFFFFFF) || (height > 0xFFFFFFFF))
+        if ((width > UINT32_MAX) || (height > UINT32_MAX))
             return E_INVALIDARG;
-#endif

         if (vMeshVertexBuffer.empty() || vMeshIndexBuffer.empty())
             return E_INVALIDARG;
@@ -872,10 +870,8 @@
         return E_INVALIDARG;
     }

-#ifdef _M_X64
-    if (signalDimension > 0xFFFFFFFF)
-        return E_INVALIDARG;
-#endif
+    if (signalDimension > UINT32_MAX)
+        return E_INVALIDARG;

     switch (indexFormat)
     {
@@ -1257,10 +1253,8 @@
     if (!width || !height)
         return E_INVALIDARG;

-#ifdef _M_X64
-    if ((width > 0xFFFFFFFF) || (height > 0xFFFFFFFF))
-        return E_INVALIDARG;
-#endif
+    if ((width > UINT32_MAX) || (height > UINT32_MAX))
+        return E_INVALIDARG;

     switch (indexFormat)
     {
@@ -1662,10 +1656,8 @@
     if (!width || !height)
         return E_INVALIDARG;

-#ifdef _M_X64
-    if ((width > 0xFFFFFFFF) || (height > 0xFFFFFFFF) || (signalDimension > 0xFFFFFFFF) || (nComponents > 0xFFFFFFFF))
-        return E_INVALIDARG;
-#endif
+    if ((width > UINT32_MAX) || (height > UINT32_MAX) || (signalDimension > UINT32_MAX) || (nComponents > UINT32_MAX))
+        return E_INVALIDARG;

     switch (indexFormat)
     {


ENH: add option to test different size

ENH: add option to test different size

--- Utilities/ftgl/demo/demo.cpp
+++ Utilities/ftgl/demo/demo.cpp
@@ -21,6 +21,8 @@
 static FTFont* fonts[5];
 static int width;
 static int height;
+
+static int point_size = 24;

 #ifdef __linux__
 const char* DEFAULT_FONT = "/usr/share/fonts/truetype/arial.ttf";
@@ -63,7 +65,6 @@
         else {
 			cout << "Reading font " << i << " from " << font_filename << endl;

-            int point_size = 24;
             if (!fonts[i]->FaceSize(point_size)) {
                 cerr << "ERROR: Unable to set font face size " << point_size << "\n";
             }
@@ -318,6 +319,11 @@
 			exit( -1 );
 		}
 		filename = argv[ 1 ];
+
+        if ( argc >= 3 )
+          {
+          point_size = atoi(argv[2]);
+          }
 	}
 	else
 	{