From: Ulrich Drepper Date: Sat, 12 Nov 2011 06:23:45 +0000 (-0500) Subject: Fix warnings in regex X-Git-Tag: glibc-2.15~99 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5e2b63c65892e054980570957f533312cfd223c2;p=platform%2Fupstream%2Fglibc.git Fix warnings in regex --- diff --git a/ChangeLog b/ChangeLog index 192f38c..897174e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2011-11-12 Ulrich Drepper + * posix/regex_internal.c (re_string_reconstruct): Actually use result + of use of trans. + * posix/regex_internal.h (re_string_wchar_at): Remove temporary + variable tmp. + * sysdeps/i386/i686/multiarch/wcscmp-c.c: Avoid warning. * sysdeps/i386/i686/multiarch/wcslen-c.c: Likewise. * sysdeps/i386/i686/multiarch/wmemcmp-c.c: Likewise. diff --git a/posix/regex_internal.c b/posix/regex_internal.c index 285ae3b..bc19243 100644 --- a/posix/regex_internal.c +++ b/posix/regex_internal.c @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2006, 2010 Free Software Foundation, Inc. + Copyright (C) 2002-2006, 2010, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -736,16 +736,18 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags) unsigned char buf[6]; size_t mbclen; + const unsigned char *pp = p; if (BE (pstr->trans != NULL, 0)) { int i = mlen < 6 ? mlen : 6; while (--i >= 0) buf[i] = pstr->trans[p[i]]; + pp = buf; } /* XXX Don't use mbrtowc, we know which conversion to use (UTF-8 -> UCS4). */ memset (&cur_state, 0, sizeof (cur_state)); - mbclen = __mbrtowc (&wc2, (const char *) p, mlen, + mbclen = __mbrtowc (&wc2, (const char *) pp, mlen, &cur_state); if (raw + offset - p <= mbclen && mbclen < (size_t) -2) diff --git a/posix/regex_internal.h b/posix/regex_internal.h index 65a9905..74dd230 100644 --- a/posix/regex_internal.h +++ b/posix/regex_internal.h @@ -1,5 +1,5 @@ /* Extended regular expression matching and search library. - Copyright (C) 2002-2005, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2002-2005, 2007, 2008, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Isamu Hasegawa . @@ -744,7 +744,6 @@ re_string_elem_size_at (const re_string_t *pstr, int idx) # ifdef _LIBC const unsigned char *p, *extra; const int32_t *table, *indirect; - int32_t tmp; # include uint_fast32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); @@ -756,7 +755,7 @@ re_string_elem_size_at (const re_string_t *pstr, int idx) indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB); p = pstr->mbs + idx; - tmp = findidx (&p); + findidx (&p); return p - pstr->mbs - idx; } else