From 89301d683e7401cb7cfcb6ebc89be6593d4c809f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 6 Jun 2000 16:53:06 +0000 Subject: Update. 2000-06-06 Ulrich Drepper * 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. --- iconvdata/euc-cn.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'iconvdata/euc-cn.c') diff --git a/iconvdata/euc-cn.c b/iconvdata/euc-cn.c index 3211b57..b4c1725 100644 --- a/iconvdata/euc-cn.c +++ b/iconvdata/euc-cn.c @@ -44,7 +44,8 @@ if (ch <= 0x7f) \ ++inptr; \ else \ - if ((ch <= 0xa0 && ch != 0x8e && ch != 0x8f) || ch > 0xfe) \ + if ((__builtin_expect (ch, 0xa1) <= 0xa0 && ch != 0x8e && ch != 0x8f) \ + || __builtin_expect (ch, 0xfe) > 0xfe) \ { \ /* This is illegal. */ \ if (! ignore_errors_p ()) \ @@ -63,7 +64,7 @@ next character is also available. */ \ const unsigned char *endp; \ \ - if (NEED_LENGTH_TEST && inptr + 1 >= inend) \ + if (NEED_LENGTH_TEST && __builtin_expect (inptr + 1 >= inend, 0)) \ { \ /* The second character is not available. Store \ the intermediate result. */ \ @@ -74,7 +75,7 @@ ch = inptr[1]; \ \ /* All second bytes of a multibyte character must be >= 0xa1. */ \ - if (ch < 0xa1) \ + if (__builtin_expect (ch, 0xa1) < 0xa1) \ { \ if (! ignore_errors_p ()) \ { \ @@ -92,7 +93,7 @@ endp = inptr; \ \ ch = gb2312_to_ucs4 (&endp, 2, 0x80); \ - if (ch == __UNKNOWN_10646_CHAR) \ + if (__builtin_expect (ch, 0) == __UNKNOWN_10646_CHAR) \ { \ /* This is an illegal character. */ \ if (! ignore_errors_p ()) \ @@ -135,9 +136,9 @@ found = ucs4_to_gb2312 (ch, outptr, \ (NEED_LENGTH_TEST \ ? outend - outptr : MAX_NEEDED_OUTPUT)); \ - if (!NEED_LENGTH_TEST || found != 0) \ + if (!NEED_LENGTH_TEST || __builtin_expect (found, 1) != 0) \ { \ - if (found == __UNKNOWN_10646_CHAR) \ + if (__builtin_expect (found, 0) == __UNKNOWN_10646_CHAR) \ { \ /* Illegal character. */ \ if (! ignore_errors_p ()) \ -- cgit v1.1