[Pcre-svn] [1063] code/trunk/pcre_compile.c: pcre32: compile…

Página superior
Eliminar este mensaje
Autor: Subversion repository
Fecha:  
A: pcre-svn
Asunto: [Pcre-svn] [1063] code/trunk/pcre_compile.c: pcre32: compile: Use uint32 to store characters in check_auto_possessive
Revision: 1063
          http://vcs.pcre.org/viewvc?view=rev&revision=1063
Author:   chpe
Date:     2012-10-16 16:54:09 +0100 (Tue, 16 Oct 2012)


Log Message:
-----------
pcre32: compile: Use uint32 to store characters in check_auto_possessive

Do this to preserve any 32-bit data character in 32-bit non-UTF-32 mode.

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


Modified: code/trunk/pcre_compile.c
===================================================================
--- code/trunk/pcre_compile.c    2012-10-16 15:54:05 UTC (rev 1062)
+++ code/trunk/pcre_compile.c    2012-10-16 15:54:09 UTC (rev 1063)
@@ -2962,7 +2962,7 @@
 */


static BOOL
-check_char_prop(int c, int ptype, int pdata, BOOL negated)
+check_char_prop(pcre_uint32 c, int ptype, int pdata, BOOL negated)
{
#ifdef SUPPORT_UCP
const pcre_uint32 *p;
@@ -3048,8 +3048,8 @@
check_auto_possessive(const pcre_uchar *previous, BOOL utf,
const pcre_uchar *ptr, int options, compile_data *cd)
{
-pcre_int32 c = NOTACHAR; // FIXMEchpe pcre_uint32
-pcre_int32 next;
+pcre_uint32 c = NOTACHAR;
+pcre_uint32 next;
int escape;
int op_code = *previous++;

@@ -3147,7 +3147,7 @@
case, which maps to the special PT_CLIST property. Check this first. */

 #ifdef SUPPORT_UCP
-  if (utf && (unsigned int)c != NOTACHAR && (options & PCRE_CASELESS) != 0)
+  if (utf && c != NOTACHAR && (options & PCRE_CASELESS) != 0)
     {
     int ocs = UCD_CASESET(next);
     if (ocs > 0) return check_char_prop(c, PT_CLIST, ocs, op_code >= OP_NOT);
@@ -3169,18 +3169,18 @@
 #ifdef SUPPORT_UTF
     if (utf)
       {
-      unsigned int othercase;
+      pcre_uint32 othercase;
       if (next < 128) othercase = cd->fcc[next]; else
 #ifdef SUPPORT_UCP
-      othercase = UCD_OTHERCASE((unsigned int)next);
+      othercase = UCD_OTHERCASE(next);
 #else
       othercase = NOTACHAR;
 #endif
-      return (unsigned int)c != othercase;
+      return c != othercase;
       }
     else
 #endif  /* SUPPORT_UTF */
-    return (c != TABLE_GET((unsigned int)next, cd->fcc, next));  /* Not UTF */
+    return (c != TABLE_GET(next, cd->fcc, next));  /* Not UTF */


     case OP_NOT:
     return c == next;
@@ -3190,18 +3190,18 @@
 #ifdef SUPPORT_UTF
     if (utf)
       {
-      unsigned int othercase;
+      pcre_uint32 othercase;
       if (next < 128) othercase = cd->fcc[next]; else
 #ifdef SUPPORT_UCP
-      othercase = UCD_OTHERCASE((unsigned int)next);
+      othercase = UCD_OTHERCASE(next);
 #else
       othercase = NOTACHAR;
 #endif
-      return (unsigned int)c == othercase;
+      return c == othercase;
       }
     else
 #endif  /* SUPPORT_UTF */
-    return (c == TABLE_GET((unsigned int)next, cd->fcc, next));  /* Not UTF */
+    return (c == TABLE_GET(next, cd->fcc, next));  /* Not UTF */


     /* Note that OP_DIGIT etc. are generated only when PCRE_UCP is *not* set.
     When it is set, \d etc. are converted into OP_(NOT_)PROP codes. */