From 3af956aefeb791864e317142d848f6a58cf10f49 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 26 Aug 2005 21:47:51 +0000 Subject: [PATCH] * config/srclist.text: Add glibc bug 1248. * lib/regex_internal.h: Remove all references to RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89 or better. (bitset_not, bitset_merge, bitset_not_merge): (bitset_mask, re_string_allocate, re_string_construct): (re_string_reconstruct, re_string_destruct, re_string_elem_size_at): (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case): (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1): (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect): (re_node_set_init_union, re_node_set_merge, re_node_set_insert): (re_node_set_insert_last, re_node_set_compare, re_node_set_contains): (re_node_set_remove_at, re_dfa_add_node, re_acquire_state): (re_acquire_state_context): Remove unnecessary forward decls. (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at): Put __attribute at function definition, now that the function decl has been removed. * lib/regex_internal.c (re_string_peek_byte_case): (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains): Likewise. --- config/srclist.txt | 4 ++- lib/ChangeLog | 23 +++++++++++++++ lib/regex_internal.c | 8 ++--- lib/regex_internal.h | 70 ++++---------------------------------------- 4 files changed, 35 insertions(+), 70 deletions(-) diff --git a/config/srclist.txt b/config/srclist.txt index c6ddaf8a91..1f31dba118 100644 --- a/config/srclist.txt +++ b/config/srclist.txt @@ -1,4 +1,4 @@ -# $Id: srclist.txt,v 1.87 2005-08-26 05:58:54 eggert Exp $ +# $Id: srclist.txt,v 1.88 2005-08-26 21:47:51 eggert Exp $ # Files for which we are not the source. See ./srclistvars.sh for the # variable definitions. @@ -123,6 +123,7 @@ $LIBCSRC/stdlib/getsubopt.c lib gpl # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1231 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1237 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1241 +# http://sources.redhat.com/bugzilla/show_bug.cgi?id=1248 #$LIBCSRC/posix/regex_internal.c lib gpl # # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1054 @@ -130,6 +131,7 @@ $LIBCSRC/stdlib/getsubopt.c lib gpl # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1237 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1241 # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1245 +# http://sources.redhat.com/bugzilla/show_bug.cgi?id=1248 #$LIBCSRC/posix/regex_internal.h lib gpl # # http://sources.redhat.com/bugzilla/show_bug.cgi?id=1216 diff --git a/lib/ChangeLog b/lib/ChangeLog index 3f5ceb9dbf..94219b6d8f 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,26 @@ +2005-08-26 Paul Eggert + + * regex_internal.h: Remove all references to + RE_NO_INTERNAL_PROTOTYPES; no longer neeeded now that we assume C89 + or better. + (bitset_not, bitset_merge, bitset_not_merge): + (bitset_mask, re_string_allocate, re_string_construct): + (re_string_reconstruct, re_string_destruct, re_string_elem_size_at): + (re_string_char_size_at, re_string_wchar_at, re_string_peek_byte_case): + (re_string_fetch_byte_case, re_node_set_alloc, re_node_set_init_1): + (re_node_set_init_2, re_node_set_init_copy, re_node_set_add_intersect): + (re_node_set_init_union, re_node_set_merge, re_node_set_insert): + (re_node_set_insert_last, re_node_set_compare, re_node_set_contains): + (re_node_set_remove_at, re_dfa_add_node, re_acquire_state): + (re_acquire_state_context): + Remove unnecessary forward decls. + (re_string_char_size_at, re_string_wchar_at, re_string_elem_size_at): + Put __attribute at function definition, + now that the function decl has been removed. + * lib/regex_internal.c (re_string_peek_byte_case): + (re_string_fetch_byte_case, re_node_set_compare, re_node_set_contains): + Likewise. + 2005-08-26 Simon Josefsson * getpass.c: Use _WIN32 instead of WIN32, suggested by Bruno diff --git a/lib/regex_internal.c b/lib/regex_internal.c index 7eed8c5934..47a45018af 100644 --- a/lib/regex_internal.c +++ b/lib/regex_internal.c @@ -731,7 +731,7 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags) } static unsigned char -internal_function +internal_function __attribute ((pure)) re_string_peek_byte_case (const re_string_t *pstr, int idx) { int ch, off; @@ -767,7 +767,7 @@ re_string_peek_byte_case (const re_string_t *pstr, int idx) } static unsigned char -internal_function +internal_function __attribute ((pure)) re_string_fetch_byte_case (re_string_t *pstr) { if (BE (!pstr->mbs_allocated, 1)) @@ -1253,7 +1253,7 @@ re_node_set_insert_last (re_node_set *set, int elem) return 1 if SET1 and SET2 are equivalent, return 0 otherwise. */ static int -internal_function +internal_function __attribute ((pure)) re_node_set_compare (const re_node_set *set1, const re_node_set *set2) { int i; @@ -1268,7 +1268,7 @@ re_node_set_compare (const re_node_set *set1, const re_node_set *set2) /* Return (idx + 1) if SET contains the element ELEM, return 0 otherwise. */ static int -internal_function +internal_function __attribute ((pure)) re_node_set_contains (const re_node_set *set, int elem) { unsigned int idx, right, mid; diff --git a/lib/regex_internal.h b/lib/regex_internal.h index 4a7ee91970..cadafddff9 100644 --- a/lib/regex_internal.h +++ b/lib/regex_internal.h @@ -139,10 +139,6 @@ typedef const unsigned int *re_const_bitset_ptr_t; memset (set, 255, sizeof (unsigned int) * BITSET_UINTS) #define bitset_copy(dest,src) \ memcpy (dest, src, sizeof (unsigned int) * BITSET_UINTS) -static inline void bitset_not (bitset set); -static inline void bitset_merge (bitset dest, const bitset src); -static inline void bitset_not_merge (bitset dest, const bitset src); -static inline void bitset_mask (bitset dest, const bitset src); #define PREV_WORD_CONSTRAINT 0x0001 #define PREV_NOTWORD_CONSTRAINT 0x0002 @@ -375,17 +371,6 @@ typedef struct re_dfa_t re_dfa_t; # endif #endif -static reg_errcode_t re_string_allocate (re_string_t *pstr, const char *str, - int len, int init_len, - REG_TRANSLATE_TYPE trans, int icase, - const re_dfa_t *dfa) - internal_function; -static reg_errcode_t re_string_construct (re_string_t *pstr, const char *str, - int len, REG_TRANSLATE_TYPE trans, - int icase, const re_dfa_t *dfa) - internal_function; -static reg_errcode_t re_string_reconstruct (re_string_t *pstr, int idx, - int eflags) internal_function; static reg_errcode_t re_string_realloc_buffers (re_string_t *pstr, int new_buf_len) internal_function; @@ -396,23 +381,9 @@ static reg_errcode_t build_wcs_upper_buffer (re_string_t *pstr) #endif /* RE_ENABLE_I18N */ static void build_upper_buffer (re_string_t *pstr) internal_function; static void re_string_translate_buffer (re_string_t *pstr) internal_function; -static void re_string_destruct (re_string_t *pstr) internal_function; -#ifdef RE_ENABLE_I18N -static int re_string_elem_size_at (const re_string_t *pstr, int idx) - internal_function __attribute ((pure)); -static inline int re_string_char_size_at (const re_string_t *pstr, int idx) - internal_function __attribute ((pure)); -static inline wint_t re_string_wchar_at (const re_string_t *pstr, int idx) - internal_function __attribute ((pure)); -#endif /* RE_ENABLE_I18N */ static unsigned int re_string_context_at (const re_string_t *input, int idx, int eflags) internal_function __attribute ((pure)); -static unsigned char re_string_peek_byte_case (const re_string_t *pstr, - int idx) - internal_function __attribute ((pure)); -static unsigned char re_string_fetch_byte_case (re_string_t *pstr) - internal_function __attribute ((pure)); #define re_string_peek_byte(pstr, offset) \ ((pstr)->mbs[(pstr)->cur_idx + offset]) @@ -675,44 +646,13 @@ struct re_dfa_t __libc_lock_define (, lock) }; -#ifndef RE_NO_INTERNAL_PROTOTYPES -static reg_errcode_t re_node_set_alloc (re_node_set *set, int size) internal_function; -static reg_errcode_t re_node_set_init_1 (re_node_set *set, int elem) internal_function; -static reg_errcode_t re_node_set_init_2 (re_node_set *set, int elem1, - int elem2) internal_function; #define re_node_set_init_empty(set) memset (set, '\0', sizeof (re_node_set)) -static reg_errcode_t re_node_set_init_copy (re_node_set *dest, - const re_node_set *src) internal_function; -static reg_errcode_t re_node_set_add_intersect (re_node_set *dest, - const re_node_set *src1, - const re_node_set *src2) internal_function; -static reg_errcode_t re_node_set_init_union (re_node_set *dest, - const re_node_set *src1, - const re_node_set *src2) internal_function; -static reg_errcode_t re_node_set_merge (re_node_set *dest, - const re_node_set *src) internal_function; -static int re_node_set_insert (re_node_set *set, int elem) internal_function; -static int re_node_set_insert_last (re_node_set *set, - int elem) internal_function; -static int re_node_set_compare (const re_node_set *set1, - const re_node_set *set2) - internal_function __attribute ((pure)); -static int re_node_set_contains (const re_node_set *set, int elem) - internal_function __attribute ((pure)); -static void re_node_set_remove_at (re_node_set *set, int idx) internal_function; #define re_node_set_remove(set,id) \ (re_node_set_remove_at (set, re_node_set_contains (set, id) - 1)) #define re_node_set_empty(p) ((p)->nelem = 0) #define re_node_set_free(set) re_free ((set)->elems) -static int re_dfa_add_node (re_dfa_t *dfa, re_token_t token) internal_function; -static re_dfastate_t *re_acquire_state (reg_errcode_t *err, re_dfa_t *dfa, - const re_node_set *nodes) internal_function; -static re_dfastate_t *re_acquire_state_context (reg_errcode_t *err, - re_dfa_t *dfa, - const re_node_set *nodes, - unsigned int context) internal_function; + static void free_state (re_dfastate_t *state) internal_function; -#endif typedef enum @@ -769,10 +709,10 @@ bitset_mask (bitset dest, const bitset src) dest[bitset_i] &= src[bitset_i]; } -#if defined RE_ENABLE_I18N && !defined RE_NO_INTERNAL_PROTOTYPES +#if defined RE_ENABLE_I18N /* Inline functions for re_string. */ static inline int -internal_function +internal_function __attribute ((pure)) re_string_char_size_at (const re_string_t *pstr, int idx) { int byte_idx; @@ -785,7 +725,7 @@ re_string_char_size_at (const re_string_t *pstr, int idx) } static inline wint_t -internal_function +internal_function __attribute ((pure)) re_string_wchar_at (const re_string_t *pstr, int idx) { if (pstr->mb_cur_max == 1) @@ -794,7 +734,7 @@ re_string_wchar_at (const re_string_t *pstr, int idx) } static int -internal_function +internal_function __attribute ((pure)) re_string_elem_size_at (const re_string_t *pstr, int idx) { #ifdef _LIBC -- 2.30.2