about summary refs log tree commit diff
path: root/iconvdata/euc-kr.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-06-06 16:53:06 +0000
committerUlrich Drepper <drepper@redhat.com>2000-06-06 16:53:06 +0000
commit89301d683e7401cb7cfcb6ebc89be6593d4c809f (patch)
tree5fcc96e30f608b81ac5a5cee239b6f4327f0a339 /iconvdata/euc-kr.c
parent5ea1a82defd37feaa6be1faf44854364c901cdaf (diff)
downloadglibc-89301d683e7401cb7cfcb6ebc89be6593d4c809f.tar.gz
glibc-89301d683e7401cb7cfcb6ebc89be6593d4c809f.tar.xz
glibc-89301d683e7401cb7cfcb6ebc89be6593d4c809f.zip
Update.
2000-06-06  Ulrich Drepper  <drepper@redhat.com>

	* iconvdata/iso-2022-kr.c: Add __builtin_expect in many places.
	* iconvdata/iso-2022-jp.c: Likewise.
	* iconvdata/iso-2022-cn.c: Likewise.
	* iconvdata/gbgbk.c: Likewise.
	* iconvdata/gbk.c: Likewise.
	* iconvdata/euc-kr.c: Likewise.
	* iconvdata/euc-jp.c: Likewise.
	* iconvdata/euc-cn.c: Likewise.
Diffstat (limited to 'iconvdata/euc-kr.c')
-rw-r--r--iconvdata/euc-kr.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/iconvdata/euc-kr.c b/iconvdata/euc-kr.c
index d84e72ca5d..48fdee3cdc 100644
--- a/iconvdata/euc-kr.c
+++ b/iconvdata/euc-kr.c
@@ -28,7 +28,8 @@ euckr_from_ucs4 (uint32_t ch, unsigned char *cp)
 {
   if (ch > 0x7f)
     {
-      if (ucs4_to_ksc5601 (ch, cp, 2) != __UNKNOWN_10646_CHAR)
+      if (__builtin_expect (ucs4_to_ksc5601 (ch, cp, 2), 0)
+	  != __UNKNOWN_10646_CHAR)
 	{
 	  cp[0] |= 0x80;
 	  cp[1] |= 0x80;
@@ -78,7 +79,9 @@ euckr_from_ucs4 (uint32_t ch, unsigned char *cp)
       ++inptr;								      \
     /* 0xfe(->0x7e : row 94) and 0xc9(->0x59 : row 41) are		      \
        user-defined areas.  */						      \
-    else if (ch <= 0xa0 || ch > 0xfe || ch == 0xc9)			      \
+    else if (__builtin_expect (ch, 0xa1) <= 0xa0			      \
+	     || __builtin_expect (ch, 0xa1) > 0xfe			      \
+	     || __builtin_expect (ch, 0xa1) == 0xc9)			      \
       {									      \
 	/* This is illegal.  */						      \
 	if (! ignore_errors_p ())					      \
@@ -97,13 +100,13 @@ euckr_from_ucs4 (uint32_t ch, unsigned char *cp)
 	   is also available.  */					      \
 	ch = ksc5601_to_ucs4 (&inptr,					      \
 			      NEED_LENGTH_TEST ? inptr - inend : 2, 0x80);    \
-	if (NEED_LENGTH_TEST && ch == 0)				      \
+	if (NEED_LENGTH_TEST && __builtin_expect (ch, 1) == 0)		      \
 	  {								      \
 	    /* The second character is not available.  */		      \
 	    result = __GCONV_INCOMPLETE_INPUT;				      \
 	    break;							      \
 	  }								      \
-	if (ch == __UNKNOWN_10646_CHAR)					      \
+	if (__builtin_expect (ch, 0) == __UNKNOWN_10646_CHAR)		      \
 	  {								      \
 	    /* This is an illegal character.  */			      \
 	    if (! ignore_errors_p ())					      \
@@ -139,7 +142,7 @@ euckr_from_ucs4 (uint32_t ch, unsigned char *cp)
        Jamos should be considered either here or in euckr_from_ucs4() */      \
     euckr_from_ucs4 (ch, cp) ;						      \
 									      \
-    if (cp[0] == '\0' && ch != 0)					      \
+    if (__builtin_expect (cp[0], '\1') == '\0' && ch != 0)		      \
       {									      \
 	/* Illegal character.  */					      \
 	if (! ignore_errors_p ())					      \
@@ -157,7 +160,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 (NEED_LENGTH_TEST && outptr >= outend)			      \
+	if (NEED_LENGTH_TEST && __builtin_expect (outptr >= outend, 0))	      \
 	  {								      \
 	    /* The result does not fit into the buffer.  */		      \
 	    --outptr;							      \