Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
232a07a9
Commit
232a07a9
authored
Sep 24, 2013
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A clean-up for the base64 functions.
SIZEOF_INT can never be 8. Removing the redundant #ifdef code.
parent
9081c4dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
15 deletions
+3
-15
mysys/base64.c
mysys/base64.c
+3
-15
No files found.
mysys/base64.c
View file @
232a07a9
...
...
@@ -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
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment