Mercurial > hg > dmlib
diff src/dmlib.c @ 2586:9807ae37ad69
Require stdbool.h, we require C11 now.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 08 Dec 2022 15:59:22 +0200 |
parents | 69a5af2eb1ea |
children |
line wrap: on
line diff
--- a/src/dmlib.c Thu Dec 08 15:56:36 2022 +0200 +++ b/src/dmlib.c Thu Dec 08 15:59:22 2022 +0200 @@ -123,34 +123,34 @@ } -BOOL dmGetIntVal(const char *str, unsigned int *value, BOOL *neg) +bool dmGetIntVal(const char *str, unsigned int *value, bool *neg) { int ch; - BOOL hex = FALSE; + bool hex = false; // Is the value negative? if (*str == '-') { if (neg == NULL) - return FALSE; + return false; - *neg = TRUE; + *neg = true; str++; } else if (neg != NULL) - *neg = FALSE; + *neg = false; // Is it hexadecimal? if (*str == '$') { - hex = TRUE; + hex = true; str++; } else if (str[0] == '0' && str[1] == 'x') { - hex = TRUE; + hex = true; str += 2; } @@ -178,7 +178,7 @@ *value |= ch - 'a' + 10; } else - return FALSE; + return false; } } else @@ -191,10 +191,10 @@ *value += ch - '0'; } else - return FALSE; + return false; } } - return TRUE; + return true; } @@ -351,7 +351,7 @@ if (!lock->used) { int res; - lock->used = TRUE; + lock->used = true; lock->id = SDL_ThreadID(); lock->state++; res = SDL_mutexP(mutex->m);