* posix/regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
	* posix/regcomp.c: Remove unnecessary uses of
	unsigned RE_TRANSLATE_TYPE.
	* posix/regex_internal.h: Likewise.
	* posix/regex_internal.c: Likewise.
	* posix/regexexec.c: Likewise.
	Based on a patch by Stepan Kasal <kasal@ucw.cz>.
This commit is contained in:
Ulrich Drepper 2005-09-23 06:11:29 +00:00
parent 8f7aee9228
commit 997470b3e1
6 changed files with 18 additions and 9 deletions

View File

@ -1,5 +1,14 @@
2005-09-22 Ulrich Drepper <drepper@redhat.com> 2005-09-22 Ulrich Drepper <drepper@redhat.com>
[BZ #281]
* posix/regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
* posix/regcomp.c: Remove unnecessary uses of
unsigned RE_TRANSLATE_TYPE.
* posix/regex_internal.h: Likewise.
* posix/regex_internal.c: Likewise.
* posix/regexexec.c: Likewise.
Based on a patch by Stepan Kasal <kasal@ucw.cz>.
[BZ #1035] [BZ #1035]
* locale/iso-4217.def: Replace TRL entry with TRY for new Turkish Lira. * locale/iso-4217.def: Replace TRL entry with TRY for new Turkish Lira.

View File

@ -117,7 +117,7 @@ static reg_errcode_t build_equiv_class (re_bitset_ptr_t sbcset,
re_charset_t *mbcset, re_charset_t *mbcset,
int *equiv_class_alloc, int *equiv_class_alloc,
const unsigned char *name); const unsigned char *name);
static reg_errcode_t build_charclass (unsigned RE_TRANSLATE_TYPE trans, static reg_errcode_t build_charclass (RE_TRANSLATE_TYPE trans,
re_bitset_ptr_t sbcset, re_bitset_ptr_t sbcset,
re_charset_t *mbcset, re_charset_t *mbcset,
int *char_class_alloc, int *char_class_alloc,
@ -126,13 +126,13 @@ static reg_errcode_t build_charclass (unsigned RE_TRANSLATE_TYPE trans,
#else /* not RE_ENABLE_I18N */ #else /* not RE_ENABLE_I18N */
static reg_errcode_t build_equiv_class (re_bitset_ptr_t sbcset, static reg_errcode_t build_equiv_class (re_bitset_ptr_t sbcset,
const unsigned char *name); const unsigned char *name);
static reg_errcode_t build_charclass (unsigned RE_TRANSLATE_TYPE trans, static reg_errcode_t build_charclass (RE_TRANSLATE_TYPE trans,
re_bitset_ptr_t sbcset, re_bitset_ptr_t sbcset,
const unsigned char *class_name, const unsigned char *class_name,
reg_syntax_t syntax); reg_syntax_t syntax);
#endif /* not RE_ENABLE_I18N */ #endif /* not RE_ENABLE_I18N */
static bin_tree_t *build_charclass_op (re_dfa_t *dfa, static bin_tree_t *build_charclass_op (re_dfa_t *dfa,
unsigned RE_TRANSLATE_TYPE trans, RE_TRANSLATE_TYPE trans,
const unsigned char *class_name, const unsigned char *class_name,
const unsigned char *extra, const unsigned char *extra,
int non_match, reg_errcode_t *err); int non_match, reg_errcode_t *err);
@ -3559,7 +3559,7 @@ build_charclass (trans, sbcset, mbcset, char_class_alloc, class_name, syntax)
#else /* not RE_ENABLE_I18N */ #else /* not RE_ENABLE_I18N */
build_charclass (trans, sbcset, class_name, syntax) build_charclass (trans, sbcset, class_name, syntax)
#endif /* not RE_ENABLE_I18N */ #endif /* not RE_ENABLE_I18N */
unsigned RE_TRANSLATE_TYPE trans; RE_TRANSLATE_TYPE trans;
re_bitset_ptr_t sbcset; re_bitset_ptr_t sbcset;
const unsigned char *class_name; const unsigned char *class_name;
reg_syntax_t syntax; reg_syntax_t syntax;
@ -3634,7 +3634,7 @@ build_charclass (trans, sbcset, class_name, syntax)
static bin_tree_t * static bin_tree_t *
build_charclass_op (dfa, trans, class_name, extra, non_match, err) build_charclass_op (dfa, trans, class_name, extra, non_match, err)
re_dfa_t *dfa; re_dfa_t *dfa;
unsigned RE_TRANSLATE_TYPE trans; RE_TRANSLATE_TYPE trans;
const unsigned char *class_name; const unsigned char *class_name;
const unsigned char *extra; const unsigned char *extra;
int non_match; int non_match;

View File

@ -346,7 +346,7 @@ typedef enum
private to the regex routines. */ private to the regex routines. */
#ifndef RE_TRANSLATE_TYPE #ifndef RE_TRANSLATE_TYPE
# define RE_TRANSLATE_TYPE char * # define RE_TRANSLATE_TYPE unsigned char *
#endif #endif
struct re_pattern_buffer struct re_pattern_buffer

View File

@ -187,7 +187,7 @@ re_string_construct_common (str, len, pstr, trans, icase, dfa)
pstr->raw_mbs = (const unsigned char *) str; pstr->raw_mbs = (const unsigned char *) str;
pstr->len = len; pstr->len = len;
pstr->raw_len = len; pstr->raw_len = len;
pstr->trans = (unsigned RE_TRANSLATE_TYPE) trans; pstr->trans = trans;
pstr->icase = icase ? 1 : 0; pstr->icase = icase ? 1 : 0;
pstr->mbs_allocated = (trans != NULL || icase); pstr->mbs_allocated = (trans != NULL || icase);
pstr->mb_cur_max = dfa->mb_cur_max; pstr->mb_cur_max = dfa->mb_cur_max;

View File

@ -345,7 +345,7 @@ struct re_string_t
the beginning of the input string. */ the beginning of the input string. */
unsigned int tip_context; unsigned int tip_context;
/* The translation passed as a part of an argument of re_compile_pattern. */ /* The translation passed as a part of an argument of re_compile_pattern. */
unsigned RE_TRANSLATE_TYPE trans; RE_TRANSLATE_TYPE trans;
/* Copy of re_dfa_t's word_char. */ /* Copy of re_dfa_t's word_char. */
re_const_bitset_ptr_t word_char; re_const_bitset_ptr_t word_char;
/* 1 if REG_ICASE. */ /* 1 if REG_ICASE. */

View File

@ -657,7 +657,7 @@ re_search_internal (preg, string, length, start, range, stop, nmatch, pmatch,
#endif #endif
char *fastmap = (preg->fastmap != NULL && preg->fastmap_accurate char *fastmap = (preg->fastmap != NULL && preg->fastmap_accurate
&& range && !preg->can_be_null) ? preg->fastmap : NULL; && range && !preg->can_be_null) ? preg->fastmap : NULL;
unsigned RE_TRANSLATE_TYPE t = (unsigned RE_TRANSLATE_TYPE) preg->translate; RE_TRANSLATE_TYPE t = preg->translate;
#if !(defined _LIBC || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) #if !(defined _LIBC || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
memset (&mctx, '\0', sizeof (re_match_context_t)); memset (&mctx, '\0', sizeof (re_match_context_t));