tizen 2.4 release
[framework/base/tizen-locale.git] / iconvdata / utf-7.c
index b58b11f..df6fe03 100644 (file)
@@ -1,5 +1,5 @@
 /* Conversion module for UTF-7.
-   Copyright (C) 2000-2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2000-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Bruno Haible <haible@clisp.cons.org>, 2000.
 
@@ -14,9 +14,8 @@
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 /* UTF-7 is a legacy encoding used for transmitting Unicode within the
    ASCII character set, used primarily by mail agents.  New programs
@@ -121,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;
@@ -168,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;                            \
@@ -341,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;                                                        \
@@ -382,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;                                                        \
@@ -406,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;                                                        \
@@ -510,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                                                                \