For Programmers: Free Programming Magazines  


Home > Archive > PHP Zend Engine > August 2006 > cvs: ZendEngine2 / zend_API.c









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cvs: ZendEngine2 / zend_API.c
Andrei Zmievski

2006-08-04, 6:56 pm

andrei Fri Aug 4 17:02:17 2006 UTC

Modified files:
/ZendEngine2 zend_API.c
Log:
Scan through all the modifiers at once, setting flags.


http://cvs.php.net/viewvc.cgi/ZendE...2&diff_format=u
Index: ZendEngine2/zend_API.c
diff -u ZendEngine2/zend_API.c:1.391 ZendEngine2/zend_API.c:1.392
--- ZendEngine2/zend_API.c:1.391 Fri Aug 4 16:58:29 2006
+++ ZendEngine2/zend_API.c Fri Aug 4 17:02:17 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/

-/* $Id: zend_API.c,v 1.391 2006/08/04 16:58:29 andrei Exp $ */
+/* $Id: zend_API.c,v 1.392 2006/08/04 17:02:17 andrei Exp $ */

#include "zend.h"
#include "zend_execute.h"
@@ -315,12 +315,20 @@
char *spec_walk = *spec;
char c = *spec_walk++;
int return_null = 0;
+ int alternate_form = 0;

- while (*spec_walk == '/' || *spec_walk == '!') {
+ /* scan through modifiers */
+ while (1) {
if (*spec_walk == '/') {
SEPARATE_ZVAL_IF_NOT_REF(arg);
- } else if (*spec_walk == '!' && Z_TYPE_PP(arg) == IS_NULL) {
- return_null = 1;
+ } else if (*spec_walk == '&') {
+ alternate_form = 1;
+ } else if (*spec_walk == '!') {
+ if (Z_TYPE_PP(arg) == IS_NULL) {
+ return_null = 1;
+ }
+ } else {
+ break;
}
spec_walk++;
}
@@ -427,7 +435,7 @@
int *pl = va_arg(*va, int *);
UConverter *conv = NULL;

- if (c == 's' && *spec_walk == '&') {
+ if (c == 's' && alternate_form) {
conv = va_arg(*va, UConverter *);
spec_walk++;
}
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com