stdscan: Use nasm_error helpers

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
Cyrill Gorcunov 2018-12-01 21:02:51 +03:00
parent a14e65699b
commit b449ce49d9

View File

@ -113,8 +113,7 @@ static int stdscan_handle_brace(struct tokenval *tv)
{
if (!(tv->t_flag & TFLAG_BRC_ANY)) {
/* invalid token is put inside braces */
nasm_error(ERR_NONFATAL,
"`%s' is not a valid decorator with braces", tv->t_charptr);
nasm_nonfatal("`%s' is not a valid decorator with braces", tv->t_charptr);
tv->t_type = TOKEN_INVALID;
} else if (tv->t_flag & TFLAG_BRC_OPT) {
if (is_reg_class(OPMASKREG, tv->t_integer)) {
@ -167,10 +166,10 @@ int stdscan(void *private_data, struct tokenval *tv)
* is it actually a register or instruction name, or what? */
token_type = nasm_token_hash(ourcopy, tv);
if (unlikely(tv->t_flag & TFLAG_WARN)) {
nasm_error(ERR_WARNING|ERR_PASS1|ERR_WARN_PTR,
"`%s' is not a NASM keyword", tv->t_charptr);
}
if (unlikely(tv->t_flag & TFLAG_WARN)) {
nasm_warnf(ERR_PASS1|ERR_WARN_PTR, "`%s' is not a NASM keyword",
tv->t_charptr);
}
if (likely(!(tv->t_flag & TFLAG_BRC))) {
/* most of the tokens fall into this case */
@ -285,8 +284,7 @@ int stdscan(void *private_data, struct tokenval *tv)
stdscan_bufptr = nasm_skip_spaces(stdscan_bufptr);
/* if brace is not closed properly or token is too long */
if ((*stdscan_bufptr != '}') || (token_len > MAX_KEYWORD)) {
nasm_error(ERR_NONFATAL,
"invalid decorator token inside braces");
nasm_nonfatal("invalid decorator token inside braces");
return tv->t_type = TOKEN_INVALID;
}