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.
This commit is contained in:
Ulrich Drepper 2000-06-06 16:53:06 +00:00
parent 5ea1a82def
commit 89301d683e
9 changed files with 148 additions and 109 deletions

View File

@ -1,3 +1,14 @@
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.
2000-06-05 Ulrich Drepper <drepper@redhat.com> 2000-06-05 Ulrich Drepper <drepper@redhat.com>
* iconvdata/big5hkscs.c: Add __builtin_expect in many places. * iconvdata/big5hkscs.c: Add __builtin_expect in many places.

View File

@ -44,7 +44,8 @@
if (ch <= 0x7f) \ if (ch <= 0x7f) \
++inptr; \ ++inptr; \
else \ 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. */ \ /* This is illegal. */ \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
@ -63,7 +64,7 @@
next character is also available. */ \ next character is also available. */ \
const unsigned char *endp; \ 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 second character is not available. Store \
the intermediate result. */ \ the intermediate result. */ \
@ -74,7 +75,7 @@
ch = inptr[1]; \ ch = inptr[1]; \
\ \
/* All second bytes of a multibyte character must be >= 0xa1. */ \ /* All second bytes of a multibyte character must be >= 0xa1. */ \
if (ch < 0xa1) \ if (__builtin_expect (ch, 0xa1) < 0xa1) \
{ \ { \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
{ \ { \
@ -92,7 +93,7 @@
endp = inptr; \ endp = inptr; \
\ \
ch = gb2312_to_ucs4 (&endp, 2, 0x80); \ 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. */ \ /* This is an illegal character. */ \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
@ -135,9 +136,9 @@
found = ucs4_to_gb2312 (ch, outptr, \ found = ucs4_to_gb2312 (ch, outptr, \
(NEED_LENGTH_TEST \ (NEED_LENGTH_TEST \
? outend - outptr : MAX_NEEDED_OUTPUT)); \ ? 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. */ \ /* Illegal character. */ \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \

View File

@ -46,7 +46,8 @@
\ \
if (ch <= 0x7f) \ if (ch <= 0x7f) \
++inptr; \ ++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. */ \ /* This is illegal. */ \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
@ -65,7 +66,7 @@
character is also available. */ \ character is also available. */ \
int ch2; \ 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 \ /* The second character is not available. Store the \
intermediate result. */ \ intermediate result. */ \
@ -76,7 +77,7 @@
ch2 = inptr[1]; \ ch2 = inptr[1]; \
\ \
/* All second bytes of a multibyte character must be >= 0xa1. */ \ /* All second bytes of a multibyte character must be >= 0xa1. */ \
if (ch2 < 0xa1) \ if (__builtin_expect (ch2, 0xa1) < 0xa1) \
{ \ { \
/* This is an illegal character. */ \ /* This is an illegal character. */ \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
@ -119,13 +120,13 @@
0x80); \ 0x80); \
} \ } \
\ \
if (NEED_LENGTH_TEST && ch == 0) \ if (NEED_LENGTH_TEST && __builtin_expect (ch, 1) == 0) \
{ \ { \
/* Not enough input available. */ \ /* Not enough input available. */ \
result = __GCONV_INCOMPLETE_INPUT; \ result = __GCONV_INCOMPLETE_INPUT; \
break; \ break; \
} \ } \
if (ch == __UNKNOWN_10646_CHAR) \ if (__builtin_expect (ch, 0) == __UNKNOWN_10646_CHAR) \
{ \ { \
/* Illegal character. */ \ /* Illegal character. */ \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
@ -173,7 +174,7 @@
size_t found; \ size_t found; \
\ \
/* See whether we have room for at least two characters. */ \ /* 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; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -204,13 +205,13 @@
(NEED_LENGTH_TEST \ (NEED_LENGTH_TEST \
? outend - outptr - 1 : 2)); \ ? outend - outptr - 1 : 2)); \
\ \
if (found == 0) \ if (__builtin_expect (found, 1) == 0) \
{ \ { \
/* We ran out of space. */ \ /* We ran out of space. */ \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ 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. */ \ /* It's a JIS 0212 character, adjust it for EUC-JP. */ \
*outptr++ = 0x8f; \ *outptr++ = 0x8f; \

View File

@ -28,7 +28,8 @@ euckr_from_ucs4 (uint32_t ch, unsigned char *cp)
{ {
if (ch > 0x7f) 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[0] |= 0x80;
cp[1] |= 0x80; cp[1] |= 0x80;
@ -78,7 +79,9 @@ euckr_from_ucs4 (uint32_t ch, unsigned char *cp)
++inptr; \ ++inptr; \
/* 0xfe(->0x7e : row 94) and 0xc9(->0x59 : row 41) are \ /* 0xfe(->0x7e : row 94) and 0xc9(->0x59 : row 41) are \
user-defined areas. */ \ 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. */ \ /* This is illegal. */ \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
@ -97,13 +100,13 @@ euckr_from_ucs4 (uint32_t ch, unsigned char *cp)
is also available. */ \ is also available. */ \
ch = ksc5601_to_ucs4 (&inptr, \ ch = ksc5601_to_ucs4 (&inptr, \
NEED_LENGTH_TEST ? inptr - inend : 2, 0x80); \ 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. */ \ /* The second character is not available. */ \
result = __GCONV_INCOMPLETE_INPUT; \ result = __GCONV_INCOMPLETE_INPUT; \
break; \ break; \
} \ } \
if (ch == __UNKNOWN_10646_CHAR) \ if (__builtin_expect (ch, 0) == __UNKNOWN_10646_CHAR) \
{ \ { \
/* This is an illegal character. */ \ /* This is an illegal character. */ \
if (! ignore_errors_p ()) \ 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() */ \ Jamos should be considered either here or in euckr_from_ucs4() */ \
euckr_from_ucs4 (ch, cp) ; \ euckr_from_ucs4 (ch, cp) ; \
\ \
if (cp[0] == '\0' && ch != 0) \ if (__builtin_expect (cp[0], '\1') == '\0' && ch != 0) \
{ \ { \
/* Illegal character. */ \ /* Illegal character. */ \
if (! ignore_errors_p ()) \ 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. */ \ /* Now test for a possible second byte and write this if possible. */ \
if (cp[1] != '\0') \ 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. */ \ /* The result does not fit into the buffer. */ \
--outptr; \ --outptr; \

View File

@ -71,7 +71,7 @@
UCS4 -> GB2312 -> GBK -> UCS4 \ UCS4 -> GB2312 -> GBK -> UCS4 \
\ \
might not produce identical text. */ \ might not produce identical text. */ \
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 second character is not available. Store \
the intermediate result. */ \ the intermediate result. */ \
@ -79,7 +79,7 @@
break; \ break; \
} \ } \
\ \
if (NEED_LENGTH_TEST && outend - outptr < 2) \ if (NEED_LENGTH_TEST && __builtin_expect (outend - outptr < 2, 0)) \
{ \ { \
/* We ran out of space. */ \ /* We ran out of space. */ \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
@ -89,11 +89,16 @@
ch = (ch << 8) | inptr[1]; \ ch = (ch << 8) | inptr[1]; \
\ \
/* Now determine whether the character is valid. */ \ /* Now determine whether the character is valid. */ \
if (ch < 0xa1a1 || ch > 0xf7fe || inptr[1] < 0xa1 \ if (__builtin_expect (ch, 0xa1a1) < 0xa1a1 \
|| __builtin_expect (ch, 0xa1a1) > 0xf7fe \
|| __builtin_expect (inptr[1], 0xa1) < 0xa1 \
/* Now test the exceptions. */ \ /* Now test the exceptions. */ \
|| (ch >= 0xa2a1 && ch <= 0xa2aa) \ || (__builtin_expect (ch, 0xa1a1) >= 0xa2a1 \
|| (ch >= 0xa6e0 && ch <= 0xa6f5) \ && __builtin_expect (ch, 0xa1a1) <= 0xa2aa) \
|| (ch >= 0xa8bb && ch <= 0xa8c0)) \ || (__builtin_expect (ch, 0xa1a1) >= 0xa6e0 \
&& __builtin_expect (ch, 0xa1a1) <= 0xa6f5) \
|| (__builtin_expect (ch, 0xa1a1) >= 0xa8bb \
&& __builtin_expect (ch, 0xa1a1) <= 0xa8c0)) \
{ \ { \
/* One of the characters we cannot map. */ \ /* One of the characters we cannot map. */ \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
@ -131,7 +136,7 @@
\ \
if (ch > 0x7f) \ if (ch > 0x7f) \
{ \ { \
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 second character is not available. Store \
the intermediate result. */ \ the intermediate result. */ \
@ -139,7 +144,7 @@
break; \ break; \
} \ } \
\ \
if (NEED_LENGTH_TEST && outend - outptr < 2) \ if (NEED_LENGTH_TEST && __builtin_expect (outend - outptr < 2, 0)) \
{ \ { \
/* We ran out of space. */ \ /* We ran out of space. */ \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \

View File

@ -13121,7 +13121,8 @@ static const char __gbk_from_ucs4_tab12[][2] =
if (ch <= 0x7f) \ if (ch <= 0x7f) \
++inptr; \ ++inptr; \
else \ else \
if (ch <= 0x80 || ch > 0xfe) \ if (__builtin_expect (ch, 0x81) <= 0x80 \
|| __builtin_expect (ch, 0x81) > 0xfe) \
{ \ { \
/* This is illegal. */ \ /* This is illegal. */ \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
@ -13141,7 +13142,7 @@ static const char __gbk_from_ucs4_tab12[][2] =
uint32_t ch2; \ uint32_t ch2; \
int idx; \ int idx; \
\ \
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 second character is not available. Store \
the intermediate result. */ \ the intermediate result. */ \
@ -13152,7 +13153,7 @@ static const char __gbk_from_ucs4_tab12[][2] =
ch2 = inptr[1]; \ ch2 = inptr[1]; \
\ \
/* All second bytes of a multibyte character must be >= 0x40. */ \ /* All second bytes of a multibyte character must be >= 0x40. */ \
if (ch2 < 0x40) \ if (__builtin_expect (ch2, 0x41) < 0x40) \
{ \ { \
/* This is an illegal character. */ \ /* This is an illegal character. */ \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
@ -13172,7 +13173,7 @@ static const char __gbk_from_ucs4_tab12[][2] =
\ \
ch = __gbk_to_ucs[idx]; \ ch = __gbk_to_ucs[idx]; \
\ \
if (ch == 0 && *inptr != '\0') \ if (__builtin_expect (ch, 1) == 0 && *inptr != '\0') \
{ \ { \
/* This is an illegal character. */ \ /* This is an illegal character. */ \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
@ -13446,7 +13447,7 @@ static const char __gbk_from_ucs4_tab12[][2] =
cp = ""; \ cp = ""; \
break; \ break; \
} \ } \
if (cp == NULL || (cp[0] == '\0' && ch != 0)) \ if (__builtin_expect (cp[0], '\1') == '\0' && ch != 0) \
{ \ { \
/* Illegal character. */ \ /* Illegal character. */ \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
@ -13458,7 +13459,8 @@ static const char __gbk_from_ucs4_tab12[][2] =
++*converted; \ ++*converted; \
} \ } \
/* See whether there is enough room for the second byte we write. */ \ /* See whether there is enough room for the second byte we write. */ \
else if (NEED_LENGTH_TEST && cp[1] != '\0' && outptr + 1 >= outend) \ else if (NEED_LENGTH_TEST && cp[1] != '\0' \
&& __builtin_expect (outptr + 1 >= outend, 0)) \
{ \ { \
/* We have not enough room. */ \ /* We have not enough room. */ \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \

View File

@ -86,15 +86,13 @@ enum
\ \
/* We are not in the initial state. To switch back we have \ /* We are not in the initial state. To switch back we have \
to emit `SI'. */ \ to emit `SI'. */ \
if (outbuf == data->__outbufend) \ if (__builtin_expect (outbuf == data->__outbufend, 0)) \
/* We don't have enough room in the output buffer. */ \ /* We don't have enough room in the output buffer. */ \
status = __GCONV_FULL_OUTPUT; \ status = __GCONV_FULL_OUTPUT; \
else \ else \
{ \ { \
/* Write out the shift sequence. */ \ /* Write out the shift sequence. */ \
*outbuf++ = SI; \ *outbuf++ = SI; \
if (data->__flags & __GCONV_IS_LAST) \
*written += 1; \
data->__outbuf = outbuf; \ data->__outbuf = outbuf; \
data->__statep->__count = ASCII_set; \ data->__statep->__count = ASCII_set; \
} \ } \
@ -121,7 +119,7 @@ enum
uint32_t ch = *inptr; \ uint32_t ch = *inptr; \
\ \
/* This is a 7bit character set, disallow all 8bit characters. */ \ /* This is a 7bit character set, disallow all 8bit characters. */ \
if (ch > 0x7f) \ if (__builtin_expect (ch, 0) > 0x7f) \
{ \ { \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
{ \ { \
@ -135,7 +133,7 @@ enum
} \ } \
\ \
/* Recognize escape sequences. */ \ /* Recognize escape sequences. */ \
if (ch == ESC) \ if (__builtin_expect (ch, 0) == ESC) \
{ \ { \
/* There are two kinds of escape sequences we have to handle: \ /* There are two kinds of escape sequences we have to handle: \
- those announcing the use of GB and CNS characters on the \ - those announcing the use of GB and CNS characters on the \
@ -143,12 +141,15 @@ enum
- the initial byte of the SS2 sequence. \ - the initial byte of the SS2 sequence. \
*/ \ */ \
if (NEED_LENGTH_TEST \ if (NEED_LENGTH_TEST \
&& (inptr + 1 > inend \ && (__builtin_expect (inptr + 1 > inend, 0) \
|| (inptr[1] == '$' \ || (inptr[1] == '$' \
&& (inptr + 2 > inend \ && (__builtin_expect (inptr + 2 > inend, 0) \
|| (inptr[2] == ')' && inptr + 3 > inend) \ || (inptr[2] == ')' \
|| (inptr[2] == '*' && inptr + 3 > inend))) \ && __builtin_expect (inptr + 3 > inend, 0)) \
|| (inptr[1] == SS2_1 && inptr + 3 > inend))) \ || (inptr[2] == '*' \
&& __builtin_expect (inptr + 3 > inend, 0)))) \
|| (inptr[1] == SS2_1 \
&& __builtin_expect (inptr + 3 > inend, 0)))) \
{ \ { \
result = __GCONV_EMPTY_INPUT; \ result = __GCONV_EMPTY_INPUT; \
break; \ break; \
@ -166,7 +167,7 @@ enum
continue; \ continue; \
} \ } \
} \ } \
else if (ch == SO) \ else if (__builtin_expect (ch, 0) == SO) \
{ \ { \
/* Switch to use GB2312 or CNS 11643 plane 1, depending on which \ /* Switch to use GB2312 or CNS 11643 plane 1, depending on which \
S0 designation came last. The only problem is what to do with \ S0 designation came last. The only problem is what to do with \
@ -177,7 +178,7 @@ enum
set = ann == CNS11643_1_ann ? CNS11643_1_set : GB2312_set; \ set = ann == CNS11643_1_ann ? CNS11643_1_set : GB2312_set; \
continue; \ continue; \
} \ } \
else if (ch == SI) \ else if (__builtin_expect (ch, 0) == SI) \
{ \ { \
/* Switch to use ASCII. */ \ /* Switch to use ASCII. */ \
++inptr; \ ++inptr; \
@ -185,14 +186,14 @@ enum
continue; \ continue; \
} \ } \
\ \
if (ch == ESC && inptr[1] == SS2_1) \ if (__builtin_expect (ch, 0) == ESC && inptr[1] == SS2_1) \
{ \ { \
/* This is a character from CNS 11643 plane 2. \ /* This is a character from CNS 11643 plane 2. \
XXX We could test here whether the use of this character \ XXX We could test here whether the use of this character \
set was announced. */ \ set was announced. */ \
inptr += 2; \ inptr += 2; \
ch = cns11643l2_to_ucs4 (&inptr, 2, 0); \ ch = cns11643l2_to_ucs4 (&inptr, 2, 0); \
if (ch == __UNKNOWN_10646_CHAR) \ if (__builtin_expect (ch, 0) == __UNKNOWN_10646_CHAR) \
{ \ { \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
{ \ { \
@ -224,12 +225,12 @@ enum
NEED_LENGTH_TEST ? inend - inptr : 2, 0);\ NEED_LENGTH_TEST ? inend - inptr : 2, 0);\
} \ } \
\ \
if (NEED_LENGTH_TEST && ch == 0) \ if (NEED_LENGTH_TEST && __builtin_expect (ch, 1) == 0) \
{ \ { \
result = __GCONV_EMPTY_INPUT; \ result = __GCONV_EMPTY_INPUT; \
break; \ break; \
} \ } \
else if (ch == __UNKNOWN_10646_CHAR) \ else if (__builtin_expect (ch, 1) == __UNKNOWN_10646_CHAR) \
{ \ { \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
{ \ { \
@ -261,10 +262,7 @@ enum
#define LOOPFCT TO_LOOP #define LOOPFCT TO_LOOP
#define BODY \ #define BODY \
{ \ { \
uint32_t ch; \ uint32_t ch = get32 (inptr); \
size_t written = 0; \
\
ch = get32 (inptr); \
\ \
/* First see whether we can write the character using the currently \ /* First see whether we can write the character using the currently \
selected character set. */ \ selected character set. */ \
@ -274,7 +272,7 @@ enum
{ \ { \
*outptr++ = SI; \ *outptr++ = SI; \
set = ASCII_set; \ set = ASCII_set; \
if (NEED_LENGTH_TEST && outptr == outend) \ if (NEED_LENGTH_TEST && __builtin_expet (outptr == outend, 0)) \
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -282,7 +280,6 @@ enum
} \ } \
\ \
*outptr++ = ch; \ *outptr++ = ch; \
written = 1; \
\ \
/* At the end of the line we have to clear the `ann' flags since \ /* At the end of the line we have to clear the `ann' flags since \
every line must contain this information again. */ \ every line must contain this information again. */ \
@ -293,6 +290,7 @@ enum
{ \ { \
char buf[2]; \ char buf[2]; \
int used; \ int used; \
size_t written = 0; \
\ \
if (set == GB2312_set || (ann & CNS11643_1_ann) == 0) \ if (set == GB2312_set || (ann & CNS11643_1_ann) == 0) \
{ \ { \
@ -321,7 +319,7 @@ enum
else \ else \
written = ucs4_to_gb2312 (ch, buf, 2); \ written = ucs4_to_gb2312 (ch, buf, 2); \
\ \
if (written != __UNKNOWN_10646_CHAR) \ if (__builin_expect (written, 0) != __UNKNOWN_10646_CHAR) \
/* Oh well, then switch SO. */ \ /* Oh well, then switch SO. */ \
used = GB2312_set + CNS11643_1_set - set; \ used = GB2312_set + CNS11643_1_set - set; \
else \ else \
@ -350,7 +348,8 @@ enum
{ \ { \
const char *escseq; \ const char *escseq; \
\ \
if (NEED_LENGTH_TEST && outptr + 4 > outend) \ if (NEED_LENGTH_TEST \
&& __builtin_expect (outptr + 4 > outend, 0)) \
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -373,7 +372,7 @@ enum
\ \
if (used == CNS11643_2_set) \ if (used == CNS11643_2_set) \
{ \ { \
if (outptr + 2 > outend) \ if (__builtin_expect (outptr + 2 > outend, 0)) \
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -388,7 +387,7 @@ enum
SO charset. */ \ SO charset. */ \
if (set == ASCII_set) \ if (set == ASCII_set) \
{ \ { \
if (outptr + 1 > outend) \ if (__builtin_expect (outptr + 1 > outend, 0)) \
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -399,13 +398,14 @@ enum
\ \
/* Always test the length here since we have used up all the \ /* Always test the length here since we have used up all the \
guaranteed output buffer slots. */ \ guaranteed output buffer slots. */ \
if (outptr + 2 > outend) \ if (__builtin_expect (outptr + 2 > outend, 0)) \
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
} \ } \
} \ } \
else if (NEED_LENGTH_TEST && outptr + 2 > outend) \ else if (NEED_LENGTH_TEST \
&& __builtin_expect (outptr + 2 > outend, 0)) \
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \

View File

@ -141,7 +141,7 @@ gconv_init (struct __gconv_step *step)
} }
result = __GCONV_NOCONV; result = __GCONV_NOCONV;
if (dir != illegal_dir) if (__builtin_expect (dir, from_iso2022jp) != illegal_dir)
{ {
new_data new_data
= (struct iso2022jp_data *) malloc (sizeof (struct iso2022jp_data)); = (struct iso2022jp_data *) malloc (sizeof (struct iso2022jp_data));
@ -208,7 +208,7 @@ gconv_end (struct __gconv_step *data)
\ \
/* We are not in the initial state. To switch back we have \ /* We are not in the initial state. To switch back we have \
to emit the sequence `Esc ( B'. */ \ to emit the sequence `Esc ( B'. */ \
if (outbuf + 3 > data->__outbufend) \ if (__builtin_expect (outbuf + 3 > data->__outbufend, 0)) \
/* We don't have enough room in the output buffer. */ \ /* We don't have enough room in the output buffer. */ \
status = __GCONV_FULL_OUTPUT; \ status = __GCONV_FULL_OUTPUT; \
else \ else \
@ -217,8 +217,6 @@ gconv_end (struct __gconv_step *data)
*outbuf++ = ESC; \ *outbuf++ = ESC; \
*outbuf++ = '('; \ *outbuf++ = '('; \
*outbuf++ = 'B'; \ *outbuf++ = 'B'; \
if (data->__flags & __GCONV_IS_LAST) \
*written += 3; \
data->__outbuf = outbuf; \ data->__outbuf = outbuf; \
/* Note that this also clears the G2 designation. */ \ /* Note that this also clears the G2 designation. */ \
data->__statep->__count &= ~7; \ data->__statep->__count &= ~7; \
@ -247,16 +245,16 @@ gconv_end (struct __gconv_step *data)
uint32_t ch = *inptr; \ uint32_t ch = *inptr; \
\ \
/* Recognize escape sequences. */ \ /* Recognize escape sequences. */ \
if (ch == ESC) \ if (__builtin_expect (ch, 0) == ESC) \
{ \ { \
/* We now must be prepared to read two to three more \ /* We now must be prepared to read two to three more \
chracters. If we have a match in the first character but \ chracters. If we have a match in the first character but \
then the input buffer ends we terminate with an error since \ then the input buffer ends we terminate with an error since \
we must not risk missing an escape sequence just because it \ we must not risk missing an escape sequence just because it \
is not entirely in the current input buffer. */ \ is not entirely in the current input buffer. */ \
if (inptr + 2 >= inend \ if (__builtin_expect (inptr + 2 >= inend, 0) \
|| (var == iso2022jp2 && inptr[1] == '$' && inptr[2] == '(' \ || (var == iso2022jp2 && inptr[1] == '$' && inptr[2] == '(' \
&& inptr + 3 >= inend)) \ && __builtin_expect (inptr + 3 >= inend, 0))) \
{ \ { \
/* Not enough input available. */ \ /* Not enough input available. */ \
result = __GCONV_EMPTY_INPUT; \ result = __GCONV_EMPTY_INPUT; \
@ -357,7 +355,7 @@ gconv_end (struct __gconv_step *data)
ch = inptr[2] | 0x80; \ ch = inptr[2] | 0x80; \
inptr += 3; \ inptr += 3; \
} \ } \
else if (set2 == ISO88597_set) \ else if (__builtin_expect (set2, ISO88597_set) == ISO88597_set) \
{ \ { \
/* We use the table from the ISO 8859-7 module. */ \ /* We use the table from the ISO 8859-7 module. */ \
if (inptr[2] < 0x20 || inptr[2] > 0x80) \ if (inptr[2] < 0x20 || inptr[2] > 0x80) \
@ -407,7 +405,7 @@ gconv_end (struct __gconv_step *data)
{ \ { \
/* Use the JIS X 0201 table. */ \ /* Use the JIS X 0201 table. */ \
ch = jisx0201_to_ucs4 (ch); \ ch = jisx0201_to_ucs4 (ch); \
if (ch == __UNKNOWN_10646_CHAR) \ if (__builtin_expect (ch, 0) == __UNKNOWN_10646_CHAR) \
{ \ { \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
{ \ { \
@ -425,7 +423,7 @@ gconv_end (struct __gconv_step *data)
{ \ { \
/* Use the JIS X 0201 table. */ \ /* Use the JIS X 0201 table. */ \
ch = jisx0201_to_ucs4 (ch + 0x80); \ ch = jisx0201_to_ucs4 (ch + 0x80); \
if (ch == __UNKNOWN_10646_CHAR) \ if (__builtin_expect (ch, 0) == __UNKNOWN_10646_CHAR) \
{ \ { \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
{ \ { \
@ -465,12 +463,12 @@ gconv_end (struct __gconv_step *data)
NEED_LENGTH_TEST ? inend - inptr : 2, 0); \ NEED_LENGTH_TEST ? inend - inptr : 2, 0); \
} \ } \
\ \
if (NEED_LENGTH_TEST && ch == 0) \ if (NEED_LENGTH_TEST && __builtin_expect (ch, 1) == 0) \
{ \ { \
result = __GCONV_EMPTY_INPUT; \ result = __GCONV_EMPTY_INPUT; \
break; \ break; \
} \ } \
else if (ch == __UNKNOWN_10646_CHAR) \ else if (__builtin_expect (ch, 0) == __UNKNOWN_10646_CHAR) \
{ \ { \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
{ \ { \
@ -575,7 +573,7 @@ gconv_end (struct __gconv_step *data)
? outend - outptr : 2)); \ ? outend - outptr : 2)); \
} \ } \
\ \
if (NEED_LENGTH_TEST && written == 0) \ if (NEED_LENGTH_TEST && __builtin_expect (written, 1) == 0) \
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -633,7 +631,7 @@ gconv_end (struct __gconv_step *data)
{ \ { \
/* We must encode using ASCII. First write out the \ /* We must encode using ASCII. First write out the \
escape sequence. */ \ escape sequence. */ \
if (NEED_LENGTH_TEST && outptr + 3 > outend) \ if (NEED_LENGTH_TEST && __builtin_expect (outptr + 3 > outend, 0))\
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -644,7 +642,7 @@ gconv_end (struct __gconv_step *data)
*outptr++ = 'B'; \ *outptr++ = 'B'; \
set = ASCII_set; \ set = ASCII_set; \
\ \
if (NEED_LENGTH_TEST && outptr + 1 > outend) \ if (NEED_LENGTH_TEST && __builtin_expect (outptr + 1 > outend, 0))\
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -668,7 +666,8 @@ gconv_end (struct __gconv_step *data)
if (written != __UNKNOWN_10646_CHAR && buf[0] < 0x80) \ if (written != __UNKNOWN_10646_CHAR && buf[0] < 0x80) \
{ \ { \
/* We use JIS X 0201. */ \ /* We use JIS X 0201. */ \
if (NEED_LENGTH_TEST && outptr + 3 > outend) \ if (NEED_LENGTH_TEST \
&& __builtin_expect (outptr + 3 > outend, 0)) \
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -679,7 +678,8 @@ gconv_end (struct __gconv_step *data)
*outptr++ = 'J'; \ *outptr++ = 'J'; \
set = JISX0201_Roman_set; \ set = JISX0201_Roman_set; \
\ \
if (NEED_LENGTH_TEST && outptr + 1 > outend) \ if (NEED_LENGTH_TEST \
&& __builtin_expect (outptr + 1 > outend, 0)) \
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -692,7 +692,8 @@ gconv_end (struct __gconv_step *data)
if (written != __UNKNOWN_10646_CHAR) \ if (written != __UNKNOWN_10646_CHAR) \
{ \ { \
/* We use JIS X 0208. */ \ /* We use JIS X 0208. */ \
if (NEED_LENGTH_TEST && outptr + 3 > outend) \ if (NEED_LENGTH_TEST \
&& __builtin_expect (outptr + 3 > outend, 0)) \
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -703,7 +704,8 @@ gconv_end (struct __gconv_step *data)
*outptr++ = 'B'; \ *outptr++ = 'B'; \
set = JISX0208_1983_set; \ set = JISX0208_1983_set; \
\ \
if (NEED_LENGTH_TEST && outptr + 2 > outend) \ if (NEED_LENGTH_TEST \
&& __builtin_expect (outptr + 2 > outend, 0)) \
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -711,7 +713,7 @@ gconv_end (struct __gconv_step *data)
*outptr++ = buf[0]; \ *outptr++ = buf[0]; \
*outptr++ = buf[1]; \ *outptr++ = buf[1]; \
} \ } \
else if (var == iso2022jp) \ else if (__builtin_expect (var, iso2022jp2) == iso2022jp) \
{ \ { \
/* We have no other choice. */ \ /* We have no other choice. */ \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
@ -728,7 +730,8 @@ gconv_end (struct __gconv_step *data)
if (written != __UNKNOWN_10646_CHAR) \ if (written != __UNKNOWN_10646_CHAR) \
{ \ { \
/* We use JIS X 0212. */ \ /* We use JIS X 0212. */ \
if (NEED_LENGTH_TEST && outptr + 4 > outend) \ if (NEED_LENGTH_TEST \
&& __builtin_expect (outptr + 4 > outend, 0)) \
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -739,7 +742,8 @@ gconv_end (struct __gconv_step *data)
*outptr++ = 'D'; \ *outptr++ = 'D'; \
set = JISX0212_set; \ set = JISX0212_set; \
\ \
if (NEED_LENGTH_TEST && outptr + 2 > outend) \ if (NEED_LENGTH_TEST \
&& __builtin_expect (outptr + 2 > outend, 0)) \
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -754,7 +758,8 @@ gconv_end (struct __gconv_step *data)
&& buf[0] >= 0x80) \ && buf[0] >= 0x80) \
{ \ { \
/* We use JIS X 0201. */ \ /* We use JIS X 0201. */ \
if (NEED_LENGTH_TEST && outptr + 3 > outend) \ if (NEED_LENGTH_TEST \
&& __builtin_expect (outptr + 3 > outend, 0)) \
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -765,7 +770,8 @@ gconv_end (struct __gconv_step *data)
*outptr++ = 'I'; \ *outptr++ = 'I'; \
set = JISX0201_Kana_set; \ set = JISX0201_Kana_set; \
\ \
if (NEED_LENGTH_TEST && outptr + 1 > outend) \ if (NEED_LENGTH_TEST \
&& __builtin_expect (outptr + 1 > outend, 0)) \
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -775,7 +781,8 @@ gconv_end (struct __gconv_step *data)
else if (ch != 0xa5 && ch >= 0x80 && ch <= 0xff) \ else if (ch != 0xa5 && ch >= 0x80 && ch <= 0xff) \
{ \ { \
/* ISO 8859-1 upper half. */ \ /* ISO 8859-1 upper half. */ \
if (NEED_LENGTH_TEST && outptr + 3 > outend) \ if (NEED_LENGTH_TEST \
&& __builtin_expect (outptr + 3 > outend, 0)) \
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -786,7 +793,8 @@ gconv_end (struct __gconv_step *data)
*outptr++ = 'A'; \ *outptr++ = 'A'; \
set2 = ISO88591_set; \ set2 = ISO88591_set; \
\ \
if (NEED_LENGTH_TEST && outptr + 3 > outend) \ if (NEED_LENGTH_TEST \
&& __builtin_expect (outptr + 3 > outend, 0)) \
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -801,7 +809,9 @@ gconv_end (struct __gconv_step *data)
if (written != __UNKNOWN_10646_CHAR) \ if (written != __UNKNOWN_10646_CHAR) \
{ \ { \
/* We use GB 2312. */ \ /* We use GB 2312. */ \
if (NEED_LENGTH_TEST && outptr + 3 > outend) \ if (NEED_LENGTH_TEST \
&& __builtin_expect (outptr + 3 > outend, \
0) \
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -812,7 +822,9 @@ gconv_end (struct __gconv_step *data)
*outptr++ = 'A'; \ *outptr++ = 'A'; \
set = GB2312_set; \ set = GB2312_set; \
\ \
if (NEED_LENGTH_TEST && outptr + 2 > outend) \ if (NEED_LENGTH_TEST \
&& __builtin_expect (outptr + 2 > outend, \
0)) \
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -827,7 +839,8 @@ gconv_end (struct __gconv_step *data)
{ \ { \
/* We use KSC 5601. */ \ /* We use KSC 5601. */ \
if (NEED_LENGTH_TEST \ if (NEED_LENGTH_TEST \
&& outptr + 4 > outend) \ && __builtin_expect (outptr + 4 \
> outend, 0)) \
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -839,7 +852,8 @@ gconv_end (struct __gconv_step *data)
set = KSC5601_set; \ set = KSC5601_set; \
\ \
if (NEED_LENGTH_TEST \ if (NEED_LENGTH_TEST \
&& outptr + 2 > outend) \ && __builtin_expect (outptr + 2 \
> outend, 0)) \
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -860,11 +874,12 @@ gconv_end (struct __gconv_step *data)
gch = iso88597_from_ucs4[ch]; \ gch = iso88597_from_ucs4[ch]; \
} \ } \
\ \
if (gch != 0) \ if (__builtin_expect (gch, 1) != 0) \
{ \ { \
/* We use ISO 8859-7 greek. */ \ /* We use ISO 8859-7 greek. */ \
if (NEED_LENGTH_TEST \ if (NEED_LENGTH_TEST \
&& outptr + 3 > outend) \ && __builtin_expect (outptr + 3 \
> outend, 0))\
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \
@ -875,7 +890,8 @@ gconv_end (struct __gconv_step *data)
set2 = ISO88597_set; \ set2 = ISO88597_set; \
\ \
if (NEED_LENGTH_TEST \ if (NEED_LENGTH_TEST \
&& outptr + 3 > outend) \ && __builtin_expect (outptr + 3 \
> outend, 0))\
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \

View File

@ -88,15 +88,13 @@ enum
\ \
/* We are not in the initial state. To switch back we have \ /* We are not in the initial state. To switch back we have \
to emit `SI'. */ \ to emit `SI'. */ \
if (outbuf == data->__outbufend) \ if (__builtin_expect (outbuf == data->__outbufend, 0)) \
/* We don't have enough room in the output buffer. */ \ /* We don't have enough room in the output buffer. */ \
status = __GCONV_FULL_OUTPUT; \ status = __GCONV_FULL_OUTPUT; \
else \ else \
{ \ { \
/* Write out the shift sequence. */ \ /* Write out the shift sequence. */ \
*outbuf++ = SI; \ *outbuf++ = SI; \
if (data->__flags & __GCONV_IS_LAST) \
*written += 1; \
data->__outbuf = outbuf; \ data->__outbuf = outbuf; \
data->__statep->__count = ASCII_set; \ data->__statep->__count = ASCII_set; \
} \ } \
@ -123,7 +121,7 @@ enum
uint32_t ch = *inptr; \ uint32_t ch = *inptr; \
\ \
/* This is a 7bit character set, disallow all 8bit characters. */ \ /* This is a 7bit character set, disallow all 8bit characters. */ \
if (ch > 0x7f) \ if (__builtin_expect (ch, 0) > 0x7f) \
{ \ { \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
{ \ { \
@ -137,16 +135,18 @@ enum
} \ } \
\ \
/* Recognize escape sequences. */ \ /* Recognize escape sequences. */ \
if (ch == ESC) \ if (__builtin_expect (ch, 0) == ESC) \
{ \ { \
/* We don't really have to handle escape sequences since all the \ /* We don't really have to handle escape sequences since all the \
switching is done using the SI and SO bytes. But we have to \ switching is done using the SI and SO bytes. But we have to \
recognize `Esc $ ) C' since this is a kind of flag for this \ recognize `Esc $ ) C' since this is a kind of flag for this \
encoding. We simply ignore it. */ \ encoding. We simply ignore it. */ \
if ((NEED_LENGTH_TEST && inptr + 1 > inend) \ if ((NEED_LENGTH_TEST && __builtin_expect (inptr + 1 > inend, 0)) \
|| (inptr[1] == '$' \ || (inptr[1] == '$' \
&& ((NEED_LENGTH_TEST && inptr + 2 > inend) \ && ((NEED_LENGTH_TEST \
|| (inptr[2] == ')' && inptr + 3 > inend)))) \ && __builtin_expect (inptr + 2 > inend, 0)) \
|| (inptr[2] == ')' \
&& __builtin_expect (inptr + 3 > inend, 0))))) \
\ \
{ \ { \
result = __GCONV_EMPTY_INPUT; \ result = __GCONV_EMPTY_INPUT; \
@ -159,14 +159,14 @@ enum
continue; \ continue; \
} \ } \
} \ } \
else if (ch == SO) \ else if (__builtin_expect (ch, 0) == SO) \
{ \ { \
/* Switch to use KSC. */ \ /* Switch to use KSC. */ \
++inptr; \ ++inptr; \
set = KSC5601_set; \ set = KSC5601_set; \
continue; \ continue; \
} \ } \
else if (ch == SI) \ else if (__builtin_expect (ch, 0) == SI) \
{ \ { \
/* Switch to use ASCII. */ \ /* Switch to use ASCII. */ \
++inptr; \ ++inptr; \
@ -187,12 +187,12 @@ enum
ch = ksc5601_to_ucs4 (&inptr, \ ch = ksc5601_to_ucs4 (&inptr, \
NEED_LENGTH_TEST ? inend - inptr : 2, 0); \ NEED_LENGTH_TEST ? inend - inptr : 2, 0); \
\ \
if (NEED_LENGTH_TEST && ch == 0) \ if (NEED_LENGTH_TEST && __builtin_expect (ch, 1) == 0) \
{ \ { \
result = __GCONV_EMPTY_INPUT; \ result = __GCONV_EMPTY_INPUT; \
break; \ break; \
} \ } \
else if (ch == __UNKNOWN_10646_CHAR) \ else if (__builtin_expect (ch, 0) == __UNKNOWN_10646_CHAR) \
{ \ { \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
{ \ { \
@ -252,7 +252,7 @@ enum
\ \
written = ucs4_to_ksc5601 (ch, buf, 2); \ written = ucs4_to_ksc5601 (ch, buf, 2); \
\ \
if (written == __UNKNOWN_10646_CHAR) \ if (__builtin_expect (written, 0) == __UNKNOWN_10646_CHAR) \
{ \ { \
/* Illegal character. */ \ /* Illegal character. */ \
if (! ignore_errors_p ()) \ if (! ignore_errors_p ()) \
@ -274,7 +274,7 @@ enum
set = KSC5601_set; \ set = KSC5601_set; \
} \ } \
\ \
if (NEED_LENGTH_TEST && outptr + 2 > outend) \ if (NEED_LENGTH_TEST && __builtin_expect (outptr + 2 > outend, 0))\
{ \ { \
result = __GCONV_FULL_OUTPUT; \ result = __GCONV_FULL_OUTPUT; \
break; \ break; \