2000-07-29  Ulrich Drepper  <drepper@redhat.com>

	* locale/langinfo.h: Add entries for extra tables in CTYPE data.
	* locale/programs/ld-ctype.c: Adjust for this.

	* locale/programs/ld-collate.c: Add more alignment checks.
	* locale/string/strcoll.c: Likewise.

2000-07-30  Mark Kettenis  <kettenis@gnu.org>

	* stdio-common/vfprintf.c: Move inclusion of _i18n_number.h
	outside USE_IN_LIBIO block.
This commit is contained in:
Ulrich Drepper 2000-07-30 00:00:23 +00:00
parent fb032fbd88
commit a9706118e0
8 changed files with 58 additions and 10 deletions

View File

@ -1,3 +1,16 @@
2000-07-29 Ulrich Drepper <drepper@redhat.com>
* locale/langinfo.h: Add entries for extra tables in CTYPE data.
* locale/programs/ld-ctype.c: Adjust for this.
* locale/programs/ld-collate.c: Add more alignment checks.
* locale/string/strcoll.c: Likewise.
2000-07-30 Mark Kettenis <kettenis@gnu.org>
* stdio-common/vfprintf.c: Move inclusion of _i18n_number.h
outside USE_IN_LIBIO block.
2000-07-26 Philip Blundell <philb@gnu.org> 2000-07-26 Philip Blundell <philb@gnu.org>
* sysdeps/arm/dl-machine.h (fix_bad_pc24): New function. * sysdeps/arm/dl-machine.h (fix_bad_pc24): New function.

View File

@ -327,6 +327,20 @@ enum
_NL_CTYPE_TRANSLIT_DEFAULT_MISSING, _NL_CTYPE_TRANSLIT_DEFAULT_MISSING,
_NL_CTYPE_TRANSLIT_IGNORE_LEN, _NL_CTYPE_TRANSLIT_IGNORE_LEN,
_NL_CTYPE_TRANSLIT_IGNORE, _NL_CTYPE_TRANSLIT_IGNORE,
_NL_CTYPE_EXTRA_MAP_1,
_NL_CTYPE_EXTRA_MAP_2,
_NL_CTYPE_EXTRA_MAP_3,
_NL_CTYPE_EXTRA_MAP_4,
_NL_CTYPE_EXTRA_MAP_5,
_NL_CTYPE_EXTRA_MAP_6,
_NL_CTYPE_EXTRA_MAP_7,
_NL_CTYPE_EXTRA_MAP_8,
_NL_CTYPE_EXTRA_MAP_9,
_NL_CTYPE_EXTRA_MAP_10,
_NL_CTYPE_EXTRA_MAP_11,
_NL_CTYPE_EXTRA_MAP_12,
_NL_CTYPE_EXTRA_MAP_13,
_NL_CTYPE_EXTRA_MAP_14,
_NL_NUM_LC_CTYPE, _NL_NUM_LC_CTYPE,
/* LC_MONETARY category: formatting of monetary quantities. /* LC_MONETARY category: formatting of monetary quantities.

View File

@ -2300,14 +2300,16 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
more information here. */ more information here. */
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_HASH_SIZE)); assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_HASH_SIZE));
iov[2 + cnt].iov_base = &collate->plane_size; iov[2 + cnt].iov_base = &collate->plane_size;
iov[2 + cnt].iov_len = sizeof (collate->plane_size); iov[2 + cnt].iov_len = sizeof (uint32_t);
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len; idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
assert (idx[cnt] % 4 == 0);
++cnt; ++cnt;
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_HASH_LAYERS)); assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_HASH_LAYERS));
iov[2 + cnt].iov_base = &collate->plane_cnt; iov[2 + cnt].iov_base = &collate->plane_cnt;
iov[2 + cnt].iov_len = sizeof (collate->plane_cnt); iov[2 + cnt].iov_len = sizeof (collate->plane_cnt);
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len; idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
assert (idx[cnt] % 4 == 0);
++cnt; ++cnt;
/* Construct a table with the names. The size of the table is the same /* Construct a table with the names. The size of the table is the same
@ -2324,6 +2326,7 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
iov[2 + cnt].iov_base = names; iov[2 + cnt].iov_base = names;
iov[2 + cnt].iov_len = table_size * sizeof (uint32_t); iov[2 + cnt].iov_len = table_size * sizeof (uint32_t);
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len; idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
assert (idx[cnt] % 4 == 0);
++cnt; ++cnt;
/* Since we are using the sign of an integer to mark indirection the /* Since we are using the sign of an integer to mark indirection the
@ -2511,6 +2514,7 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
iov[2 + cnt].iov_len = table_size * sizeof (uint32_t); iov[2 + cnt].iov_len = table_size * sizeof (uint32_t);
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len; idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
assert (iov[2 + cnt].iov_len % sizeof (int32_t) == 0); assert (iov[2 + cnt].iov_len % sizeof (int32_t) == 0);
assert (idx[cnt] % 4 == 0);
++cnt; ++cnt;
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_WEIGHTWC)); assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_WEIGHTWC));
@ -2518,6 +2522,7 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
iov[2 + cnt].iov_base = obstack_finish (&weightpool); iov[2 + cnt].iov_base = obstack_finish (&weightpool);
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len; idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
assert (iov[2 + cnt].iov_len % sizeof (int32_t) == 0); assert (iov[2 + cnt].iov_len % sizeof (int32_t) == 0);
assert (idx[cnt] % 4 == 0);
++cnt; ++cnt;
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_EXTRAWC)); assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_EXTRAWC));
@ -2526,6 +2531,7 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len; idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
assert (iov[2 + cnt].iov_len % sizeof (int32_t) == 0); assert (iov[2 + cnt].iov_len % sizeof (int32_t) == 0);
assert (iov[2 + cnt].iov_len % sizeof (int32_t) == 0); assert (iov[2 + cnt].iov_len % sizeof (int32_t) == 0);
assert (idx[cnt] % 4 == 0);
++cnt; ++cnt;
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_INDIRECTWC)); assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_INDIRECTWC));
@ -2533,6 +2539,7 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
iov[2 + cnt].iov_base = obstack_finish (&indirectpool); iov[2 + cnt].iov_base = obstack_finish (&indirectpool);
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len; idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
assert (iov[2 + cnt].iov_len % sizeof (int32_t) == 0); assert (iov[2 + cnt].iov_len % sizeof (int32_t) == 0);
assert (idx[cnt] % 4 == 0);
++cnt; ++cnt;
@ -2633,12 +2640,14 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
iov[2 + cnt].iov_base = &elem_size; iov[2 + cnt].iov_base = &elem_size;
iov[2 + cnt].iov_len = sizeof (int32_t); iov[2 + cnt].iov_len = sizeof (int32_t);
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len; idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
assert (idx[cnt] % 4 == 0);
++cnt; ++cnt;
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_SYMB_TABLEMB)); assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_SYMB_TABLEMB));
iov[2 + cnt].iov_base = elem_table; iov[2 + cnt].iov_base = elem_table;
iov[2 + cnt].iov_len = elem_size * 2 * sizeof (int32_t); iov[2 + cnt].iov_len = elem_size * 2 * sizeof (int32_t);
idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len; idx[1 + cnt] = idx[cnt] + iov[2 + cnt].iov_len;
assert (idx[cnt] % 4 == 0);
++cnt; ++cnt;
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_SYMB_EXTRAMB)); assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_SYMB_EXTRAMB));
@ -2656,6 +2665,7 @@ collate_output (struct localedef_t *locale, struct charmap_t *charmap,
assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_COLLSEQWC)); assert (cnt == _NL_ITEM_INDEX (_NL_COLLATE_COLLSEQWC));
iov[2 + cnt].iov_base = collate->wcseqorder; iov[2 + cnt].iov_base = collate->wcseqorder;
iov[2 + cnt].iov_len = table_size * sizeof (uint32_t); iov[2 + cnt].iov_len = table_size * sizeof (uint32_t);
assert (idx[cnt] % 4 == 0);
++cnt; ++cnt;
assert (cnt == _NL_ITEM_INDEX (_NL_NUM_LC_COLLATE)); assert (cnt == _NL_ITEM_INDEX (_NL_NUM_LC_COLLATE));

View File

@ -838,7 +838,7 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap,
{ {
static const char nulbytes[4] = { 0, 0, 0, 0 }; static const char nulbytes[4] = { 0, 0, 0, 0 };
struct locale_ctype_t *ctype = locale->categories[LC_CTYPE].ctype; struct locale_ctype_t *ctype = locale->categories[LC_CTYPE].ctype;
const size_t nelems = (_NL_ITEM_INDEX (_NL_NUM_LC_CTYPE) const size_t nelems = (_NL_ITEM_INDEX (_NL_CTYPE_EXTRA_MAP_1)
+ (oldstyle_tables + (oldstyle_tables
? (ctype->map_collection_nr - 2) ? (ctype->map_collection_nr - 2)
: (ctype->nr_charclass + ctype->map_collection_nr))); : (ctype->nr_charclass + ctype->map_collection_nr)));
@ -866,7 +866,7 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap,
for (elem = 0; elem < nelems; ++elem) for (elem = 0; elem < nelems; ++elem)
{ {
if (elem < _NL_ITEM_INDEX (_NL_NUM_LC_CTYPE)) if (elem < _NL_ITEM_INDEX (_NL_CTYPE_EXTRA_MAP_1))
switch (elem) switch (elem)
{ {
#define CTYPE_EMPTY(name) \ #define CTYPE_EMPTY(name) \
@ -1155,7 +1155,7 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap,
/* Handle extra maps. */ /* Handle extra maps. */
if (oldstyle_tables) if (oldstyle_tables)
{ {
size_t nr = (elem - _NL_ITEM_INDEX (_NL_NUM_LC_CTYPE)) + 2; size_t nr = (elem - _NL_ITEM_INDEX (_NL_CTYPE_EXTRA_MAP_1)) + 2;
iov[2 + elem + offset].iov_base = ctype->map32[nr]; iov[2 + elem + offset].iov_base = ctype->map32[nr];
iov[2 + elem + offset].iov_len = ((ctype->plane_size iov[2 + elem + offset].iov_len = ((ctype->plane_size
@ -1166,7 +1166,7 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap,
} }
else else
{ {
size_t nr = elem - _NL_ITEM_INDEX (_NL_NUM_LC_CTYPE); size_t nr = elem - _NL_ITEM_INDEX (_NL_CTYPE_EXTRA_MAP_1);
if (nr < ctype->nr_charclass) if (nr < ctype->nr_charclass)
{ {
iov[2 + elem + offset] = ctype->class_3level[nr]; iov[2 + elem + offset] = ctype->class_3level[nr];
@ -4240,7 +4240,7 @@ Computing table size for character classes might take a while..."),
} }
else else
{ {
ctype->class_offset = _NL_ITEM_INDEX (_NL_NUM_LC_CTYPE); ctype->class_offset = _NL_ITEM_INDEX (_NL_CTYPE_EXTRA_MAP_1);
ctype->map_offset = ctype->class_offset + ctype->nr_charclass; ctype->map_offset = ctype->class_offset + ctype->nr_charclass;
} }

View File

@ -1,5 +1,7 @@
2000-07-29 Ulrich Drepper <drepper@redhat.com> 2000-07-29 Ulrich Drepper <drepper@redhat.com>
* tst-langinfo.c (main): Fix esacape sequence handling.
* charmaps/EUC-TW: New file. * charmaps/EUC-TW: New file.
* tst-digits.c: Add tests for wprintf. * tst-digits.c: Add tests for wprintf.

View File

@ -213,7 +213,7 @@ main (void)
++rp; ++rp;
if (*rp == '\0') if (*rp == '\0')
break; break;
if (*rp >= '\0' && *rp <= 'p') if (*rp >= '0' && *rp <= '9')
{ {
int val = *rp - '0'; int val = *rp - '0';
if (rp[1] >= '0' && rp[1] <= '9') if (rp[1] >= '0' && rp[1] <= '9')

View File

@ -102,8 +102,6 @@
# undef EOF # undef EOF
# define EOF WEOF # define EOF WEOF
# endif # endif
# include "_i18n_number.h"
#else /* ! USE_IN_LIBIO */ #else /* ! USE_IN_LIBIO */
/* This code is for use in the GNU C library. */ /* This code is for use in the GNU C library. */
# include <stdio.h> # include <stdio.h>
@ -155,6 +153,8 @@ extern void __flockfile (FILE *);
extern void __funlockfile (FILE *); extern void __funlockfile (FILE *);
#endif /* USE_IN_LIBIO */ #endif /* USE_IN_LIBIO */
#include "_i18n_number.h"
/* Include the shared code for parsing the format string. */ /* Include the shared code for parsing the format string. */
#include "printf-parse.h" #include "printf-parse.h"

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. /* Copyright (C) 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Written by Ulrich Drepper <drepper@cygnus.com>, 1995. Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
@ -143,6 +143,15 @@ STRCOLL (s1, s2, l)
#endif #endif
use_malloc = 0; use_malloc = 0;
assert (((uintptr_t) table) % sizeof (table[0]) == 0);
assert (((uintptr_t) weights) % sizeof (weights[0]) == 0);
assert (((uintptr_t) weights) % sizeof (weights[0]) == 0);
assert (((uintptr_t) extra) % sizeof (extra[0]) == 0);
assert (((uintptr_t) indirect) % sizeof (indirect[0]) == 0);
#ifdef WIDE_CHAR_VERSION
assert (((uintptr_t) names) % sizeof (names[0]) == 0);
#endif
/* We need this a few times. */ /* We need this a few times. */
s1len = STRLEN (s1); s1len = STRLEN (s1);
s2len = STRLEN (s2); s2len = STRLEN (s2);