Commits

Anonymous committed 3af8fbe

ENH: remove warnings

Comments (0)

Files changed (1)

GCC_XML/KWSys/SystemTools.cxx

   second = primary.substr(start+1, valuenamepos-start-1);
   primary = primary.substr(0, start);
   
-  HKEY primaryKey;
+  HKEY primaryKey = HKEY_CURRENT_USER;
   if (primary == "HKEY_CURRENT_USER")
     {
     primaryKey = HKEY_CURRENT_USER;
   second = primary.substr(start+1, valuenamepos-start-1);
   primary = primary.substr(0, start);
   
-  HKEY primaryKey;
+  HKEY primaryKey = HKEY_CURRENT_USER;
   if (primary == "HKEY_CURRENT_USER")
     {
     primaryKey = HKEY_CURRENT_USER;
   second = primary.substr(start+1, valuenamepos-start-1);
   primary = primary.substr(0, start);
   
-  HKEY primaryKey;
+  HKEY primaryKey = HKEY_CURRENT_USER;
   if (primary == "HKEY_CURRENT_USER")
     {
     primaryKey = HKEY_CURRENT_USER;
 kwsys_stl::string SystemTools::Capitalized(const kwsys_stl::string& s)
 {
   kwsys_stl::string n;
+  if(s.size() == 0)
+    {
+    return n;
+    }
   n.resize(s.size());
-  n[0] = toupper(s[0]);
+  n[0] = static_cast<kwsys_stl::string::value_type>(toupper(s[0]));
   for (size_t i = 1; i < s.size(); i++)
     {
-    n[i] = tolower(s[i]);
+    n[i] = static_cast<kwsys_stl::string::value_type>(tolower(s[i]));
     }
   return n;
 }
   n.resize(s.size());
   for (size_t i = 0; i < s.size(); i++)
     {
-    n[i] = tolower(s[i]);
+    n[i] = static_cast<kwsys_stl::string::value_type>(tolower(s[i]));
     }
   return n;
 }
   n.resize(s.size());
   for (size_t i = 0; i < s.size(); i++)
     {
-    n[i] = toupper(s[i]);
+    n[i] = static_cast<kwsys_stl::string::value_type>(toupper(s[i]));
     }
   return n;
 }