]> granicus.if.org Git - recode/commitdiff
Get rid of SET_SUBTASK_ERROR macro; use identical recode_if_nogo function
authorReuben Thomas <rrt@sc3d.org>
Fri, 26 Jan 2018 21:49:20 +0000 (21:49 +0000)
committerReuben Thomas <rrt@sc3d.org>
Sun, 28 Jan 2018 22:41:22 +0000 (22:41 +0000)
The function was used much more than the macro anyway.

src/iconv.c
src/outer.c
src/recodext.h
src/ucs.c

index d37999f59dbaf3e1aa708baef6339451f4730ffa..3e47b2163afd51407e54b1bac532ebca30dad950 100644 (file)
@@ -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);
     }
 
index ce85df35f95f23a18dc95284687ad844dadf4400..848db8104873ea30ea02bf5c9c3d68e33a6e9da0 100644 (file)
@@ -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);
 }
 
index 9d3dd47349c03b699d8f6370a3c2c2f757b4bfa6..dda0c79afd0a5a905a5a4f957c5eb60b5ed8c81c 100644 (file)
@@ -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.  |
 `--------------------------------------------------------------------------*/
index dd9329eabb16a5be91f6f60d47c7f5f66062ebb1..33524650297a169e408ebebd2b3052064f139f74 100644 (file)
--- 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;