From 578d635f7a905f974e5d329113cc5ae0a2e29134 Mon Sep 17 00:00:00 2001 From: Reuben Thomas Date: Fri, 26 Jan 2018 21:49:20 +0000 Subject: [PATCH] Get rid of SET_SUBTASK_ERROR macro; use identical recode_if_nogo function The function was used much more than the macro anyway. --- src/iconv.c | 2 +- src/outer.c | 2 +- src/recodext.h | 7 ------- src/ucs.c | 8 ++++---- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/iconv.c b/src/iconv.c index d37999f..3e47b21 100644 --- a/src/iconv.c +++ b/src/iconv.c @@ -176,7 +176,7 @@ transform_with_iconv (RECODE_SUBTASK subtask) if (conversion == (iconv_t) -1) { - SET_SUBTASK_ERROR (RECODE_SYSTEM_ERROR, subtask); + recode_if_nogo (RECODE_SYSTEM_ERROR, subtask); SUBTASK_RETURN (subtask); } diff --git a/src/outer.c b/src/outer.c index ce85df3..848db81 100644 --- a/src/outer.c +++ b/src/outer.c @@ -150,7 +150,7 @@ declare_single (RECODE_OUTER outer, static bool internal_iconv (RECODE_SUBTASK subtask) { - SET_SUBTASK_ERROR (RECODE_USER_ERROR, subtask); + recode_if_nogo (RECODE_USER_ERROR, subtask); SUBTASK_RETURN (subtask); } diff --git a/src/recodext.h b/src/recodext.h index 9d3dd47..dda0c79 100644 --- a/src/recodext.h +++ b/src/recodext.h @@ -36,13 +36,6 @@ typedef const struct recode_step * RECODE_CONST_STEP; typedef const struct recode_alias * RECODE_CONST_ALIAS; typedef const struct recode_task * RECODE_CONST_TASK; -/*---------------------------------------------------------. -| Maintain maximum of ERROR and current error in SUBTASK. | -`---------------------------------------------------------*/ - -#define SET_SUBTASK_ERROR(Error, Subtask) \ - recode_if_nogo (Error, Subtask) - /*--------------------------------------------------------------------------. | Return from SUBTASK, with `false' if the failure level has been reached. | `--------------------------------------------------------------------------*/ diff --git a/src/ucs.c b/src/ucs.c index dd9329e..3352465 100644 --- a/src/ucs.c +++ b/src/ucs.c @@ -389,7 +389,7 @@ get_ucs2 (unsigned *value, RECODE_SUBTASK subtask) character2 = get_byte (subtask); if (character2 == EOF) { - SET_SUBTASK_ERROR (RECODE_INVALID_INPUT, subtask); + recode_if_nogo (RECODE_INVALID_INPUT, subtask); return false; } @@ -492,7 +492,7 @@ get_ucs4 (unsigned *value, RECODE_SUBTASK subtask) character = get_byte (subtask); if (character == EOF) { - SET_SUBTASK_ERROR (RECODE_INVALID_INPUT, subtask); + recode_if_nogo (RECODE_INVALID_INPUT, subtask); return false; } chunk |= (BIT_MASK (8) & character) << 16; @@ -500,7 +500,7 @@ get_ucs4 (unsigned *value, RECODE_SUBTASK subtask) character = get_byte (subtask); if (character == EOF) { - SET_SUBTASK_ERROR (RECODE_INVALID_INPUT, subtask); + recode_if_nogo (RECODE_INVALID_INPUT, subtask); return false; } chunk |= (BIT_MASK (8) & character) << 8; @@ -508,7 +508,7 @@ get_ucs4 (unsigned *value, RECODE_SUBTASK subtask) character = get_byte (subtask); if (character == EOF) { - SET_SUBTASK_ERROR (RECODE_INVALID_INPUT, subtask); + recode_if_nogo (RECODE_INVALID_INPUT, subtask); return false; } chunk |= BIT_MASK (8) & character; -- 2.50.1