Move numvalue herleper into nasmlib.h

No need to duplicate implementation.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
Cyrill Gorcunov 2011-04-13 14:11:15 +04:00
parent fb27fc21e7
commit a39912dcd9
4 changed files with 3 additions and 8 deletions

4
nasm.h
View File

@ -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.
*/

View File

@ -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)
{

View File

@ -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

View File

@ -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;