[PHP-CVS] cvs: php-src /ext/ctype ctype.c

2008-01-21 Thread Sara Golemon
pollita Mon Jan 21 08:10:21 2008 UTC

  Modified files:  
/php-src/ext/ctype  ctype.c 
  Log:
  Unicode migration for ext/ctype
  
http://cvs.php.net/viewvc.cgi/php-src/ext/ctype/ctype.c?r1=1.46&r2=1.47&diff_format=u
Index: php-src/ext/ctype/ctype.c
diff -u php-src/ext/ctype/ctype.c:1.46 php-src/ext/ctype/ctype.c:1.47
--- php-src/ext/ctype/ctype.c:1.46  Mon Dec 31 07:12:08 2007
+++ php-src/ext/ctype/ctype.c   Mon Jan 21 08:10:21 2008
@@ -159,17 +159,22 @@
return; \
switch (Z_TYPE_P(c)) { \
case IS_LONG: \
-   if (Z_LVAL_P(c) <= 255 && Z_LVAL_P(c) >= 0) { \
-   RETURN_BOOL(iswhat(Z_LVAL_P(c))); \
-   } else if (Z_LVAL_P(c) >= -128 && Z_LVAL_P(c) < 0) { \
-   RETURN_BOOL(iswhat(Z_LVAL_P(c) + 256)); \
+   RETURN_BOOL(u_##iswhat(Z_LVAL_P(c))); \
+   break; \
+   case IS_UNICODE: \
+   { \
+   int ofs = 0; \
+   while (ofs < Z_USTRLEN_P(c)) { \
+   UChar32 ch; \
+   U16_GET(Z_USTRVAL_P(c), 0, ofs, Z_USTRLEN_P(c), 
ch); \
+   if (!u_##iswhat(ch)) { \
+   RETURN_FALSE; \
+   } \
+   U16_FWD_1(Z_USTRVAL_P(c), ofs, Z_USTRLEN_P(c)); 
\
+   } \
+   RETURN_TRUE; \
} \
-   tmp = *c; \
-   zval_copy_ctor(&tmp); \
-   convert_to_string(&tmp); \
-   c = &tmp; \
case IS_STRING: \
-string:\
{ \
char *p = Z_STRVAL_P(c), *e = Z_STRVAL_P(c) + 
Z_STRLEN_P(c); \
if (e == p) {   \
@@ -185,12 +190,6 @@
if (c == &tmp) zval_dtor(&tmp); \
RETURN_TRUE; \
} \
-   case IS_UNICODE: \
-   tmp = *c; \
-   zval_copy_ctor(&tmp); \
-   convert_to_string(&tmp); \
-   c = &tmp; \
-   goto string; \
default: \
break; \
} \
@@ -198,7 +197,7 @@
  
 /* }}} */
 
-/* {{{ proto bool ctype_alnum(mixed c)
+/* {{{ proto bool ctype_alnum(mixed c) U
Checks for alphanumeric character(s) */
 static PHP_FUNCTION(ctype_alnum)
 {
@@ -206,7 +205,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool ctype_alpha(mixed c)
+/* {{{ proto bool ctype_alpha(mixed c) U
Checks for alphabetic character(s) */
 static PHP_FUNCTION(ctype_alpha)
 {
@@ -214,7 +213,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool ctype_cntrl(mixed c)
+/* {{{ proto bool ctype_cntrl(mixed c) U
Checks for control character(s) */
 static PHP_FUNCTION(ctype_cntrl)
 {
@@ -222,7 +221,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool ctype_digit(mixed c)
+/* {{{ proto bool ctype_digit(mixed c) U
Checks for numeric character(s) */
 static PHP_FUNCTION(ctype_digit)
 {
@@ -230,7 +229,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool ctype_lower(mixed c)
+/* {{{ proto bool ctype_lower(mixed c) U
Checks for lowercase character(s)  */
 static PHP_FUNCTION(ctype_lower)
 {
@@ -238,7 +237,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool ctype_graph(mixed c)
+/* {{{ proto bool ctype_graph(mixed c) U
Checks for any printable character(s) except space */
 static PHP_FUNCTION(ctype_graph)
 {
@@ -246,7 +245,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool ctype_print(mixed c)
+/* {{{ proto bool ctype_print(mixed c) U
Checks for printable character(s) */
 static PHP_FUNCTION(ctype_print)
 {
@@ -254,7 +253,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool ctype_punct(mixed c)
+/* {{{ proto bool ctype_punct(mixed c) U
Checks for any printable character which is not whitespace or an 
alphanumeric character */
 static PHP_FUNCTION(ctype_punct)
 {
@@ -262,7 +261,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool ctype_space(mixed c)
+/* {{{ proto bool ctype_space(mixed c) U
Checks for whitespace character(s)*/
 static PHP_FUNCTION(ctype_space)
 {
@@ -270,7 +269,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool ctype_upper(mixed c)
+/* {{{ proto bool ctype_upper(mixed c) U
Checks for uppercase character(s) */
 static PHP_FUNCTION(ctype_upper)
 {
@@ -278,7 +277,7 @@
 }
 /* }}} */
 
-/* {{{ proto bool ctype_xdigit(mixed c)
+/* {{{ proto bool ctype_xdigit(mixed c) U
Checks for character(s) representing a hexadecimal digit */
 static PHP_FUNCTION(ctype_xdigit)
 {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/ctype ctype.c /ext/gmp gmp.c /ext/tokenizer tokenizer.c /ext/xmlreader php_xmlreader.c /ext/xsl php_xsl.c

2007-01-12 Thread Antony Dovgal
tony2001Fri Jan 12 12:16:36 2007 UTC

  Modified files:  
/php-src/ext/xslphp_xsl.c 
/php-src/ext/xmlreader  php_xmlreader.c 
/php-src/ext/tokenizer  tokenizer.c 
/php-src/ext/gmpgmp.c 
/php-src/ext/ctype  ctype.c 
  Log:
  delete useless comments and skeleton leftovers
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/xsl/php_xsl.c?r1=1.40&r2=1.41&diff_format=u
Index: php-src/ext/xsl/php_xsl.c
diff -u php-src/ext/xsl/php_xsl.c:1.40 php-src/ext/xsl/php_xsl.c:1.41
--- php-src/ext/xsl/php_xsl.c:1.40  Mon Jan  1 09:29:34 2007
+++ php-src/ext/xsl/php_xsl.c   Fri Jan 12 12:16:35 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_xsl.c,v 1.40 2007/01/01 09:29:34 sebastian Exp $ */
+/* $Id: php_xsl.c,v 1.41 2007/01/12 12:16:35 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -28,9 +28,6 @@
 #include "php_xsl.h"
 
 
-/* If you declare any globals in php_xsl.h uncomment this:
-ZEND_DECLARE_MODULE_GLOBALS(xsl)
-*/
 zend_class_entry *xsl_xsltprocessor_class_entry;
 static zend_object_handlers xsl_object_handlers;
 
@@ -251,10 +248,6 @@
  */
 PHP_MSHUTDOWN_FUNCTION(xsl)
 {
-   /* uncomment this line if you have INI entries
-   UNREGISTER_INI_ENTRIES();
-   */
-
xsltUnregisterExtModuleFunction ((const xmlChar *) "functionString",
   (const xmlChar *) "http://php.net/xsl";);
xsltUnregisterExtModuleFunction ((const xmlChar *) "function",
@@ -266,7 +259,6 @@
 }
 /* }}} */
 
-/* Remove if there's nothing to do at request start */
 /* {{{ PHP_RINIT_FUNCTION
  */
 PHP_RINIT_FUNCTION(xsl)
@@ -276,7 +268,6 @@
 }
 /* }}} */
 
-/* Remove if there's nothing to do at request end */
 /* {{{ PHP_RSHUTDOWN_FUNCTION
  */
 PHP_RSHUTDOWN_FUNCTION(xsl)
@@ -308,14 +299,10 @@
php_info_print_table_row(2, "libxslt compiled against libxml 
Version", buffer);
}
 #if HAVE_XSL_EXSLT
-   php_info_print_table_row(2, "EXSLT", "enabled");
-   php_info_print_table_row(2, "libexslt Version", 
LIBEXSLT_DOTTED_VERSION);
+   php_info_print_table_row(2, "EXSLT", "enabled");
+   php_info_print_table_row(2, "libexslt Version", 
LIBEXSLT_DOTTED_VERSION);
 #endif
php_info_print_table_end();
-
-   /* Remove comments if you have entries in php.ini
-   DISPLAY_INI_ENTRIES();
-   */
 }
 /* }}} */
 
http://cvs.php.net/viewvc.cgi/php-src/ext/xmlreader/php_xmlreader.c?r1=1.44&r2=1.45&diff_format=u
Index: php-src/ext/xmlreader/php_xmlreader.c
diff -u php-src/ext/xmlreader/php_xmlreader.c:1.44 
php-src/ext/xmlreader/php_xmlreader.c:1.45
--- php-src/ext/xmlreader/php_xmlreader.c:1.44  Mon Jan  1 09:29:33 2007
+++ php-src/ext/xmlreader/php_xmlreader.c   Fri Jan 12 12:16:36 2007
@@ -16,7 +16,7 @@
   +--+
 */
 
-/* $Id: php_xmlreader.c,v 1.44 2007/01/01 09:29:33 sebastian Exp $ */
+/* $Id: php_xmlreader.c,v 1.45 2007/01/12 12:16:36 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1304,7 +1304,6 @@
 }
 /* }}} */
 
-
 /* {{{ PHP_MSHUTDOWN_FUNCTION
  */
 PHP_MSHUTDOWN_FUNCTION(xmlreader)
@@ -1323,10 +1322,6 @@
php_info_print_table_row(2, "XMLReader", "enabled");
}
php_info_print_table_end();
-
-   /* Remove comments if you have entries in php.ini
-   DISPLAY_INI_ENTRIES();
-   */
 }
 /* }}} */
 
http://cvs.php.net/viewvc.cgi/php-src/ext/tokenizer/tokenizer.c?r1=1.39&r2=1.40&diff_format=u
Index: php-src/ext/tokenizer/tokenizer.c
diff -u php-src/ext/tokenizer/tokenizer.c:1.39 
php-src/ext/tokenizer/tokenizer.c:1.40
--- php-src/ext/tokenizer/tokenizer.c:1.39  Mon Jan  1 09:29:33 2007
+++ php-src/ext/tokenizer/tokenizer.c   Fri Jan 12 12:16:36 2007
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: tokenizer.c,v 1.39 2007/01/01 09:29:33 sebastian Exp $ */
+/* $Id: tokenizer.c,v 1.40 2007/01/12 12:16:36 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -92,12 +92,6 @@
 
 #define zendtext LANG_SCNG(yy_text)
 #define zendleng LANG_SCNG(yy_leng)
-/* If you declare any globals in php_tokenizer.h uncomment this:
-ZEND_DECLARE_MODULE_GLOBALS(tokenizer)
-*/
-
-/* True global resources - no need for thread safety here */
-/* static int le_tokenizer; */
 
 /* {{{ tokenizer_functions[]
  *
@@ -134,35 +128,10 @@
 ZEND_GET_MODULE(tokenizer)
 #endif
 
-/* {{{ PHP_INI
- */
-/* Remove comments and fill if you need to have entries in php.ini
-PHP_INI_BEGIN()
-   STD_PHP_INI_ENTRY("tokenizer.global_value",  "42", PHP_INI_ALL, 
OnUpdateLong, global_value, zend_tokenizer_globals, tokenizer_globals)
-   STD_PHP_INI_ENTRY("tokenizer.global_string", "foobar", PHP_INI_ALL, 
OnUpdateString, global_string, zend_tokenizer_globals, tokenizer_globals)
-PHP_INI_END()
-*/
-/* }}} */
-
-/* {{{ PHP_GINIT_FUNCT

[PHP-CVS] cvs: php-src /ext/ctype ctype.c

2005-12-21 Thread Dmitry Stogov
dmitry  Thu Dec 22 07:54:19 2005 EDT

  Modified files:  
/php-src/ext/ctype  ctype.c 
  Log:
  Fixed memory corruption
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/ctype/ctype.c?r1=1.36&r2=1.37&diff_format=u
Index: php-src/ext/ctype/ctype.c
diff -u php-src/ext/ctype/ctype.c:1.36 php-src/ext/ctype/ctype.c:1.37
--- php-src/ext/ctype/ctype.c:1.36  Tue Dec  6 02:24:26 2005
+++ php-src/ext/ctype/ctype.c   Thu Dec 22 07:54:19 2005
@@ -92,7 +92,7 @@
 /* {{{ ctype
  */
 #define CTYPE(iswhat) \
-   zval *c; \
+   zval *c, tmp; \
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &c) == 
FAILURE) \
return; \
switch (Z_TYPE_P(c)) { \
@@ -102,23 +102,33 @@
} else if (Z_LVAL_P(c) >= -128 && Z_LVAL_P(c) < 0) { \
RETURN_BOOL(iswhat(Z_LVAL_P(c) + 256)); \
} \
-   SEPARATE_ZVAL(&c);  \
-   convert_to_string(c);   \
+   tmp = *c; \
+   zval_copy_ctor(&tmp); \
+   convert_to_string(&tmp); \
+   c = &tmp; \
case IS_STRING: \
case IS_BINARY: \
 string:\
{ \
char *p = Z_STRVAL_P(c), *e = Z_STRVAL_P(c) + 
Z_STRLEN_P(c); \
if (e == p) {   \
+   if (c == &tmp) zval_dtor(&tmp); \
RETURN_FALSE;   \
}   \
while (p < e) { \
-   if(!iswhat((int)*(unsigned char *)(p++))) 
RETURN_FALSE; \
+   if(!iswhat((int)*(unsigned char *)(p++))) { \
+   if (c == &tmp) zval_dtor(&tmp); \
+   RETURN_FALSE; \
+   } \
} \
+   if (c == &tmp) zval_dtor(&tmp); \
RETURN_TRUE; \
} \
case IS_UNICODE: \
-   convert_to_string(c); \
+   tmp = *c; \
+   zval_copy_ctor(&tmp); \
+   convert_to_string(&tmp); \
+   c = &tmp; \
goto string; \
default: \
break; \

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/ctype ctype.c

2005-08-17 Thread Andrei Zmievski
Keep in mind that we only want to use POSIX-compatible ICU functions  
for ext/ctype. The full range of character properties will be  
available via ext/unicode.


-Andrei


On Aug 17, 2005, at 1:42 PM, Ilia Alshanetsky wrote:


Yeah, I'll put it on my todo.

Ilia

Dmitry Stogov wrote:


You probably right.
Can you do it by you self?

Dmitry.




-Original Message-
From: Ilia Alshanetsky [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 17, 2005 6:25 PM
To: Dmitry Stogov
Cc: php-cvs@lists.php.net
Subject: Re: [PHP-CVS] cvs: php-src /ext/ctype ctype.c


Dmitry,

Would it not be better to emulate ctype functionality via
equivalent ICU functions/macros when the given value is Unicode?

Ilia

Dmitry Stogov wrote:



dmitryWed Aug 17 10:16:06 2005 EDT

 Modified files:
   /php-src/ext/ctypectype.c
 Log:
 Unicode support






http://cvs.php.net/diff.php/php-src/ext/ctype/ctype.c? 
r1=1.34&r2=1.35&




ty=u
Index: php-src/ext/ctype/ctype.c
diff -u php-src/ext/ctype/ctype.c:1.34



php-src/ext/ctype/ctype.c:1.35



--- php-src/ext/ctype/ctype.c:1.34Wed Aug  3 10:06:43 2005
+++ php-src/ext/ctype/ctype.cWed Aug 17 10:16:05 2005
@@ -105,6 +105,8 @@
SEPARATE_ZVAL(&c);\
convert_to_string(c);\
case IS_STRING: \
+case IS_BINARY: \
+string:\
{ \
char *p = Z_STRVAL_P(c), *e =



Z_STRVAL_P(c) + Z_STRLEN_P(c); \



if (e == p) {\
@@ -115,6 +117,9 @@
} \
RETURN_TRUE; \
} \
+case IS_UNICODE: \
+convert_to_string(c); \
+goto string; \
default: \
break; \
} \














--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/ctype ctype.c

2005-08-17 Thread Ilia Alshanetsky
Yeah, I'll put it on my todo.

Ilia

Dmitry Stogov wrote:
> You probably right.
> Can you do it by you self?
> 
> Dmitry.
> 
> 
>>-Original Message-
>>From: Ilia Alshanetsky [mailto:[EMAIL PROTECTED] 
>>Sent: Wednesday, August 17, 2005 6:25 PM
>>To: Dmitry Stogov
>>Cc: php-cvs@lists.php.net
>>Subject: Re: [PHP-CVS] cvs: php-src /ext/ctype ctype.c
>>
>>
>>Dmitry,
>>
>>Would it not be better to emulate ctype functionality via 
>>equivalent ICU functions/macros when the given value is Unicode?
>>
>>Ilia
>>
>>Dmitry Stogov wrote:
>>
>>>dmitry   Wed Aug 17 10:16:06 2005 EDT
>>>
>>>  Modified files:  
>>>/php-src/ext/ctype   ctype.c 
>>>  Log:
>>>  Unicode support
>>>  
>>>  
>>>
>>
>>http://cvs.php.net/diff.php/php-src/ext/ctype/ctype.c?r1=1.34&r2=1.35&;
>>
>>>ty=u
>>>Index: php-src/ext/ctype/ctype.c
>>>diff -u php-src/ext/ctype/ctype.c:1.34 
>>
>>php-src/ext/ctype/ctype.c:1.35
>>
>>>--- php-src/ext/ctype/ctype.c:1.34   Wed Aug  3 10:06:43 2005
>>>+++ php-src/ext/ctype/ctype.cWed Aug 17 10:16:05 2005
>>>@@ -105,6 +105,8 @@
>>> SEPARATE_ZVAL(&c);  \
>>> convert_to_string(c);   \
>>> case IS_STRING: \
>>>+case IS_BINARY: \
>>>+string:\
>>> { \
>>> char *p = Z_STRVAL_P(c), *e = 
>>
>>Z_STRVAL_P(c) + Z_STRLEN_P(c); \
>>
>>> if (e == p) {   \
>>>@@ -115,6 +117,9 @@
>>> } \
>>> RETURN_TRUE; \
>>> } \
>>>+case IS_UNICODE: \
>>>+convert_to_string(c); \
>>>+goto string; \
>>> default: \
>>> break; \
>>> } \
>>>
>>
>>
> 
> 
> 
> 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-CVS] cvs: php-src /ext/ctype ctype.c

2005-08-17 Thread Dmitry Stogov
You probably right.
Can you do it by you self?

Dmitry.

> -Original Message-
> From: Ilia Alshanetsky [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, August 17, 2005 6:25 PM
> To: Dmitry Stogov
> Cc: php-cvs@lists.php.net
> Subject: Re: [PHP-CVS] cvs: php-src /ext/ctype ctype.c
> 
> 
> Dmitry,
> 
> Would it not be better to emulate ctype functionality via 
> equivalent ICU functions/macros when the given value is Unicode?
> 
> Ilia
> 
> Dmitry Stogov wrote:
> > dmitry  Wed Aug 17 10:16:06 2005 EDT
> > 
> >   Modified files:  
> > /php-src/ext/ctype  ctype.c 
> >   Log:
> >   Unicode support
> >   
> >   
> > 
> http://cvs.php.net/diff.php/php-src/ext/ctype/ctype.c?r1=1.34&r2=1.35&;
> > ty=u
> > Index: php-src/ext/ctype/ctype.c
> > diff -u php-src/ext/ctype/ctype.c:1.34 
> php-src/ext/ctype/ctype.c:1.35
> > --- php-src/ext/ctype/ctype.c:1.34  Wed Aug  3 10:06:43 2005
> > +++ php-src/ext/ctype/ctype.c   Wed Aug 17 10:16:05 2005
> > @@ -105,6 +105,8 @@
> > SEPARATE_ZVAL(&c);  \
> > convert_to_string(c);   \
> > case IS_STRING: \
> > +   case IS_BINARY: \
> > +string:\
> > { \
> > char *p = Z_STRVAL_P(c), *e = 
> Z_STRVAL_P(c) + Z_STRLEN_P(c); \
> > if (e == p) {   \
> > @@ -115,6 +117,9 @@
> > } \
> > RETURN_TRUE; \
> > } \
> > +   case IS_UNICODE: \
> > +   convert_to_string(c); \
> > +   goto string; \
> > default: \
> > break; \
> > } \
> > 
> 
> 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/ctype ctype.c

2005-08-17 Thread Ilia Alshanetsky
Dmitry,

Would it not be better to emulate ctype functionality via equivalent ICU
functions/macros when the given value is Unicode?

Ilia

Dmitry Stogov wrote:
> dmitryWed Aug 17 10:16:06 2005 EDT
> 
>   Modified files:  
> /php-src/ext/ctypectype.c 
>   Log:
>   Unicode support
>   
>   
> http://cvs.php.net/diff.php/php-src/ext/ctype/ctype.c?r1=1.34&r2=1.35&ty=u
> Index: php-src/ext/ctype/ctype.c
> diff -u php-src/ext/ctype/ctype.c:1.34 php-src/ext/ctype/ctype.c:1.35
> --- php-src/ext/ctype/ctype.c:1.34Wed Aug  3 10:06:43 2005
> +++ php-src/ext/ctype/ctype.c Wed Aug 17 10:16:05 2005
> @@ -105,6 +105,8 @@
>   SEPARATE_ZVAL(&c);  \
>   convert_to_string(c);   \
>   case IS_STRING: \
> + case IS_BINARY: \
> +string:\
>   { \
>   char *p = Z_STRVAL_P(c), *e = Z_STRVAL_P(c) + 
> Z_STRLEN_P(c); \
>   if (e == p) {   \
> @@ -115,6 +117,9 @@
>   } \
>   RETURN_TRUE; \
>   } \
> + case IS_UNICODE: \
> + convert_to_string(c); \
> + goto string; \
>   default: \
>   break; \
>   } \
> 

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/ctype ctype.c

2005-08-17 Thread Dmitry Stogov
dmitry  Wed Aug 17 10:16:06 2005 EDT

  Modified files:  
/php-src/ext/ctype  ctype.c 
  Log:
  Unicode support
  
  
http://cvs.php.net/diff.php/php-src/ext/ctype/ctype.c?r1=1.34&r2=1.35&ty=u
Index: php-src/ext/ctype/ctype.c
diff -u php-src/ext/ctype/ctype.c:1.34 php-src/ext/ctype/ctype.c:1.35
--- php-src/ext/ctype/ctype.c:1.34  Wed Aug  3 10:06:43 2005
+++ php-src/ext/ctype/ctype.c   Wed Aug 17 10:16:05 2005
@@ -105,6 +105,8 @@
SEPARATE_ZVAL(&c);  \
convert_to_string(c);   \
case IS_STRING: \
+   case IS_BINARY: \
+string:\
{ \
char *p = Z_STRVAL_P(c), *e = Z_STRVAL_P(c) + 
Z_STRLEN_P(c); \
if (e == p) {   \
@@ -115,6 +117,9 @@
} \
RETURN_TRUE; \
} \
+   case IS_UNICODE: \
+   convert_to_string(c); \
+   goto string; \
default: \
break; \
} \

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/ctype ctype.c

2004-11-30 Thread Ilia Alshanetsky
iliaa   Tue Nov 30 11:55:55 2004 EDT

  Modified files:  
/php-src/ext/ctype  ctype.c 
  Log:
  Fixed bug #30945 (make ctype_* functions return FALSE on empty strings).
  Slight performance improvement of multi-byte string checking via ctype_*.
  
  
http://cvs.php.net/diff.php/php-src/ext/ctype/ctype.c?r1=1.32&r2=1.33&ty=u
Index: php-src/ext/ctype/ctype.c
diff -u php-src/ext/ctype/ctype.c:1.32 php-src/ext/ctype/ctype.c:1.33
--- php-src/ext/ctype/ctype.c:1.32  Wed Sep 29 21:22:56 2004
+++ php-src/ext/ctype/ctype.c   Tue Nov 30 11:55:55 2004
@@ -106,11 +106,11 @@
convert_to_string(c);   \
case IS_STRING: \
{ \
-   char *p; \
-   int n, len; \
-   p=Z_STRVAL_P(c); \
-   len = Z_STRLEN_P(c); \
-   for(n=0;nhttp://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/ctype ctype.c

2004-09-29 Thread Ilia Alshanetsky
iliaa   Wed Sep 29 21:22:56 2004 EDT

  Modified files:  
/php-src/ext/ctype  ctype.c 
  Log:
  Fixed bug #30276 (Possible crash in ctype_digit on large numbers).
  
  
http://cvs.php.net/diff.php/php-src/ext/ctype/ctype.c?r1=1.31&r2=1.32&ty=u
Index: php-src/ext/ctype/ctype.c
diff -u php-src/ext/ctype/ctype.c:1.31 php-src/ext/ctype/ctype.c:1.32
--- php-src/ext/ctype/ctype.c:1.31  Tue Jul 20 16:08:08 2004
+++ php-src/ext/ctype/ctype.c   Wed Sep 29 21:22:56 2004
@@ -99,7 +99,7 @@
case IS_LONG: \
if (Z_LVAL_P(c) <= 255 && Z_LVAL_P(c) >= 0) { \
RETURN_BOOL(iswhat(Z_LVAL_P(c))); \
-   } else if (Z_LVAL_P(c) >= -128) { \
+   } else if (Z_LVAL_P(c) >= -128 && Z_LVAL_P(c) < 0) { \
RETURN_BOOL(iswhat(Z_LVAL_P(c) + 256)); \
} \
SEPARATE_ZVAL(&c);  \

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/ctype ctype.c

2004-07-20 Thread Moriyoshi Koizumi
moriyoshi   Tue Jul 20 16:08:08 2004 EDT

  Modified files:  
/php-src/ext/ctype  ctype.c 
  Log:
  - Correct range checks.
  - Normalize negative values.
  
  
http://cvs.php.net/diff.php/php-src/ext/ctype/ctype.c?r1=1.30&r2=1.31&ty=u
Index: php-src/ext/ctype/ctype.c
diff -u php-src/ext/ctype/ctype.c:1.30 php-src/ext/ctype/ctype.c:1.31
--- php-src/ext/ctype/ctype.c:1.30  Mon Jul 19 21:03:16 2004
+++ php-src/ext/ctype/ctype.c   Tue Jul 20 16:08:08 2004
@@ -97,9 +97,11 @@
return; \
switch (Z_TYPE_P(c)) { \
case IS_LONG: \
-   if (Z_LVAL_P(c) < 255 && Z_LVAL_P(c) > -127) {  \
+   if (Z_LVAL_P(c) <= 255 && Z_LVAL_P(c) >= 0) { \
RETURN_BOOL(iswhat(Z_LVAL_P(c))); \
-   }   \
+   } else if (Z_LVAL_P(c) >= -128) { \
+   RETURN_BOOL(iswhat(Z_LVAL_P(c) + 256)); \
+   } \
SEPARATE_ZVAL(&c);  \
convert_to_string(c);   \
case IS_STRING: \

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/ctype ctype.c

2004-07-19 Thread Ilia Alshanetsky
iliaa   Mon Jul 19 21:03:16 2004 EDT

  Modified files:  
/php-src/ext/ctype  ctype.c 
  Log:
  Fixed bug #29226 (ctype_* functions missing validation of numeric string 
  representations).
  
  
http://cvs.php.net/diff.php/php-src/ext/ctype/ctype.c?r1=1.29&r2=1.30&ty=u
Index: php-src/ext/ctype/ctype.c
diff -u php-src/ext/ctype/ctype.c:1.29 php-src/ext/ctype/ctype.c:1.30
--- php-src/ext/ctype/ctype.c:1.29  Thu Jan  8 03:14:36 2004
+++ php-src/ext/ctype/ctype.c   Mon Jul 19 21:03:16 2004
@@ -97,7 +97,11 @@
return; \
switch (Z_TYPE_P(c)) { \
case IS_LONG: \
-   RETURN_BOOL(iswhat(Z_LVAL_P(c))); \
+   if (Z_LVAL_P(c) < 255 && Z_LVAL_P(c) > -127) {  \
+   RETURN_BOOL(iswhat(Z_LVAL_P(c))); \
+   }   \
+   SEPARATE_ZVAL(&c);  \
+   convert_to_string(c);   \
case IS_STRING: \
{ \
char *p; \

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] cvs: php-src /ext/ctype ctype.c

2003-10-03 Thread Moriyoshi Koizumi
moriyoshi   Fri Oct  3 11:50:02 2003 EDT

  Modified files:  
/php-src/ext/ctype  ctype.c 
  Log:
  Bug #25745 (ctype functions don't deal with non-ascii characters properly)
  
  
Index: php-src/ext/ctype/ctype.c
diff -u php-src/ext/ctype/ctype.c:1.27 php-src/ext/ctype/ctype.c:1.28
--- php-src/ext/ctype/ctype.c:1.27  Tue Jun 10 16:03:26 2003
+++ php-src/ext/ctype/ctype.c   Fri Oct  3 11:50:01 2003
@@ -105,7 +105,7 @@
p=Z_STRVAL_P(c); \
len = Z_STRLEN_P(c); \
for(n=0;nhttp://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php