summaryrefslogtreecommitdiff
path: root/iconvdata/tscii.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-08-20 19:50:45 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-08-20 19:50:45 +0200
commit4dd9e35bfd35d3138bc44169baba098005bad51e (patch)
treea4939c43a9c3fe00eb27f023e14acc5e1fe8808c /iconvdata/tscii.c
parentbd42a4599d1b6f77bcfe1e4f67b7cbd9e1cb2dfd (diff)
parentf76453c31593957fec1a99b986bfa5506618b79c (diff)
Merge commit 'refs/top-bases/t/bigmem' into t/bigmem
Diffstat (limited to 'iconvdata/tscii.c')
-rw-r--r--iconvdata/tscii.c47
1 files changed, 24 insertions, 23 deletions
diff --git a/iconvdata/tscii.c b/iconvdata/tscii.c
index e8363d12c9..b945772f69 100644
--- a/iconvdata/tscii.c
+++ b/iconvdata/tscii.c
@@ -1,5 +1,5 @@
/* Conversion from and to TSCII.
- Copyright (C) 2002-2014 Free Software Foundation, Inc.
+ Copyright (C) 2002-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Bruno Haible <bruno@clisp.org>, 2002.
@@ -38,6 +38,7 @@
#define TO_LOOP to_tscii
#define DEFINE_INIT 1
#define DEFINE_FINI 1
+#define ONE_DIRECTION 0
#define FROM_LOOP_MIN_NEEDED_FROM 1
#define FROM_LOOP_MAX_NEEDED_FROM 2
#define FROM_LOOP_MIN_NEEDED_TO 4
@@ -90,7 +91,7 @@
{ \
do \
{ \
- if (__builtin_expect (outbuf + 4 > outend, 0)) \
+ if (__glibc_unlikely (outbuf + 4 > outend)) \
{ \
/* We don't have enough room in the output buffer. */ \
status = __GCONV_FULL_OUTPUT; \
@@ -108,10 +109,10 @@
else \
{ \
uint32_t last = data->__statep->__count >> 3; \
- if (__builtin_expect (last >> 8, 0)) \
+ if (__glibc_unlikely (last >> 8)) \
{ \
/* Write out the last character, two bytes. */ \
- if (__builtin_expect (outbuf + 2 <= outend, 1)) \
+ if (__glibc_likely (outbuf + 2 <= outend)) \
{ \
*outbuf++ = last & 0xff; \
*outbuf++ = (last >> 8) & 0xff; \
@@ -124,7 +125,7 @@
else \
{ \
/* Write out the last character, a single byte. */ \
- if (__builtin_expect (outbuf < outend, 1)) \
+ if (__glibc_likely (outbuf < outend)) \
{ \
*outbuf++ = last & 0xff; \
data->__statep->__count = 0; \
@@ -384,7 +385,7 @@ static const uint32_t tscii_next_state[6] =
/* See whether we have room for two characters. Otherwise \
store only the first character now, and put the second \
one into the queue. */ \
- if (__builtin_expect (outptr + 4 > outend, 0)) \
+ if (__glibc_unlikely (outptr + 4 > outend)) \
{ \
*statep = u2 << 8; \
result = __GCONV_FULL_OUTPUT; \
@@ -421,7 +422,7 @@ static const uint32_t tscii_next_state[6] =
inptr++; \
put32 (outptr, 0x0BB8); \
outptr += 4; \
- if (__builtin_expect (outptr + 4 > outend, 0)) \
+ if (__glibc_unlikely (outptr + 4 > outend)) \
{ \
*statep = (0x0BCD << 8) + (4 << 4); \
result = __GCONV_FULL_OUTPUT; \
@@ -429,7 +430,7 @@ static const uint32_t tscii_next_state[6] =
} \
put32 (outptr, 0x0BCD); \
outptr += 4; \
- if (__builtin_expect (outptr + 4 > outend, 0)) \
+ if (__glibc_unlikely (outptr + 4 > outend)) \
{ \
*statep = (0x0BB0 << 8) + (2 << 4); \
result = __GCONV_FULL_OUTPUT; \
@@ -437,7 +438,7 @@ static const uint32_t tscii_next_state[6] =
} \
put32 (outptr, 0x0BB0); \
outptr += 4; \
- if (__builtin_expect (outptr + 4 > outend, 0)) \
+ if (__glibc_unlikely (outptr + 4 > outend)) \
{ \
*statep = (0x0BC0 << 8); \
result = __GCONV_FULL_OUTPUT; \
@@ -454,7 +455,7 @@ static const uint32_t tscii_next_state[6] =
inptr++; \
put32 (outptr, 0x0B95); \
outptr += 4; \
- if (__builtin_expect (outptr + 4 > outend, 0)) \
+ if (__glibc_unlikely (outptr + 4 > outend)) \
{ \
*statep = (0x0BCD << 8) + (1 << 4); \
result = __GCONV_FULL_OUTPUT; \
@@ -462,7 +463,7 @@ static const uint32_t tscii_next_state[6] =
} \
put32 (outptr, 0x0BCD); \
outptr += 4; \
- if (__builtin_expect (outptr + 4 > outend, 0)) \
+ if (__glibc_unlikely (outptr + 4 > outend)) \
{ \
*statep = (0x0BB7 << 8); \
result = __GCONV_FULL_OUTPUT; \
@@ -479,7 +480,7 @@ static const uint32_t tscii_next_state[6] =
inptr++; \
put32 (outptr, 0x0B95); \
outptr += 4; \
- if (__builtin_expect (outptr + 4 > outend, 0)) \
+ if (__glibc_unlikely (outptr + 4 > outend)) \
{ \
*statep = (0x0BCD << 8) + (5 << 4); \
result = __GCONV_FULL_OUTPUT; \
@@ -487,7 +488,7 @@ static const uint32_t tscii_next_state[6] =
} \
put32 (outptr, 0x0BCD); \
outptr += 4; \
- if (__builtin_expect (outptr + 4 > outend, 0)) \
+ if (__glibc_unlikely (outptr + 4 > outend)) \
{ \
*statep = (0x0BB7 << 8) + (3 << 4); \
result = __GCONV_FULL_OUTPUT; \
@@ -495,7 +496,7 @@ static const uint32_t tscii_next_state[6] =
} \
put32 (outptr, 0x0BB7); \
outptr += 4; \
- if (__builtin_expect (outptr + 4 > outend, 0)) \
+ if (__glibc_unlikely (outptr + 4 > outend)) \
{ \
*statep = (0x0BCD << 8); \
result = __GCONV_FULL_OUTPUT; \
@@ -592,7 +593,7 @@ static const uint8_t consonant_with_virama[18] =
} \
if (ch == 0x0BC6) \
{ \
- if (__builtin_expect (outptr + 2 <= outend, 1)) \
+ if (__glibc_likely (outptr + 2 <= outend)) \
{ \
*outptr++ = 0xa6; \
*outptr++ = last; \
@@ -608,7 +609,7 @@ static const uint8_t consonant_with_virama[18] =
} \
if (ch == 0x0BC7) \
{ \
- if (__builtin_expect (outptr + 2 <= outend, 1)) \
+ if (__glibc_likely (outptr + 2 <= outend)) \
{ \
*outptr++ = 0xa7; \
*outptr++ = last; \
@@ -624,7 +625,7 @@ static const uint8_t consonant_with_virama[18] =
} \
if (ch == 0x0BC8) \
{ \
- if (__builtin_expect (outptr + 2 <= outend, 1)) \
+ if (__glibc_likely (outptr + 2 <= outend)) \
{ \
*outptr++ = 0xa8; \
*outptr++ = last; \
@@ -640,7 +641,7 @@ static const uint8_t consonant_with_virama[18] =
} \
if (ch == 0x0BCA) \
{ \
- if (__builtin_expect (outptr + 3 <= outend, 1)) \
+ if (__glibc_likely (outptr + 3 <= outend)) \
{ \
*outptr++ = 0xa6; \
*outptr++ = last; \
@@ -657,7 +658,7 @@ static const uint8_t consonant_with_virama[18] =
} \
if (ch == 0x0BCB) \
{ \
- if (__builtin_expect (outptr + 3 <= outend, 1)) \
+ if (__glibc_likely (outptr + 3 <= outend)) \
{ \
*outptr++ = 0xa7; \
*outptr++ = last; \
@@ -674,7 +675,7 @@ static const uint8_t consonant_with_virama[18] =
} \
if (ch == 0x0BCC) \
{ \
- if (__builtin_expect (outptr + 3 <= outend, 1)) \
+ if (__glibc_likely (outptr + 3 <= outend)) \
{ \
*outptr++ = 0xa7; \
*outptr++ = last; \
@@ -771,9 +772,9 @@ static const uint8_t consonant_with_virama[18] =
} \
\
/* Output the buffered character. */ \
- if (__builtin_expect (last >> 8, 0)) \
+ if (__glibc_unlikely (last >> 8)) \
{ \
- if (__builtin_expect (outptr + 2 <= outend, 1)) \
+ if (__glibc_likely (outptr + 2 <= outend)) \
{ \
*outptr++ = last & 0xff; \
*outptr++ = (last >> 8) & 0xff; \
@@ -808,7 +809,7 @@ static const uint8_t consonant_with_virama[18] =
else if (ch >= 0x0BCA && ch <= 0x0BCC) \
{ \
/* See whether we have room for two bytes. */ \
- if (__builtin_expect (outptr + 2 <= outend, 1)) \
+ if (__glibc_likely (outptr + 2 <= outend)) \
{ \
*outptr++ = (ch == 0x0BCA ? 0xa6 : 0xa7); \
*outptr++ = (ch != 0x0BCC ? 0xa1 : 0xaa); \