aboutsummaryrefslogtreecommitdiff
path: root/iconvdata
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-05-28 05:26:16 +0000
committerUlrich Drepper <drepper@redhat.com>2002-05-28 05:26:16 +0000
commit834cef7c02db3d9284ce2098519859ec81c3b996 (patch)
treef52629cf057e42582c3d95204aade406c85cde48 /iconvdata
parentc0a0f9a32c8baa6ab93d00eb42d92c02e9e146d7 (diff)
downloadglibc-834cef7c02db3d9284ce2098519859ec81c3b996.tar
glibc-834cef7c02db3d9284ce2098519859ec81c3b996.tar.gz
glibc-834cef7c02db3d9284ce2098519859ec81c3b996.tar.bz2
glibc-834cef7c02db3d9284ce2098519859ec81c3b996.zip
Update.
2002-05-27 Alexandre Oliva <aoliva@redhat.com> * configure.in (DO_STATIC_NSS): Define if --disable-shared. 2002-05-26 Bruno Haible <bruno@clisp.org> * iconvdata/iso-2022-jp.c (BODY for TO_LOOP): Avoid running off the end of the ISO-8859-7 from idx table. 2002-05-27 Ulrich Drepper <drepper@redhat.com> * manual/lang.texi: Fix FLT_EPSILON description [PR libc/3649]. 2002-05-24 David S. Miller <davem@redhat.com> * string/bits/string2.h (memset): Do not try to optimize when not _STRING_ARCH_unaligned if GCC will do the right thing.
Diffstat (limited to 'iconvdata')
-rw-r--r--iconvdata/iso-2022-jp.c108
1 files changed, 57 insertions, 51 deletions
diff --git a/iconvdata/iso-2022-jp.c b/iconvdata/iso-2022-jp.c
index 5e4ddaa441..18a89cd16a 100644
--- a/iconvdata/iso-2022-jp.c
+++ b/iconvdata/iso-2022-jp.c
@@ -708,25 +708,29 @@ static const cvlist_t conversion_lists[4] =
} \
else if (set2 == ISO88597_set) \
{ \
- const struct gap *rp = from_idx; \
- \
- while (ch > rp->end) \
- ++rp; \
- if (ch >= rp->start) \
+ if (__builtin_expect (ch < 0xffff, 1)) \
{ \
- unsigned char res = iso88597_from_ucs4[ch - 0xa0 + rp->idx]; \
- if (res != '\0') \
+ const struct gap *rp = from_idx; \
+ \
+ while (ch > rp->end) \
+ ++rp; \
+ if (ch >= rp->start) \
{ \
- if (__builtin_expect (outptr + 3 > outend, 0)) \
+ unsigned char res = \
+ iso88597_from_ucs4[ch - 0xa0 + rp->idx]; \
+ if (res != '\0') \
{ \
- result = __GCONV_FULL_OUTPUT; \
- break; \
- } \
+ if (__builtin_expect (outptr + 3 > outend, 0)) \
+ { \
+ result = __GCONV_FULL_OUTPUT; \
+ break; \
+ } \
\
- *outptr++ = ESC; \
- *outptr++ = 'N'; \
- *outptr++ = res; \
- written = 3; \
+ *outptr++ = ESC; \
+ *outptr++ = 'N'; \
+ *outptr++ = res; \
+ written = 3; \
+ } \
} \
} \
} \
@@ -817,43 +821,45 @@ static const cvlist_t conversion_lists[4] =
} \
\
/* Try ISO 8859-7 upper half. */ \
- { \
- const struct gap *rp = from_idx; \
+ if (__builtin_expect (ch < 0xffff, 1)) \
+ { \
+ const struct gap *rp = from_idx; \
\
- while (ch > rp->end) \
- ++rp; \
- if (ch >= rp->start) \
- { \
- unsigned char res = \
- iso88597_from_ucs4[ch - 0xa0 + rp->idx]; \
- if (res != '\0') \
- { \
- if (set2 != ISO88597_set) \
- { \
- if (__builtin_expect (outptr + 3 > outend, 0))\
- { \
- result = __GCONV_FULL_OUTPUT; \
- break; \
- } \
- *outptr++ = ESC; \
- *outptr++ = '.'; \
- *outptr++ = 'F'; \
- set2 = ISO88597_set; \
- } \
- \
- if (__builtin_expect (outptr + 3 > outend, 0)) \
- { \
- result = __GCONV_FULL_OUTPUT; \
- break; \
- } \
- *outptr++ = ESC; \
- *outptr++ = 'N'; \
- *outptr++ = res; \
- result = __GCONV_OK; \
- break; \
- } \
- } \
- } \
+ while (ch > rp->end) \
+ ++rp; \
+ if (ch >= rp->start) \
+ { \
+ unsigned char res = \
+ iso88597_from_ucs4[ch - 0xa0 + rp->idx]; \
+ if (res != '\0') \
+ { \
+ if (set2 != ISO88597_set) \
+ { \
+ if (__builtin_expect (outptr + 3 > outend, \
+ 0)) \
+ { \
+ result = __GCONV_FULL_OUTPUT; \
+ break; \
+ } \
+ *outptr++ = ESC; \
+ *outptr++ = '.'; \
+ *outptr++ = 'F'; \
+ set2 = ISO88597_set; \
+ } \
+ \
+ if (__builtin_expect (outptr + 3 > outend, 0)) \
+ { \
+ result = __GCONV_FULL_OUTPUT; \
+ break; \
+ } \
+ *outptr++ = ESC; \
+ *outptr++ = 'N'; \
+ *outptr++ = res; \
+ result = __GCONV_OK; \
+ break; \
+ } \
+ } \
+ } \
\
break; \
\