diff options
author | Carmelo Amoroso <carmelo.amoroso@st.com> | 2008-07-31 15:21:24 +0000 |
---|---|---|
committer | Carmelo Amoroso <carmelo.amoroso@st.com> | 2008-07-31 15:21:24 +0000 |
commit | dd7d7e3f138d1835d153c316f3d771e40dc641ba (patch) | |
tree | 7427232d1e9759028490f843152a83a4bbbab7db /libc/misc/regex | |
parent | 89ed2cccba266f7738ceb445e4d43103c08cbe75 (diff) | |
download | uClibc-alpine-dd7d7e3f138d1835d153c316f3d771e40dc641ba.tar.bz2 uClibc-alpine-dd7d7e3f138d1835d153c316f3d771e40dc641ba.tar.xz |
Synch with trunk at rev 22997.
Basically trailing whitespaces removal, fix non standard keywords
asm -> __asm__ inline -> __inline__ and some minor changes on trunk.
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'libc/misc/regex')
-rw-r--r-- | libc/misc/regex/regcomp.c | 32 | ||||
-rw-r--r-- | libc/misc/regex/regex_internal.c | 8 | ||||
-rw-r--r-- | libc/misc/regex/regex_internal.h | 12 | ||||
-rw-r--r-- | libc/misc/regex/regex_old.c | 44 | ||||
-rw-r--r-- | libc/misc/regex/regexec.c | 12 |
5 files changed, 54 insertions, 54 deletions
diff --git a/libc/misc/regex/regcomp.c b/libc/misc/regex/regcomp.c index 471ea55f0..210ae05ee 100644 --- a/libc/misc/regex/regcomp.c +++ b/libc/misc/regex/regcomp.c @@ -120,7 +120,7 @@ static bin_tree_t *duplicate_tree (const bin_tree_t *src, re_dfa_t *dfa); static void free_token (re_token_t *node); static reg_errcode_t free_tree (void *extra, bin_tree_t *node); static reg_errcode_t mark_opt_subexp (void *extra, bin_tree_t *node); - + /* This table gives an error message for each of the error codes listed in regex.h. Obviously the order here has to be same as there. POSIX doesn't require that we do anything for REG_NOERROR, @@ -200,7 +200,7 @@ const size_t __re_error_msgid_idx[] attribute_hidden = REG_ESIZE_IDX, REG_ERPAREN_IDX }; - + /* Entry points for GNU code. */ /* re_compile_pattern is the GNU regular expression compiler: it @@ -286,7 +286,7 @@ re_compile_fastmap (bufp) strong_alias(__re_compile_fastmap, re_compile_fastmap) #endif -static inline void +static __inline__ void __attribute ((always_inline)) re_set_fastmap (char *fastmap, int icase, int ch) { @@ -406,7 +406,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state, } } } - + /* Entry point for POSIX code. */ /* regcomp takes a regular expression as a string and compiles it. @@ -632,7 +632,7 @@ regfree (preg) #if defined _LIBC || defined __UCLIBC__ strong_alias(__regfree, regfree) #endif - + /* Entry points compatible with 4.2 BSD regex library. We don't define them unless specifically requested. */ @@ -701,7 +701,7 @@ libc_freeres_fn (free_mem) #endif #endif /* _REGEX_RE_COMP */ - + /* Internal entry point. Compile the regular expression PATTERN, whose length is LENGTH. SYNTAX indicate regular expression's syntax. */ @@ -1019,7 +1019,7 @@ create_initial_state (re_dfa_t *dfa) re_node_set_free (&init_nodes); return REG_NOERROR; } - + #ifdef RE_ENABLE_I18N /* If it is possible to do searching in single byte encoding instead of UTF-8 to speed things up, set dfa->mb_cur_max to 1, clear is_utf8 and change @@ -1089,7 +1089,7 @@ optimize_utf8 (re_dfa_t *dfa) dfa->has_mb_node = dfa->nbackref > 0 || has_period; } #endif - + /* Analyze the structure tree, and calculate "first", "next", "edest", "eclosure", and "inveclosure". */ @@ -1700,7 +1700,7 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, int node, int root) *new_set = eclosure; return REG_NOERROR; } - + /* Functions for token which are used in the parser. */ /* Fetch a token from INPUT. @@ -2037,7 +2037,7 @@ peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax) } return 1; } - + /* Functions for parser. */ /* Entry point of the parser. @@ -2721,7 +2721,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, Seek the collating symbol entry correspondings to NAME. Return the index of the symbol in the SYMB_TABLE. */ - auto inline int32_t + auto __inline__ int32_t __attribute ((always_inline)) seek_collating_symbol_entry (name, name_len) const unsigned char *name; @@ -2759,7 +2759,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, Look up the collation sequence value of BR_ELEM. Return the value if succeeded, UINT_MAX otherwise. */ - auto inline unsigned int + auto __inline__ unsigned int __attribute ((always_inline)) lookup_collation_sequence_value (br_elem) bracket_elem_t *br_elem; @@ -2827,7 +2827,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, mbcset->range_ends, is a pointer argument sinse we may update it. */ - auto inline reg_errcode_t + auto __inline__ reg_errcode_t __attribute ((always_inline)) build_range_exp (sbcset, mbcset, range_alloc, start_elem, end_elem) re_charset_t *mbcset; @@ -2910,7 +2910,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, COLL_SYM_ALLOC is the allocated size of mbcset->coll_sym, is a pointer argument sinse we may update it. */ - auto inline reg_errcode_t + auto __inline__ reg_errcode_t __attribute ((always_inline)) build_collating_symbol (sbcset, mbcset, coll_sym_alloc, name) re_charset_t *mbcset; @@ -3660,7 +3660,7 @@ fetch_number (re_string_t *input, re_token_t *token, reg_syntax_t syntax) } return num; } - + #ifdef RE_ENABLE_I18N static void free_charset (re_charset_t *cset) @@ -3676,7 +3676,7 @@ free_charset (re_charset_t *cset) re_free (cset); } #endif /* RE_ENABLE_I18N */ - + /* Functions for binary tree operation. */ /* Create a tree node. */ diff --git a/libc/misc/regex/regex_internal.c b/libc/misc/regex/regex_internal.c index fa0b336e8..11b1be7c2 100644 --- a/libc/misc/regex/regex_internal.c +++ b/libc/misc/regex/regex_internal.c @@ -29,7 +29,7 @@ static re_dfastate_t *create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes, unsigned int context, unsigned int hash) internal_function; - + /* Functions for string operation. */ /* This function allocate the buffers. It is necessary to call @@ -873,7 +873,7 @@ re_string_context_at (const re_string_t *input, int idx, int eflags) return IS_NEWLINE (c) && input->newline_anchor ? CONTEXT_NEWLINE : 0; } } - + /* Functions for set operation. */ static reg_errcode_t @@ -1314,7 +1314,7 @@ re_node_set_remove_at (re_node_set *set, int idx) for (; idx < set->nelem; idx++) set->elems[idx] = set->elems[idx + 1]; } - + /* Add the token TOKEN to dfa->nodes, and return the index of the token. Or return -1, if an error will be occured. */ @@ -1366,7 +1366,7 @@ re_dfa_add_node (re_dfa_t *dfa, re_token_t token) return dfa->nodes_len++; } -static inline unsigned int +static __inline__ unsigned int internal_function calc_state_hash (const re_node_set *nodes, unsigned int context) { diff --git a/libc/misc/regex/regex_internal.h b/libc/misc/regex/regex_internal.h index af38acc42..725e33a5a 100644 --- a/libc/misc/regex/regex_internal.h +++ b/libc/misc/regex/regex_internal.h @@ -656,7 +656,7 @@ struct re_dfa_t (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) - + typedef enum { @@ -682,7 +682,7 @@ typedef struct /* Inline functions for bitset operation. */ -static inline void +static __inline__ void bitset_not (bitset_t set) { int bitset_i; @@ -690,7 +690,7 @@ bitset_not (bitset_t set) set[bitset_i] = ~set[bitset_i]; } -static inline void +static __inline__ void bitset_merge (bitset_t dest, const bitset_t src) { int bitset_i; @@ -698,7 +698,7 @@ bitset_merge (bitset_t dest, const bitset_t src) dest[bitset_i] |= src[bitset_i]; } -static inline void +static __inline__ void bitset_mask (bitset_t dest, const bitset_t src) { int bitset_i; @@ -708,7 +708,7 @@ bitset_mask (bitset_t dest, const bitset_t src) #ifdef RE_ENABLE_I18N /* Inline functions for re_string. */ -static inline int +static __inline__ int internal_function __attribute ((pure)) re_string_char_size_at (const re_string_t *pstr, int idx) { @@ -721,7 +721,7 @@ re_string_char_size_at (const re_string_t *pstr, int idx) return byte_idx; } -static inline wint_t +static __inline__ wint_t internal_function __attribute ((pure)) re_string_wchar_at (const re_string_t *pstr, int idx) { diff --git a/libc/misc/regex/regex_old.c b/libc/misc/regex/regex_old.c index dc5781967..f56c56bf9 100644 --- a/libc/misc/regex/regex_old.c +++ b/libc/misc/regex/regex_old.c @@ -223,7 +223,7 @@ char *realloc (); # ifndef MB_LEN_MAX # define MB_LEN_MAX 1 # endif - + /* Get the interface, including the syntax bits. */ # ifdef __UCLIBC__ # include "_regex.h" @@ -296,7 +296,7 @@ char *realloc (); /* As in Harbison and Steele. */ # define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128) # endif - + # ifndef emacs /* How many characters in the character set. */ # define CHAR_SET_SIZE 256 @@ -335,7 +335,7 @@ init_syntax_once () # define SYNTAX(c) re_syntax_table[(unsigned char) (c)] # endif /* emacs */ - + /* Integer type for pointers. */ # if !defined _LIBC && !defined __intptr_t_defined typedef unsigned long int uintptr_t; @@ -482,7 +482,7 @@ static int wcs_re_search_2 PARAMS ((struct re_pattern_buffer *bufp, struct re_registers *regs, int stop)); static int wcs_re_compile_fastmap PARAMS ((struct re_pattern_buffer *bufp)); #endif - + /* These are the command codes that appear in compiled regular expressions. Some opcodes are followed by argument bytes. A command code can specify any interpretation whatsoever for its @@ -641,7 +641,7 @@ typedef enum # endif /* emacs */ } re_opcode_t; #endif /* not INSIDE_RECURSION */ - + #ifdef BYTE # define CHAR_T char @@ -777,7 +777,7 @@ PREFIX(extract_number_and_incr) (destination, source) # endif /* DEBUG */ - + /* If DEBUG is defined, Regex prints many voluminous messages about what it is doing (if the variable `debug' is nonzero). If linked with the @@ -1277,7 +1277,7 @@ printchar (c) # endif /* not DEBUG */ - + # ifdef WCHAR /* This convert a multibyte string to a wide character string. @@ -1394,7 +1394,7 @@ re_set_syntax (syntax) # if defined _LIBC || defined __UCLIBC__ strong_alias(__re_set_syntax, re_set_syntax) # endif - + /* This table gives an error message for each of the error codes listed in regex.h. Obviously the order here has to be same as there. POSIX doesn't require that we do anything for REG_NOERROR, @@ -1474,7 +1474,7 @@ static const size_t re_error_msgid_idx[] = REG_ESIZE_IDX, REG_ERPAREN_IDX }; - + #endif /* INSIDE_RECURSION */ #ifndef DEFINED_ONCE @@ -1515,7 +1515,7 @@ static const size_t re_error_msgid_idx[] = # undef MATCH_MAY_ALLOCATE # endif #endif /* not DEFINED_ONCE */ - + #ifdef INSIDE_RECURSION /* Failure stack declarations and macros; both re_compile_fastmap and re_match_2 use a failure stack. These have to be macros because of @@ -1887,7 +1887,7 @@ typedef struct set_regs_matched_done = 0; \ DEBUG_STATEMENT (nfailure_points_popped++); \ } /* POP_FAILURE_POINT */ - + /* Structure for per-register (a.k.a. per-group) information. Other register information, such as the starting and ending positions (which are addresses), and the list of @@ -2306,7 +2306,7 @@ typedef struct || STREQ (string, "cntrl") || STREQ (string, "blank")) # endif # endif /* DEFINED_ONCE */ - + # ifndef MATCH_MAY_ALLOCATE /* If we cannot allocate large objects within re_match_2_internal, @@ -2357,7 +2357,7 @@ PREFIX(regex_grow_registers) (num_regs) } # endif /* not MATCH_MAY_ALLOCATE */ - + # ifndef DEFINED_ONCE static boolean group_in_compile_stack _RE_ARGS ((compile_stack_type compile_stack, @@ -4648,7 +4648,7 @@ byte_compile_range (range_start_char, p_ptr, pend, translate, syntax, b) return ret; } #endif /* WCHAR */ - + /* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in BUFP. A fastmap records which of the (1 << BYTEWIDTH) possible characters can start a string that matches the pattern. This fastmap @@ -5018,7 +5018,7 @@ re_compile_fastmap (bufp) #if defined _LIBC || defined __UCLIBC__ strong_alias(__re_compile_fastmap, re_compile_fastmap) #endif - + /* Set REGS to hold NUM_REGS registers, storing them in STARTS and ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use @@ -5057,7 +5057,7 @@ re_set_registers (bufp, regs, num_regs, starts, ends) #if defined _LIBC || defined __UCLIBC__ strong_alias(__re_set_registers, re_set_registers) #endif - + /* Searching routines. */ /* Like re_search_2, below, but only one string is specified, and @@ -5546,7 +5546,7 @@ PREFIX(re_search_2) (bufp, string1, size1, string2, size2, startpos, range, to actually save any registers when none are active. */ #define NO_HIGHEST_ACTIVE_REG (1 << BYTEWIDTH) #define NO_LOWEST_ACTIVE_REG (NO_HIGHEST_ACTIVE_REG + 1) - + #else /* not INSIDE_RECURSION */ /* Matching routines. */ @@ -7659,7 +7659,7 @@ byte_re_match_2_internal (bufp, string1, size1,string2, size2, pos, return -1; /* Failure to match. */ } /* re_match_2 */ - + /* Subroutine definitions for re_match_2. */ @@ -7931,7 +7931,7 @@ PREFIX(bcmp_translate) (s1, s2, len, translate) } return 0; } - + #else /* not INSIDE_RECURSION */ @@ -7980,7 +7980,7 @@ re_compile_pattern (pattern, length, bufp) #if defined _LIBC || defined __UCLIBC__ strong_alias(__re_compile_pattern, re_compile_pattern) #endif - + /* Entry points compatible with 4.2 BSD regex library. We don't define them unless specifically requested. */ @@ -8056,7 +8056,7 @@ re_exec (s) } #endif /* _REGEX_RE_COMP */ - + /* POSIX.2 functions. Don't define these for Emacs. */ #ifndef emacs @@ -8331,7 +8331,7 @@ strong_alias(__regfree, regfree) #endif /* not INSIDE_RECURSION */ - + #undef STORE_NUMBER #undef STORE_NUMBER_AND_INCR #undef EXTRACT_NUMBER diff --git a/libc/misc/regex/regexec.c b/libc/misc/regex/regexec.c index 2c8917e19..587e6af30 100644 --- a/libc/misc/regex/regexec.c +++ b/libc/misc/regex/regexec.c @@ -200,7 +200,7 @@ static int check_node_accept (const re_match_context_t *mctx, internal_function; static reg_errcode_t extend_buffers (re_match_context_t *mctx) internal_function; - + /* Entry point for POSIX code. */ /* regexec searches for a given pattern, specified by PREG, in the @@ -595,7 +595,7 @@ re_set_registers (bufp, regs, num_regs, starts, ends) #if defined _LIBC || defined __UCLIBC__ strong_alias(__re_set_registers, re_set_registers) #endif - + /* Entry points compatible with 4.2 BSD regex library. We don't define them unless specifically requested. */ @@ -610,7 +610,7 @@ re_exec (s) return 0 == regexec (&re_comp_buf, s, 0, NULL, 0); } #endif /* _REGEX_RE_COMP */ - + /* Internal entry point. */ /* Searches for a compiled pattern PREG in the string STRING, whose @@ -1027,7 +1027,7 @@ prune_impossible_nodes (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 __inline__ re_dfastate_t * __attribute ((always_inline)) internal_function acquire_init_state_context (reg_errcode_t *err, const re_match_context_t *mctx, int idx) @@ -2236,7 +2236,7 @@ sift_states_iter_mb (const re_match_context_t *mctx, re_sift_context_t *sctx, } #endif /* RE_ENABLE_I18N */ - + /* Functions for state transition. */ /* Return the next state to which the current state STATE will transit by @@ -4117,7 +4117,7 @@ extend_buffers (re_match_context_t *mctx) return REG_NOERROR; } - + /* Functions for matching context. */ /* Initialize MCTX. */ |