[Pcre-svn] [409] code/trunk: Further USPTR additions.

トップ ページ
このメッセージを削除
著者: Subversion repository
日付:  
To: pcre-svn
題目: [Pcre-svn] [409] code/trunk: Further USPTR additions.
Revision: 409
          http://vcs.pcre.org/viewvc?view=rev&revision=409
Author:   ph10
Date:     2009-03-28 17:10:56 +0000 (Sat, 28 Mar 2009)


Log Message:
-----------
Further USPTR additions.

Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/pcre_exec.c
    code/trunk/pcre_newline.c
    code/trunk/pcre_valid_utf8.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2009-03-27 17:52:03 UTC (rev 408)
+++ code/trunk/ChangeLog    2009-03-28 17:10:56 UTC (rev 409)
@@ -17,7 +17,7 @@
     but BOOL is not.


 3.  The pcre_config() function was treating the PCRE_MATCH_LIMIT and
-    PCRE_MATCH_LIMIT_RETURSION values as ints, when they should be long ints.
+    PCRE_MATCH_LIMIT_RECURSION values as ints, when they should be long ints.


 4.  The pcregrep documentation said spaces were inserted as well as colons (or
     hyphens) following file names and line numbers when outputting matching
@@ -109,6 +109,9 @@
     because when scanning forward to find the reference group, PCRE was not
     taking into account the duplicate group numbers. A pattern such as
     ^X(?3)(a)(?|(b)|(q))(Y) is an example.
+    
+26. Changed a few more instances of "const unsigned char *" to USPTR, making
+    the feature of a custom pointer more persuasive (as requested by a user). 





Modified: code/trunk/pcre_exec.c
===================================================================
--- code/trunk/pcre_exec.c    2009-03-27 17:52:03 UTC (rev 408)
+++ code/trunk/pcre_exec.c    2009-03-28 17:10:56 UTC (rev 409)
@@ -322,9 +322,9 @@


/* Function arguments that may change */

- const uschar *Xeptr;
+ USPTR Xeptr;
const uschar *Xecode;
- const uschar *Xmstart;
+ USPTR Xmstart;
int Xoffset_top;
long int Xims;
eptrblock *Xeptrb;
@@ -333,15 +333,15 @@

/* Function local variables */

- const uschar *Xcallpat;
+ USPTR Xcallpat;
#ifdef SUPPORT_UTF8
- const uschar *Xcharptr;
+ USPTR Xcharptr;
#endif
- const uschar *Xdata;
- const uschar *Xnext;
- const uschar *Xpp;
- const uschar *Xprev;
- const uschar *Xsaved_eptr;
+ USPTR Xdata;
+ USPTR Xnext;
+ USPTR Xpp;
+ USPTR Xprev;
+ USPTR Xsaved_eptr;

recursion_info Xnew_recursive;

@@ -428,7 +428,7 @@
*/

 static int
-match(REGISTER USPTR eptr, REGISTER const uschar *ecode, const uschar *mstart,
+match(REGISTER USPTR eptr, REGISTER const uschar *ecode, USPTR mstart,
   int offset_top, match_data *md, unsigned long int ims, eptrblock *eptrb,
   int flags, unsigned int rdepth)
 {
@@ -1461,7 +1461,7 @@
         {
         if (eptr == md->start_subject) prev_is_word = FALSE; else
           {
-          const uschar *lastptr = eptr - 1;
+          USPTR lastptr = eptr - 1;
           while((*lastptr & 0xc0) == 0x80) lastptr--;
           GETCHAR(c, lastptr);
           prev_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0;
@@ -4619,11 +4619,11 @@
 #ifdef SUPPORT_UTF8
 if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0)
   {
-  if (_pcre_valid_utf8((uschar *)subject, length) >= 0)
+  if (_pcre_valid_utf8((USPTR)subject, length) >= 0)
     return PCRE_ERROR_BADUTF8;
   if (start_offset > 0 && start_offset < length)
     {
-    int tb = ((uschar *)subject)[start_offset];
+    int tb = ((USPTR)subject)[start_offset];
     if (tb > 127)
       {
       tb &= 0xc0;


Modified: code/trunk/pcre_newline.c
===================================================================
--- code/trunk/pcre_newline.c    2009-03-27 17:52:03 UTC (rev 408)
+++ code/trunk/pcre_newline.c    2009-03-28 17:10:56 UTC (rev 409)
@@ -6,7 +6,7 @@
 and semantics are as close as possible to those of the Perl 5 language.


                        Written by Philip Hazel
-           Copyright (c) 1997-2008 University of Cambridge
+           Copyright (c) 1997-2009 University of Cambridge


-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -73,8 +73,7 @@
*/

BOOL
-_pcre_is_newline(const uschar *ptr, int type, const uschar *endptr,
- int *lenptr, BOOL utf8)
+_pcre_is_newline(USPTR ptr, int type, USPTR endptr, int *lenptr, BOOL utf8)
{
int c;
if (utf8) { GETCHAR(c, ptr); } else c = *ptr;
@@ -123,8 +122,7 @@
*/

BOOL
-_pcre_was_newline(const uschar *ptr, int type, const uschar *startptr,
- int *lenptr, BOOL utf8)
+_pcre_was_newline(USPTR ptr, int type, USPTR startptr, int *lenptr, BOOL utf8)
{
int c;
ptr--;

Modified: code/trunk/pcre_valid_utf8.c
===================================================================
--- code/trunk/pcre_valid_utf8.c    2009-03-27 17:52:03 UTC (rev 408)
+++ code/trunk/pcre_valid_utf8.c    2009-03-28 17:10:56 UTC (rev 409)
@@ -6,7 +6,7 @@
 and semantics are as close as possible to those of the Perl 5 language.


                        Written by Philip Hazel
-           Copyright (c) 1997-2008 University of Cambridge
+           Copyright (c) 1997-2009 University of Cambridge


-----------------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
@@ -75,10 +75,10 @@
*/

int
-_pcre_valid_utf8(const uschar *string, int length)
+_pcre_valid_utf8(USPTR string, int length)
{
#ifdef SUPPORT_UTF8
-register const uschar *p;
+register USPTR p;

if (length < 0)
{