diff --git a/Source/CTest/cmCTestSubmit.cxx b/Source/CTest/cmCTestSubmit.cxx index 0d647ebef..24f3e5e77 100644 --- a/Source/CTest/cmCTestSubmit.cxx +++ b/Source/CTest/cmCTestSubmit.cxx @@ -299,7 +299,6 @@ bool cmCTestSubmit::TriggerUsingHTTP(const std::vector& 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& 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); diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 1b5c8e67d..fe185739f 100644 --- a/Source/cmCTest.cxx +++ b/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 ) diff --git a/Source/cmDynamicLoader.cxx b/Source/cmDynamicLoader.cxx index 8eff2e787..d9cd11918 100644 --- a/Source/cmDynamicLoader.cxx +++ b/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(&result); diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 8fc1a0881..d38c3004e 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/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++; } } } diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 218c87d3a..46bcabd9b 100644 --- a/Source/cmSystemTools.cxx +++ b/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)