]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - iconvdata/tcvn5712-1.c
test-container: Fix "unused code" warnings on HURD
[thirdparty/glibc.git] / iconvdata / tcvn5712-1.c
index 49d5430f27112d980364f6427b8305a0249d3e5a..5de6b99ccc83ebd667dafac0015acb8b25279703 100644 (file)
@@ -1,7 +1,6 @@
 /* Conversion to and from TCVN5712-1.
-   Copyright (C) 2001, 2002, 2004, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2001-2022 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -15,7 +14,7 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 #include <dlfcn.h>
 #include <stdint.h>
@@ -29,6 +28,7 @@
 #define TO_LOOP                        to_tcvn5712_1
 #define DEFINE_INIT            1
 #define DEFINE_FINI            1
+#define ONE_DIRECTION          0
 #define FROM_LOOP_MIN_NEEDED_FROM      1
 #define FROM_LOOP_MAX_NEEDED_FROM      1
 #define FROM_LOOP_MIN_NEEDED_TO                4
@@ -64,7 +64,7 @@
     {                                                                        \
       if (FROM_DIRECTION)                                                    \
        {                                                                     \
-         if (__builtin_expect (outbuf + 4 <= outend, 1))                     \
+         if (__glibc_likely (outbuf + 4 <= outend))                          \
            {                                                                 \
              /* Write out the last character.  */                            \
              *((uint32_t *) outbuf) = data->__statep->__count >> 3;          \
@@ -379,7 +379,7 @@ static const struct
     last_ch = *statep >> 3;                                                  \
                                                                              \
     /* We have to buffer ch if it is a possible match in comp_table_data.  */ \
-    must_buffer_ch = (ch >= 0x0041 && ch <= 0x01b0);                         \
+    must_buffer_ch = (ch >= 0x0041 && ch <= 0x01b0);                          \
                                                                              \
     if (last_ch)                                                             \
       {                                                                              \
@@ -652,7 +652,7 @@ static const struct
            res = 0;                                                          \
          }                                                                   \
                                                                              \
-       if (__builtin_expect (res != 0, 1))                                   \
+       if (__glibc_likely (res != 0))                                        \
          {                                                                   \
            *outptr++ = res;                                                  \
            inptr += 4;                                                       \
@@ -696,7 +696,7 @@ static const struct
                  }                                                           \
                                                                              \
                /* See whether we have room for two bytes.  */                \
-               if (__builtin_expect (outptr + 1 >= outend, 0))               \
+               if (__glibc_unlikely (outptr + 1 >= outend))                  \
                  {                                                           \
                    result = __GCONV_FULL_OUTPUT;                             \
                    break;                                                    \