nasm.h: move "regs.h" to top; make is_register() a bool

Move the #include of regs.h to the top with the other includes, and
make is_register() -- being a boolean predicate -- return bool.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2010-07-25 00:17:12 -07:00
parent a38b86aecf
commit b453c866ab

8
nasm.h
View File

@ -47,6 +47,7 @@
#include "insnsi.h" /* For enum opcode */
#include "directiv.h" /* For enum directive */
#include "opflags.h"
#include "regs.h"
#define NO_SEG -1L /* null segment value */
#define SEG_ABS 0x40000000L /* mask for far-absolute segments */
@ -418,11 +419,8 @@ enum {
* -----------------------------------------------------------
*/
/* Register names automatically generated from regs.dat */
#include "regs.h"
/* verify value to be register */
static inline int is_register(int reg)
/* Verify value to be a valid register */
static inline bool is_register(int reg)
{
return reg >= EXPR_REG_START && reg < REG_ENUM_LIMIT;
}