Salome HOME
Merge remote-tracking branch 'remotes/origin/EDF_2020_Lot2'
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Tools.cpp
index f3a28048810519d2b992eae3202396a92350fba1..0b72c418f795263e3808897a343f6f11068bf968 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2020  CEA/DEN, 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
@@ -279,8 +279,8 @@ GeomAPI_Shape::ShapeType shapeTypeByStr(std::string theShapeTypeStr)
 {
   GeomAPI_Shape::ShapeType aShapeType = GeomAPI_Shape::SHAPE;
 
-  std::transform(theShapeTypeStr.begin(), theShapeTypeStr.end(),
-                 theShapeTypeStr.begin(), ::tolower);
+  std::transform(theShapeTypeStr.begin(), theShapeTypeStr.end(), theShapeTypeStr.begin(),
+                 [](char c) { return static_cast<char>(::tolower(c)); });
 
   if(theShapeTypeStr == "compound") {
     aShapeType = GeomAPI_Shape::COMPOUND;
@@ -377,6 +377,8 @@ GeomAPI_Shape::ShapeType getShapeType(const ModelHighAPI_Selection& theSelection
       aShapeType = shapeTypeByStr(aType);
       break;
     }
+    default:
+      break; // do nothing [to avoid compilation warning]
   }
 
   return aShapeType;
@@ -386,7 +388,8 @@ GeomAPI_Shape::ShapeType getShapeType(const ModelHighAPI_Selection& theSelection
 ModelAPI_AttributeTables::ValueType valueTypeByStr(const std::string& theValueTypeStr)
 {
   std::string aType = theValueTypeStr;
-  std::transform(aType.begin(), aType.end(), aType.begin(), ::tolower);
+  std::transform(aType.begin(), aType.end(), aType.begin(),
+                 [](char c) { return static_cast<char>(::tolower(c)); });
   if (aType == "boolean")
     return ModelAPI_AttributeTables::BOOLEAN;
   else if (aType == "integer")
@@ -421,7 +424,7 @@ std::string storeFeatures(const std::wstring& theDocName, DocumentPtr theDoc,
      }
   }
   // store the model features information: iterate all features
-  int anObjectsCount = 0; // stores the number of compared features for this document to compare
+  size_t anObjectsCount = 0; // stores the number of compared features for this document to compare
   std::set<std::wstring> aProcessed; // processed features names (that are in the current document)
 
   // process all objects (features and folders)
@@ -553,10 +556,15 @@ static bool checkDump(SessionPtr theSession,
   return true;
 }
 
-bool checkPyDump(const std::string& theFilenameNaming,
-                 const std::string& theFilenameGeo,
-                 const std::string& theFilenameWeak,
-                 const checkDumpType theCheckType)
+bool checkPyDump(
+#ifdef _DEBUG
+  const std::string&, const std::string&, const std::string&,
+#else
+  const std::string& theFilenameNaming,
+  const std::string& theFilenameGeo,
+  const std::string& theFilenameWeak,
+#endif
+  const checkDumpType theCheckType)
 {
   static const std::string anErrorByNaming("checkPythonDump by naming");
   static const std::string anErrorByGeometry("checkPythonDump by geometry");