From 03ea4328ae1ea7e985f7fd9a42ebf77bc64bd47c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 20 Nov 2012 22:25:10 -0800 Subject: [PATCH] regex: no 'static inline' * lib/regex_internal.c (calc_state_hash): * lib/regex_internal.h (bitset_set, bitset_clear, bitset_contain) (bitset_empty, bitset_set_all, bitset_copy, bitset_not, bitset_merge) (bitset_mask, re_string_char_size_at, re_string_wchar_at): Now static, not static inline. (inline) [__GNUC__ < 3 && _LIBC]: Remove macro; no longer needed. --- ChangeLog | 9 +++++++++ lib/regex_internal.c | 2 +- lib/regex_internal.h | 29 +++++++++++++---------------- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 77836fd6d..4d2fce3de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2012-11-29 Paul Eggert + regex: no 'static inline' + * lib/regex_internal.c (calc_state_hash): + * lib/regex_internal.h (bitset_set, bitset_clear, bitset_contain) + (bitset_empty, bitset_set_all, bitset_copy, bitset_not, bitset_merge) + (bitset_mask, re_string_char_size_at, re_string_wchar_at): + Now static, not static inline. + (inline) [__GNUC__ < 3 && _LIBC]: + Remove macro; no longer needed. + xvasprintf: no 'static inline' * lib/xvasprintf.c (xstrcat): Now static, not static inline. diff --git a/lib/regex_internal.c b/lib/regex_internal.c index 7e8c1bc25..7bb64354f 100644 --- a/lib/regex_internal.c +++ b/lib/regex_internal.c @@ -1454,7 +1454,7 @@ re_dfa_add_node (re_dfa_t *dfa, re_token_t token) return dfa->nodes_len++; } -static inline re_hashval_t +static re_hashval_t internal_function calc_state_hash (const re_node_set *nodes, unsigned int context) { diff --git a/lib/regex_internal.h b/lib/regex_internal.h index 2b9f69756..a8362ed1d 100644 --- a/lib/regex_internal.h +++ b/lib/regex_internal.h @@ -83,9 +83,6 @@ # define BE(expr, val) __builtin_expect (expr, val) #else # define BE(expr, val) (expr) -# ifdef _LIBC -# define inline -# endif #endif /* Number of ASCII characters. */ @@ -727,33 +724,33 @@ typedef struct } bracket_elem_t; -/* Inline functions for bitset_t operation. */ +/* Functions for bitset_t operation. */ -static inline void +static void bitset_set (bitset_t set, Idx i) { set[i / BITSET_WORD_BITS] |= (bitset_word_t) 1 << i % BITSET_WORD_BITS; } -static inline void +static void bitset_clear (bitset_t set, Idx i) { set[i / BITSET_WORD_BITS] &= ~ ((bitset_word_t) 1 << i % BITSET_WORD_BITS); } -static inline bool +static bool bitset_contain (const bitset_t set, Idx i) { return (set[i / BITSET_WORD_BITS] >> i % BITSET_WORD_BITS) & 1; } -static inline void +static void bitset_empty (bitset_t set) { memset (set, '\0', sizeof (bitset_t)); } -static inline void +static void bitset_set_all (bitset_t set) { memset (set, -1, sizeof (bitset_word_t) * (SBC_MAX / BITSET_WORD_BITS)); @@ -762,13 +759,13 @@ bitset_set_all (bitset_t set) ((bitset_word_t) 1 << SBC_MAX % BITSET_WORD_BITS) - 1; } -static inline void +static void bitset_copy (bitset_t dest, const bitset_t src) { memcpy (dest, src, sizeof (bitset_t)); } -static inline void +static void bitset_not (bitset_t set) { int bitset_i; @@ -780,7 +777,7 @@ bitset_not (bitset_t set) & ~set[BITSET_WORDS - 1]); } -static inline void +static void bitset_merge (bitset_t dest, const bitset_t src) { int bitset_i; @@ -788,7 +785,7 @@ bitset_merge (bitset_t dest, const bitset_t src) dest[bitset_i] |= src[bitset_i]; } -static inline void +static void bitset_mask (bitset_t dest, const bitset_t src) { int bitset_i; @@ -797,8 +794,8 @@ bitset_mask (bitset_t dest, const bitset_t src) } #ifdef RE_ENABLE_I18N -/* Inline functions for re_string. */ -static inline int +/* Functions for re_string. */ +static int internal_function __attribute ((pure)) re_string_char_size_at (const re_string_t *pstr, Idx idx) { @@ -811,7 +808,7 @@ re_string_char_size_at (const re_string_t *pstr, Idx idx) return byte_idx; } -static inline wint_t +static wint_t internal_function __attribute ((pure)) re_string_wchar_at (const re_string_t *pstr, Idx idx) { -- 2.11.0