C99 Compliance (#29)

This pull request brings Cytoplasm up from C89 to C99, which makes it much more portable across platforms. In particular, this pull request solves a number of issues with 32-bit platforms.

Closes #28.
Closes #12.
Closes #20.

Reviewed-on: https://git.telodendria.io/Telodendria/Cytoplasm/pulls/29
This commit is contained in:
Jordan Bancino 2024-01-13 17:13:45 -05:00
parent d0969d0dd7
commit 662696ce12
40 changed files with 384 additions and 1667 deletions

View file

@ -212,7 +212,7 @@ Base64Unpad(char *base64, size_t length)
base64[length] = '\0';
}
extern int
bool
Base64Pad(char **base64Ptr, size_t length)
{
char *tmp;
@ -221,7 +221,7 @@ Base64Pad(char **base64Ptr, size_t length)
if (length % 4 == 0)
{
return length; /* Success: no padding needed */
return true; /* Success: no padding needed */
}
newSize = length + (4 - (length % 4));
@ -229,7 +229,7 @@ Base64Pad(char **base64Ptr, size_t length)
tmp = Realloc(*base64Ptr, newSize + 100);;
if (!tmp)
{
return 0; /* Memory error */
return false; /* Memory error */
}
*base64Ptr = tmp;
@ -240,5 +240,5 @@ Base64Pad(char **base64Ptr, size_t length)
(*base64Ptr)[newSize] = '\0';
return newSize;
return true;
}