summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/nasmlib.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/nasmlib.h b/include/nasmlib.h
index a5994528..593e2046 100644
--- a/include/nasmlib.h
+++ b/include/nasmlib.h
@@ -212,8 +212,12 @@ char *nasm_strsep(char **stringp, const char *delim);
size_t pure_func strnlen(const char *, size_t);
#endif
-/* This returns the numeric value of a given 'digit'. */
-#define numvalue(c) ((c) >= 'a' ? (c) - 'a' + 10 : (c) >= 'A' ? (c) - 'A' + 10 : (c) - '0')
+/* This returns the numeric value of a given 'digit'; no check for validity */
+static inline unsigned int numvalue(unsigned char c)
+{
+ c |= 0x20;
+ return c >= 'a' ? c - 'a' + 10 : c - '0';
+}
/*
* Convert a string into a number, using NASM number rules. Sets