diff options
Diffstat (limited to 'Source/cmCTest.cxx')
-rw-r--r-- | Source/cmCTest.cxx | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index e1391a7..f80d4ac 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -240,7 +240,7 @@ int cmCTest::HTTPRequest(std::string url, HTTPMethod method, //---------------------------------------------------------------------- std::string cmCTest::MakeURLSafe(const std::string& str) { - cmOStringStream ost; + std::ostringstream ost; char buffer[10]; for ( std::string::size_type pos = 0; pos < str.size(); pos ++ ) { @@ -1302,7 +1302,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, inst.TimeOut = timeout; // Capture output of the child ctest. - cmOStringStream oss; + std::ostringstream oss; inst.SetStreams(&oss, &oss); std::vector<std::string> args; @@ -1316,7 +1316,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, if (strcmp(argv[i],"--build-generator") == 0 && timeout > 0) { args.push_back("--test-timeout"); - cmOStringStream msg; + std::ostringstream msg; msg << timeout; args.push_back(msg.str()); } @@ -1689,7 +1689,7 @@ std::string cmCTest::Base64GzipEncodeFile(std::string file) //---------------------------------------------------------------------- std::string cmCTest::Base64EncodeFile(std::string file) { - long len = cmSystemTools::FileLength(file); + size_t const len = cmSystemTools::FileLength(file); cmsys::ifstream ifs(file.c_str(), std::ios::in #ifdef _WIN32 | std::ios::binary @@ -1700,14 +1700,13 @@ std::string cmCTest::Base64EncodeFile(std::string file) ifs.close(); unsigned char *encoded_buffer - = new unsigned char [ static_cast<int>( - static_cast<double>(len) * 1.5 + 5.0) ]; + = new unsigned char [ (len * 3) / 2 + 5 ]; - unsigned long rlen + size_t const rlen = cmsysBase64_Encode(file_buffer, len, encoded_buffer, 1); std::string base64 = ""; - for(unsigned long i = 0; i < rlen; i++) + for(size_t i = 0; i < rlen; i++) { base64 += encoded_buffer[i]; } @@ -3191,9 +3190,9 @@ bool cmCTest::CompressString(std::string& str) // Now base64 encode the resulting binary string unsigned char* base64EncodedBuffer - = new unsigned char[static_cast<int>(outSize * 1.5)]; + = new unsigned char[(outSize * 3) / 2]; - unsigned long rlen + size_t rlen = cmsysBase64_Encode(out, strm.total_out, base64EncodedBuffer, 1); str = ""; |