mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 20:40:05 +00:00
Update.
* iconvdata/ibm1129.h: Remove duplicate mappings. * iconvdata/ibm937.c: Handle overflow errors. Handle new tables. * iconvdata/ibm937.h: Reorganize table to safe a lot of space. Patch by Masahide Washizawa <WASHI@jp.ibm.com>. * timezone/zic.c: Fix handling of turnaround times. Patch by Arthur David Olson <olsona@dc37a.nci.nih.gov>. 2001-12-02 Moshe Olshansky <OLSHANSK@il.ibm.com> * sysdeps/ieee754/dbl-64/e_remainder.c (__ieee754_remainder): Fix overflow problem. 2001-12-05 Ulrich Drepper <drepper@redhat.com> * posix/regex.c: For use outside glibc defined bounded pointer macros here. Patch by Jim Meyering <jim@meyering.net>.
This commit is contained in:
parent
350b053ae9
commit
29132b9151
18
ChangeLog
18
ChangeLog
@ -1,5 +1,23 @@
|
||||
2001-12-05 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* iconvdata/ibm1129.h: Remove duplicate mappings.
|
||||
* iconvdata/ibm937.c: Handle overflow errors. Handle new tables.
|
||||
* iconvdata/ibm937.h: Reorganize table to safe a lot of space.
|
||||
Patch by Masahide Washizawa <WASHI@jp.ibm.com>.
|
||||
|
||||
* timezone/zic.c: Fix handling of turnaround times.
|
||||
Patch by Arthur David Olson <olsona@dc37a.nci.nih.gov>.
|
||||
|
||||
2001-12-02 Moshe Olshansky <OLSHANSK@il.ibm.com>
|
||||
|
||||
* sysdeps/ieee754/dbl-64/e_remainder.c (__ieee754_remainder): Fix
|
||||
overflow problem.
|
||||
|
||||
2001-12-05 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* posix/regex.c: For use outside glibc defined bounded pointer
|
||||
macros here. Patch by Jim Meyering <jim@meyering.net>.
|
||||
|
||||
* iconvdata/Makefile (modules): Add TCVN5712-1.
|
||||
* iconvdata/TESTS: Add TCVN5712-1.
|
||||
* iconvdata/gconv-modules: Likewise.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Conversion from and to IBM1129.
|
||||
Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Masahide Washizawa <washi@jp.ibm.com>, 2000.
|
||||
|
||||
@ -83,7 +83,7 @@ static const uint32_t to_ucs4[256] =
|
||||
[0xf0] = 0x0111, [0xf1] = 0x00f1, [0xf2] = 0x0323, [0xf3] = 0x00f3,
|
||||
[0xf4] = 0x00f4, [0xf5] = 0x01a1, [0xf6] = 0x00f6, [0xf7] = 0x00f7,
|
||||
[0xf8] = 0x00f8, [0xf9] = 0x00f9, [0xfa] = 0x00fa, [0xfb] = 0x00fb,
|
||||
[0xfc] = 0x00fc, [0xfd] = 0x01b0, [0xfe] = 0x20ab, [0xff] = 0x00ff,
|
||||
[0xfc] = 0x00fc, [0xfd] = 0x01b0, [0xfe] = 0x20ab, [0xff] = 0x00ff
|
||||
};
|
||||
|
||||
static const struct gap from_idx[] =
|
||||
@ -97,7 +97,6 @@ static const struct gap from_idx[] =
|
||||
{ start: 0x0300, end: 0x0309, idx: -499 },
|
||||
{ start: 0x0323, end: 0x0323, idx: -524 },
|
||||
{ start: 0x20ab, end: 0x20ab, idx: -8083 },
|
||||
{ start: 0xff01, end: 0xff5e, idx: -65000 },
|
||||
{ start: 0xffff, end: 0xffff, idx: 0 }
|
||||
};
|
||||
|
||||
@ -138,16 +137,5 @@ static const char from_ucs4[] =
|
||||
'\x00', '\x00', '\xc3', '\xe3', '\xd0', '\xf0', '\xb8', '\xa8',
|
||||
'\xb4', '\xd5', '\xf5', '\xdd', '\xfd', '\xcc', '\xec', '\x00',
|
||||
'\xde', '\x00', '\x00', '\x00', '\x00', '\x00', '\xd2', '\xf2',
|
||||
'\xfe', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27',
|
||||
'\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f',
|
||||
'\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37',
|
||||
'\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f',
|
||||
'\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47',
|
||||
'\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f',
|
||||
'\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57',
|
||||
'\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f',
|
||||
'\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67',
|
||||
'\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f',
|
||||
'\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77',
|
||||
'\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e',
|
||||
'\xfe'
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Conversion to and from IBM937.
|
||||
/* Conversion from and to IBM937.
|
||||
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Masahide Washizawa <washi@yamato.ibm.co.jp>, 2000.
|
||||
@ -95,6 +95,7 @@ enum
|
||||
#define BODY \
|
||||
{ \
|
||||
uint32_t ch = *inptr; \
|
||||
uint32_t res; \
|
||||
\
|
||||
if (__builtin_expect (ch, 0) == SO) \
|
||||
{ \
|
||||
@ -123,9 +124,9 @@ enum
|
||||
\
|
||||
if (curcs == sb) \
|
||||
{ \
|
||||
/* Use the UCS4 table for single byte. */ \
|
||||
ch = __ibm937sb_to_ucs4[ch]; \
|
||||
if (__builtin_expect (ch, L'\1') == L'\0' && *inptr != '\0') \
|
||||
/* Use the IBM937 table for single byte. */ \
|
||||
res = __ibm937sb_to_ucs4[ch]; \
|
||||
if (__builtin_expect (res, L'\1') == L'\0' && ch != '\0') \
|
||||
{ \
|
||||
/* This is an illegal character. */ \
|
||||
if (! ignore_errors_p ()) \
|
||||
@ -137,19 +138,34 @@ enum
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
put32 (outptr, ch); \
|
||||
put32 (outptr, res); \
|
||||
outptr += 4; \
|
||||
} \
|
||||
++inptr; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
/* Use the IBM937 table for double byte. */ \
|
||||
const struct gap *rp2 = __ibm937db_to_ucs4_idx; \
|
||||
\
|
||||
assert (curcs == db); \
|
||||
\
|
||||
ch = ibm937db_to_ucs4(inptr[0], inptr[1]); \
|
||||
if (__builtin_expect (ch, L'\1') == L'\0' && *inptr != '\0') \
|
||||
/* Use the IBM937 table for double byte. */ \
|
||||
if (__builtin_expect (inptr + 1 >= inend, 0)) \
|
||||
{ \
|
||||
/* The second character is not available. \
|
||||
Store the intermediate result. */ \
|
||||
result = __GCONV_INCOMPLETE_INPUT; \
|
||||
break; \
|
||||
} \
|
||||
\
|
||||
ch = (ch * 0x100) + inptr[1]; \
|
||||
while (ch > rp2->end) \
|
||||
++rp2; \
|
||||
\
|
||||
if (__builtin_expect (rp2 == NULL, 0) \
|
||||
|| __builtin_expect (ch < rp2->start, 0) \
|
||||
|| (res = __ibm937db_to_ucs4[ch + rp2->idx], \
|
||||
__builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \
|
||||
{ \
|
||||
/* This is an illegal character. */ \
|
||||
if (! ignore_errors_p ()) \
|
||||
@ -161,7 +177,7 @@ enum
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
put32 (outptr, ch); \
|
||||
put32 (outptr, res); \
|
||||
outptr += 4; \
|
||||
} \
|
||||
inptr += 2; \
|
||||
@ -181,22 +197,40 @@ enum
|
||||
#define BODY \
|
||||
{ \
|
||||
uint32_t ch = get32 (inptr); \
|
||||
const struct gap *rp1 = __ucs4_to_ibm937sb_idx; \
|
||||
const struct gap *rp2 = __ucs4_to_ibm937db_idx; \
|
||||
const char *cp; \
|
||||
\
|
||||
/* Use the UCS4 table for single byte. */ \
|
||||
if (__builtin_expect (ch >= (sizeof (__ucs4_to_ibm937sb) \
|
||||
/ sizeof (__ucs4_to_ibm937sb[0])), 0) \
|
||||
|| (cp = __ucs4_to_ibm937sb[ch], \
|
||||
__builtin_expect (cp[0], '\1') == '\0' && ch != 0)) \
|
||||
if (__builtin_expect (ch >= 0xffff, 0)) \
|
||||
{ \
|
||||
/* Use the UCS4 table for double byte. */ \
|
||||
cp = __ucs4_to_ibm937db[ch]; \
|
||||
if (__builtin_expect (ch >= (sizeof (__ucs4_to_ibm937db) \
|
||||
/ sizeof (__ucs4_to_ibm937db[0])), 0) \
|
||||
|| __builtin_expect (cp[0], '\1') == '\0') \
|
||||
{ \
|
||||
UNICODE_TAG_HANDLER (ch, 4); \
|
||||
UNICODE_TAG_HANDLER (ch, 4); \
|
||||
\
|
||||
if (! ignore_errors_p ()) \
|
||||
{ \
|
||||
result = __GCONV_ILLEGAL_INPUT; \
|
||||
break; \
|
||||
} \
|
||||
++*irreversible; \
|
||||
inptr += 4; \
|
||||
continue; \
|
||||
} \
|
||||
\
|
||||
while (ch > rp1->end) \
|
||||
++rp1; \
|
||||
\
|
||||
/* Use the UCS4 table for single byte. */ \
|
||||
if (__builtin_expect (ch < rp1->start, 0) \
|
||||
|| (cp = __ucs4_to_ibm937sb[ch + rp1->idx], \
|
||||
__builtin_expect (cp[0], L'\1') == L'\0' && ch != '\0')) \
|
||||
{ \
|
||||
/* Use the UCS4 table for double byte. */ \
|
||||
while (ch > rp2->end) \
|
||||
++rp2; \
|
||||
\
|
||||
if (__builtin_expect (ch < rp2->start, 0) \
|
||||
|| (cp = __ucs4_to_ibm937db[ch + rp2->idx], \
|
||||
__builtin_expect (cp[0], L'\1')==L'\0' && ch != '\0')) \
|
||||
{ \
|
||||
/* This is an illegal character. */ \
|
||||
if (! ignore_errors_p ()) \
|
||||
{ \
|
||||
@ -209,10 +243,16 @@ enum
|
||||
{ \
|
||||
if (curcs == sb) \
|
||||
{ \
|
||||
if (__builtin_expect (outptr + 1 > outend, 0)) \
|
||||
{ \
|
||||
result = __GCONV_FULL_OUTPUT; \
|
||||
break; \
|
||||
} \
|
||||
*outptr++ = SO; \
|
||||
curcs = db; \
|
||||
} \
|
||||
if (__builtin_expect (outptr + 1 >= outend, 0)) \
|
||||
\
|
||||
if (__builtin_expect (outptr + 2 > outend, 0)) \
|
||||
{ \
|
||||
result = __GCONV_FULL_OUTPUT; \
|
||||
break; \
|
||||
@ -225,15 +265,21 @@ enum
|
||||
{ \
|
||||
if (curcs == db) \
|
||||
{ \
|
||||
*outptr++ = SI; \
|
||||
curcs = sb; \
|
||||
if (__builtin_expect (outptr == outend, 0)) \
|
||||
if (__builtin_expect (outptr + 1 > outend, 0)) \
|
||||
{ \
|
||||
result = __GCONV_FULL_OUTPUT; \
|
||||
break; \
|
||||
} \
|
||||
*outptr++ = SI; \
|
||||
} \
|
||||
\
|
||||
if (__builtin_expect (outptr + 1 > outend, 0)) \
|
||||
{ \
|
||||
result = __GCONV_FULL_OUTPUT; \
|
||||
break; \
|
||||
} \
|
||||
*outptr++ = cp[0]; \
|
||||
curcs = sb; \
|
||||
} \
|
||||
\
|
||||
/* Now that we wrote the output increment the input pointer. */ \
|
||||
|
19332
iconvdata/ibm937.h
19332
iconvdata/ibm937.h
File diff suppressed because it is too large
Load Diff
@ -112,6 +112,13 @@
|
||||
# define gettext_noop(String) String
|
||||
# endif
|
||||
|
||||
/* Support for bounded pointers. */
|
||||
# if !defined _LIBC && !defined __BOUNDED_POINTERS__
|
||||
# define __bounded /* nothing */
|
||||
# define __unbounded /* nothing */
|
||||
# define __ptrvalue /* nothing */
|
||||
# endif
|
||||
|
||||
/* The `emacs' switch turns on certain matching commands
|
||||
that make sense only in Emacs. */
|
||||
# ifdef emacs
|
||||
|
@ -55,8 +55,8 @@ double __ieee754_remainder(double x, double y)
|
||||
kx=u.i[HIGH_HALF]&0x7fffffff; /* no sign for x*/
|
||||
t.i[HIGH_HALF]&=0x7fffffff; /*no sign for y */
|
||||
ky=t.i[HIGH_HALF];
|
||||
/*------ |x| < 2^1024 and 2^-970 < |y| < 2^1024 ------------------*/
|
||||
if (kx<0x7ff00000 && ky<0x7ff00000 && ky>=0x03500000) {
|
||||
/*------ |x| < 2^1023 and 2^-970 < |y| < 2^1024 ------------------*/
|
||||
if (kx<0x7fe00000 && ky<0x7ff00000 && ky>=0x03500000) {
|
||||
if (kx+0x00100000<ky) return x;
|
||||
if ((kx-0x01500000)<ky) {
|
||||
z=x/t.x;
|
||||
@ -100,14 +100,22 @@ double __ieee754_remainder(double x, double y)
|
||||
{z=u.x/t.x; d=(z+big.x)-big.x; return ((u.x-d*w.x)-d*ww.x);}
|
||||
}
|
||||
|
||||
} /* (kx<0x7ff00000&&ky<0x7ff00000&&ky>=0x03500000) */
|
||||
} /* (kx<0x7fe00000&&ky<0x7ff00000&&ky>=0x03500000) */
|
||||
else {
|
||||
if (kx<0x7ff00000&&ky<0x7ff00000&&(ky>0||t.i[LOW_HALF]!=0)) {
|
||||
if (kx<0x7fe00000&&ky<0x7ff00000&&(ky>0||t.i[LOW_HALF]!=0)) {
|
||||
y=ABS(y)*t128.x;
|
||||
z=__ieee754_remainder(x,y)*t128.x;
|
||||
z=__ieee754_remainder(z,y)*tm128.x;
|
||||
return z;
|
||||
}
|
||||
else {
|
||||
if ((kx&0x7ff00000)==0x7fe00000&&ky<0x7ff00000&&(ky>0||t.i[LOW_HALF]!=0)) {
|
||||
y=ABS(y);
|
||||
z=2.0*__ieee754_remainder(0.5*x,y);
|
||||
d = ABS(z);
|
||||
if (d <= ABS(d-y)) return z;
|
||||
else return (z>0)?z-y:z+y;
|
||||
}
|
||||
else { /* if x is too big */
|
||||
if (kx == 0x7ff00000 && u.i[LOW_HALF] == 0 && y == 1.0)
|
||||
return x / x;
|
||||
@ -116,5 +124,6 @@ double __ieee754_remainder(double x, double y)
|
||||
return (u.i[HIGH_HALF]&0x80000000)?nNAN.x:NAN.x;
|
||||
else return x;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
#ifndef lint
|
||||
#ifndef NOID
|
||||
static char elsieid[] = "@(#)zic.c 7.102";
|
||||
static char elsieid[] = "@(#)zic.c 7.104";
|
||||
#endif /* !defined NOID */
|
||||
#endif /* !defined lint */
|
||||
|
||||
@ -1616,16 +1616,16 @@ const int zonecount;
|
||||
typecnt = 0;
|
||||
charcnt = 0;
|
||||
/*
|
||||
** A guess that may well be corrected later.
|
||||
*/
|
||||
stdoff = 0;
|
||||
/*
|
||||
** Thanks to Earl Chew (earl@dnd.icp.nec.com.au)
|
||||
** for noting the need to unconditionally initialize startttisstd.
|
||||
*/
|
||||
startttisstd = FALSE;
|
||||
startttisgmt = FALSE;
|
||||
for (i = 0; i < zonecount; ++i) {
|
||||
/*
|
||||
** A guess that may well be corrected later.
|
||||
*/
|
||||
stdoff = 0;
|
||||
zp = &zpfirst[i];
|
||||
usestart = i > 0 && (zp - 1)->z_untiltime > min_time;
|
||||
useuntil = i < (zonecount - 1);
|
||||
@ -1645,8 +1645,7 @@ const int zonecount;
|
||||
if (usestart) {
|
||||
addtt(starttime, type);
|
||||
usestart = FALSE;
|
||||
}
|
||||
else if (stdoff != 0)
|
||||
} else if (stdoff != 0)
|
||||
addtt(min_time, type);
|
||||
} else for (year = min_year; year <= max_year; ++year) {
|
||||
if (useuntil && year > zp->z_untilrule.r_hiyear)
|
||||
|
Loading…
Reference in New Issue
Block a user