&& data->__invocation_counter == 0) \
{ \
/* Emit the Byte Order Mark. */ \
- if (outbuf + 2 > outend) \
+ if (__builtin_expect (outbuf + 2 > outend, 0)) \
return __GCONV_FULL_OUTPUT; \
\
put16u (outbuf, BOM); \
}
result = __GCONV_NOCONV;
- if (dir != illegal_dir)
+ if (__builtin_expect (dir, to_utf16) != illegal_dir)
{
new_data = (struct utf16_data *) malloc (sizeof (struct utf16_data));
\
if (swap) \
{ \
- if (c >= 0x10000) \
+ if (__builtin_expect (c, 0) >= 0x10000) \
{ \
- if (c >= 0x110000) \
+ if (__builtin_expect (c, 0) >= 0x110000) \
{ \
if (! ignore_errors_p ()) \
{ \
} \
\
/* Generate a surrogate character. */ \
- if (NEED_LENGTH_TEST && outptr + 4 > outend) \
+ if (NEED_LENGTH_TEST && __builtin_expect (outptr + 4 > outend, 0))\
{ \
/* Overflow in the output buffer. */ \
result = __GCONV_FULL_OUTPUT; \
} \
else \
{ \
- if (c >= 0x10000) \
+ if (__builtin_expect (c, 0) >= 0x10000) \
{ \
- if (c >= 0x110000) \
+ if (__builtin_expect (c, 0) >= 0x110000) \
{ \
if (! ignore_errors_p ()) \
{ \
} \
\
/* Generate a surrogate character. */ \
- if (NEED_LENGTH_TEST && outptr + 4 > outend) \
+ if (NEED_LENGTH_TEST && __builtin_expect (outptr + 4 > outend, 0))\
{ \
/* Overflow in the output buffer. */ \
result = __GCONV_FULL_OUTPUT; \
{ \
u1 = bswap_16 (u1); \
\
- if (u1 < 0xd800 || u1 > 0xdfff) \
+ if (__builtin_expect (u1, 0) < 0xd800 || u1 > 0xdfff) \
{ \
/* No surrogate. */ \
- put32 (outptr, u1); \
+ put32 (outptr, u1); \
inptr += 2; \
} \
else \
\
/* It's a surrogate character. At least the first word says \
it is. */ \
- if (NEED_LENGTH_TEST && inptr + 4 > inend) \
+ if (NEED_LENGTH_TEST && __builtin_expect (inptr + 4 > inend, 0)) \
{ \
/* We don't have enough input for another complete input \
character. */ \
\
inptr += 2; \
u2 = bswap_16 (get16 (inptr)); \
- if (u2 < 0xdc00 || u2 >= 0xdfff) \
+ if (__builtin_expect (u2, 0xdc00) < 0xdc00 \
+ || __builtin_expect (u2, 0xdc00) >= 0xdfff) \
{ \
/* This is no valid second word for a surrogate. */ \
if (! ignore_errors_p ()) \
} \
else \
{ \
- if (u1 < 0xd800 || u1 > 0xdfff) \
+ if (__builtin_expect (u1, 0) < 0xd800 || u1 > 0xdfff) \
{ \
/* No surrogate. */ \
put32 (outptr, u1); \
\
/* It's a surrogate character. At least the first word says \
it is. */ \
- if (NEED_LENGTH_TEST && inptr + 4 > inend) \
+ if (NEED_LENGTH_TEST && __builtin_expect (inptr + 4 > inend, 0)) \
{ \
/* We don't have enough input for another complete input \
character. */ \
\
inptr += 2; \
u2 = get16 (inptr); \
- if (u2 < 0xdc00 || u2 >= 0xdfff) \
+ if (__builtin_expect (u2, 0xdc00) < 0xdc00 \
+ || __builtin_expect (u2, 0xdc00) >= 0xdfff) \
{ \
/* This is no valid second word for a surrogate. */ \
if (! ignore_errors_p ()) \