Salome HOME
#18963 Minimize compiler warnings
[modules/smesh.git] / src / MEDWrapper / MED_Wrapper.cxx
index 81d3ba9ec5c3797fd8ef47cc26bb66f7bf69fb1a..fea95266423a4a3c244ec86af5f8620e575ccb96 100644 (file)
@@ -38,8 +38,8 @@
 static int MYDEBUG = 0;
 static int MYVALUEDEBUG = 0;
 #else
-static int MYDEBUG = 0;
-static int MYVALUEDEBUG = 0;
+static int MYDEBUG = 0;      // todo: unused in release mode
+static int MYVALUEDEBUG = 0; // todo: unused in release mode
 #endif
 
 namespace MED
@@ -105,28 +105,28 @@ namespace MED
       if (myCount++ == 0) {
         const char* aFileName = myFileName.c_str();
 #ifdef WIN32
-               if (med_access_mode(theMode) == MED_ACC_RDWR) {
-                       // Force removing readonly attribute from a file under Windows, because of a bug in the HDF5
-                       std::string aReadOlnyRmCmd = "attrib -r \"" + myFileName + "\"> nul 2>&1";
+        if (med_access_mode(theMode) == MED_ACC_RDWR) {
+          // Force removing readonly attribute from a file under Windows, because of a bug in the HDF5
+          std::string aReadOlnyRmCmd = "attrib -r \"" + myFileName + "\"> nul 2>&1";
 #ifdef UNICODE
-                       const char* to_decode = aReadOlnyRmCmd.c_str();
-                       int size_needed = MultiByteToWideChar(CP_UTF8, 0, to_decode, strlen(to_decode), NULL, 0);
-                       wchar_t* awReadOlnyRmCmd = new wchar_t[size_needed + 1];
-                       MultiByteToWideChar(CP_UTF8, 0, to_decode, strlen(to_decode), awReadOlnyRmCmd, size_needed);
-                       awReadOlnyRmCmd[size_needed] = '\0';
-                       _wsystem(awReadOlnyRmCmd);
-                       delete[] awReadOlnyRmCmd;
-#else  
-                       system(aReadOlnyRmCmd.c_str());
+          const char* to_decode = aReadOlnyRmCmd.c_str();
+          int size_needed = MultiByteToWideChar(CP_UTF8, 0, to_decode, strlen(to_decode), NULL, 0);
+          wchar_t* awReadOlnyRmCmd = new wchar_t[size_needed + 1];
+          MultiByteToWideChar(CP_UTF8, 0, to_decode, strlen(to_decode), awReadOlnyRmCmd, size_needed);
+          awReadOlnyRmCmd[size_needed] = '\0';
+          _wsystem(awReadOlnyRmCmd);
+          delete[] awReadOlnyRmCmd;
+#else
+          system(aReadOlnyRmCmd.c_str());
 #endif
-               }
+        }
 #endif
         myFid = MEDfileVersionOpen(aFileName,med_access_mode(theMode), myMajor, myMinor, MED_RELEASE_NUM);
       }
       if (theErr)
         *theErr = TErr(myFid);
       else if (myFid < 0)
-        EXCEPTION(std::runtime_error,"TFile - MEDfileVersionOpen('"<<myFileName<<"',"<<theMode<<"',"<< MED_MAJOR_NUM<<"',"<< myMinor<<"',"<< MED_RELEASE_NUM<<")");
+        EXCEPTION(std::runtime_error,"TFile - MEDfileVersionOpen('"<<myFileName<<"',"<<theMode<<"',"<< myMajor <<"',"<< myMinor<<"',"<< MED_RELEASE_NUM<<")");
     }
 
     const TIdt&
@@ -630,7 +630,7 @@ namespace MED
   void
   TWrapper
   ::GetNames(TElemInfo& theInfo,
-             TInt theNb,
+             TInt /*theNb*/,
              EEntiteMaillage theEntity,
              EGeometrieElement theGeom,
              TErr* theErr)
@@ -721,7 +721,7 @@ namespace MED
   void
   TWrapper
   ::GetNumeration(TElemInfo& theInfo,
-                  TInt theNb,
+                  TInt /*theNb*/,
                   EEntiteMaillage theEntity,
                   EGeometrieElement theGeom,
                   TErr* theErr)
@@ -812,7 +812,7 @@ namespace MED
   void
   TWrapper
   ::GetFamilies(TElemInfo& theInfo,
-                TInt theNb,
+                TInt /*theNb*/,
                 EEntiteMaillage theEntity,
                 EGeometrieElement theGeom,
                 TErr* theErr)
@@ -2323,7 +2323,7 @@ namespace MED
   //----------------------------------------------------------------------------
   EGeometrieElement
   TWrapper
-  ::GetBallGeom(const TMeshInfo& theMeshInfo)
+  ::GetBallGeom(const TMeshInfo& /*theMeshInfo*/)
   {
     TErr anError;
     TFileWrapper aFileWrapper(myFile, eLECTURE, &anError, myMinor);
@@ -2464,7 +2464,7 @@ namespace MED
 
     // write node ids
     SetCellInfo(theInfo, theMode, theErr);
-    if (theErr && theErr < 0)
+    if (theErr && *theErr < 0)
       return;
 
     // write diameter
@@ -2763,7 +2763,7 @@ namespace MED
   //----------------------------------------------------------------------------
   void
   TWrapper
-  ::GetGaussInfo(TInt theId,
+  ::GetGaussInfo(TInt /*theId*/,
                  TGaussInfo& theInfo,
                  TErr* theErr)
   {
@@ -3127,7 +3127,7 @@ namespace MED
   //----------------------------------------------------------------------------
   void
   TWrapper
-  ::GetProfileInfo(TInt theId,
+  ::GetProfileInfo(TInt /*theId*/,
                    TProfileInfo& theInfo,
                    TErr* theErr)
   {
@@ -4006,7 +4006,7 @@ namespace MED
   //----------------------------------------------------------------------------
   PGrilleInfo
   TWrapper
-  ::CrGrilleInfo(const PMeshInfo& theMeshInfo)
+  ::CrGrilleInfo(const PMeshInfo& /*theMeshInfo*/)
   {
     return PGrilleInfo(); // not implemented????
   }