diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2017-08-23 07:41:23 (GMT) |
---|---|---|
committer | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2017-08-27 07:58:46 (GMT) |
commit | 190e3825d44d4f846d37e1ec7372f5829a5b6b3e (patch) | |
tree | 85605643bc6fcdcb455d5fe58469a08874ef8673 /Source/CTest/cmCTestSubmitHandler.cxx | |
parent | 2ade9a0264b7c8d4e97d9d820e8c1531f3d1a43c (diff) | |
download | CMake-190e3825d44d4f846d37e1ec7372f5829a5b6b3e.zip CMake-190e3825d44d4f846d37e1ec7372f5829a5b6b3e.tar.gz CMake-190e3825d44d4f846d37e1ec7372f5829a5b6b3e.tar.bz2 |
Replace C-style casts
Diffstat (limited to 'Source/CTest/cmCTestSubmitHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestSubmitHandler.cxx | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 5c67816..b7d0d1f 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -100,7 +100,7 @@ private: static size_t cmCTestSubmitHandlerWriteMemoryCallback(void* ptr, size_t size, size_t nmemb, void* data) { - int realsize = (int)(size * nmemb); + int realsize = static_cast<int>(size * nmemb); cmCTestSubmitHandlerVectorOfChar* vec = static_cast<cmCTestSubmitHandlerVectorOfChar*>(data); @@ -239,8 +239,8 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix, /* we pass our 'chunk' struct to the callback function */ cmCTestSubmitHandlerVectorOfChar chunk; cmCTestSubmitHandlerVectorOfChar chunkDebug; - ::curl_easy_setopt(curl, CURLOPT_FILE, (void*)&chunk); - ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void*)&chunkDebug); + ::curl_easy_setopt(curl, CURLOPT_FILE, &chunk); + ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &chunkDebug); // Now run off and do what you've been told! res = ::curl_easy_perform(curl); @@ -413,7 +413,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, case ' ': case '=': case '%': - sprintf(hexCh, "%%%02X", (int)c); + sprintf(hexCh, "%%%02X", static_cast<int>(c)); ofile.append(hexCh); break; default: @@ -471,8 +471,8 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, /* we pass our 'chunk' struct to the callback function */ cmCTestSubmitHandlerVectorOfChar chunk; cmCTestSubmitHandlerVectorOfChar chunkDebug; - ::curl_easy_setopt(curl, CURLOPT_FILE, (void*)&chunk); - ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void*)&chunkDebug); + ::curl_easy_setopt(curl, CURLOPT_FILE, &chunk); + ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &chunkDebug); // Now run off and do what you've been told! res = ::curl_easy_perform(curl); @@ -667,8 +667,8 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(const std::set<std::string>& files, /* we pass our 'chunk' struct to the callback function */ cmCTestSubmitHandlerVectorOfChar chunk; cmCTestSubmitHandlerVectorOfChar chunkDebug; - ::curl_easy_setopt(curl, CURLOPT_FILE, (void*)&chunk); - ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void*)&chunkDebug); + ::curl_easy_setopt(curl, CURLOPT_FILE, &chunk); + ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &chunkDebug); std::string rfile = remoteprefix + cmSystemTools::GetFilenameName(*file); std::string ofile; @@ -686,7 +686,7 @@ bool cmCTestSubmitHandler::TriggerUsingHTTP(const std::set<std::string>& files, case ' ': case '=': case '%': - sprintf(hexCh, "%%%02X", (int)c); + sprintf(hexCh, "%%%02X", static_cast<int>(c)); ofile.append(hexCh); break; default: @@ -948,8 +948,9 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC( char remoteCommand[] = "Submit.put"; char* pRealURL = const_cast<char*>(realURL.c_str()); - result = xmlrpc_client_call(&env, pRealURL, remoteCommand, "(6)", - fileBuffer, (xmlrpc_int32)fileSize); + result = + xmlrpc_client_call(&env, pRealURL, remoteCommand, "(6)", fileBuffer, + static_cast<xmlrpc_int32>(fileSize)); delete[] fileBuffer; @@ -1082,8 +1083,8 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file, << "site=" << curl.Escape(this->CTest->GetCTestConfiguration("Site")) << "&" << "track=" << curl.Escape(this->CTest->GetTestModelString()) << "&" - << "starttime=" << (int)cmSystemTools::GetTime() << "&" - << "endtime=" << (int)cmSystemTools::GetTime() << "&" + << "starttime=" << static_cast<int>(cmSystemTools::GetTime()) << "&" + << "endtime=" << static_cast<int>(cmSystemTools::GetTime()) << "&" << "datafilesmd5[0]=" << md5sum << "&" << "type=" << curl.Escape(typeString); std::string fields = str.str(); |