summaryrefslogtreecommitdiff
path: root/eval.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 /eval.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 'eval.c')
-rw-r--r--eval.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/eval.c b/eval.c
index 3679f2d..65290f2 100644
--- a/eval.c
+++ b/eval.c
@@ -223,7 +223,7 @@ static expr *segment_part(expr * e)
/*
* Recursive-descent parser. Called with a single boolean operand,
- * which is TRUE if the evaluation is critical (i.e. unresolved
+ * which is true if the evaluation is critical (i.e. unresolved
* symbols are an error condition). Must update the global `i' to
* reflect the token after the parsed string. May return NULL.
*
@@ -357,7 +357,7 @@ static expr *rexp3(int critical)
if (!f)
return NULL;
- e = add_vectors(e, scalar_mult(f, -1L, FALSE));
+ e = add_vectors(e, scalar_mult(f, -1L, false));
switch (j) {
case TOKEN_EQ:
@@ -365,9 +365,9 @@ static expr *rexp3(int critical)
if (is_unknown(e))
v = -1; /* means unknown */
else if (!is_really_simple(e) || reloc_value(e) != 0)
- v = (j == TOKEN_NE); /* unequal, so return TRUE if NE */
+ v = (j == TOKEN_NE); /* unequal, so return true if NE */
else
- v = (j == TOKEN_EQ); /* equal, so return TRUE if EQ */
+ v = (j == TOKEN_EQ); /* equal, so return true if EQ */
break;
default:
if (is_unknown(e))
@@ -528,7 +528,7 @@ static expr *expr4(int critical)
e = add_vectors(e, f);
break;
case '-':
- e = add_vectors(e, scalar_mult(f, -1L, FALSE));
+ e = add_vectors(e, scalar_mult(f, -1L, false));
break;
}
}
@@ -562,9 +562,9 @@ static expr *expr5(int critical)
switch (j) {
case '*':
if (is_simple(e))
- e = scalar_mult(f, reloc_value(e), TRUE);
+ e = scalar_mult(f, reloc_value(e), true);
else if (is_simple(f))
- e = scalar_mult(e, reloc_value(f), TRUE);
+ e = scalar_mult(e, reloc_value(f), true);
else if (is_just_unknown(e) && is_just_unknown(f))
e = unknown_expr();
else {
@@ -673,7 +673,7 @@ static expr *expr6(int critical)
e = expr6(critical);
if (!e)
return NULL;
- return scalar_mult(e, -1L, FALSE);
+ return scalar_mult(e, -1L, false);
case '+':
@@ -861,7 +861,7 @@ expr *evaluate(scanner sc, void *scprivate, struct tokenval *tv,
if (!f)
return NULL;
}
- e = scalar_mult(e, 1L, FALSE); /* strip far-absolute segment part */
+ e = scalar_mult(e, 1L, false); /* strip far-absolute segment part */
if (f) {
expr *g;
if (is_just_unknown(f))