diff options
author | Alexander Barkov <bar@mnogosearch.org> | 2013-09-24 17:28:02 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mnogosearch.org> | 2013-09-24 17:28:02 +0400 |
commit | 232a07a9b6309962e87421be9544147d90684969 (patch) | |
tree | 8291c53e479c77520303194a369dd0040135c37c /mysys | |
parent | 9081c4dc6bbc22f627f96077d36e5d55d6696acb (diff) | |
download | mariadb-git-232a07a9b6309962e87421be9544147d90684969.tar.gz |
A clean-up for the base64 functions.
SIZEOF_INT can never be 8. Removing the redundant #ifdef code.
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/base64.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/mysys/base64.c b/mysys/base64.c index 88aab7a6450..265b2f22aad 100644 --- a/mysys/base64.c +++ b/mysys/base64.c @@ -27,24 +27,16 @@ static char base64_table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" /** * Maximum length base64_needed_encoded_length() - * can handle without signed integer overflow: (x + 2) / 3 * 4 + * can handle without signed integer overflow. */ int base64_encode_max_arg_length() { -#if (SIZEOF_INT == 8) /* - (6827690988321067803 + 2) / 3 + 4 -> 9223372036854775805 Okey - (6827690988321067804 + 2) / 3 + 4 -> -9223372036854775807 Overflow - */ - return 0x5EC0D4C77B03531BLL; /* 6827690988321067803 */ -#else - /* - 1589695686 -> 2147483646 (7FFFFFFE) - 1589695687 -> -2147483645 + base64_needed_encoded_length(1589695686) -> 2147483646 (7FFFFFFE) + base64_needed_encoded_length(1589695687) -> -2147483645 */ return 0x5EC0D4C6; /* 1589695686 */ -#endif } @@ -67,11 +59,7 @@ base64_needed_encoded_length(int length_of_data) int base64_decode_max_arg_length() { -#if (SIZEOF_INT == 8) - return 0x7FFFFFFFFFFFFFFFLL; -#else return 0x7FFFFFFF; -#endif } |