]> Creatis software - crea.git/blobdiff - lib/creaDevManagerLib/modelCDMProject.cpp
Feature #1711
[crea.git] / lib / creaDevManagerLib / modelCDMProject.cpp
index 51f642a0b097068da7d779cccbb84a6e561620dc..14422b6286332463bbe1fa7f82e6b9db64d8ed32 100644 (file)
@@ -87,7 +87,7 @@ modelCDMProject::modelCDMProject(
           CDMUtilities::splitter::split(nameBits, word, " ", CDMUtilities::splitter::no_empties);
 
           this->name = this->nameProject = "";
-          for (int i = 0; i < nameBits.size(); i++)
+          for (int i = 0; i < (int)(nameBits.size()); i++)
             {
               if(i != 0)
                 this->name += " ";
@@ -261,10 +261,12 @@ bool modelCDMProject::SetVersion(const std::string& version, std::string*& resul
   CDMUtilities::splitter::split(vers, version, " .", CDMUtilities::splitter::no_empties);
 
   time_t now = time(0);
-  tm* ltm = localtime(&now);
+
+  tm ltm;
+  localtime_s(&ltm, &now);
 
   std::stringstream date;
-  date << ltm->tm_mday << "/" << 1 + ltm->tm_mon << "/" << 1900 + ltm->tm_year;
+  date << ltm.tm_mday << "/" << 1 + ltm.tm_mon << "/" << 1900 + ltm.tm_year;
 
   //set name of library in CMakeLists inside copied folder
   std::string line;
@@ -337,7 +339,7 @@ modelCDMIProjectTreeNode* modelCDMProject::CreatePackage(
 
   CDMUtilities::splitter::split(words,name," ",CDMUtilities::splitter::no_empties);
   std::string nameFixed = "";
-  for (int i = 0; i < words.size(); i++)
+  for (int i = 0; i < (int)(words.size()); i++)
     {
       nameFixed += words[i];
     }
@@ -345,7 +347,7 @@ modelCDMIProjectTreeNode* modelCDMProject::CreatePackage(
   words.clear();
   CDMUtilities::splitter::split(words,authors," ",CDMUtilities::splitter::no_empties);
   std::string authorFixed;
-  for (int i = 0; i < words.size(); i++)
+  for (int i = 0; i < (int)(words.size()); i++)
     {
       authorFixed += words[i];
     }
@@ -353,13 +355,13 @@ modelCDMIProjectTreeNode* modelCDMProject::CreatePackage(
   words.clear();
   std::string descriptionFixed;
   CDMUtilities::splitter::split(words,authorsEmail," ",CDMUtilities::splitter::no_empties);
-  for (int i = 0; i < words.size(); i++)
+  for (int i = 0; i < (int)(words.size()); i++)
     {
       descriptionFixed += words[i];
     }
   words.clear();
   CDMUtilities::splitter::split(words,description," ",CDMUtilities::splitter::no_empties);
-  for (int i = 0; i < words.size(); i++)
+  for (int i = 0; i < (int)(words.size()); i++)
     {
       descriptionFixed += "_" + words[i];
     }
@@ -463,7 +465,7 @@ const bool modelCDMProject::Refresh(std::string*& result)
           CDMUtilities::splitter::split(nameBits, word, " ", CDMUtilities::splitter::no_empties);
 
           this->name = this->nameProject = "";
-          for (int i = 0; i < nameBits.size(); i++)
+          for (int i = 0; i < (int)(nameBits.size()); i++)
             {
               if(i != 0)
                 this->name += " ";
@@ -556,7 +558,7 @@ const bool modelCDMProject::Refresh(std::string*& result)
           else if(stdfileName.size() > 9 && stdfileName.substr(0,5) == "bbtk_" && stdfileName.substr(stdfileName.size()-4,4) == "_PKG")
             {
               bool found = false;
-              for (int i = 0; !found && i < this->packages.size(); i++)
+              for (int i = 0; !found && i < (int)(this->packages.size()); i++)
                 {
                   if (this->packages[i]->GetName() == stdfileName)
                     {
@@ -580,7 +582,7 @@ const bool modelCDMProject::Refresh(std::string*& result)
           else
             {
               bool found = false;
-              for (int i = 0; !found && i < this->children.size(); i++)
+              for (int i = 0; !found && i < (int)(this->children.size()); i++)
                 {
                   if (this->children[i]->GetName() == stdfileName)
                     {
@@ -626,7 +628,7 @@ const bool modelCDMProject::Refresh(std::string*& result)
           else
             {
               bool found = false;
-              for (int i = 0; !found && i < this->children.size(); i++)
+              for (int i = 0; !found && i < (int)(this->children.size()); i++)
                 {
                   if (this->children[i]->GetName() == stdfileName)
                     {
@@ -648,7 +650,7 @@ const bool modelCDMProject::Refresh(std::string*& result)
         }
     }
 
-  for (int i = 0; i < checkedPackages.size(); i++)
+  for (int i = 0; i < (int)(checkedPackages.size()); i++)
     {
       if(!checkedPackages[i])
         {
@@ -657,7 +659,7 @@ const bool modelCDMProject::Refresh(std::string*& result)
           i--;
         }
     }
-  for (int i = 0; i < checked.size(); i++)
+  for (int i = 0; i < (int)(checked.size()); i++)
     {
       if(!checked[i])
         {
@@ -802,7 +804,7 @@ void modelCDMProject::CheckStructure(std::map<std::string, bool>& properties)
       //set properties parameters based on model
       properties["project add appli"] = this->appli != NULL;
       properties["project add lib"] = this->lib != NULL;
-      for (int i = 0; i < this->packages.size(); i++)
+      for (int i = 0; i < (int)(this->packages.size()); i++)
         properties["project add " + packages[i]->GetName()] = false;
 
       //open cmakelists
@@ -824,7 +826,7 @@ void modelCDMProject::CheckStructure(std::map<std::string, bool>& properties)
                 {
                   word = words[0];
                   CDMUtilities::splitter::split(words, word, " ", CDMUtilities::splitter::empties_ok);
-                  for (int i = 0; i < words.size(); i++)
+                  for (int i = 0; i < (int)(words.size()); i++)
                     {
                       if(words[i].substr(0,2) == "//")
                         break;
@@ -922,7 +924,7 @@ void modelCDMProject::CheckStructure(std::map<std::string, bool>& properties)
   //check lib's structure
   this->lib->CheckStructure(properties);
   //check packages' structure
-  for (int i = 0; i < this->packages.size(); i++)
+  for (int i = 0; i < (int)(this->packages.size()); i++)
     {
       properties["package " + this->packages[i]->GetName()] = true;
       this->packages[i]->CheckStructure(properties);