diff options
-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 208fd86..8acc62d 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 9198427..f3c9e82 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 6a62831..bdb32dd 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 5f7626f..b28e45d 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 976926b..2f2d2ba 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 0000000..6c76572 --- /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 6a396fa..3fe6baf 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 f4d641d..ef4ba2b 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 9d2bca4..6d0d03c 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 we have to insert the byte sequences now. */ if (elem->mbs == NULL && seq != NULL) @@ -1169,8 +1177,9 @@ sequence is not lower than that of the last character"), "LC_COLLATE"); /* Now we are ready to insert the new value in the sequence. Find out whether the element is already known. */ + void *ptr; if (find_entry (&collate->seq_table, seq->name, namelen, - (void **) &elem) != 0) + &ptr) != 0) { uint32_t wcs[2] = { seq->ucs4, 0 }; @@ -1186,6 +1195,9 @@ sequence is not lower than that of the last character"), "LC_COLLATE"); /* This cannot happen. */ assert (! "Internal error"); } + else + /* Copy the result. */ + elem = ptr; /* Test whether this element is not already in the list. */ if (elem->next != NULL || (collate->cursor != NULL @@ -1324,9 +1336,12 @@ order for `%.*s' already defined at %s:%Zu"), sprintf (buf + preflen, base == 10 ? "%ld" : "%lX", from); /* Look whether this name is already defined. */ - if (find_entry (&collate->seq_table, buf, symlen, - (void **) &elem) == 0) + void *ptr; + if (find_entry (&collate->seq_table, buf, symlen, &ptr) == 0) { + /* Copy back the result. */ + elem = ptr; + if (elem->next != NULL || (collate->cursor != NULL && elem->next == collate->cursor)) { @@ -3009,7 +3024,7 @@ collate_read (struct linereader *ldfile, struct localedef_t *result, size_t newname_len = arg->val.str.lenmb; const char *symname; size_t symname_len; - struct symbol_t *symval; + void *symval; /* Actually struct symbol_t* */ arg = lr_token (ldfile, charmap, result, repertoire, verbose); if (arg->tok != tok_bsymbol) @@ -3045,7 +3060,7 @@ collate_read (struct linereader *ldfile, struct localedef_t *result, /* See whether the symbol name is already defined. */ if (find_entry (&collate->sym_table, symname, symname_len, - (void **) &symval) != 0) + &symval) != 0) { lr_error (ldfile, _("\ %s: unknown symbol `%s' in equivalent definition"), @@ -3294,6 +3309,7 @@ error while adding equivalent collating symbol")); size_t lenmb; struct element_t *insp; int no_error = 1; + void *ptr; if (arg->tok == tok_bsymbol) { @@ -3307,18 +3323,20 @@ error while adding equivalent collating symbol")); lenmb = 9; } - if (find_entry (&collate->seq_table, startmb, lenmb, - (void **) &insp) == 0) + if (find_entry (&collate->seq_table, startmb, lenmb, &ptr) == 0) /* Yes, the symbol exists. Simply point the cursor to it. */ - collate->cursor = insp; + collate->cursor = (struct element_t *) ptr; else { struct symbol_t *symbp; + void *ptr; if (find_entry (&collate->sym_table, startmb, lenmb, - (void **) &symbp) == 0) + &ptr) == 0) { + symbp = ptr; + if (symbp->order->last != NULL || symbp->order->next != NULL) collate->cursor = symbp->order; @@ -3334,8 +3352,10 @@ error while adding equivalent collating symbol")); } } else if (find_entry (&collate->elem_table, startmb, lenmb, - (void **) &insp) == 0) + &ptr) == 0) { + insp = (struct element_t *) ptr; + if (insp->last != NULL || insp->next != NULL) collate->cursor = insp; else @@ -3517,10 +3537,12 @@ error while adding equivalent collating symbol")); collation symbols since these are purely abstract values and don't need directions associated. */ struct element_t *seqp; + void *ptr; - if (find_entry (&collate->seq_table, symstr, symlen, - (void **) &seqp) == 0) + if (find_entry (&collate->seq_table, symstr, symlen, &ptr) == 0) { + seqp = ptr; + /* It's already defined. First check whether this is really a collating symbol. */ if (seqp->is_character) @@ -3561,8 +3583,9 @@ error while adding equivalent collating symbol")); { /* It is possible that we already have this collation sequence. In this case we move the entry. */ - struct element_t *seqp; + struct element_t *seqp = NULL; void *sym; + void *ptr; /* If the symbol after which we have to insert was not found ignore all entries. */ @@ -3572,17 +3595,19 @@ error while adding equivalent collating symbol")); break; } - if (find_entry (&collate->seq_table, symstr, symlen, - (void **) &seqp) == 0) - goto move_entry; + if (find_entry (&collate->seq_table, symstr, symlen, &ptr) == 0) + { + seqp = (struct element_t *) ptr; + goto move_entry; + } if (find_entry (&collate->sym_table, symstr, symlen, &sym) == 0 && (seqp = ((struct symbol_t *) sym)->order) != NULL) goto move_entry; - if (find_entry (&collate->elem_table, symstr, symlen, - (void **) &seqp) == 0 - && (seqp->last != NULL || seqp->next != NULL + if (find_entry (&collate->elem_table, symstr, symlen, &ptr) == 0 + && (seqp = (struct element_t *) ptr, + seqp->last != NULL || seqp->next != NULL || (collate->start != NULL && seqp == collate->start))) { move_entry: diff --git a/locale/programs/locfile.c b/locale/programs/locfile.c index 1e8e434..2eeed96 100644 --- a/locale/programs/locfile.c +++ b/locale/programs/locfile.c @@ -764,3 +764,63 @@ cannot create output file `%s' for category `%s'"), fname, category)); free (fname); } + + +/* General handling of `copy'. */ +void +handle_copy (struct linereader *ldfile, const struct charmap_t *charmap, + const char *repertoire_name, struct localedef_t *result, + enum token_t token, int locale, const char *locale_name, + int ignore_content) +{ + struct token *now; + int warned = 0; + + now = lr_token (ldfile, charmap, result, NULL, verbose); + if (now->tok != tok_string) + lr_error (ldfile, _("expect string argument for `copy'")); + else if (!ignore_content) + { + if (now->val.str.startmb == NULL) + lr_error (ldfile, _("\ +locale name should consist only of portable characters")); + else + { + (void) add_to_readlist (locale, now->val.str.startmb, + repertoire_name, 1, NULL); + result->copy_name[locale] = now->val.str.startmb; + } + } + + lr_ignore_rest (ldfile, now->tok == tok_string); + + /* The rest of the line must be empty and the next keyword must be + `END xxx'. */ + while ((now = lr_token (ldfile, charmap, result, NULL, verbose))->tok + != tok_end && now->tok != tok_eof) + { + if (warned == 0) + { + lr_error (ldfile, _("\ +no other keyword shall be specified when `copy' is used")); + warned = 1; + } + + lr_ignore_rest (ldfile, 0); + } + + if (now->tok != tok_eof) + { + /* Handle `END xxx'. */ + now = lr_token (ldfile, charmap, result, NULL, verbose); + + if (now->tok != token) + lr_error (ldfile, _("\ +`%1$s' definition does not end with `END %1$s'"), locale_name); + + lr_ignore_rest (ldfile, now->tok == token); + } + else + /* When we come here we reached the end of the file. */ + lr_error (ldfile, _("%s: premature end of file"), locale_name); +} diff --git a/locale/programs/locfile.h b/locale/programs/locfile.h index 2e96c62..db34f46 100644 --- a/locale/programs/locfile.h +++ b/locale/programs/locfile.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1996-2001, 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@gnu.org>, 1996. @@ -45,64 +45,12 @@ struct locale_file /* General handling of `copy'. */ -static inline void -handle_copy (struct linereader *ldfile, const struct charmap_t *charmap, - const char *repertoire_name, struct localedef_t *result, - enum token_t token, int locale, const char *locale_name, - int ignore_content) -{ - struct token *now; - int warned = 0; - - now = lr_token (ldfile, charmap, result, NULL, verbose); - if (now->tok != tok_string) - lr_error (ldfile, _("expect string argument for `copy'")); - else if (!ignore_content) - { - if (now->val.str.startmb == NULL) - lr_error (ldfile, _("\ -locale name should consist only of portable characters")); - else - { - (void) add_to_readlist (locale, now->val.str.startmb, - repertoire_name, 1, NULL); - result->copy_name[locale] = now->val.str.startmb; - } - } - - lr_ignore_rest (ldfile, now->tok == tok_string); - - /* The rest of the line must be empty and the next keyword must be - `END xxx'. */ - while ((now = lr_token (ldfile, charmap, result, NULL, verbose))->tok - != tok_end && now->tok != tok_eof) - { - if (warned == 0) - { - lr_error (ldfile, _("\ -no other keyword shall be specified when `copy' is used")); - warned = 1; - } - - lr_ignore_rest (ldfile, 0); - } - - if (now->tok != tok_eof) - { - /* Handle `END xxx'. */ - now = lr_token (ldfile, charmap, result, NULL, verbose); - - if (now->tok != token) - lr_error (ldfile, _("\ -`%1$s' definition does not end with `END %1$s'"), locale_name); - - lr_ignore_rest (ldfile, now->tok == token); - } - else - /* When we come here we reached the end of the file. */ - lr_error (ldfile, _("%s: premature end of file"), locale_name); -} - +extern void handle_copy (struct linereader *ldfile, + const struct charmap_t *charmap, + const char *repertoire_name, + struct localedef_t *result, enum token_t token, + int locale, const char *locale_name, + int ignore_content); /* Found in locfile.c. */ extern int locfile_read (struct localedef_t *result, diff --git a/locale/weightwc.h b/locale/weightwc.h index 649b7a7..9957893 100644 --- a/locale/weightwc.h +++ b/locale/weightwc.h @@ -27,7 +27,7 @@ findidx (const wint_t **cpp) wint_t ch; ch = *(*cpp)++; - i = collidx_table_lookup ((const char *) table, ch); + i = __collidx_table_lookup ((const char *) table, ch); if (i >= 0) /* This is an index into the weight table. Cool. */ diff --git a/nss/getent.c b/nss/getent.c index aed346c..d346f86 100644 --- a/nss/getent.c +++ b/nss/getent.c @@ -229,7 +229,7 @@ group_keys (int number, char *key[]) } /* This is for hosts */ -static inline void +static void print_hosts (struct hostent *host) { unsigned int cnt; @@ -396,7 +396,7 @@ netgroup_keys (int number, char *key[]) } /* This is for networks */ -static inline void +static void print_networks (struct netent *net) { unsigned int i; @@ -691,7 +691,7 @@ services_keys (int number, char *key[]) } /* This is for shadow */ -static inline void +static void print_shadow (struct spwd *sp) { printf ("%s:%s:", @@ -791,7 +791,7 @@ parse_option (int key, char *arg, struct argp_state *state) } /* build doc */ -static inline void +static void build_doc (void) { int i, j, len; diff --git a/nss/nss_files/files-parse.c b/nss/nss_files/files-parse.c index 1800d36..7d1e232 100644 --- a/nss/nss_files/files-parse.c +++ b/nss/nss_files/files-parse.c @@ -67,7 +67,7 @@ struct parser_data #ifdef ENTDATA /* The function can't be exported, because the entdata structure is defined only in files-foo.c. */ -# define parser_stclass static inline +# define parser_stclass static # define nss_files_parse_hidden_def(name) #else /* Export the line parser function so it can be used in nss_db. */ diff --git a/posix/fnmatch_loop.c b/posix/fnmatch_loop.c index 8c0b06b..0c14d45 100644 --- a/posix/fnmatch_loop.c +++ b/posix/fnmatch_loop.c @@ -622,7 +622,7 @@ FCT (pattern, string, string_end, no_leading_period, flags) # ifdef WIDE_CHAR_VERSION /* Search in the `names' array for the characters. */ - fcollseq = collseq_table_lookup (collseq, fn); + fcollseq = __collseq_table_lookup (collseq, fn); if (fcollseq == ~((uint32_t) 0)) /* XXX We don't know anything about the character we are supposed to match. This means we are @@ -632,7 +632,7 @@ FCT (pattern, string, string_end, no_leading_period, flags) if (is_seqval) lcollseq = cold; else - lcollseq = collseq_table_lookup (collseq, cold); + lcollseq = __collseq_table_lookup (collseq, cold); # else fcollseq = collseq[fn]; lcollseq = is_seqval ? cold : collseq[(UCHAR) cold]; @@ -794,7 +794,7 @@ FCT (pattern, string, string_end, no_leading_period, flags) { # ifdef WIDE_CHAR_VERSION hcollseq = - collseq_table_lookup (collseq, cend); + __collseq_table_lookup (collseq, cend); if (hcollseq == ~((uint32_t) 0)) { /* Hum, no information about the upper diff --git a/posix/regcomp.c b/posix/regcomp.c index 007bd77..61e32c9 100644 --- a/posix/regcomp.c +++ b/posix/regcomp.c @@ -291,6 +291,7 @@ weak_alias (__re_compile_fastmap, re_compile_fastmap) #endif static inline void +__attribute ((always_inline)) re_set_fastmap (char *fastmap, int icase, int ch) { fastmap[ch] = 1; @@ -2515,6 +2516,7 @@ parse_bracket_exp (regexp, dfa, token, syntax, err) Return the index of the symbol in the SYMB_TABLE. */ static inline int32_t + __attribute ((always_inline)) seek_collating_symbol_entry (name, name_len) const unsigned char *name; size_t name_len; @@ -2547,6 +2549,7 @@ parse_bracket_exp (regexp, dfa, token, syntax, err) Return the value if succeeded, UINT_MAX otherwise. */ static inline unsigned int + __attribute ((always_inline)) lookup_collation_sequence_value (br_elem) bracket_elem_t *br_elem; { @@ -2560,12 +2563,12 @@ parse_bracket_exp (regexp, dfa, token, syntax, err) else { wint_t wc = __btowc (br_elem->opr.ch); - return collseq_table_lookup (collseqwc, wc); + return __collseq_table_lookup (collseqwc, wc); } } else if (br_elem->type == MB_CHAR) { - return collseq_table_lookup (collseqwc, br_elem->opr.wch); + return __collseq_table_lookup (collseqwc, br_elem->opr.wch); } else if (br_elem->type == COLL_SYM) { @@ -2614,6 +2617,7 @@ parse_bracket_exp (regexp, dfa, token, syntax, err) update it. */ static inline reg_errcode_t + __attribute ((always_inline)) # ifdef RE_ENABLE_I18N build_range_exp (sbcset, mbcset, range_alloc, start_elem, end_elem) re_charset_t *mbcset; @@ -2686,7 +2690,7 @@ parse_bracket_exp (regexp, dfa, token, syntax, err) if (nrules == 0) ch_collseq = collseqmb[ch]; else - ch_collseq = collseq_table_lookup (collseqwc, __btowc (ch)); + ch_collseq = __collseq_table_lookup (collseqwc, __btowc (ch)); if (start_collseq <= ch_collseq && ch_collseq <= end_collseq) bitset_set (sbcset, ch); } @@ -2700,6 +2704,7 @@ parse_bracket_exp (regexp, dfa, token, syntax, err) pointer argument sinse we may update it. */ static inline reg_errcode_t + __attribute ((always_inline)) # ifdef RE_ENABLE_I18N build_collating_symbol (sbcset, mbcset, coll_sym_alloc, name) re_charset_t *mbcset; diff --git a/posix/regexec.c b/posix/regexec.c index 9ade27a..277c935 100644 --- a/posix/regexec.c +++ b/posix/regexec.c @@ -50,10 +50,10 @@ static int re_search_stub (struct re_pattern_buffer *bufp, int ret_len); static unsigned re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, int nregs, int regs_allocated); -static inline re_dfastate_t *acquire_init_state_context (reg_errcode_t *err, - const regex_t *preg, - const re_match_context_t *mctx, - int idx); +static re_dfastate_t *acquire_init_state_context (reg_errcode_t *err, + const regex_t *preg, + const re_match_context_t *mctx, + int idx); static reg_errcode_t prune_impossible_nodes (const regex_t *preg, re_match_context_t *mctx); static int check_matching (const regex_t *preg, re_match_context_t *mctx, @@ -906,7 +906,7 @@ prune_impossible_nodes (preg, mctx) We must select appropriate initial state depending on the context, since initial states may have constraints like "\<", "^", etc.. */ -static inline re_dfastate_t * +static re_dfastate_t * acquire_init_state_context (err, preg, mctx, idx) reg_errcode_t *err; const regex_t *preg; @@ -1507,7 +1507,7 @@ sift_states_backward (preg, mctx, sctx) /* Helper functions. */ -static inline reg_errcode_t +static reg_errcode_t clean_state_log_if_need (mctx, next_state_log_idx) re_match_context_t *mctx; int next_state_log_idx; @@ -3528,7 +3528,7 @@ check_node_accept_bytes (preg, node_idx, input, str_idx) if (elem_len <= char_len) { collseqwc = _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQWC); - in_collseq = collseq_table_lookup (collseqwc, wc); + in_collseq = __collseq_table_lookup (collseqwc, wc); } else in_collseq = find_collation_sequence_value (pin, elem_len); diff --git a/resolv/res_send.c b/resolv/res_send.c index d237c9a..19adc3e 100644 --- a/resolv/res_send.c +++ b/resolv/res_send.c @@ -108,63 +108,46 @@ static const char rcsid[] = "$BINDId: res_send.c,v 8.38 2000/03/30 20:16:51 vixi /* From ev_streams.c. */ -static inline struct iovec -evConsIovec(void *buf, size_t cnt) { - struct iovec ret; - - memset(&ret, 0xf5, sizeof ret); - ret.iov_base = buf; - ret.iov_len = cnt; - return (ret); +static inline void +__attribute ((always_inline)) +evConsIovec(void *buf, size_t cnt, struct iovec *vec) { + memset(vec, 0xf5, sizeof (*vec)); + vec->iov_base = buf; + vec->iov_len = cnt; } /* From ev_timers.c. */ #define BILLION 1000000000 -static inline struct timespec -evTimeSpec(struct timeval tv) { - struct timespec ts; - - ts.tv_sec = tv.tv_sec; - ts.tv_nsec = tv.tv_usec * 1000; - return (ts); -} - -static inline struct timespec -evConsTime(time_t sec, long nsec) { - struct timespec x; - - x.tv_sec = sec; - x.tv_nsec = nsec; - return (x); +static inline void +evConsTime(struct timespec *res, time_t sec, long nsec) { + res->tv_sec = sec; + res->tv_nsec = nsec; } -static inline struct timespec -evAddTime(struct timespec addend1, struct timespec addend2) { - struct timespec x; - - x.tv_sec = addend1.tv_sec + addend2.tv_sec; - x.tv_nsec = addend1.tv_nsec + addend2.tv_nsec; - if (x.tv_nsec >= BILLION) { - x.tv_sec++; - x.tv_nsec -= BILLION; +static inline void +evAddTime(struct timespec *res, const struct timespec *addend1, + const struct timespec *addend2) { + res->tv_sec = addend1->tv_sec + addend2->tv_sec; + res->tv_nsec = addend1->tv_nsec + addend2->tv_nsec; + if (res->tv_nsec >= BILLION) { + res->tv_sec++; + res->tv_nsec -= BILLION; } - return (x); } -static inline struct timespec -evSubTime(struct timespec minuend, struct timespec subtrahend) { - struct timespec x; - - x.tv_sec = minuend.tv_sec - subtrahend.tv_sec; - if (minuend.tv_nsec >= subtrahend.tv_nsec) - x.tv_nsec = minuend.tv_nsec - subtrahend.tv_nsec; +static inline void +evSubTime(struct timespec *res, const struct timespec *minuend, + const struct timespec *subtrahend) { + res->tv_sec = minuend->tv_sec - subtrahend->tv_sec; + if (minuend->tv_nsec >= subtrahend->tv_nsec) + res->tv_nsec = minuend->tv_nsec - subtrahend->tv_nsec; else { - x.tv_nsec = BILLION - subtrahend.tv_nsec + minuend.tv_nsec; - x.tv_sec--; + res->tv_nsec = (BILLION + - subtrahend->tv_nsec + minuend->tv_nsec); + res->tv_sec--; } - return (x); } static inline int @@ -176,13 +159,14 @@ evCmpTime(struct timespec a, struct timespec b) { return (x < 0L ? (-1) : x > 0L ? (1) : (0)); } -static inline struct timespec -evNowTime() { +static inline void +evNowTime(struct timespec *res) { struct timeval now; if (gettimeofday(&now, NULL) < 0) - return (evConsTime(0, 0)); - return (evTimeSpec(now)); + evConsTime(res, 0, 0); + else + TIMEVAL_TO_TIMESPEC (&now, res); } #endif @@ -561,9 +545,11 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen, res_sendhookact act; #ifdef _LIBC - act = (*statp->qhook)((struct sockaddr_in **) - &nsap, &buf, &buflen, + struct sockaddr_in *nsap4; + nsap4 = (struct sockaddr_in *) nsap; + act = (*statp->qhook)(&nsap4, &buf, &buflen, ans, anssiz, &resplen); + nsap = (struct sockaddr_in6 *) nsap4; #else act = (*statp->qhook)(&nsap, &buf, &buflen, ans, anssiz, &resplen); @@ -768,9 +754,10 @@ send_vc(res_state statp, * Send length & message */ putshort((u_short)buflen, (u_char*)&len); - iov[0] = evConsIovec(&len, INT16SZ); - iov[1] = evConsIovec((void*)buf, buflen); - if (writev(statp->_vcsock, iov, 2) != (INT16SZ + buflen)) { + evConsIovec(&len, INT16SZ, &iov[0]); + evConsIovec((void*)buf, buflen, &iov[1]); + if (TEMP_FAILURE_RETRY (writev(statp->_vcsock, iov, 2)) + != (INT16SZ + buflen)) { *terrno = errno; Perror(statp, stderr, "write failed", errno); res_nclose(statp); @@ -782,7 +769,8 @@ send_vc(res_state statp, read_len: cp = ans; len = INT16SZ; - while ((n = read(statp->_vcsock, (char *)cp, (int)len)) > 0) { + while ((n = TEMP_FAILURE_RETRY (read(statp->_vcsock, (char *)cp, + (int)len))) > 0) { cp += n; if ((len -= n) <= 0) break; @@ -998,9 +986,9 @@ send_dg(res_state statp, seconds /= statp->nscount; if (seconds <= 0) seconds = 1; - now = evNowTime(); - timeout = evConsTime(seconds, 0); - finish = evAddTime(now, timeout); + evNowTime(&now); + evConsTime(&timeout, seconds, 0); + evAddTime(&finish, &now, &timeout); wait: #ifdef _LIBC /* Convert struct timespec in milliseconds. */ @@ -1021,9 +1009,9 @@ send_dg(res_state statp, } if (n < 0) { if (errno == EINTR) { - now = evNowTime(); + evNowTime(&now); if (evCmpTime(finish, now) > 0) { - timeout = evSubTime(finish, now); + evSubTime(&timeout, &finish, &now); goto wait; } } @@ -1244,7 +1232,7 @@ pselect(int nfds, void *rfds, void *wfds, void *efds, if (sigmask) sigprocmask(SIG_SETMASK, &sigs, NULL); if (tsp) - *tsp = evTimeSpec(tv); + TIMEVAL_TO_TIMESPEC (tv, *tsp); return (n); } #endif diff --git a/sysdeps/unix/sysv/linux/i386/dl-procinfo.h b/sysdeps/unix/sysv/linux/i386/dl-procinfo.h index 1c09a0d..3ffca4a 100644 --- a/sysdeps/unix/sysv/linux/i386/dl-procinfo.h +++ b/sysdeps/unix/sysv/linux/i386/dl-procinfo.h @@ -1,5 +1,5 @@ /* Linux/i386 version of processor capability information handling macros. - Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1998-2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. @@ -97,7 +97,7 @@ enum }; static inline int -__attribute__ ((unused)) +__attribute__ ((unused, always_inline)) _dl_string_hwcap (const char *str) { int i; @@ -112,7 +112,7 @@ _dl_string_hwcap (const char *str) static inline int -__attribute__ ((unused)) +__attribute__ ((unused, always_inline)) _dl_string_platform (const char *str) { int i; diff --git a/sysdeps/unix/sysv/linux/ifreq.c b/sysdeps/unix/sysv/linux/ifreq.c index ad408df..5ab5b06 100644 --- a/sysdeps/unix/sysv/linux/ifreq.c +++ b/sysdeps/unix/sysv/linux/ifreq.c @@ -19,6 +19,13 @@ #include "ifreq.h" +/* Variable to signal whether SIOCGIFCONF is not available. */ +#if __ASSUME_SIOCGIFNAME == 0 || 1 +static int old_siocgifconf; +#else +# define old_siocgifconf 0 +#endif + void __ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd) diff --git a/sysdeps/unix/sysv/linux/ifreq.h b/sysdeps/unix/sysv/linux/ifreq.h index 9e4f662..b92e063 100644 --- a/sysdeps/unix/sysv/linux/ifreq.h +++ b/sysdeps/unix/sysv/linux/ifreq.h @@ -25,13 +25,6 @@ #include <sys/ioctl.h> #include "kernel-features.h" -/* Variable to signal whether SIOCGIFCONF is not available. */ -#if __ASSUME_SIOCGIFNAME == 0 || 1 -static int old_siocgifconf; -#else -# define old_siocgifconf 0 -#endif - extern void __ifreq (struct ifreq **ifreqs, int *num_ifs, int sockfd); diff --git a/wctype/wchar-lookup.h b/wctype/wchar-lookup.h index ac66a5d..74d9c8f 100644 --- a/wctype/wchar-lookup.h +++ b/wctype/wchar-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. @@ -49,6 +49,7 @@ */ static __inline int +__attribute ((always_inline)) wctype_table_lookup (const char *table, uint32_t wc) { uint32_t shift1 = ((const uint32_t *) table)[0]; @@ -80,6 +81,7 @@ wctype_table_lookup (const char *table, uint32_t wc) unit is a single byte, and no 5 bits are used as a word index. */ static __inline int +__attribute ((always_inline)) wcwidth_table_lookup (const char *table, uint32_t wc) { uint32_t shift1 = ((const uint32_t *) table)[0]; @@ -113,6 +115,7 @@ wcwidth_table_lookup (const char *table, uint32_t wc) bits are used as a word index. */ static __inline uint32_t +__attribute ((always_inline)) wctrans_table_lookup (const char *table, uint32_t wc) { uint32_t shift1 = ((const uint32_t *) table)[0]; |