cvs: php-src /ext/standard basic_functions.c streamsfuncs.c

From: Date: Thu, 31 Aug 2006 14:41:16 +0000
Subject: cvs: php-src /ext/standard basic_functions.c streamsfuncs.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-40241@lists.php.net to get a copy of this message
tony2001 Thu Aug 31 14:41:16 2006 UTC Modified files: /php-src/ext/standard basic_functions.c streamsfuncs.c Log: more z/Z fixes http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.800&r2=1.801&diff_format=u Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.800 php-src/ext/standard/basic_functions.c:1.801 --- php-src/ext/standard/basic_functions.c:1.800 Mon Aug 28 19:56:06 2006 +++ php-src/ext/standard/basic_functions.c Thu Aug 31 14:41:15 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.800 2006/08/28 19:56:06 tony2001 Exp $ */ +/* $Id: basic_functions.c,v 1.801 2006/08/31 14:41:15 tony2001 Exp $ */ #include "php.h" #include "php_streams.h" @@ -5365,16 +5365,16 @@ Syntax highlight a source file */ PHP_FUNCTION(highlight_file) { - zval *filename; + char *filename; + int filename_len; zend_syntax_highlighter_ini syntax_highlighter_ini; zend_bool i = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &filename, &i) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &filename, &filename_len, &i) == FAILURE) { RETURN_FALSE; } - convert_to_string(filename); - if (php_check_open_basedir(Z_STRVAL_P(filename) TSRMLS_CC)) { + if (php_check_open_basedir(filename TSRMLS_CC)) { RETURN_FALSE; } @@ -5384,7 +5384,7 @@ php_get_highlight_struct(&syntax_highlighter_ini); - if (highlight_file(Z_STRVAL_P(filename), &syntax_highlighter_ini TSRMLS_CC) == FAILURE) { + if (highlight_file(filename, &syntax_highlighter_ini TSRMLS_CC) == FAILURE) { RETURN_FALSE; } @@ -5437,16 +5437,16 @@ Syntax highlight a string or optionally return it */ PHP_FUNCTION(highlight_string) { - zval *expr; + zval **expr; zend_syntax_highlighter_ini syntax_highlighter_ini; char *hicompiled_string_description; zend_bool i = 0; int old_error_reporting = EG(error_reporting); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|b", &expr, &i) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z|b", &expr, &i) == FAILURE) { RETURN_FALSE; } - convert_to_string(expr); + convert_to_string_ex(expr); if (i) { php_output_start_default(TSRMLS_C); @@ -5458,7 +5458,7 @@ hicompiled_string_description = zend_make_compiled_string_description("highlighted code" TSRMLS_CC); - if (highlight_string(expr, &syntax_highlighter_ini, hicompiled_string_description TSRMLS_CC) == FAILURE) { + if (highlight_string(*expr, &syntax_highlighter_ini, hicompiled_string_description TSRMLS_CC) == FAILURE) { efree(hicompiled_string_description); RETURN_FALSE; } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.82&r2=1.83&diff_format=u Index: php-src/ext/standard/streamsfuncs.c diff -u php-src/ext/standard/streamsfuncs.c:1.82 php-src/ext/standard/streamsfuncs.c:1.83 --- php-src/ext/standard/streamsfuncs.c:1.82 Tue Aug 8 16:59:11 2006 +++ php-src/ext/standard/streamsfuncs.c Thu Aug 31 14:41:15 2006 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: streamsfuncs.c,v 1.82 2006/08/08 16:59:11 tony2001 Exp $ */ +/* $Id: streamsfuncs.c,v 1.83 2006/08/31 14:41:15 tony2001 Exp $ */ #include "php.h" #include "php_globals.h" @@ -711,7 +711,7 @@ Runs the select() system call on the sets of streams with a timeout specified by tv_sec and tv_usec */ PHP_FUNCTION(stream_select) { - zval *r_array, *w_array, *e_array, *sec = NULL; + zval *r_array, *w_array, *e_array, **sec = NULL; struct timeval tv; struct timeval *tv_p = NULL; fd_set rfds, wfds, efds; @@ -720,7 +720,7 @@ long usec = 0; int set_count, max_set_count = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!a!a!z!|l", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE) + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!a!a!Z!|l", &r_array, &w_array, &e_array, &sec, &usec) == FAILURE) return; FD_ZERO(&rfds); @@ -757,9 +757,9 @@ /* If seconds is not set to null, build the timeval, else we wait indefinitely */ if (sec != NULL) { - convert_to_long(sec); + convert_to_long_ex(sec); - if (Z_LVAL_P(sec) < 0) { + if (Z_LVAL_PP(sec) < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "The seconds parameter must be greater than 0."); RETURN_FALSE; } else if (usec < 0) { @@ -769,10 +769,10 @@ /* Solaris + BSD do not like microsecond values which are >= 1 sec */ if (usec > 999999) { - tv.tv_sec = Z_LVAL_P(sec) + (usec / 1000000); + tv.tv_sec = Z_LVAL_PP(sec) + (usec / 1000000); tv.tv_usec = usec % 1000000; } else { - tv.tv_sec = Z_LVAL_P(sec); + tv.tv_sec = Z_LVAL_PP(sec); tv.tv_usec = usec; }

« previous php.cvs (#40241) next »