diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2012-01-15 18:07:05 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2012-01-15 18:07:05 +0000 |
commit | 91aad13b2f1763201de03b6667a9fb869103fa39 (patch) | |
tree | 622f850ea2999c3b7f784acfa5cfd6c82149f339 | |
parent | c4e858ed1e48ee8284b05f4c46776540eec95e99 (diff) | |
download | pcre-91aad13b2f1763201de03b6667a9fb869103fa39.tar.gz |
Get rid of a number of -Wunused-but-set-variable compiler warnings.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@881 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | pcre_dfa_exec.c | 7 | ||||
-rw-r--r-- | pcre_jit_test.c | 4 | ||||
-rw-r--r-- | pcrecpp.cc | 2 | ||||
-rw-r--r-- | pcretest.c | 12 |
5 files changed, 17 insertions, 10 deletions
@@ -35,6 +35,8 @@ Version 8.30 9. The invalid Unicode surrogate codepoints U+D800 to U+DFFF are now rejected if they appear, or are escaped, in patterns. + +10. Get rid of a number of -Wunused-but-set-variable warnings. Version 8.21 12-Dec-2011 diff --git a/pcre_dfa_exec.c b/pcre_dfa_exec.c index 887c79b..f61dbd3 100644 --- a/pcre_dfa_exec.c +++ b/pcre_dfa_exec.c @@ -3031,8 +3031,6 @@ dfa_match_data match_block; dfa_match_data *md = &match_block; BOOL utf, anchored, startline, firstline; const pcre_uchar *current_subject, *end_subject; -const pcre_uint8 *lcc; - const pcre_study_data *study = NULL; const pcre_uchar *req_char_ptr; @@ -3194,10 +3192,9 @@ in other programs later. */ if (md->tables == NULL) md->tables = PRIV(default_tables); -/* The lower casing table and the "must be at the start of a line" flag are -used in a loop when finding where to start. */ +/* The "must be at the start of a line" flags are used in a loop when finding +where to start. */ -lcc = md->tables + lcc_offset; startline = (re->flags & PCRE_STARTLINE) != 0; firstline = (re->options & PCRE_FIRSTLINE) != 0; diff --git a/pcre_jit_test.c b/pcre_jit_test.c index 0f394f7..26a6f34 100644 --- a/pcre_jit_test.c +++ b/pcre_jit_test.c @@ -721,15 +721,19 @@ static const unsigned char *tables(int mode) return tables_copy; } +#ifdef SUPPORT_PCRE8 static pcre_jit_stack* callback8(void *arg) { return (pcre_jit_stack *)arg; } +#endif +#ifdef SUPPORT_PCRE16 static pcre16_jit_stack* callback16(void *arg) { return (pcre16_jit_stack *)arg; } +#endif #ifdef SUPPORT_PCRE8 static void setstack8(pcre_extra *extra) @@ -384,7 +384,6 @@ int RE::GlobalReplace(const StringPiece& rewrite, int vec[kVecSize]; string out; int start = 0; - int lastend = -1; bool last_match_was_empty_string = false; while (start <= static_cast<int>(str->length())) { @@ -440,7 +439,6 @@ int RE::GlobalReplace(const StringPiece& rewrite, out.append(*str, start, matchstart - start); Rewrite(&out, rewrite, *str, vec, matches); start = matchend; - lastend = matchend; count++; last_match_was_empty_string = (matchstart == matchend); } @@ -2182,20 +2182,22 @@ pcre_jit_stack *jit_stack = NULL; substring names, each list itself being terminated by an empty name. Assume that 1024 is plenty long enough for the few names we'll be testing. It is easiest to keep separate 8-bit and 16-bit versions, using the 16-bit version -for the actual memory, to ensure alignment. By defining these variables always -(whether or not 8-bit or 16-bit is supported), we avoid too much mess with -#ifdefs in the code. */ +for the actual memory, to ensure alignment. */ pcre_uint16 copynames[1024]; pcre_uint16 getnames[1024]; +#ifdef SUPPORT_PCRE16 pcre_uint16 *cn16ptr; pcre_uint16 *gn16ptr; +#endif +#ifdef SUPPORT_PCRE8 pcre_uint8 *copynames8 = (pcre_uint8 *)copynames; pcre_uint8 *getnames8 = (pcre_uint8 *)getnames; pcre_uint8 *cn8ptr; pcre_uint8 *gn8ptr; +#endif /* Get buffers from malloc() so that valgrind will check their misuse when debugging. They grow automatically when very long lines are read. The 16-bit @@ -3369,10 +3371,14 @@ while (!done) *copynames = 0; *getnames = 0; +#ifdef SUPPORT_PCRE16 cn16ptr = copynames; gn16ptr = getnames; +#endif +#ifdef SUPPORT_PCRE8 cn8ptr = copynames8; gn8ptr = getnames8; +#endif SET_PCRE_CALLOUT(callout); first_callout = 1; |