]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - iconvdata/utf-7.c
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / iconvdata / utf-7.c
index 3336b1ff39b2c44dfd357a8ab007a63c3ba2a319..b4998dbf5527b2351b31e412c97176cf28ae84b1 100644 (file)
@@ -1,5 +1,5 @@
 /* Conversion module for UTF-7.
-   Copyright (C) 2000-2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2000-2016 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Bruno Haible <haible@clisp.cons.org>, 2000.
 
@@ -120,6 +120,7 @@ base64 (unsigned int i)
 #define MAX_NEEDED_FROM                6
 #define MIN_NEEDED_TO          4
 #define MAX_NEEDED_TO          4
+#define ONE_DIRECTION          0
 #define PREPARE_LOOP \
   mbstate_t saved_state;                                                     \
   mbstate_t *statep = data->__statep;
@@ -167,9 +168,9 @@ base64 (unsigned int i)
            put32 (outptr, ch);                                               \
            outptr += 4;                                                      \
          }                                                                   \
-       else if (__builtin_expect (ch == '+', 1))                             \
+       else if (__glibc_likely (ch == '+'))                                  \
          {                                                                   \
-           if (__builtin_expect (inptr + 2 > inend, 0))                      \
+           if (__glibc_unlikely (inptr + 2 > inend))                         \
              {                                                               \
                /* Not enough input available.  */                            \
                result = __GCONV_INCOMPLETE_INPUT;                            \
@@ -340,7 +341,7 @@ base64 (unsigned int i)
            else                                                              \
              STANDARD_TO_LOOP_ERR_HANDLER (4);                               \
                                                                              \
-           if (__builtin_expect (outptr + count > outend, 0))                \
+           if (__glibc_unlikely (outptr + count > outend))                   \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -381,7 +382,7 @@ base64 (unsigned int i)
            size_t count;                                                     \
                                                                              \
            count = ((statep->__count & 0x18) >= 0x10) + isxbase64 (ch) + 1;  \
-           if (__builtin_expect (outptr + count > outend, 0))                \
+           if (__glibc_unlikely (outptr + count > outend))                   \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -405,7 +406,7 @@ base64 (unsigned int i)
            else                                                              \
              STANDARD_TO_LOOP_ERR_HANDLER (4);                               \
                                                                              \
-           if (__builtin_expect (outptr + count > outend, 0))                \
+           if (__glibc_unlikely (outptr + count > outend))                   \
              {                                                               \
                result = __GCONV_FULL_OUTPUT;                                 \
                break;                                                        \
@@ -509,7 +510,7 @@ base64 (unsigned int i)
          /* Deactivate base64 encoding.  */                                  \
          size_t count = ((state & 0x18) >= 0x10) + 1;                        \
                                                                              \
-         if (__builtin_expect (outbuf + count > outend, 0))                  \
+         if (__glibc_unlikely (outbuf + count > outend))                     \
            /* We don't have enough room in the output buffer.  */            \
            status = __GCONV_FULL_OUTPUT;                                     \
          else                                                                \