Browse Source

Remove some borland 6 warnings

Bill Hoffman 22 years ago
parent
commit
8cb6645ad8

+ 1 - 3
Source/CTest/cmCTestSubmit.cxx

@@ -299,7 +299,6 @@ bool cmCTestSubmit::TriggerUsingHTTP(const std::vector<std::string>& files,
                                      const std::string& url)
 {
   CURL *curl;
-  CURLcode res = CURLcode();
 
   /* In windows, this will init the winsock stuff */
   ::curl_global_init(CURL_GLOBAL_ALL);
@@ -363,8 +362,7 @@ bool cmCTestSubmit::TriggerUsingHTTP(const std::vector<std::string>& files,
         std::cout << "Trigger url: " << turl.c_str() << std::endl;
         }
       curl_easy_setopt(curl, CURLOPT_URL, turl.c_str());
-      res = curl_easy_perform(curl);
-      if ( res )
+      if ( curl_easy_perform(curl) )
         {
         std::cout << "Error when uploading" << std::endl;
         ::curl_easy_cleanup(curl);

+ 1 - 2
Source/cmCTest.cxx

@@ -170,10 +170,9 @@ static const char* cmCTestWarningExceptions[] = {
 
 std::string cmCTest::MakeXMLSafe(const std::string& str)
 {
-  std::string::size_type pos = 0;
   cmOStringStream ost;
   char buffer[10];
-  for ( pos = 0; pos < str.size(); pos ++ )
+  for (std::string::size_type  pos = 0; pos < str.size(); pos ++ )
     {
     unsigned char ch = str[pos];
     if ( (ch > 126 || ch < 32) && ch != 9  && ch != 10 && ch != 13 )

+ 6 - 7
Source/cmDynamicLoader.cxx

@@ -259,15 +259,14 @@ int cmDynamicLoader::CloseLibrary(cmLibHandle lib)
 cmDynamicLoaderFunction
 cmDynamicLoader::GetSymbolAddress(cmLibHandle lib, const char* sym)
 { 
-  void* result = 0;
 #ifdef UNICODE
-        wchar_t *wsym = new wchar_t [mbstowcs(NULL, sym, 32000)];
-        mbstowcs(wsym, sym, 32000);
-        void *ret = GetProcAddress(lib, wsym);
-        delete [] wsym;
-        result = ret;
+  wchar_t *wsym = new wchar_t [mbstowcs(NULL, sym, 32000)];
+  mbstowcs(wsym, sym, 32000);
+  void *ret = GetProcAddress(lib, wsym);
+  delete [] wsym;
+  void* result = ret;
 #else
-  result = GetProcAddress(lib, sym);
+  void* result = GetProcAddress(lib, sym);
 #endif
   // Hack to cast pointer-to-data to pointer-to-function.
   return *reinterpret_cast<cmDynamicLoaderFunction*>(&result);

+ 0 - 2
Source/cmGlobalVisualStudio71Generator.cxx

@@ -203,7 +203,6 @@ void cmGlobalVisualStudio71Generator::WriteProjectDepends(std::ostream& fout,
                                       const cmTarget& target
   )
 {
-  int depcount = 0;
   // insert Begin Project Dependency  Project_Dep_Name project stuff here 
   if (target.GetType() != cmTarget::STATIC_LIBRARY)
     {
@@ -237,7 +236,6 @@ void cmGlobalVisualStudio71Generator::WriteProjectDepends(std::ostream& fout,
       {
       fout << "\t\t{" << this->CreateGUID(i->c_str()) << "} = {"
            << this->CreateGUID(i->c_str()) << "}\n";
-      depcount++;
       }
     }
 }

+ 3 - 3
Source/cmSystemTools.cxx

@@ -704,12 +704,12 @@ void cmSystemTools::ConvertToUnixSlashes(std::string& path)
     pos++;
     }
   // Remove all // from the path just like most unix shells
+#ifndef _WIN32
   int start_find = 0;
-
-#ifdef _WIN32
+#else
   // However, on windows if the first characters are both slashes,
   // then keep them that way, so that network paths can be handled.
-  start_find = 1;
+  int start_find = 1;
 #endif
 
   while((pos = path.find("//", start_find)) != std::string::npos)