Use macro for chex
This commit is contained in:
parent
f7a2b49120
commit
f88bb1f137
11
src/modal.c
11
src/modal.c
|
@ -13,6 +13,7 @@ static char bank_b[0x4000], *dst_ = bank_b;
|
|||
static char *regs[0x100], stack[0x10], *stack_ = stack;
|
||||
|
||||
#define spacer(c) (c <= ' ' || c == '(' || c == ')')
|
||||
#define chex(c) (0xf & (c - (c <= '9' ? '0' : 0x57)))
|
||||
|
||||
static char *
|
||||
copy(char *src, char *dst, int length)
|
||||
|
@ -21,16 +22,6 @@ copy(char *src, char *dst, int length)
|
|||
return dst;
|
||||
}
|
||||
|
||||
int
|
||||
chex(char c)
|
||||
{
|
||||
c -= 0x30;
|
||||
if(c < 10) return c;
|
||||
c -= 0x31;
|
||||
if(c < 6) return 10 + c;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char *
|
||||
walk(char *s)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue