summaryrefslogtreecommitdiff
path: root/nasmlib.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-10-11 00:05:31 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-10-11 00:05:57 -0700
commit70055964fc24699c07c515dd9a603196ba06a654 (patch)
tree10deb40fda3517be5d7b21b191429bcfd220d15a /nasmlib.c
parent54901e1785dcc7e8aec3198f58f580165856672f (diff)
downloadnasm-70055964fc24699c07c515dd9a603196ba06a654.tar.gz
nasm-70055964fc24699c07c515dd9a603196ba06a654.tar.bz2
nasm-70055964fc24699c07c515dd9a603196ba06a654.zip
Additional uses of bool and enum
Proper use of bool and enum makes code easier to debug. Do more of it. In particular, we really should stomp out any residual uses of magic constants that aren't enums or, in some cases, even #defines.
Diffstat (limited to 'nasmlib.c')
-rw-r--r--nasmlib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/nasmlib.c b/nasmlib.c
index 7e7441b..8c81d6c 100644
--- a/nasmlib.c
+++ b/nasmlib.c
@@ -196,13 +196,13 @@ char *nasm_strsep(char **stringp, const char *delim)
#define lib_isnumchar(c) ( isalnum(c) || (c) == '$')
#define numvalue(c) ((c)>='a' ? (c)-'a'+10 : (c)>='A' ? (c)-'A'+10 : (c)-'0')
-int64_t readnum(char *str, int *error)
+int64_t readnum(char *str, bool *error)
{
char *r = str, *q;
int32_t radix;
uint64_t result, checklimit;
int digit, last;
- int warn = false;
+ bool warn = false;
int sign = 1;
*error = false;
@@ -293,7 +293,7 @@ int64_t readnum(char *str, int *error)
return result * sign;
}
-int64_t readstrnum(char *str, int length, int *warn)
+int64_t readstrnum(char *str, int length, bool *warn)
{
int64_t charconst = 0;
int i;