summaryrefslogtreecommitdiff
path: root/nasmlib.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-10-10 14:58:45 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-10-10 14:58:45 -0700
commit6867acc18ee541e361a5fa1e5a1bac3a478a3856 (patch)
treeb13b49a2e8227469c3eb7cb983e4b2bb27868466 /nasmlib.c
parentbe1b83d24aee03d29913957fdba40cf7a268e660 (diff)
downloadnasm-6867acc18ee541e361a5fa1e5a1bac3a478a3856.tar.gz
nasm-6867acc18ee541e361a5fa1e5a1bac3a478a3856.tar.bz2
nasm-6867acc18ee541e361a5fa1e5a1bac3a478a3856.zip
Use the compiler-provided booleans if available, otherwise emulate
Both C and C++ have "bool", "true" and "false" in lower case; C requires <stdbool.h> for this, in C++ it is an inherent type built into the compiler. Use those instead of the old macros; emulate with a simple typedef enum if unavailable.
Diffstat (limited to 'nasmlib.c')
-rw-r--r--nasmlib.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/nasmlib.c b/nasmlib.c
index 0a0bb95..aca2af4 100644
--- a/nasmlib.c
+++ b/nasmlib.c
@@ -202,10 +202,10 @@ int64_t readnum(char *str, int *error)
int32_t radix;
uint64_t result, checklimit;
int digit, last;
- int warn = FALSE;
+ int warn = false;
int sign = 1;
- *error = FALSE;
+ *error = false;
while (isspace(*r))
r++; /* find start of number */
@@ -249,7 +249,7 @@ int64_t readnum(char *str, int *error)
* now.
*/
if (r >= q) {
- *error = TRUE;
+ *error = true;
return 0;
}
@@ -274,11 +274,11 @@ int64_t readnum(char *str, int *error)
while (*r && r < q) {
if (*r < '0' || (*r > '9' && *r < 'A')
|| (digit = numvalue(*r)) >= radix) {
- *error = TRUE;
+ *error = true;
return 0;
}
if (result > checklimit || (result == checklimit && digit >= last)) {
- warn = TRUE;
+ warn = true;
}
result = radix * result + digit;
@@ -298,19 +298,19 @@ int64_t readstrnum(char *str, int length, int *warn)
int64_t charconst = 0;
int i;
- *warn = FALSE;
+ *warn = false;
str += length;
if (globalbits == 64) {
for (i = 0; i < length; i++) {
if (charconst & 0xFF00000000000000ULL)
- *warn = TRUE;
+ *warn = true;
charconst = (charconst << 8) + (uint8_t)*--str;
}
} else {
for (i = 0; i < length; i++) {
if (charconst & 0xFF000000UL)
- *warn = TRUE;
+ *warn = true;
charconst = (charconst << 8) + (uint8_t)*--str;
}
}