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

@ -247,12 +247,12 @@ HashMapGet(HashMap * map, const char *key)
return NULL;
}
int
bool
HashMapIterateReentrant(HashMap * map, char **key, void **value, size_t * i)
{
if (!map)
{
return 0;
return false;
}
if (*i >= map->capacity)
@ -260,7 +260,7 @@ HashMapIterateReentrant(HashMap * map, char **key, void **value, size_t * i)
*i = 0;
*key = NULL;
*value = NULL;
return 0;
return false;
}
while (*i < map->capacity)
@ -273,20 +273,20 @@ HashMapIterateReentrant(HashMap * map, char **key, void **value, size_t * i)
{
*key = bucket->key;
*value = bucket->value;
return 1;
return true;
}
}
*i = 0;
return 0;
return false;
}
int
bool
HashMapIterate(HashMap * map, char **key, void **value)
{
if (!map)
{
return 0;
return false;
}
else
{