diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2016-02-17 20:27:41 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2016-02-17 20:27:41 -0800 |
commit | 130736c0cfcad28ee16cec6c14bb22999d982e5a (patch) | |
tree | 017a036105b472b6fbc1a9b16b750f8d00c3640f /parser.c | |
parent | bbbf50839479a63841169b8995f285fb1c8a3fc5 (diff) | |
download | nasm-130736c0cfcad28ee16cec6c14bb22999d982e5a.tar.gz |
Get rid of a bunch of unnecessary indirections
We pass around a whole bunch of function pointers in arguments,
which then just get stashed in static variables. Clean this mess
up and in particular handle the error management in the preprocessor
using nasm_set_verror() which already exists.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'parser.c')
-rw-r--r-- | parser.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -461,7 +461,7 @@ restart_parse: expr *value; i = stdscan(NULL, &tokval); - value = evaluate(stdscan, NULL, &tokval, NULL, pass0, nasm_error, NULL); + value = evaluate(stdscan, NULL, &tokval, NULL, pass0, NULL); i = tokval.t_type; if (!value) /* Error in evaluator */ goto fail; @@ -646,8 +646,7 @@ is_float: eop->stringval = (char *)eop + sizeof(extop); if (!eop->stringlen || !float_const(tokval.t_charptr, sign, - (uint8_t *)eop->stringval, - eop->stringlen, nasm_error)) + (uint8_t *)eop->stringval, eop->stringlen)) eop->type = EOT_NOTHING; i = stdscan(NULL, &tokval); /* eat the comma */ } else { @@ -656,7 +655,7 @@ is_float: is_expression: value = evaluate(stdscan, NULL, &tokval, NULL, - critical, nasm_error, NULL); + critical, NULL); i = tokval.t_type; if (!value) /* Error in evaluator */ goto fail; @@ -845,8 +844,7 @@ is_expression: } value = evaluate(stdscan, NULL, &tokval, - &op->opflags, - critical, nasm_error, &hints); + &op->opflags, critical, &hints); i = tokval.t_type; if (op->opflags & OPFLAG_FORWARD) { result->forw_ref = true; @@ -876,8 +874,7 @@ is_expression: i = stdscan(NULL, &tokval); } value = evaluate(stdscan, NULL, &tokval, - &op->opflags, - critical, nasm_error, &hints); + &op->opflags, critical, &hints); i = tokval.t_type; if (op->opflags & OPFLAG_FORWARD) { result->forw_ref = true; @@ -898,7 +895,7 @@ is_expression: i = stdscan(NULL, &tokval); /* Eat comma */ value = evaluate(stdscan, NULL, &tokval, &op->opflags, - critical, nasm_error, &hints); + critical, &hints); i = tokval.t_type; if (!value) goto fail; |