Salome HOME
Fix for "16925 [CEA 16749] MeshCut Python exception with Windows" issue.
[modules/smesh.git] / src / Tools / MeshCut / MeshCut_Maillage.cxx
index 0ae4437e0ae15eeeee450a57684d1bfb2c5204f2..c6cc137dd2331d146d6a1ade23ac2cde2a0ba427 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2006-2012  EDF R&D
+// Copyright (C) 2006-2019  EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -204,7 +204,7 @@ float Maillage::distanceNoeudMaille(int ngnoeud, int imaille, TYPE_MAILLE tm)
 int Maillage::noeudVoisin(int ngnoeud, int imaille, TYPE_MAILLE tm)
 {
   float x, y, z;
-  int ngv;
+  int ngv = -1;
   float x0 = XX[ngnoeud - 1];
   float y0 = YY[ngnoeud - 1];
   float z0 = ZZ[ngnoeud - 1];
@@ -324,7 +324,7 @@ void Maillage::inputMED(std::string fichierMED)
   // Lecture des infos concernant le premier maillage
   if (MEDmeshInfo(fid, 1, maa, &spacedim, &mdim, &type, desc, dtunit, &sortingtype, &nPasTemps, &axistype, axisname,
                   unitname) < 0)
-    ERREUR("Error while reading mesh informations ");
+    ERREUR("Error while reading mesh information ");
   //cout << chrono() << " --- inputMED: MEDmeshInfo: OK" << endl;
 
 //  cerr << "maa=" << maa << endl;
@@ -557,13 +557,13 @@ void Maillage::inputMED(std::string fichierMED)
   ostringstream OSCOORD;
 
   med_int nnoe = 0; // Nbre de noeuds
-  med_float *coo1; // Table des coordonnées
+  med_float *coo1 = 0; // Table des coordonnées
   //  char nomcoo[mdim * MED_SNAME_SIZE + 1]; // Table des noms des coordonnées
   //  char unicoo[mdim * MED_SNAME_SIZE + 1]; // Table des unités des coordonnées
-  char *nomnoe;
+  char *nomnoe = 0;
 
-  med_int *numnoe;
-  med_int *nufano;
+  med_int *numnoe = 0;
+  med_int *nufano = 0;
   //  med_grid_type rep;
   //  med_bool inonoe, inunoe;
   //  med_int profil[2] = { 2, 3 };
@@ -934,7 +934,7 @@ void Maillage::acquisitionTYPE_inputMED(TYPE_MAILLE TYPE, int nTYPE, med_idt fid
 void Maillage::outputMED(std::string fichierMED)
 {
   // int i, j, k;
-  int nTYPE, tTYPE;
+  int nTYPE;//, tTYPE;
   string line, s, stype, nomnoeud;
   //  med_err ret = 0; // Code retour
   //  int ig, jg;
@@ -1121,8 +1121,8 @@ void Maillage::outputMED(std::string fichierMED)
           // Création de la famille
           if (MEDfamilyCr(fid, maa, nomfam, numfam, 0, MED_NO_GROUP) < 0)
             ERREUR("Error MEDfamilyCr");
-         delete gro;
-       }
+          delete gro;
+        }
 
     }
 
@@ -1133,7 +1133,7 @@ void Maillage::outputMED(std::string fichierMED)
   //  float x, y, z;
 
   med_int nnoe = nombreNoeudsMaillage; // Nombre de noeuds
-  med_float *coo; // Table des coordonnées
+  med_float *coo = 0; // Table des coordonnées
 
   // Noms des coordonnées (variable nomcoo)
   char* nomcoo = new char[mdim * MED_SNAME_SIZE + 1];
@@ -1169,9 +1169,9 @@ void Maillage::outputMED(std::string fichierMED)
 
   // Tables des noms, numeros, numeros de familles des noeuds
   //    autant d'elements que de noeuds - les noms ont pout longueur MED_SNAME_SIZE
-  char *nomnoe;
+  char *nomnoe = 0;
   med_int *numnoe = NULL;
-  med_int *nufano;
+  med_int *nufano = NULL;
   med_bool inonoe = MED_FALSE;
   med_bool inunoe = MED_FALSE;
 
@@ -1437,7 +1437,7 @@ void Maillage::outputMED(std::string fichierMED)
           if (MEDfamilyCr(fid, maa, nomfam, numfam, 1, gro) < 0)
             ERREUR("Error MEDfamilyCr");
 
-         delete gro;
+          delete gro;
         }
     }
 
@@ -1457,7 +1457,7 @@ void Maillage::outputMED(std::string fichierMED)
       if (EFFECTIFS_TYPES[tm])
         {
           nTYPE = EFFECTIFS_TYPES[tm];
-          tTYPE = Nnoeuds(tm);
+          //tTYPE = Nnoeuds(tm);
           MGE = InstanceMGE(tm);
           stype = TM2string(tm);
 
@@ -1580,7 +1580,7 @@ int Maillage::NGLOBAL(TYPE_MAILLE typeMaille, int nlocal)
 TYPE_MAILLE Maillage::TYPE(int nglobal)
 {
   // Attention, les num. globaux commencent à 1, les num. locaux à 0
-  TYPE_MAILLE resultat;
+  TYPE_MAILLE resultat = (TYPE_MAILLE)-1;
   int cpt = 0;
   for (int itm = (int) POI1; itm <= (int) HEXA20; itm++)
     {