diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 4 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 5 | ||||
-rw-r--r-- | Source/cmCTest.cxx | 13 | ||||
-rw-r--r-- | Source/cmStandardIncludes.h | 21 | ||||
-rw-r--r-- | Source/kwsys/Base64.c | 24 | ||||
-rw-r--r-- | Source/kwsys/Base64.h.in | 18 |
7 files changed, 33 insertions, 54 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 506f0da..05b46c5 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 1) -set(CMake_VERSION_PATCH 20150105) +set(CMake_VERSION_PATCH 20150108) #set(CMake_VERSION_RC 1) diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 9e3c9fc..ff55528 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -116,10 +116,10 @@ void cmCTestRunTest::CompressOutput() unsigned char *encoded_buffer = new unsigned char[static_cast<int>(outSize * 1.5)]; - unsigned long rlen + size_t rlen = cmsysBase64_Encode(out, strm.total_out, encoded_buffer, 1); - for(unsigned long i = 0; i < rlen; i++) + for(size_t i = 0; i < rlen; i++) { this->CompressedOutput += encoded_buffer[i]; } diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index b77825d..38ce3dc 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1976,9 +1976,8 @@ std::string cmCTestTestHandler::GenerateRegressionImages( = new unsigned char [ static_cast<int>( static_cast<double>(len) * 1.5 + 5.0) ]; - unsigned long rlen + size_t rlen = cmsysBase64_Encode(file_buffer, len, encoded_buffer, 1); - unsigned long cc; ostr << "\t\t\t<NamedMeasurement" @@ -1988,7 +1987,7 @@ std::string cmCTestTestHandler::GenerateRegressionImages( << measurementfile.match(4) << "\"" << " encoding=\"base64\"" << ">" << std::endl << "\t\t\t\t<Value>"; - for ( cc = 0; cc < rlen; cc ++ ) + for (size_t cc = 0; cc < rlen; cc ++ ) { ostr << encoded_buffer[cc]; if ( cc % 60 == 0 && cc ) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 80dbaf3..2f1cf10 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1688,7 +1688,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 @@ -1699,14 +1699,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]; } @@ -3190,9 +3189,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 = ""; diff --git a/Source/cmStandardIncludes.h b/Source/cmStandardIncludes.h index 6b85634..e4f5760 100644 --- a/Source/cmStandardIncludes.h +++ b/Source/cmStandardIncludes.h @@ -146,11 +146,6 @@ extern int putenv (char *__string) __THROW; #define for if(false) {} else for #endif -// Provide std::ios_base on ancient GCC 2.9x -#if defined(__GNUC__) && __GNUC__ < 3 -namespace std { typedef ios ios_base; } -#endif - // check for the 720 compiler on the SGI // which has some strange properties that I don't think are worth // checking for in a general way in configure @@ -393,20 +388,6 @@ inline bool cmHasLiteralSuffixImpl(const char* str1, return len >= N && strcmp(str1 + len - N, str2) == 0; } -#if defined(__GNUC__) && __GNUC__ < 3 - -#define cmArrayBegin(a) a -#define cmArraySize(a) (sizeof(a)/sizeof(*a)) -#define cmArrayEnd(a) a + cmArraySize(a) - -#define cmHasLiteralPrefix(STR1, STR2) \ - cmHasLiteralPrefixImpl(STR1, "" STR2 "", sizeof(STR2) - 1) - -#define cmHasLiteralSuffix(STR1, STR2) \ - cmHasLiteralSuffixImpl(STR1, "" STR2 "", sizeof(STR2) - 1) - -#else - template<typename T, size_t N> const T* cmArrayBegin(const T (&a)[N]) { return a; } template<typename T, size_t N> @@ -426,8 +407,6 @@ bool cmHasLiteralSuffix(T str1, const char (&str2)[N]) return cmHasLiteralSuffixImpl(str1, str2, N - 1); } -#endif - struct cmStrCmp { cmStrCmp(const char *test) : m_test(test) {} cmStrCmp(const std::string &test) : m_test(test) {} diff --git a/Source/kwsys/Base64.c b/Source/kwsys/Base64.c index d07bdd0..4b8ede2 100644 --- a/Source/kwsys/Base64.c +++ b/Source/kwsys/Base64.c @@ -115,10 +115,10 @@ void kwsysBase64_Encode1(const unsigned char *src, unsigned char *dest) actually knowing how much data to expect (if the input is not a multiple of 3 bytes then the extra padding needed to complete the encode 4 bytes will stop the decoding anyway). */ -unsigned long kwsysBase64_Encode(const unsigned char *input, - unsigned long length, - unsigned char *output, - int mark_end) +size_t kwsysBase64_Encode(const unsigned char *input, + size_t length, + unsigned char *output, + int mark_end) { const unsigned char *ptr = input; const unsigned char *end = input + length; @@ -157,7 +157,7 @@ unsigned long kwsysBase64_Encode(const unsigned char *input, optr += 4; } - return (unsigned long)(optr - output); + return (size_t)(optr - output); } /*--------------------------------------------------------------------------*/ @@ -207,10 +207,10 @@ int kwsysBase64_Decode3(const unsigned char *src, unsigned char *dest) 'length' parameter is ignored. This enables the caller to decode a stream without actually knowing how much decoded data to expect (of course, the buffer must be large enough). */ -unsigned long kwsysBase64_Decode(const unsigned char *input, - unsigned long length, - unsigned char *output, - unsigned long max_input_length) +size_t kwsysBase64_Decode(const unsigned char *input, + size_t length, + unsigned char *output, + size_t max_input_length) { const unsigned char *ptr = input; unsigned char *optr = output; @@ -226,7 +226,7 @@ unsigned long kwsysBase64_Decode(const unsigned char *input, optr += len; if(len < 3) { - return (unsigned long)(optr - output); + return (size_t)(optr - output); } ptr += 4; } @@ -240,7 +240,7 @@ unsigned long kwsysBase64_Decode(const unsigned char *input, optr += len; if(len < 3) { - return (unsigned long)(optr - output); + return (size_t)(optr - output); } ptr += 4; } @@ -275,5 +275,5 @@ unsigned long kwsysBase64_Decode(const unsigned char *input, } } - return (unsigned long)(optr - output); + return (size_t)(optr - output); } diff --git a/Source/kwsys/Base64.h.in b/Source/kwsys/Base64.h.in index 3468007..36ed3cc 100644 --- a/Source/kwsys/Base64.h.in +++ b/Source/kwsys/Base64.h.in @@ -14,6 +14,8 @@ #include <@KWSYS_NAMESPACE@/Configure.h> +#include <stddef.h> /* size_t */ + /* Redefine all public interface symbol names to be in the proper namespace. These macros are used internally to kwsys only, and are not visible to user code. Use kwsysHeaderDump.pl to reproduce @@ -68,10 +70,10 @@ kwsysEXPORT void kwsysBase64_Encode1(const unsigned char *src, * the extra padding needed to complete the encode 4 bytes will stop * the decoding anyway). */ -kwsysEXPORT unsigned long kwsysBase64_Encode(const unsigned char *input, - unsigned long length, - unsigned char *output, - int mark_end); +kwsysEXPORT size_t kwsysBase64_Encode(const unsigned char *input, + size_t length, + unsigned char *output, + int mark_end); /** * Decode 4 bytes into a 3 byte string. Returns the number of bytes @@ -92,10 +94,10 @@ kwsysEXPORT int kwsysBase64_Decode3(const unsigned char *src, * much decoded data to expect (of course, the buffer must be large * enough). */ -kwsysEXPORT unsigned long kwsysBase64_Decode(const unsigned char *input, - unsigned long length, - unsigned char *output, - unsigned long max_input_length); +kwsysEXPORT size_t kwsysBase64_Decode(const unsigned char *input, + size_t length, + unsigned char *output, + size_t max_input_length); #if defined(__cplusplus) } /* extern "C" */ |