1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-06-05 00:22:17 +03:00

Harmonize posix/regcomp.c with gnulib: comment formatting

This commit is contained in:
Roland McGrath 2015-03-10 13:53:34 -07:00
parent 85ca85ae9a
commit d3821ab0ac
2 changed files with 37 additions and 32 deletions

View File

@ -1,3 +1,8 @@
2015-03-10 Roland McGrath <roland@hack.frob.com>
* posix/regcomp.c: Fix comment typos and formatting to harmonize with
gnulib file. Replace __attribute with __attribute__ throughout.
2015-03-10 Carlos O'Donell <carlos@redhat.com> 2015-03-10 Carlos O'Donell <carlos@redhat.com>
* sysdeps/hppa/fpu/libm-test-ulps: Update. * sysdeps/hppa/fpu/libm-test-ulps: Update.

View File

@ -212,7 +212,7 @@ const size_t __re_error_msgid_idx[] attribute_hidden =
compiles PATTERN (of length LENGTH) and puts the result in BUFP. compiles PATTERN (of length LENGTH) and puts the result in BUFP.
Returns 0 if the pattern was valid, otherwise an error string. Returns 0 if the pattern was valid, otherwise an error string.
Assumes the `allocated' (and perhaps `buffer') and `translate' fields Assumes the 'allocated' (and perhaps 'buffer') and 'translate' fields
are set in BUFP on entry. */ are set in BUFP on entry. */
const char * const char *
@ -241,7 +241,7 @@ re_compile_pattern (pattern, length, bufp)
weak_alias (__re_compile_pattern, re_compile_pattern) weak_alias (__re_compile_pattern, re_compile_pattern)
#endif #endif
/* Set by `re_set_syntax' to the current regexp syntax to recognize. Can /* Set by 're_set_syntax' to the current regexp syntax to recognize. Can
also be assigned to arbitrarily: each pattern buffer stores its own also be assigned to arbitrarily: each pattern buffer stores its own
syntax, so it can be changed between regex compilations. */ syntax, so it can be changed between regex compilations. */
/* This has no initializer because initialized variables in Emacs /* This has no initializer because initialized variables in Emacs
@ -292,8 +292,8 @@ weak_alias (__re_compile_fastmap, re_compile_fastmap)
#endif #endif
static inline void static inline void
__attribute ((always_inline)) __attribute__ ((always_inline))
re_set_fastmap (char *fastmap, int icase, int ch) re_set_fastmap (char *fastmap, bool icase, int ch)
{ {
fastmap[ch] = 1; fastmap[ch] = 1;
if (icase) if (icase)
@ -438,15 +438,15 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
PREG is a regex_t *. We do not expect any fields to be initialized, PREG is a regex_t *. We do not expect any fields to be initialized,
since POSIX says we shouldn't. Thus, we set since POSIX says we shouldn't. Thus, we set
`buffer' to the compiled pattern; 'buffer' to the compiled pattern;
`used' to the length of the compiled pattern; 'used' to the length of the compiled pattern;
`syntax' to RE_SYNTAX_POSIX_EXTENDED if the 'syntax' to RE_SYNTAX_POSIX_EXTENDED if the
REG_EXTENDED bit in CFLAGS is set; otherwise, to REG_EXTENDED bit in CFLAGS is set; otherwise, to
RE_SYNTAX_POSIX_BASIC; RE_SYNTAX_POSIX_BASIC;
`newline_anchor' to REG_NEWLINE being set in CFLAGS; 'newline_anchor' to REG_NEWLINE being set in CFLAGS;
`fastmap' to an allocated space for the fastmap; 'fastmap' to an allocated space for the fastmap;
`fastmap_accurate' to zero; 'fastmap_accurate' to zero;
`re_nsub' to the number of subexpressions in PATTERN. 're_nsub' to the number of subexpressions in PATTERN.
PATTERN is the address of the pattern string. PATTERN is the address of the pattern string.
@ -703,7 +703,7 @@ re_comp (s)
+ __re_error_msgid_idx[(int) REG_ESPACE]); + __re_error_msgid_idx[(int) REG_ESPACE]);
} }
/* Since `re_exec' always passes NULL for the `regs' argument, we /* Since 're_exec' always passes NULL for the 'regs' argument, we
don't need to initialize the pattern buffer fields which affect it. */ don't need to initialize the pattern buffer fields which affect it. */
/* Match anchors at newlines. */ /* Match anchors at newlines. */
@ -1511,7 +1511,7 @@ duplicate_node_closure (re_dfa_t *dfa, int top_org_node, int top_clone_node,
destination. */ destination. */
org_dest = dfa->edests[org_node].elems[0]; org_dest = dfa->edests[org_node].elems[0];
re_node_set_empty (dfa->edests + clone_node); re_node_set_empty (dfa->edests + clone_node);
/* If the node is root_node itself, it means the epsilon clsoure /* If the node is root_node itself, it means the epsilon closure
has a loop. Then tie it to the destination of the root_node. */ has a loop. Then tie it to the destination of the root_node. */
if (org_node == root_node && clone_node != org_node) if (org_node == root_node && clone_node != org_node)
{ {
@ -1520,7 +1520,7 @@ duplicate_node_closure (re_dfa_t *dfa, int top_org_node, int top_clone_node,
return REG_ESPACE; return REG_ESPACE;
break; break;
} }
/* In case of the node has another constraint, add it. */ /* In case the node has another constraint, append it. */
constraint |= dfa->nodes[org_node].constraint; constraint |= dfa->nodes[org_node].constraint;
clone_dest = duplicate_node (dfa, org_dest, constraint); clone_dest = duplicate_node (dfa, org_dest, constraint);
if (BE (clone_dest == -1, 0)) if (BE (clone_dest == -1, 0))
@ -1663,7 +1663,7 @@ calc_eclosure (re_dfa_t *dfa)
/* If we have already calculated, skip it. */ /* If we have already calculated, skip it. */
if (dfa->eclosures[node_idx].nelem != 0) if (dfa->eclosures[node_idx].nelem != 0)
continue; continue;
/* Calculate epsilon closure of `node_idx'. */ /* Calculate epsilon closure of 'node_idx'. */
err = calc_eclosure_iter (&eclosure_elem, dfa, node_idx, 1); err = calc_eclosure_iter (&eclosure_elem, dfa, node_idx, 1);
if (BE (err != REG_NOERROR, 0)) if (BE (err != REG_NOERROR, 0))
return err; return err;
@ -1730,11 +1730,11 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, int node, int root)
} }
else else
eclosure_elem = dfa->eclosures[edest]; eclosure_elem = dfa->eclosures[edest];
/* Merge the epsilon closure of `edest'. */ /* Merge the epsilon closure of 'edest'. */
err = re_node_set_merge (&eclosure, &eclosure_elem); err = re_node_set_merge (&eclosure, &eclosure_elem);
if (BE (err != REG_NOERROR, 0)) if (BE (err != REG_NOERROR, 0))
return err; return err;
/* If the epsilon closure of `edest' is incomplete, /* If the epsilon closure of 'edest' is incomplete,
the epsilon closure of this node is also incomplete. */ the epsilon closure of this node is also incomplete. */
if (dfa->eclosures[edest].nelem == 0) if (dfa->eclosures[edest].nelem == 0)
{ {
@ -2096,7 +2096,7 @@ peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
/* Entry point of the parser. /* Entry point of the parser.
Parse the regular expression REGEXP and return the structure tree. Parse the regular expression REGEXP and return the structure tree.
If an error is occured, ERR is set by error code, and return NULL. If an error occurs, ERR is set by error code, and return NULL.
This function build the following tree, from regular expression <reg_exp>: This function build the following tree, from regular expression <reg_exp>:
CAT CAT
/ \ / \
@ -2138,7 +2138,7 @@ parse (re_string_t *regexp, regex_t *preg, reg_syntax_t syntax,
/ \ / \
<branch1> <branch2> <branch1> <branch2>
ALT means alternative, which represents the operator `|'. */ ALT means alternative, which represents the operator '|'. */
static bin_tree_t * static bin_tree_t *
parse_reg_exp (re_string_t *regexp, regex_t *preg, re_token_t *token, parse_reg_exp (re_string_t *regexp, regex_t *preg, re_token_t *token,
@ -2634,7 +2634,7 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
Build the range expression which starts from START_ELEM, and ends Build the range expression which starts from START_ELEM, and ends
at END_ELEM. The result are written to MBCSET and SBCSET. at END_ELEM. The result are written to MBCSET and SBCSET.
RANGE_ALLOC is the allocated size of mbcset->range_starts, and RANGE_ALLOC is the allocated size of mbcset->range_starts, and
mbcset->range_ends, is a pointer argument sinse we may mbcset->range_ends, is a pointer argument since we may
update it. */ update it. */
static reg_errcode_t static reg_errcode_t
@ -2793,13 +2793,13 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
const int32_t *symb_table; const int32_t *symb_table;
const unsigned char *extra; const unsigned char *extra;
/* Local function for parse_bracket_exp used in _LIBC environement. /* Local function for parse_bracket_exp used in _LIBC environment.
Seek the collating symbol entry correspondings to NAME. Seek the collating symbol entry corresponding to NAME.
Return the index of the symbol in the SYMB_TABLE, Return the index of the symbol in the SYMB_TABLE,
or -1 if not found. */ or -1 if not found. */
auto inline int32_t auto inline int32_t
__attribute ((always_inline)) __attribute__ ((always_inline))
seek_collating_symbol_entry (const unsigned char *name, size_t name_len) seek_collating_symbol_entry (const unsigned char *name, size_t name_len)
{ {
int32_t elem; int32_t elem;
@ -2825,7 +2825,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
Return the value if succeeded, UINT_MAX otherwise. */ Return the value if succeeded, UINT_MAX otherwise. */
auto inline unsigned int auto inline unsigned int
__attribute ((always_inline)) __attribute__ ((always_inline))
lookup_collation_sequence_value (bracket_elem_t *br_elem) lookup_collation_sequence_value (bracket_elem_t *br_elem)
{ {
if (br_elem->type == SB_CHAR) if (br_elem->type == SB_CHAR)
@ -2885,15 +2885,15 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
return UINT_MAX; return UINT_MAX;
} }
/* Local function for parse_bracket_exp used in _LIBC environement. /* Local function for parse_bracket_exp used in _LIBC environment.
Build the range expression which starts from START_ELEM, and ends Build the range expression which starts from START_ELEM, and ends
at END_ELEM. The result are written to MBCSET and SBCSET. at END_ELEM. The result are written to MBCSET and SBCSET.
RANGE_ALLOC is the allocated size of mbcset->range_starts, and RANGE_ALLOC is the allocated size of mbcset->range_starts, and
mbcset->range_ends, is a pointer argument sinse we may mbcset->range_ends, is a pointer argument since we may
update it. */ update it. */
auto inline reg_errcode_t auto inline reg_errcode_t
__attribute ((always_inline)) __attribute__ ((always_inline))
build_range_exp (bitset_t sbcset, re_charset_t *mbcset, int *range_alloc, build_range_exp (bitset_t sbcset, re_charset_t *mbcset, int *range_alloc,
bracket_elem_t *start_elem, bracket_elem_t *end_elem) bracket_elem_t *start_elem, bracket_elem_t *end_elem)
{ {
@ -2966,14 +2966,14 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
return REG_NOERROR; return REG_NOERROR;
} }
/* Local function for parse_bracket_exp used in _LIBC environement. /* Local function for parse_bracket_exp used in _LIBC environment.
Build the collating element which is represented by NAME. Build the collating element which is represented by NAME.
The result are written to MBCSET and SBCSET. The result are written to MBCSET and SBCSET.
COLL_SYM_ALLOC is the allocated size of mbcset->coll_sym, is a COLL_SYM_ALLOC is the allocated size of mbcset->coll_sym, is a
pointer argument sinse we may update it. */ pointer argument since we may update it. */
auto inline reg_errcode_t auto inline reg_errcode_t
__attribute ((always_inline)) __attribute__ ((always_inline))
build_collating_symbol (bitset_t sbcset, re_charset_t *mbcset, build_collating_symbol (bitset_t sbcset, re_charset_t *mbcset,
int *coll_sym_alloc, const unsigned char *name) int *coll_sym_alloc, const unsigned char *name)
{ {
@ -3412,7 +3412,7 @@ parse_bracket_symbol (bracket_elem_t *elem, re_string_t *regexp,
Build the equivalence class which is represented by NAME. Build the equivalence class which is represented by NAME.
The result are written to MBCSET and SBCSET. The result are written to MBCSET and SBCSET.
EQUIV_CLASS_ALLOC is the allocated size of mbcset->equiv_classes, EQUIV_CLASS_ALLOC is the allocated size of mbcset->equiv_classes,
is a pointer argument sinse we may update it. */ is a pointer argument since we may update it. */
static reg_errcode_t static reg_errcode_t
#ifdef RE_ENABLE_I18N #ifdef RE_ENABLE_I18N
@ -3505,7 +3505,7 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name)
Build the character class which is represented by NAME. Build the character class which is represented by NAME.
The result are written to MBCSET and SBCSET. The result are written to MBCSET and SBCSET.
CHAR_CLASS_ALLOC is the allocated size of mbcset->char_classes, CHAR_CLASS_ALLOC is the allocated size of mbcset->char_classes,
is a pointer argument sinse we may update it. */ is a pointer argument since we may update it. */
static reg_errcode_t static reg_errcode_t
#ifdef RE_ENABLE_I18N #ifdef RE_ENABLE_I18N