tizen 2.4 release
[framework/base/tizen-locale.git] / iconvdata / euc-kr.c
index 8e9120b..552b8f5 100644 (file)
@@ -1,6 +1,5 @@
 /* Mapping tables for EUC-KR handling.
-   Copyright (C) 1998, 1999, 2000-2002, 2003, 2007
-   Free Software Foundation, Inc.
+   Copyright (C) 1998-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jungshik Shin <jshin@pantheon.yale.edu>
    and Ulrich Drepper <drepper@cygnus.com>, 1998.
@@ -16,9 +15,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/>.  */
 
 #include <dlfcn.h>
 #include <stdint.h>
@@ -68,6 +66,7 @@ euckr_from_ucs4 (uint32_t ch, unsigned char *cp)
 #define MIN_NEEDED_FROM                1
 #define MAX_NEEDED_FROM                2
 #define MIN_NEEDED_TO          4
+#define ONE_DIRECTION          0
 
 
 /* First define the conversion function from EUC-KR to UCS4.  */
@@ -95,13 +94,13 @@ euckr_from_ucs4 (uint32_t ch, unsigned char *cp)
        /* Two-byte character.  First test whether the next byte              \
           is also available.  */                                             \
        ch = ksc5601_to_ucs4 (&inptr, inend - inptr, 0x80);                   \
-       if (__builtin_expect (ch == 0, 0))                                    \
+       if (__glibc_unlikely (ch == 0))                                       \
          {                                                                   \
            /* The second byte is not available.  */                          \
            result = __GCONV_INCOMPLETE_INPUT;                                \
            break;                                                            \
          }                                                                   \
-       if (__builtin_expect (ch == __UNKNOWN_10646_CHAR, 0))                 \
+       if (__glibc_unlikely (ch == __UNKNOWN_10646_CHAR))                    \
          /* This is an illegal character.  */                                \
          STANDARD_FROM_LOOP_ERR_HANDLER (2);                                 \
       }                                                                              \
@@ -146,7 +145,7 @@ euckr_from_ucs4 (uint32_t ch, unsigned char *cp)
     /* Now test for a possible second byte and write this if possible.  */    \
     if (cp[1] != '\0')                                                       \
       {                                                                              \
-       if (__builtin_expect (outptr >= outend, 0))                           \
+       if (__glibc_unlikely (outptr >= outend))                              \
          {                                                                   \
            /* The result does not fit into the buffer.  */                   \
            --outptr;                                                         \