From: Ulrich Drepper Date: Thu, 9 Dec 1999 07:52:58 +0000 (+0000) Subject: Update. X-Git-Tag: upstream/2.30~26477 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f1d8b8044e2dbf207ab98b26f5b9bbdfb7e59382;p=external%2Fglibc.git Update. * locale/programs/ld-ctype.c (ctype_output): Correct sizes of mapping arrays. (allocate_arrays): Allocate memory for map32. Correctly install default values in it and install defined mappings. * locale/programs/ld-monetary.c (monetary_finish): Provide default value for mon_grouping. --- diff --git a/ChangeLog b/ChangeLog index a7a4aae..695337e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 1999-12-08 Ulrich Drepper + * locale/programs/ld-ctype.c (ctype_output): Correct sizes of mapping + arrays. + (allocate_arrays): Allocate memory for map32. Correctly install + default values in it and install defined mappings. + + * locale/programs/ld-monetary.c (monetary_finish): Provide default + value for mon_grouping. + * elf/readlib.c: Include a.out.h last since the Linux/Alpha headers are not clean enough. diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c index 1b8775e..5dcb013 100644 --- a/locale/programs/ld-ctype.c +++ b/locale/programs/ld-ctype.c @@ -787,20 +787,18 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap, CTYPE_DATA (_NL_CTYPE_TOUPPER, ctype->map[0], - (ctype->plane_size * ctype->plane_cnt + 128) - * sizeof (uint32_t)); + (256 + 128) * sizeof (uint32_t)); CTYPE_DATA (_NL_CTYPE_TOLOWER, ctype->map[1], - (ctype->plane_size * ctype->plane_cnt + 128) - * sizeof (uint32_t)); + (256 + 128) * sizeof (uint32_t)); CTYPE_DATA (_NL_CTYPE_TOUPPER32, ctype->map32[0], - (ctype->plane_size * ctype->plane_cnt + 128) + (ctype->plane_size * ctype->plane_cnt) * sizeof (uint32_t)); CTYPE_DATA (_NL_CTYPE_TOLOWER32, ctype->map32[1], - (ctype->plane_size * ctype->plane_cnt + 128) + (ctype->plane_size * ctype->plane_cnt) * sizeof (uint32_t)); CTYPE_DATA (_NL_CTYPE_CLASS32, @@ -981,7 +979,7 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap, iov[2 + elem + offset].iov_base = ctype->map32[nr]; iov[2 + elem + offset].iov_len = ((ctype->plane_size - * ctype->plane_cnt + 128) + * ctype->plane_cnt) * sizeof (uint32_t)); idx[elem + 1] = idx[elem] + iov[2 + elem + offset].iov_len; @@ -3059,18 +3057,25 @@ Computing table size for character classes might take a while..."), unsigned int idx2; /* Allocate table. */ - ctype->map[idx] = (uint32_t *) xmalloc (ctype->plane_size - * ctype->plane_cnt - * sizeof (uint32_t)); + ctype->map32[idx] = (uint32_t *) xmalloc (ctype->plane_size + * ctype->plane_cnt + * sizeof (uint32_t)); /* Copy default value (identity mapping). */ - memcpy (ctype->map[idx], ctype->names, + memcpy (ctype->map32[idx], ctype->names, ctype->plane_size * ctype->plane_cnt * sizeof (uint32_t)); /* Copy values from collection. */ for (idx2 = 0; idx2 < 256; ++idx2) if (ctype->map_collection[idx][idx2] != 0) - ctype->map[idx][idx2] = ctype->map_collection[idx][idx2]; + ctype->map32[idx][idx2] = ctype->map_collection[idx][idx2]; + + while (idx2 < ctype->map_collection_act[idx]) + if (ctype->map_collection[idx][idx2] != 0) + *find_idx (ctype, &ctype->map32[idx], + &ctype->map_collection_max[idx], + &ctype->map_collection_act[idx], + ctype->names[idx2]) = ctype->map_collection[idx][idx2]; } /* Extra array for class and map names. */ diff --git a/locale/programs/ld-monetary.c b/locale/programs/ld-monetary.c index 31846b1..afad481 100644 --- a/locale/programs/ld-monetary.c +++ b/locale/programs/ld-monetary.c @@ -241,9 +241,15 @@ not correspond to a valid name in ISO 4217"), "LC_MONETARY", "mon_decimal_point"); } - if (monetary->mon_grouping_len == 0 && ! be_quiet && ! nothing) - error (0, 0, _("%s: field `%s' not defined"), - "LC_MONETARY", "mon_grouping"); + if (monetary->mon_grouping_len == 0) + { + if (! be_quiet && ! nothing) + error (0, 0, _("%s: field `%s' not defined"), + "LC_MONETARY", "mon_grouping"); + + monetary->mon_grouping = "\177"; + monetary->mon_grouping_len = 1; + } #undef TEST_ELEM #define TEST_ELEM(cat, min, max) \ diff --git a/localedata/tests/test6.c b/localedata/tests/test6.c new file mode 100644 index 0000000..735b1ad --- /dev/null +++ b/localedata/tests/test6.c @@ -0,0 +1,138 @@ +/* Test program for character classes and mappings. + Copyright (C) 1999 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1999. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include +#include + + +int +main (void) +{ + const char lower[] = "abcdefghijklmnopqrstuvwxyz"; + const char upper[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; +#define LEN (sizeof (upper) - 1) + const wchar_t wlower[] = L"abcdefghijklmnopqrstuvwxyz"; + const wchar_t wupper[] = L"ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int i; + int result = 0; + + setlocale (LC_ALL, "test6"); + + for (i = 0; i < LEN; ++i) + { + /* Test basic table handling (basic == not more than 256 characters). + The charmaps swaps the normal lower-upper case meaning of the + ASCII characters used in the source code while the Unicode mapping + in the repertoire map has the normal correspondants. This test + shows the independence of the tables for `char' and `wchar_t' + characters. */ + + if (islower (lower[i])) + { + printf ("islower ('%c') false\n", lower[i]); + result = 1; + } + if (! isupper (lower[i])) + { + printf ("isupper ('%c') false\n", lower[i]); + result = 1; + } + + if (! islower (upper[i])) + { + printf ("islower ('%c') false\n", upper[i]); + result = 1; + } + if (isupper (upper[i])) + { + printf ("isupper ('%c') false\n", upper[i]); + result = 1; + } + + if (toupper (lower[i]) != lower[i]) + { + printf ("toupper ('%c') false\n", lower[i]); + result = 1; + } + if (tolower (lower[i]) != upper[i]) + { + printf ("tolower ('%c') false\n", lower[i]); + result = 1; + } + + if (tolower (upper[i]) != upper[i]) + { + printf ("tolower ('%c') false\n", upper[i]); + result = 1; + } + if (toupper (upper[i]) != lower[i]) + { + printf ("toupper ('%c') false\n", upper[i]); + result = 1; + } + + if (iswlower (wupper[i])) + { + printf ("iswlower (L'%c') false\n", upper[i]); + result = 1; + } + if (! iswupper (wupper[i])) + { + printf ("iswupper (L'%c') false\n", upper[i]); + result = 1; + } + + if (iswupper (wlower[i])) + { + printf ("iswupper (L'%c') false\n", lower[i]); + result = 1; + } + if (! iswlower (wlower[i])) + { + printf ("iswlower (L'%c') false\n", lower[i]); + result = 1; + } + + if (towupper (wlower[i]) != wupper[i]) + { + printf ("towupper ('%c') false\n", lower[i]); + result = 1; + } + if (towlower (wlower[i]) != wlower[i]) + { + printf ("towlower ('%c') false\n", lower[i]); + result = 1; + } + + if (towlower (wupper[i]) != wlower[i]) + { + printf ("towlower ('%c') false\n", upper[i]); + result = 1; + } + if (towupper (wupper[i]) != wupper[i]) + { + printf ("towupper ('%c') false\n", upper[i]); + result = 1; + } + } + + return result; +} diff --git a/localedata/tests/test6.cm b/localedata/tests/test6.cm new file mode 100644 index 0000000..3711495 --- /dev/null +++ b/localedata/tests/test6.cm @@ -0,0 +1,93 @@ + test6 + +CHARMAP + \x09 + \x0A + \x0B + \x0C + \x0D + \x20 + \x20 + \x21 +<"> \x22 +<%> \x25 +<&> \x26 +<'> \x27 +<(> \x28 +<)> \x29 +<*> \x2A +<+> \x2B +<,> \x2C +<-> \x2D +<.> \x2E +<\\> \x2F +<0> \x30 +<1> \x31 +<2> \x32 +<3> \x33 +<4> \x34 +<5> \x35 +<6> \x36 +<7> \x37 +<8> \x38 +<9> \x39 +<:> \x3A +<;> \x3B +<<> \x3C +<=> \x3D +<\>> \x3E + \x3F + \x41 + \x42 + \x43 + \x44 + \x45 + \x46 + \x47 + \x48 + \x49 + \x4A + \x4B + \x4C + \x4D + \x4E + \x4F +

\x70 + \x71 + \x72 + \x73 + \x74 + \x75 + \x76 + \x77 + \x78 + \x79 + \x7A +END CHARMAP diff --git a/localedata/tests/test6.def b/localedata/tests/test6.def new file mode 100644 index 0000000..f8f88b3 --- /dev/null +++ b/localedata/tests/test6.def @@ -0,0 +1,20 @@ +LC_CTYPE + +lower ;;;;;;;;;;;;;;;

;; \ + ;;;;;;;; +upper ;;;;;;;;;;;;;;;

;; \ + ;;;;;;;; + +tolower (,);(,);(,);(,);(,);(,); \ + (,);(,);(,);(,);(,);(,); \ + (,);(,);(,);(

,

);(,);(,); \ + (,);(,);(,);(,);(,);(,); \ + (,);(,) + +toupper (,);(,);(,);(,);(,);(,); \ + (,);(,);(,);(,);(,);(,); \ + (,);(,);(,);(

,

);(,);(,); \ + (,);(,);(,);(,);(,);(,); \ + (,);(,) + +END LC_CTYPE diff --git a/localedata/tests/test6.mne b/localedata/tests/test6.mne new file mode 100644 index 0000000..bb12185 --- /dev/null +++ b/localedata/tests/test6.mne @@ -0,0 +1,113 @@ + HORIZONTAL TABULATION + LINE FEED + VERTICAL TABULATION + FORM FEED + CARRIAGE RETURN + SPACE + SPACE + EXCLAMATION MARK +<"> QUOTATION MARK + NUMBER SIGN + DOLLAR SIGN + DOLLAR SIGN +<%> PERCENT SIGN +<&> AMPERSAND +<'> APOSTROPHE +<(> LEFT PARENTHESIS +<)> RIGHT PARENTHESIS +<*> ASTERISK +<+> PLUS SIGN +<,> COMMA +<-> HYPHEN-MINUS +<.> FULL STOP + SOLIDUS +<0> DIGIT ZERO +<1> DIGIT ONE +<2> DIGIT TWO +<3> DIGIT THREE +<4> DIGIT FOUR +<5> DIGIT FIVE +<6> DIGIT SIX +<7> DIGIT SEVEN +<8> DIGIT EIGHT +<9> DIGIT NINE +<:> COLON +<;> SEMICOLON +<<> LESS-THAN SIGN +<=> EQUALS SIGN +<\>> GREATER-THAN SIGN + QUESTION MARK +<@> COMMERCIAL AT + LATIN CAPITAL LETTER A + LATIN CAPITAL LETTER B + LATIN CAPITAL LETTER C + LATIN CAPITAL LETTER D + LATIN CAPITAL LETTER E + LATIN CAPITAL LETTER F + LATIN CAPITAL LETTER G + LATIN CAPITAL LETTER H + LATIN CAPITAL LETTER I + LATIN CAPITAL LETTER J + LATIN CAPITAL LETTER K + LATIN CAPITAL LETTER L + LATIN CAPITAL LETTER M + LATIN CAPITAL LETTER N + LATIN CAPITAL LETTER O +

LATIN CAPITAL LETTER P + LATIN CAPITAL LETTER Q + LATIN CAPITAL LETTER R + LATIN CAPITAL LETTER S + LATIN CAPITAL LETTER T + LATIN CAPITAL LETTER U + LATIN CAPITAL LETTER V + LATIN CAPITAL LETTER W + LATIN CAPITAL LETTER X + LATIN CAPITAL LETTER Y + LATIN CAPITAL LETTER Z +<<(> LEFT SQUARE BRACKET + LEFT SQUARE BRACKET + REVERSE SOLIDUS + REVERSE SOLIDUS + REVERSE SOLIDUS +<)\>> RIGHT SQUARE BRACKET + RIGHT SQUARE BRACKET +<'\>> CIRCUMFLEX ACCENT + CIRCUMFLEX ACCENT + CIRCUMFLEX ACCENT +<_> LOW LINE + LOW LINE + LOW LINE +<'!> GRAVE ACCENT + GRAVE ACCENT + LATIN SMALL LETTER A + LATIN SMALL LETTER B + LATIN SMALL LETTER C + LATIN SMALL LETTER D + LATIN SMALL LETTER E + LATIN SMALL LETTER F + LATIN SMALL LETTER G + LATIN SMALL LETTER H + LATIN SMALL LETTER I + LATIN SMALL LETTER J + LATIN SMALL LETTER K + LATIN SMALL LETTER L + LATIN SMALL LETTER M + LATIN SMALL LETTER N + LATIN SMALL LETTER O +

LATIN SMALL LETTER P + LATIN SMALL LETTER Q + LATIN SMALL LETTER R + LATIN SMALL LETTER S + LATIN SMALL LETTER T + LATIN SMALL LETTER U + LATIN SMALL LETTER V + LATIN SMALL LETTER W + LATIN SMALL LETTER X + LATIN SMALL LETTER Y + LATIN SMALL LETTER Z +<(!> LEFT CURLY BRACKET + VERTICAL LINE + VERTICAL LINE + RIGHT CURLY BRACKET +<'?> TILDE +

DELETE diff --git a/sysdeps/unix/sysv/linux/i386/mmap64.S b/sysdeps/unix/sysv/linux/i386/mmap64.S index 916149a..4a30185 100644 --- a/sysdeps/unix/sysv/linux/i386/mmap64.S +++ b/sysdeps/unix/sysv/linux/i386/mmap64.S @@ -22,7 +22,7 @@ #define EINVAL 22 #define ENOSYS 38 - + .text ENTRY (__mmap64) @@ -51,7 +51,7 @@ ENTRY (__mmap64) movl 36(%esp), %edi /* Do the system call trap. */ -L(do_syscal): +L(do_syscall): int $0x80 /* If 0 > %eax > -4096 there was an error. */

\x50 + \x51 + \x52 + \x53 + \x54 + \x55 + \x56 + \x57 + \x58 + \x59 + \x5A +<_> \x5F + \x61 + \x62 + \x63 + \x64 + \x65 + \x66 + \x67 + \x68 + \x69 + \x6A + \x6B + \x6C + \x6D + \x6E + \x6F +