summaryrefslogtreecommitdiff
path: root/parser.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-10-10 14:58:45 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-10-10 14:58:45 -0700
commit6867acc18ee541e361a5fa1e5a1bac3a478a3856 (patch)
treeb13b49a2e8227469c3eb7cb983e4b2bb27868466 /parser.c
parentbe1b83d24aee03d29913957fdba40cf7a268e660 (diff)
downloadnasm-6867acc18ee541e361a5fa1e5a1bac3a478a3856.tar.gz
nasm-6867acc18ee541e361a5fa1e5a1bac3a478a3856.tar.bz2
nasm-6867acc18ee541e361a5fa1e5a1bac3a478a3856.zip
Use the compiler-provided booleans if available, otherwise emulate
Both C and C++ have "bool", "true" and "false" in lower case; C requires <stdbool.h> for this, in C++ it is an inherent type built into the compiler. Use those instead of the old macros; emulate with a simple typedef enum if unavailable.
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/parser.c b/parser.c
index 5fe79f8..f2b7cfe 100644
--- a/parser.c
+++ b/parser.c
@@ -51,7 +51,7 @@ insn *parse_line(int pass, char *buffer, insn * result,
int critical;
struct eval_hints hints;
- result->forw_ref = FALSE;
+ result->forw_ref = false;
error = errfunc;
stdscan_reset();
@@ -92,7 +92,7 @@ insn *parse_line(int pass, char *buffer, insn * result,
* am still not certain.
*/
ldef(result->label, in_abs_seg ? abs_seg : location->segment,
- location->offset, NULL, TRUE, FALSE, outfmt, errfunc);
+ location->offset, NULL, true, false, outfmt, errfunc);
}
}
@@ -192,7 +192,7 @@ insn *parse_line(int pass, char *buffer, insn * result,
extop *eop, **tail = &result->eops, **fixptr;
int oper_num = 0;
- result->eops_float = FALSE;
+ result->eops_float = false;
/*
* Begin to read the DB/DW/DD/DQ/DT/DO/INCBIN operands.
@@ -233,7 +233,7 @@ insn *parse_line(int pass, char *buffer, insn * result,
if (i == TOKEN_FLOAT) {
eop->type = EOT_DB_STRING;
- result->eops_float = TRUE;
+ result->eops_float = true;
switch (result->opcode) {
case I_DW:
eop->stringlen = 2;
@@ -426,7 +426,7 @@ insn *parse_line(int pass, char *buffer, insn * result,
}
if (i == '[' || i == '&') { /* memory reference */
- mref = TRUE;
+ mref = true;
bracket = (i == '[');
while ((i = stdscan(NULL, &tokval)) == TOKEN_SPECIAL) {
/* check for address directives */
@@ -502,8 +502,8 @@ insn *parse_line(int pass, char *buffer, insn * result,
}
}
} else { /* immediate operand, or register */
- mref = FALSE;
- bracket = FALSE; /* placate optimisers */
+ mref = false;
+ bracket = false; /* placate optimisers */
}
if ((result->oprs[operand].type & FAR) && !mref &&
@@ -516,7 +516,7 @@ insn *parse_line(int pass, char *buffer, insn * result,
critical, error, &hints);
i = tokval.t_type;
if (result->oprs[operand].opflags & OPFLAG_FORWARD) {
- result->forw_ref = TRUE;
+ result->forw_ref = true;
}
if (!value) { /* error in evaluator */
result->opcode = -1; /* unrecoverable parse error: */
@@ -562,7 +562,7 @@ insn *parse_line(int pass, char *buffer, insn * result,
critical, error, &hints);
i = tokval.t_type;
if (result->oprs[operand].opflags & OPFLAG_FORWARD) {
- result->forw_ref = TRUE;
+ result->forw_ref = true;
}
/* and get the offset */
if (!value) { /* but, error in evaluator */