diff options
| author | Ondřej Bílka <neleai@seznam.cz> | 2014-02-10 14:45:42 +0100 |
|---|---|---|
| committer | Ondřej Bílka <neleai@seznam.cz> | 2014-02-10 15:07:12 +0100 |
| commit | a1ffb40e32741f992c743e7b16c061fefa3747ac (patch) | |
| tree | 246a29a87b26cfd5d07b17070f85eb3785018de9 /iconvdata | |
| parent | 1448f3244714a9dabb5240ec18b094f100887d5c (diff) | |
| download | glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.tar.xz glibc-a1ffb40e32741f992c743e7b16c061fefa3747ac.zip | |
Use glibc_likely instead __builtin_expect.
Diffstat (limited to 'iconvdata')
45 files changed, 266 insertions, 266 deletions
diff --git a/iconvdata/8bit-gap.c b/iconvdata/8bit-gap.c index bc210260ec..b33a6eafdb 100644 --- a/iconvdata/8bit-gap.c +++ b/iconvdata/8bit-gap.c @@ -88,7 +88,7 @@ struct gap uint32_t ch = get32 (inptr); \ unsigned char res; \ \ - if (__builtin_expect (ch >= 0xffff, 0)) \ + if (__glibc_unlikely (ch >= 0xffff)) \ { \ UNICODE_TAG_HANDLER (ch, 4); \ rp = NULL; \ diff --git a/iconvdata/ansi_x3.110.c b/iconvdata/ansi_x3.110.c index 8b490d182a..9b67e62dc3 100644 --- a/iconvdata/ansi_x3.110.c +++ b/iconvdata/ansi_x3.110.c @@ -567,7 +567,7 @@ static const char from_ucs4[][2] = /* Now test for a possible second byte and write this if possible. */ \ if (cp[1] != '\0') \ { \ - if (__builtin_expect (outptr >= outend, 0)) \ + if (__glibc_unlikely (outptr >= outend)) \ { \ /* The result does not fit into the buffer. */ \ --outptr; \ diff --git a/iconvdata/big5.c b/iconvdata/big5.c index 2a5887b1f0..4c8df8e7e0 100644 --- a/iconvdata/big5.c +++ b/iconvdata/big5.c @@ -8401,7 +8401,7 @@ static const char from_ucs4_tab15[][2] = uint32_t ch2; \ int idx; \ \ - if (__builtin_expect (inptr + 1 >= inend, 0)) \ + if (__glibc_unlikely (inptr + 1 >= inend)) \ { \ /* The second character is not available. */ \ result = __GCONV_INCOMPLETE_INPUT; \ @@ -8426,7 +8426,7 @@ static const char from_ucs4_tab15[][2] = ch = big5_to_ucs[idx]; \ \ /* Is this character defined? */ \ - if (__builtin_expect (ch == 0, 0)) \ + if (__glibc_unlikely (ch == 0)) \ { \ /* This is an illegal character. */ \ STANDARD_FROM_LOOP_ERR_HANDLER (2); \ diff --git a/iconvdata/big5hkscs.c b/iconvdata/big5hkscs.c index 90a9bfcf89..6084bd81c8 100644 --- a/iconvdata/big5hkscs.c +++ b/iconvdata/big5hkscs.c @@ -17774,7 +17774,7 @@ static struct { \ if (FROM_DIRECTION) \ { \ - if (__builtin_expect (outbuf + 4 <= outend, 1)) \ + if (__glibc_likely (outbuf + 4 <= outend)) \ { \ /* Write out the last character. */ \ *((uint32_t *) outbuf) = data->__statep->__count >> 3; \ @@ -17787,7 +17787,7 @@ static struct } \ else \ { \ - if (__builtin_expect (outbuf + 2 <= outend, 1)) \ + if (__glibc_likely (outbuf + 2 <= outend)) \ { \ /* Write out the last character. */ \ uint32_t lasttwo = data->__statep->__count >> 3; \ @@ -17814,7 +17814,7 @@ static struct \ /* Determine whether there is a buffered character pending. */ \ ch = *statep >> 3; \ - if (__builtin_expect (ch == 0, 1)) \ + if (__glibc_likely (ch == 0)) \ { \ /* No - so look at the next input byte. */ \ ch = *inptr; \ @@ -17826,7 +17826,7 @@ static struct uint32_t ch2; \ int idx; \ \ - if (__builtin_expect (inptr + 1 >= inend, 0)) \ + if (__glibc_unlikely (inptr + 1 >= inend)) \ { \ /* The second character is not available. */ \ result = __GCONV_INCOMPLETE_INPUT; \ @@ -17887,7 +17887,7 @@ static struct \ inptr += 2; \ } \ - else if (__builtin_expect (ch == 0xff, 0)) \ + else if (__glibc_unlikely (ch == 0xff)) \ { \ STANDARD_FROM_LOOP_ERR_HANDLER (1); \ } \ @@ -17937,7 +17937,7 @@ static struct goto not_combining; \ \ /* Output the combined character. */ \ - if (__builtin_expect (outptr + 1 >= outend, 0)) \ + if (__glibc_unlikely (outptr + 1 >= outend)) \ { \ result = __GCONV_FULL_OUTPUT; \ break; \ @@ -17950,7 +17950,7 @@ static struct \ not_combining: \ /* Output the buffered character. */ \ - if (__builtin_expect (outptr + 1 >= outend, 0)) \ + if (__glibc_unlikely (outptr + 1 >= outend)) \ { \ result = __GCONV_FULL_OUTPUT; \ break; \ @@ -17992,7 +17992,7 @@ static struct else \ { \ /* Check for possible combining character. */ \ - if (__builtin_expect (ch == 0xca || ch == 0xea, 0)) \ + if (__glibc_unlikely (ch == 0xca || ch == 0xea)) \ { \ *statep = ((cp[0] << 8) | cp[1]) << 3; \ inptr += 4; \ @@ -18009,7 +18009,7 @@ static struct } \ \ *outptr++ = cp[0]; \ - if (__builtin_expect (cp[1] != '\0', 1)) \ + if (__glibc_likely (cp[1] != '\0')) \ *outptr++ = cp[1]; \ } \ } \ diff --git a/iconvdata/cp1255.c b/iconvdata/cp1255.c index 9a05d3020c..3106d2062f 100644 --- a/iconvdata/cp1255.c +++ b/iconvdata/cp1255.c @@ -65,7 +65,7 @@ { \ if (FROM_DIRECTION) \ { \ - if (__builtin_expect (outbuf + 4 <= outend, 1)) \ + if (__glibc_likely (outbuf + 4 <= outend)) \ { \ /* Write out the last character. */ \ *((uint32_t *) outbuf) = data->__statep->__count >> 3; \ @@ -201,7 +201,7 @@ static const struct { unsigned int idx; unsigned int len; } comp_table[8] = { if (ch >= 0x80) \ { \ ch = to_ucs4[ch - 0x80]; \ - if (__builtin_expect (ch == L'\0', 0)) \ + if (__glibc_unlikely (ch == L'\0')) \ { \ /* This is an illegal character. */ \ STANDARD_FROM_LOOP_ERR_HANDLER (1); \ @@ -463,7 +463,7 @@ static const struct { res = 0; \ } \ \ - if (__builtin_expect (res != 0, 1)) \ + if (__glibc_likely (res != 0)) \ { \ *outptr++ = res; \ inptr += 4; \ @@ -515,7 +515,7 @@ static const struct { if (decomp_table[i].comb2 < 0) \ { \ /* See whether we have room for two bytes. */ \ - if (__builtin_expect (outptr + 1 >= outend, 0)) \ + if (__glibc_unlikely (outptr + 1 >= outend)) \ { \ result = __GCONV_FULL_OUTPUT; \ break; \ @@ -527,7 +527,7 @@ static const struct { else \ { \ /* See whether we have room for three bytes. */ \ - if (__builtin_expect (outptr + 2 >= outend, 0)) \ + if (__glibc_unlikely (outptr + 2 >= outend)) \ { \ result = __GCONV_FULL_OUTPUT; \ break; \ diff --git a/iconvdata/cp1258.c b/iconvdata/cp1258.c index bafa28cc18..6dc13b2bdf 100644 --- a/iconvdata/cp1258.c +++ b/iconvdata/cp1258.c @@ -66,7 +66,7 @@ { \ if (FROM_DIRECTION) \ { \ - if (__builtin_expect (outbuf + 4 <= outend, 1)) \ + if (__glibc_likely (outbuf + 4 <= outend)) \ { \ /* Write out the last character. */ \ *((uint32_t *) outbuf) = data->__statep->__count >> 3; \ @@ -375,7 +375,7 @@ static const struct if (ch >= 0x80) \ { \ ch = to_ucs4[ch - 0x80]; \ - if (__builtin_expect (ch == L'\0', 0)) \ + if (__glibc_unlikely (ch == L'\0')) \ { \ /* This is an illegal character. */ \ STANDARD_FROM_LOOP_ERR_HANDLER (1); \ @@ -802,7 +802,7 @@ static const struct res = 0; \ } \ \ - if (__builtin_expect (res != 0, 1)) \ + if (__glibc_likely (res != 0)) \ { \ *outptr++ = res; \ inptr += 4; \ @@ -845,7 +845,7 @@ static const struct } \ \ /* See whether we have room for two bytes. */ \ - if (__builtin_expect (outptr + 1 >= outend, 0)) \ + if (__glibc_unlikely (outptr + 1 >= outend)) \ { \ result = __GCONV_FULL_OUTPUT; \ break; \ diff --git a/iconvdata/cp932.c b/iconvdata/cp932.c index b8269ac061..c467aaa2bb 100644 --- a/iconvdata/cp932.c +++ b/iconvdata/cp932.c @@ -4574,7 +4574,7 @@ static const char from_ucs4_extra[229][2] = uint32_t ch2; \ uint_fast32_t idx; \ \ - if (__builtin_expect (inptr + 1 >= inend, 0)) \ + if (__glibc_unlikely (inptr + 1 >= inend)) \ { \ /* The second character is not available. Store \ the intermediate result. */ \ @@ -4704,7 +4704,7 @@ static const char from_ucs4_extra[229][2] = /* Now test for a possible second byte and write this if possible. */\ if (cp[1] != '\0') \ { \ - if (__builtin_expect (outptr + 1 >= outend, 0)) \ + if (__glibc_unlikely (outptr + 1 >= outend)) \ { \ /* The result does not fit into the buffer. */ \ result = __GCONV_FULL_OUTPUT; \ diff --git a/iconvdata/euc-cn.c b/iconvdata/euc-cn.c index 0b8a74b706..246ef5d70c 100644 --- a/iconvdata/euc-cn.c +++ b/iconvdata/euc-cn.c @@ -56,7 +56,7 @@ next byte is also available. */ \ const unsigned char *endp; \ \ - if (__builtin_expect (inptr + 1 >= inend, 0)) \ + if (__glibc_unlikely (inptr + 1 >= inend)) \ { \ /* The second character is not available. Store \ the intermediate result. */ \ @@ -67,14 +67,14 @@ ch = inptr[1]; \ \ /* All second bytes of a multibyte character must be >= 0xa1. */ \ - if (__builtin_expect (ch < 0xa1, 0)) \ + if (__glibc_unlikely (ch < 0xa1)) \ STANDARD_FROM_LOOP_ERR_HANDLER (1); \ \ /* This is code set 1: GB 2312-80. */ \ endp = inptr; \ \ ch = gb2312_to_ucs4 (&endp, 2, 0x80); \ - if (__builtin_expect (ch == __UNKNOWN_10646_CHAR, 0)) \ + if (__glibc_unlikely (ch == __UNKNOWN_10646_CHAR)) \ { \ /* This is an illegal character. */ \ STANDARD_FROM_LOOP_ERR_HANDLER (2); \ diff --git a/iconvdata/euc-jisx0213.c b/iconvdata/euc-jisx0213.c index 2737842de1..ff4e46fdda 100644 --- a/iconvdata/euc-jisx0213.c +++ b/iconvdata/euc-jisx0213.c @@ -79,7 +79,7 @@ { \ if (FROM_DIRECTION) \ { \ - if (__builtin_expect (outbuf + 4 <= outend, 1)) \ + if (__glibc_likely (outbuf + 4 <= outend)) \ { \ /* Write out the last character. */ \ *((uint32_t *) outbuf) = data->__statep->__count >> 3; \ @@ -92,7 +92,7 @@ } \ else \ { \ - if (__builtin_expect (outbuf + 2 <= outend, 1)) \ + if (__glibc_likely (outbuf + 2 <= outend)) \ { \ /* Write out the last character. */ \ uint32_t lasttwo = data->__statep->__count >> 3; \ @@ -119,7 +119,7 @@ \ /* Determine whether there is a buffered character pending. */ \ ch = *statep >> 3; \ |
