[Pcre-svn] [751] code/trunk: Code tidies.

Startseite
Nachricht löschen
Autor: Subversion repository
Datum:  
To: pcre-svn
Betreff: [Pcre-svn] [751] code/trunk: Code tidies.
Revision: 751
          http://vcs.pcre.org/viewvc?view=rev&revision=751
Author:   ph10
Date:     2011-11-18 11:13:30 +0000 (Fri, 18 Nov 2011)


Log Message:
-----------
Code tidies.

Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/pcre_compile.c
    code/trunk/pcre_exec.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2011-11-18 11:07:14 UTC (rev 750)
+++ code/trunk/ChangeLog    2011-11-18 11:13:30 UTC (rev 751)
@@ -41,6 +41,8 @@
     one behaved incorrectly. For example, (A){2,}+ behaved as if it was
     (A)(A)++ which meant that, after a subsequent mismatch, backtracking into 
     the first (A) could occur when it should not. 
+    
+10. Add a cast and remove a redundant test from the code. 



Version 8.20 21-Oct-2011

Modified: code/trunk/pcre_compile.c
===================================================================
--- code/trunk/pcre_compile.c    2011-11-18 11:07:14 UTC (rev 750)
+++ code/trunk/pcre_compile.c    2011-11-18 11:13:30 UTC (rev 751)
@@ -3352,7 +3352,8 @@
       }


     *lengthptr += (int)(code - last_code);
-    DPRINTF(("length=%d added %d c=%c\n", *lengthptr, code - last_code, c));
+    DPRINTF(("length=%d added %d c=%c\n", *lengthptr, (int)(code - last_code),
+      c));


     /* If "previous" is set and it is not at the start of the work space, move
     it back to there, in order to avoid filling up the work space. Otherwise,


Modified: code/trunk/pcre_exec.c
===================================================================
--- code/trunk/pcre_exec.c    2011-11-18 11:07:14 UTC (rev 750)
+++ code/trunk/pcre_exec.c    2011-11-18 11:13:30 UTC (rev 751)
@@ -1253,14 +1253,14 @@
       else
         {
         int recno = GET2(ecode, LINK_SIZE + 2);   /* Recursion group number*/
-        condition =  (recno == RREF_ANY || recno == md->recursive->group_num);
+        condition = (recno == RREF_ANY || recno == md->recursive->group_num);


         /* If the test is for recursion into a specific subpattern, and it is
         false, but the test was set up by name, scan the table to see if the
         name refers to any other numbers, and test them. The condition is true
         if any one is set. */


-        if (!condition && condcode == OP_NRREF && recno != RREF_ANY)
+        if (!condition && condcode == OP_NRREF)
           {
           uschar *slotA = md->name_table;
           for (i = 0; i < md->name_count; i++)