summaryrefslogtreecommitdiff
path: root/iconvdata/euc-jp.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-jp.c
parent5ea1a82defd37feaa6be1faf44854364c901cdaf (diff)
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-jp.c')
-rw-r--r--iconvdata/euc-jp.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/iconvdata/euc-jp.c b/iconvdata/euc-jp.c
index 240d76037f..a781182e78 100644
--- a/iconvdata/euc-jp.c
+++ b/iconvdata/euc-jp.c
@@ -46,7 +46,8 @@
\
if (ch <= 0x7f) \
++inptr; \
- else if ((ch <= 0xa0 && ch != 0x8e && ch != 0x8f) || ch > 0xfe) \
+ else if ((__builtin_expect (ch, 0xa1) <= 0xa0 && ch != 0x8e && ch != 0x8f)\
+ || __builtin_expect (ch, 0xfe) > 0xfe) \
{ \
/* This is illegal. */ \
if (! ignore_errors_p ()) \
@@ -65,7 +66,7 @@
character is also available. */ \
int ch2; \
\
- 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. */ \
@@ -76,7 +77,7 @@
ch2 = inptr[1]; \
\
/* All second bytes of a multibyte character must be >= 0xa1. */ \
- if (ch2 < 0xa1) \
+ if (__builtin_expect (ch2, 0xa1) < 0xa1) \
{ \
/* This is an illegal character. */ \
if (! ignore_errors_p ()) \
@@ -119,13 +120,13 @@
0x80); \
} \
\
- if (NEED_LENGTH_TEST && ch == 0) \
+ if (NEED_LENGTH_TEST && __builtin_expect (ch, 1) == 0) \
{ \
/* Not enough input available. */ \
result = __GCONV_INCOMPLETE_INPUT; \
break; \
} \
- if (ch == __UNKNOWN_10646_CHAR) \
+ if (__builtin_expect (ch, 0) == __UNKNOWN_10646_CHAR) \
{ \
/* Illegal character. */ \
if (! ignore_errors_p ()) \
@@ -173,7 +174,7 @@
size_t found; \
\
/* See whether we have room for at least two characters. */ \
- if (NEED_LENGTH_TEST && outptr + 1 >= outend) \
+ if (NEED_LENGTH_TEST && __builtin_expect (outptr + 1 >= outend, 0)) \
{ \
result = __GCONV_FULL_OUTPUT; \
break; \
@@ -204,13 +205,13 @@
(NEED_LENGTH_TEST \
? outend - outptr - 1 : 2)); \
\
- if (found == 0) \
+ if (__builtin_expect (found, 1) == 0) \
{ \
/* We ran out of space. */ \
result = __GCONV_FULL_OUTPUT; \
break; \
} \
- else if (found != __UNKNOWN_10646_CHAR) \
+ else if (__builtin_expect (found, 0) != __UNKNOWN_10646_CHAR) \
{ \
/* It's a JIS 0212 character, adjust it for EUC-JP. */ \
*outptr++ = 0x8f; \