]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
code update due to array modification
authorAnthony Geay <anthony.geay@edf.fr>
Thu, 2 Jan 2020 15:08:48 +0000 (16:08 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Thu, 2 Jan 2020 15:08:48 +0000 (16:08 +0100)
src/Plugins/MEDWriter/IO/VTKToMEDMem.cxx
src/Plugins/VoroGauss/IO/vtkVoroGauss.cxx

index 19090de0302fa1f8db1f4833af438223675051b6..80a2bc03d1d78b6c63e9214fee676577c42ed2e9 100644 (file)
@@ -111,11 +111,11 @@ Fam::Fam(const std::string& name)
 std::map<int,int> ComputeMapOfType()
 {
   std::map<int,int> ret;
-  int nbOfTypesInMC(sizeof(MEDCouplingUMesh::MEDCOUPLING2VTKTYPETRADUCER)/sizeof(int));
+  int nbOfTypesInMC(sizeof(MEDCOUPLING2VTKTYPETRADUCER)/sizeof( decltype(MEDCOUPLING2VTKTYPETRADUCER[0]) ));
   for(int i=0;i<nbOfTypesInMC;i++)
     {
-      int vtkId(MEDCouplingUMesh::MEDCOUPLING2VTKTYPETRADUCER[i]);
-      if(vtkId!=-1)
+      auto vtkId(MEDCOUPLING2VTKTYPETRADUCER[i]);
+      if(vtkId!=MEDCOUPLING2VTKTYPETRADUCER_NONE)
         ret[vtkId]=i;
     }
   return ret;
index e251eb2343b31e1b8f756ef52f6734c1b95dac1d..c3776572826a39780cfb56a0caaa6f3d7b2e915e 100644 (file)
@@ -93,11 +93,11 @@ vtkStandardNewMacro(vtkVoroGauss);
 std::map<int,int> ComputeMapOfType()
 {
   std::map<int,int> ret;
-  int nbOfTypesInMC(sizeof(MEDCouplingUMesh::MEDCOUPLING2VTKTYPETRADUCER)/sizeof(int));
+  int nbOfTypesInMC(sizeof(MEDCOUPLING2VTKTYPETRADUCER)/sizeof( decltype(MEDCOUPLING2VTKTYPETRADUCER[0]) ));
   for(int i=0;i<nbOfTypesInMC;i++)
     {
-      int vtkId(MEDCouplingUMesh::MEDCOUPLING2VTKTYPETRADUCER[i]);
-      if(vtkId!=-1)
+      auto vtkId(MEDCOUPLING2VTKTYPETRADUCER[i]);
+      if(vtkId!=MEDCOUPLING2VTKTYPETRADUCER_NONE)
         ret[vtkId]=i;
     }
   return ret;
@@ -106,11 +106,11 @@ std::map<int,int> ComputeMapOfType()
 std::map<int,int> ComputeRevMapOfType()
 {
   std::map<int,int> ret;
-  int nbOfTypesInMC(sizeof(MEDCouplingUMesh::MEDCOUPLING2VTKTYPETRADUCER)/sizeof(int));
+  int nbOfTypesInMC(sizeof(MEDCOUPLING2VTKTYPETRADUCER)/sizeof( decltype(MEDCOUPLING2VTKTYPETRADUCER[0]) ));
   for(int i=0;i<nbOfTypesInMC;i++)
     {
-      int vtkId(MEDCouplingUMesh::MEDCOUPLING2VTKTYPETRADUCER[i]);
-      if(vtkId!=-1)
+      auto vtkId(MEDCOUPLING2VTKTYPETRADUCER[i]);
+      if(vtkId!=MEDCOUPLING2VTKTYPETRADUCER_NONE)
         ret[i]=vtkId;
     }
   return ret;