diff options
| author | Ulrich Drepper <drepper@redhat.com> | 2003-06-13 21:05:42 +0000 |
|---|---|---|
| committer | Ulrich Drepper <drepper@redhat.com> | 2003-06-13 21:05:42 +0000 |
| commit | 2533775393adba65535482cf3a6277774231677d (patch) | |
| tree | 136df37bbdf4b2793575e4853fa0ce3521ada388 | |
| parent | 309695129a603c3dd0541d1dc542b83d30445c84 (diff) | |
| download | glibc-2533775393adba65535482cf3a6277774231677d.tar.xz glibc-2533775393adba65535482cf3a6277774231677d.zip | |
Update.
2003-06-13 Ulrich Drepper <drepper@redhat.com>
Fixing gcc 3.3 warnings, part II.
* argp/argp-help.c (hol_entry_long_iterate): Always inline.
* elf/dl-load.c (cache_rpath): Don't inline.
* iconvdata/cns11642l2.h: Always inline all functions.
* iconvdata/iso-ir-165.h: Likewise.
* locale/Makefile (aux): Add coll-lookup.
* locale/coll-lookup.c: New file.
* locale/coll-lookup.h (collidx_table_lookup): Do not define here.
(collseq_table_lookup): Likewise.
* locale/weightwc.h: Adjust collidx_table_lookup calls for name change.
* posix/fnmatch_loop.c: Adjust collseq_table_lookup calls for name
change.
* posix/regcomp.c: Likewise.
* posix/regexec.c: Likewise.
* locale/programs/3level.h (*_get): Always inline.
* locale/programs/locfile.h: Move definition of handle_copy to...
* locale/programs/locfile.c: ...here.
* locale/programs/ld-collate.c (obstack_int32_grow): Always inline.
(obstack_int32_grow_fast): Likewise.
(utf8_encode): Likewise.
(find_element): Avoid aliasing problems.
(insert_value): Likewise.
(collate_read): Likewise.
* nss/getent.c (print_hosts): Don't inline
(print_networks): Likewise.
(print_shadow): Likewise.
(build_doc): Likewise.
* nss/nss_files/files-parse.c [ENTDATA] (parser_stclass): Don't
inline.
* posix/regcomp.c (re_set_fastmap): Always inline.
(seek_collating_symbol_entry): Likewise.
(lookup_collation_sequence_value): Likewise.
(build_range_exp): Likewise.
(build_collating_symbol): Likewise.
* posix/regexec.c (acquire_init_state_context): Don't inline.
(clean_state_log_if_need): Likewise.
* resolv/res_send.c (eConsIovec): Rewrite to not return struct and
adjust all callers.
(evConsTime): Likewise.
(evAddTime): Likewise.
(evSubTime): Likewise.
(evNowTime): Likewise.
(evTimeSpec): Removed.
(__libc_res_nsend): Avoid aliasing problem.
* sysdeps/unix/sysv/linux/ifreq.h: Move old_siocgifconf definition to..
* sysdeps/unix/sysv/linux/ifreq.c: ...here.
* sysdeps/unix/sysv/linux/i386/dl-procinfo.h (_dl_string_hwcap):
Always inline.
(_dl_string_platform): Likewise.
* wctype/wchar-lookup.h (wctype_table_lookup): Always inline.
(wcwidth_table_lookup): Likewise.
(wctrans_table_lookup): Likewise.
* sysdeps/unix/sysv/linux/sys/epoll.h: Include <stdint.h>.
| -rw-r--r-- | ChangeLog | 57 | ||||
| -rw-r--r-- | argp/argp-help.c | 1 | ||||
| -rw-r--r-- | elf/dl-load.c | 2 | ||||
| -rw-r--r-- | iconvdata/cns11643l2.h | 4 | ||||
| -rw-r--r-- | iconvdata/iso-ir-165.h | 4 | ||||
| -rw-r--r-- | locale/Makefile | 4 | ||||
| -rw-r--r-- | locale/coll-lookup.c | 81 | ||||
| -rw-r--r-- | locale/coll-lookup.h | 83 | ||||
| -rw-r--r-- | locale/programs/3level.h | 3 | ||||
| -rw-r--r-- | locale/programs/ld-collate.c | 83 | ||||
| -rw-r--r-- | locale/programs/locfile.c | 60 | ||||
| -rw-r--r-- | locale/programs/locfile.h | 66 | ||||
| -rw-r--r-- | locale/weightwc.h | 2 | ||||
| -rw-r--r-- | nss/getent.c | 8 | ||||
| -rw-r--r-- | nss/nss_files/files-parse.c | 2 | ||||
| -rw-r--r-- | posix/fnmatch_loop.c | 6 | ||||
| -rw-r--r-- | posix/regcomp.c | 11 | ||||
| -rw-r--r-- | posix/regexec.c | 14 | ||||
| -rw-r--r-- | resolv/res_send.c | 108 | ||||
| -rw-r--r-- | sysdeps/unix/sysv/linux/i386/dl-procinfo.h | 6 | ||||
| -rw-r--r-- | sysdeps/unix/sysv/linux/ifreq.c | 7 | ||||
| -rw-r--r-- | sysdeps/unix/sysv/linux/ifreq.h | 7 | ||||
| -rw-r--r-- | wctype/wchar-lookup.h | 5 |
23 files changed, 362 insertions, 262 deletions
@@ -1,3 +1,60 @@ +2003-06-13 Ulrich Drepper <drepper@redhat.com> + + Fixing gcc 3.3 warnings, part II. + * argp/argp-help.c (hol_entry_long_iterate): Always inline. + * elf/dl-load.c (cache_rpath): Don't inline. + * iconvdata/cns11642l2.h: Always inline all functions. + * iconvdata/iso-ir-165.h: Likewise. + * locale/Makefile (aux): Add coll-lookup. + * locale/coll-lookup.c: New file. + * locale/coll-lookup.h (collidx_table_lookup): Do not define here. + (collseq_table_lookup): Likewise. + * locale/weightwc.h: Adjust collidx_table_lookup calls for name change. + * posix/fnmatch_loop.c: Adjust collseq_table_lookup calls for name + change. + * posix/regcomp.c: Likewise. + * posix/regexec.c: Likewise. + * locale/programs/3level.h (*_get): Always inline. + * locale/programs/locfile.h: Move definition of handle_copy to... + * locale/programs/locfile.c: ...here. + * locale/programs/ld-collate.c (obstack_int32_grow): Always inline. + (obstack_int32_grow_fast): Likewise. + (utf8_encode): Likewise. + (find_element): Avoid aliasing problems. + (insert_value): Likewise. + (collate_read): Likewise. + * nss/getent.c (print_hosts): Don't inline + (print_networks): Likewise. + (print_shadow): Likewise. + (build_doc): Likewise. + * nss/nss_files/files-parse.c [ENTDATA] (parser_stclass): Don't + inline. + * posix/regcomp.c (re_set_fastmap): Always inline. + (seek_collating_symbol_entry): Likewise. + (lookup_collation_sequence_value): Likewise. + (build_range_exp): Likewise. + (build_collating_symbol): Likewise. + * posix/regexec.c (acquire_init_state_context): Don't inline. + (clean_state_log_if_need): Likewise. + * resolv/res_send.c (eConsIovec): Rewrite to not return struct and + adjust all callers. + (evConsTime): Likewise. + (evAddTime): Likewise. + (evSubTime): Likewise. + (evNowTime): Likewise. + (evTimeSpec): Removed. + (__libc_res_nsend): Avoid aliasing problem. + * sysdeps/unix/sysv/linux/ifreq.h: Move old_siocgifconf definition to.. + * sysdeps/unix/sysv/linux/ifreq.c: ...here. + * sysdeps/unix/sysv/linux/i386/dl-procinfo.h (_dl_string_hwcap): + Always inline. + (_dl_string_platform): Likewise. + * wctype/wchar-lookup.h (wctype_table_lookup): Always inline. + (wcwidth_table_lookup): Likewise. + (wctrans_table_lookup): Likewise. + + * sysdeps/unix/sysv/linux/sys/epoll.h: Include <stdint.h>. + 2003-06-12 Ulrich Drepper <drepper@redhat.com> * wcsmbs/wchar.h: Define wint_t in std namespace, too [PR libc/5034]. diff --git a/argp/argp-help.c b/argp/argp-help.c index 208fd86d6b..8acc62d068 100644 --- a/argp/argp-help.c +++ b/argp/argp-help.c @@ -547,6 +547,7 @@ hol_entry_short_iterate (const struct hol_entry *entry, } static inline int +__attribute ((always_inline)) hol_entry_long_iterate (const struct hol_entry *entry, int (*func)(const struct argp_option *opt, const struct argp_option *real, diff --git a/elf/dl-load.c b/elf/dl-load.c index 9198427edd..f3c9e82423 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -578,7 +578,7 @@ decompose_rpath (struct r_search_path_struct *sps, /* Make sure cached path information is stored in *SP and return true if there are any paths to search there. */ -static inline bool +static bool cache_rpath (struct link_map *l, struct r_search_path_struct *sp, int tag, diff --git a/iconvdata/cns11643l2.h b/iconvdata/cns11643l2.h index 6a6283137f..bdb32dde71 100644 --- a/iconvdata/cns11643l2.h +++ b/iconvdata/cns11643l2.h @@ -1,5 +1,5 @@ /* Access functions for CNS 11643, plane 2 handling. - Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2001, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. @@ -26,6 +26,7 @@ extern const uint16_t __cns11643l2_to_ucs4_tab[]; static inline uint32_t +__attribute ((always_inline)) cns11643l2_to_ucs4 (const unsigned char **s, size_t avail, unsigned char offset) { @@ -58,6 +59,7 @@ extern const char __cns11643_from_ucs4p0_tab[][3]; static inline size_t +__attribute ((always_inline)) ucs4_to_cns11643l2 (uint32_t wch, unsigned char *s, size_t avail) { unsigned int ch = (unsigned int) wch; diff --git a/iconvdata/iso-ir-165.h b/iconvdata/iso-ir-165.h index 5f7626f202..b28e45d811 100644 --- a/iconvdata/iso-ir-165.h +++ b/iconvdata/iso-ir-165.h @@ -1,6 +1,6 @@ /* Tables for conversion to and from ISO-IR-165. converting from UCS using gaps. - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 2000. @@ -40,6 +40,7 @@ extern const uint16_t __isoir165_to_tab[ISOIR165_FROMSIZE]; /* XXX If we at some point need an offset value to decode the byte sequences another parameter can be added. */ static inline uint32_t +__attribute ((always_inline)) isoir165_to_ucs4 (const unsigned char **s, size_t avail) { unsigned char ch = *(*s); @@ -70,6 +71,7 @@ extern const struct gap __isoir165_from_idx[]; extern const char __isoir165_from_tab[]; static inline size_t +__attribute ((always_inline)) ucs4_to_isoir165 (uint32_t wch, char *s, size_t avail) { unsigned int ch = (unsigned int) wch; diff --git a/locale/Makefile b/locale/Makefile index 976926bb8e..2f2d2ba5f1 100644 --- a/locale/Makefile +++ b/locale/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1991,92,1995-1999,2000,2001,2002 Free Software Foundation, Inc. +# Copyright (C) 1991,1992,1995-2002,2003 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -42,7 +42,7 @@ tests = tst-C-locale categories = ctype messages monetary numeric time paper name \ address telephone measurement identification collate aux = $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \ - xlocale localename global-locale + xlocale localename global-locale coll-lookup others = localedef locale #others-static = localedef locale install-bin = localedef locale diff --git a/locale/coll-lookup.c b/locale/coll-lookup.c new file mode 100644 index 0000000000..6c765727cc --- /dev/null +++ b/locale/coll-lookup.c @@ -0,0 +1,81 @@ +/* Copyright (C) 2000, 2003 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Bruno Haible <haible@clisp.cons.org>, 2000. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#include <stdint.h> + +/* Lookup in a table of int32_t, with default value 0. */ +int32_t +internal_function +__collidx_table_lookup (const char *table, uint32_t wc) +{ + uint32_t shift1 = ((const uint32_t *) table)[0]; + uint32_t index1 = wc >> shift1; + uint32_t bound = ((const uint32_t *) table)[1]; + if (index1 < bound) + { + uint32_t lookup1 = ((const uint32_t *) table)[5 + index1]; + if (lookup1 != 0) + { + uint32_t shift2 = ((const uint32_t *) table)[2]; + uint32_t mask2 = ((const uint32_t *) table)[3]; + uint32_t index2 = (wc >> shift2) & mask2; + uint32_t lookup2 = ((const uint32_t *)(table + lookup1))[index2]; + if (lookup2 != 0) + { + uint32_t mask3 = ((const uint32_t *) table)[4]; + uint32_t index3 = wc & mask3; + int32_t lookup3 = ((const int32_t *)(table + lookup2))[index3]; + + return lookup3; + } + } + } + return 0; +} + + +/* Lookup in a table of uint32_t, with default value 0xffffffff. */ +uint32_t +internal_function +__collseq_table_lookup (const char *table, uint32_t wc) +{ + uint32_t shift1 = ((const uint32_t *) table)[0]; + uint32_t index1 = wc >> shift1; + uint32_t bound = ((const uint32_t *) table)[1]; + if (index1 < bound) + { + uint32_t lookup1 = ((const uint32_t *) table)[5 + index1]; + if (lookup1 != 0) + { + uint32_t shift2 = ((const uint32_t *) table)[2]; + uint32_t mask2 = ((const uint32_t *) table)[3]; + uint32_t index2 = (wc >> shift2) & mask2; + uint32_t lookup2 = ((const uint32_t *)(table + lookup1))[index2]; + if (lookup2 != 0) + { + uint32_t mask3 = ((const uint32_t *) table)[4]; + uint32_t index3 = wc & mask3; + uint32_t lookup3 = ((const uint32_t *)(table + lookup2))[index3]; + + return lookup3; + } + } + } + return ~((uint32_t) 0); +} diff --git a/locale/coll-lookup.h b/locale/coll-lookup.h index 6a396fa878..3fe6bafb71 100644 --- a/locale/coll-lookup.h +++ b/locale/coll-lookup.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Bruno Haible <haible@clisp.cons.org>, 2000. @@ -17,85 +17,12 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -/* Word tables are accessed by cutting wc in three blocks of bits: - - the high 32-q-p bits, - - the next q bits, - - the next p bits. - - +------------------+-----+-----+ - wc = + 32-q-p | q | p | - +------------------+-----+-----+ - - p and q are variable. For 16-bit Unicode it is sufficient to - choose p and q such that q+p <= 16. - - The table contains the following uint32_t words: - - q+p, - - s = upper exclusive bound for wc >> (q+p), - - p, - - 2^q-1, - - 2^p-1, - - 1st-level table: s offsets, pointing into the 2nd-level table, - - 2nd-level table: k*2^q offsets, pointing into the 3rd-level table, - - 3rd-level table: j*2^p words, each containing 32 bits of data. -*/ - #include <stdint.h> /* Lookup in a table of int32_t, with default value 0. */ -static inline int32_t -collidx_table_lookup (const char *table, uint32_t wc) -{ - uint32_t shift1 = ((const uint32_t *) table)[0]; - uint32_t index1 = wc >> shift1; - uint32_t bound = ((const uint32_t *) table)[1]; - if (index1 < bound) - { - uint32_t lookup1 = ((const uint32_t *) table)[5 + index1]; - if (lookup1 != 0) - { - uint32_t shift2 = ((const uint32_t *) table)[2]; - uint32_t mask2 = ((const uint32_t *) table)[3]; - uint32_t index2 = (wc >> shift2) & mask2; - uint32_t lookup2 = ((const uint32_t *)(table + lookup1))[index2]; - if (lookup2 != 0) - { - uint32_t mask3 = ((const uint32_t *) table)[4]; - uint32_t index3 = wc & mask3; - int32_t lookup3 = ((const int32_t *)(table + lookup2))[index3]; - - return lookup3; - } - } - } - return 0; -} +extern int32_t __collidx_table_lookup (const char *table, uint32_t wc) + internal_function; /* Lookup in a table of uint32_t, with default value 0xffffffff. */ -static inline uint32_t -collseq_table_lookup (const char *table, uint32_t wc) -{ - uint32_t shift1 = ((const uint32_t *) table)[0]; - uint32_t index1 = wc >> shift1; - uint32_t bound = ((const uint32_t *) table)[1]; - if (index1 < bound) - { - uint32_t lookup1 = ((const uint32_t *) table)[5 + index1]; - if (lookup1 != 0) - { - uint32_t shift2 = ((const uint32_t *) table)[2]; - uint32_t mask2 = ((const uint32_t *) table)[3]; - uint32_t index2 = (wc >> shift2) & mask2; - uint32_t lookup2 = ((const uint32_t *)(table + lookup1))[index2]; - if (lookup2 != 0) - { - uint32_t mask3 = ((const uint32_t *) table)[4]; - uint32_t index3 = wc & mask3; - uint32_t lookup3 = ((const uint32_t *)(table + lookup2))[index3]; - - return lookup3; - } - } - } - return ~((uint32_t) 0); -} +extern uint32_t __collseq_table_lookup (const char *table, uint32_t wc) + internal_function; diff --git a/locale/programs/3level.h b/locale/programs/3level.h index f4d641d67c..ef4ba2bbc0 100644 --- a/locale/programs/3level.h +++ b/locale/programs/3level.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2001 Free Software Foundation, Inc. +/* Copyright (C) 2000-2001, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Bruno Haible <haible@clisp.cons.org>, 2000. @@ -80,6 +80,7 @@ CONCAT(TABLE,_init) (struct TABLE *t) /* Retrieve an entry. */ static inline ELEMENT +__attribute ((always_inline)) CONCAT(TABLE,_get) (struct TABLE *t, uint32_t wc) { uint32_t index1 = wc >> (t->q + t->p); diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c index 9d2bca437a..6d0d03c235 100644 --- a/locale/programs/ld-collate.c +++ b/locale/programs/ld-collate.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-1999, 2000, 2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1995-2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@gnu.org>, 1995. @@ -42,6 +42,7 @@ #define obstack_chunk_free free static inline void +__attribute ((always_inline)) obstack_int32_grow (struct obstack *obstack, int32_t data) { if (sizeof (int32_t) == sizeof (int)) @@ -51,6 +52,7 @@ obstack_int32_grow (struct obstack *obstack, int32_t data) } static inline void +__attribute ((always_inline)) obstack_int32_grow_fast (struct obstack *obstack, int32_t data) { if (sizeof (int32_t) == sizeof (int)) @@ -249,6 +251,7 @@ static uint32_t nrules; /* We need UTF-8 encoding of numbers. */ static inline int +__attribute ((always_inline)) utf8_encode (char *buf, int val) { int retval; @@ -606,10 +609,10 @@ static struct element_t * find_element (struct linereader *ldfile, struct locale_collate_t *collate, const char *str, size_t len) { - struct element_t *result = NULL; + void *result = NULL; /* Search for the entries among the collation sequences already define. */ - if (find_entry (&collate->seq_table, str, len, (void **) &result) != 0) + if (find_entry (&collate->seq_table, str, len, &result) != 0) { /* Nope, not define yet. So we see whether it is a collation symbol. */ @@ -625,8 +628,7 @@ find_element (struct linereader *ldfile, struct locale_collate_t *collate, result = sym->order = new_element (collate, NULL, 0, NULL, NULL, 0, 0); } - else if (find_entry (&collate->elem_table, str, len, - (void **) &result) != 0) + else if (find_entry (&collate->elem_table, str, len, &result) != 0) { /* It's also no collation element. So it is a character element defined later. */ @@ -636,7 +638,7 @@ find_element (struct linereader *ldfile, struct locale_collate_t *collate, } } - return result; + return (struct element_t *) result; } @@ -944,8 +946,8 @@ insert_value (struct linereader *ldfile, const char *symstr, size_t symlen, { /* It's no character, so look through the collation elements and symbol list. */ - if (find_entry (&collate->elem_table, symstr, symlen, - (void **) &elem) != 0) + void *ptr = elem; + if (find_entry (&collate->elem_table, symstr, symlen, &ptr) != 0) { void *result; struct symbol_t *sym = NULL; @@ -976,12 +978,15 @@ insert_value (struct linereader *ldfile, const char *symstr, size_t symlen, insert_entry (&collate->seq_table, symstr, symlen, elem); } } + else + /* Copy the result back. */ + elem = ptr; } else { /* Otherwise the symbols stands for a character. */ - if (find_entry (&collate->seq_table, symstr, symlen, - (void **) &elem) != 0) + void *ptr = elem; + if (find_entry (&collate->seq_table, symstr, symlen, &ptr) != 0) { uint32_t wcs[2] = { wc, 0 }; @@ -998,6 +1003,9 @@ insert_value (struct linereader *ldfile, const char *symstr, size_t symlen, } else { + /* Copy the result back. */ + elem = ptr; + /* Maybe the character was used before the definition. In this case |
