]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - iconvdata/utf-32.c
support: Add support_install_rootsbindir
[thirdparty/glibc.git] / iconvdata / utf-32.c
index 6d3e6da30a1fb7ce272df45995638a82d8fd7a3a..34e350c91436cbf101b091c844c088026ab86c36 100644 (file)
@@ -1,5 +1,5 @@
 /* Conversion module for UTF-32.
-   Copyright (C) 1999-2013 Free Software Foundation, Inc.
+   Copyright (C) 1999-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -37,6 +37,7 @@
 #define DEFINE_FINI            0
 #define MIN_NEEDED_FROM                4
 #define MIN_NEEDED_TO          4
+#define ONE_DIRECTION          0
 #define FROM_DIRECTION         (dir == from_utf32)
 #define PREPARE_LOOP \
   enum direction dir = ((struct utf32_data *) step->__data)->dir;            \
@@ -44,7 +45,7 @@
   int swap;                                                                  \
   if (FROM_DIRECTION && var == UTF_32)                                       \
     {                                                                        \
-      if (__builtin_expect (data->__invocation_counter == 0, 0))             \
+      if (__glibc_unlikely (data->__invocation_counter == 0))                \
        {                                                                     \
          /* We have to find out which byte order the file is encoded in.  */ \
          if (inptr + 4 > inend)                                              \
@@ -65,7 +66,7 @@
           && data->__invocation_counter == 0)                                \
     {                                                                        \
       /* Emit the Byte Order Mark.  */                                       \
-      if (__builtin_expect (outbuf + 4 > outend, 0))                         \
+      if (__glibc_unlikely (outbuf + 4 > outend))                            \
        return __GCONV_FULL_OUTPUT;                                           \
                                                                              \
       put32u (outbuf, BOM);                                                  \
@@ -196,11 +197,11 @@ gconv_end (struct __gconv_step *data)
   {                                                                          \
     uint32_t c = get32 (inptr);                                                      \
                                                                              \
-    if (__builtin_expect (c >= 0x110000, 0))                                 \
+    if (__glibc_unlikely (c >= 0x110000))                                    \
       {                                                                              \
        STANDARD_TO_LOOP_ERR_HANDLER (4);                                     \
       }                                                                              \
-    else if (__builtin_expect (c >= 0xd800 && c < 0xe000, 0))                \
+    else if (__glibc_unlikely (c >= 0xd800 && c < 0xe000))                   \
       {                                                                              \
        /* Surrogate characters in UCS-4 input are not valid.                 \
           We must catch this.  If we let surrogates pass through,            \
@@ -238,7 +239,7 @@ gconv_end (struct __gconv_step *data)
     if (swap)                                                                \
       u1 = bswap_32 (u1);                                                    \
                                                                              \
-    if (__builtin_expect (u1 >= 0x110000, 0))                                \
+    if (__glibc_unlikely (u1 >= 0x110000 || (u1 >= 0xd800 && u1 < 0xe000)))   \
       {                                                                              \
        /* This is illegal.  */                                               \
        STANDARD_FROM_LOOP_ERR_HANDLER (4);                                   \