[Pcre-svn] [881] code/trunk: Get rid of a number of -Wunuse…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [881] code/trunk: Get rid of a number of -Wunused-but-set-variable compiler warnings.
Revision: 881
          http://vcs.pcre.org/viewvc?view=rev&revision=881
Author:   ph10
Date:     2012-01-15 18:07:05 +0000 (Sun, 15 Jan 2012)


Log Message:
-----------
Get rid of a number of -Wunused-but-set-variable compiler warnings.

Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/pcre_dfa_exec.c
    code/trunk/pcre_jit_test.c
    code/trunk/pcrecpp.cc
    code/trunk/pcretest.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2012-01-15 17:23:37 UTC (rev 880)
+++ code/trunk/ChangeLog    2012-01-15 18:07:05 UTC (rev 881)
@@ -35,6 +35,8 @@


 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

Modified: code/trunk/pcre_dfa_exec.c
===================================================================
--- code/trunk/pcre_dfa_exec.c    2012-01-15 17:23:37 UTC (rev 880)
+++ code/trunk/pcre_dfa_exec.c    2012-01-15 18:07:05 UTC (rev 881)
@@ -3031,8 +3031,6 @@
 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 @@

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;


Modified: code/trunk/pcre_jit_test.c
===================================================================
--- code/trunk/pcre_jit_test.c    2012-01-15 17:23:37 UTC (rev 880)
+++ code/trunk/pcre_jit_test.c    2012-01-15 18:07:05 UTC (rev 881)
@@ -721,15 +721,19 @@
     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)

Modified: code/trunk/pcrecpp.cc
===================================================================
--- code/trunk/pcrecpp.cc    2012-01-15 17:23:37 UTC (rev 880)
+++ code/trunk/pcrecpp.cc    2012-01-15 18:07:05 UTC (rev 881)
@@ -384,7 +384,6 @@
   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 @@
     out.append(*str, start, matchstart - start);
     Rewrite(&out, rewrite, *str, vec, matches);
     start = matchend;
-    lastend = matchend;
     count++;
     last_match_was_empty_string = (matchstart == matchend);
   }


Modified: code/trunk/pcretest.c
===================================================================
--- code/trunk/pcretest.c    2012-01-15 17:23:37 UTC (rev 880)
+++ code/trunk/pcretest.c    2012-01-15 18:07:05 UTC (rev 881)
@@ -2182,20 +2182,22 @@
 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 @@
     *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;