summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2011-04-13 14:11:15 +0400
committerCyrill Gorcunov <gorcunov@gmail.com>2011-06-25 12:10:40 +0400
commita39912dcd9ad21cba4bf1748200126dce3c011bf (patch)
treecc5691d9aec74b2a8aa46678eea4c0cd5e6c6c41
parentfb27fc21e72bd58fec0f117732f4729e19774403 (diff)
downloadnasm-a39912dcd9ad21cba4bf1748200126dce3c011bf.tar.gz
nasm-a39912dcd9ad21cba4bf1748200126dce3c011bf.tar.bz2
nasm-a39912dcd9ad21cba4bf1748200126dce3c011bf.zip
Move numvalue herleper into nasmlib.h
No need to duplicate implementation. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r--nasm.h4
-rw-r--r--nasmlib.c3
-rw-r--r--nasmlib.h2
-rw-r--r--quote.c2
4 files changed, 3 insertions, 8 deletions
diff --git a/nasm.h b/nasm.h
index b4ec449..79df94e 100644
--- a/nasm.h
+++ b/nasm.h
@@ -400,10 +400,6 @@ extern Preproc nasmpp;
#define isnumstart(c) ( nasm_isdigit(c) || (c)=='$' )
#define isnumchar(c) ( nasm_isalnum(c) || (c)=='_' )
-/* This returns the numeric value of a given 'digit'. */
-
-#define numvalue(c) ((c)>='a' ? (c)-'a'+10 : (c)>='A' ? (c)-'A'+10 : (c)-'0')
-
/*
* Data-type flags that get passed to listing-file routines.
*/
diff --git a/nasmlib.c b/nasmlib.c
index d70f6c2..d1e564f 100644
--- a/nasmlib.c
+++ b/nasmlib.c
@@ -291,8 +291,7 @@ char *nasm_strsep(char **stringp, const char *delim)
#endif
-#define lib_isnumchar(c) (nasm_isalnum(c) || (c) == '$' || (c) == '_')
-#define numvalue(c) ((c)>='a' ? (c)-'a'+10 : (c)>='A' ? (c)-'A'+10 : (c)-'0')
+#define lib_isnumchar(c) (nasm_isalnum(c) || (c) == '$' || (c) == '_')
static int radix_letter(char c)
{
diff --git a/nasmlib.h b/nasmlib.h
index 2c335e1..e571159 100644
--- a/nasmlib.h
+++ b/nasmlib.h
@@ -205,6 +205,8 @@ int nasm_memicmp(const char *, const char *, size_t);
char *nasm_strsep(char **stringp, const char *delim);
#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')
/*
* Convert a string into a number, using NASM number rules. Sets
diff --git a/quote.c b/quote.c
index e45dfb2..fe1c97d 100644
--- a/quote.c
+++ b/quote.c
@@ -42,8 +42,6 @@
#include "nasmlib.h"
#include "quote.h"
-#define numvalue(c) ((c)>='a' ? (c)-'a'+10 : (c)>='A' ? (c)-'A'+10 : (c)-'0')
-
char *nasm_quote(char *str, size_t len)
{
char c, c1, *p, *q, *nstr, *ep;