diff options
author | Brad King <brad.king@kitware.com> | 2003-07-01 17:32:28 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2003-07-01 17:32:28 (GMT) |
commit | cee10ceebd58134ee8015837d87d4870124c9aee (patch) | |
tree | 1d49a4e0985cd6e7c48e253819e53d80cf4b485d /Source/kwsys/Base64.c | |
parent | 6b1770932e88c6ebf0c53ff9f5aebcaae8d66af8 (diff) | |
download | CMake-cee10ceebd58134ee8015837d87d4870124c9aee.zip CMake-cee10ceebd58134ee8015837d87d4870124c9aee.tar.gz CMake-cee10ceebd58134ee8015837d87d4870124c9aee.tar.bz2 |
ERR: Added casts to remove type conversion warnings. Pointer differences can be 64-bit, but unsigned long is 32-bit on many platforms. We know we are not traversing more data than can be handled by an unsigned long, though, because the length argument is an unsigned long.
Diffstat (limited to 'Source/kwsys/Base64.c')
-rw-r--r-- | Source/kwsys/Base64.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Source/kwsys/Base64.c b/Source/kwsys/Base64.c index 3a0b17e..34d6048 100644 --- a/Source/kwsys/Base64.c +++ b/Source/kwsys/Base64.c @@ -115,7 +115,9 @@ void kwsysBase64_Encode1(const unsigned char *src, unsigned char *dest) 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) + unsigned long length, + unsigned char *output, + int mark_end) { const unsigned char *ptr = input; const unsigned char *end = input + length; @@ -154,8 +156,9 @@ unsigned long kwsysBase64_Encode(const unsigned char *input, optr += 4; } - return optr - output; + return (unsigned long)(optr - output); } + /*--------------------------------------------------------------------------*/ /* Decode 4 bytes into a 3 byte string. */ int kwsysBase64_Decode3(const unsigned char *src, unsigned char *dest) @@ -204,7 +207,9 @@ int kwsysBase64_Decode3(const unsigned char *src, unsigned char *dest) 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) + unsigned long length, + unsigned char *output, + unsigned long max_input_length) { const unsigned char *ptr = input; unsigned char *optr = output; @@ -220,7 +225,7 @@ unsigned long kwsysBase64_Decode(const unsigned char *input, optr += len; if(len < 3) { - return optr - output; + return (unsigned long)(optr - output); } ptr += 4; } @@ -234,7 +239,7 @@ unsigned long kwsysBase64_Decode(const unsigned char *input, optr += len; if(len < 3) { - return optr - output; + return (unsigned long)(optr - output); } ptr += 4; } @@ -258,5 +263,5 @@ unsigned long kwsysBase64_Decode(const unsigned char *input, } } - return optr - output; + return (unsigned long)(optr - output); } |