cvs: php-src(PHP_5_2) /ext/standard basic_functions.c streamsfuncs.c
| From: | Antony Dovgal | Date: | Thu, 31 Aug 2006 14:41:24 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/standard basic_functions.c streamsfuncs.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-40242@lists.php.net to get a copy of this message | ||
tony2001 Thu Aug 31 14:41:24 2006 UTC
Modified files: (Branch: PHP_5_2)
/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.725.2.31.2.22&r2=1.725.2.31.2.23&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.725.2.31.2.22
php-src/ext/standard/basic_functions.c:1.725.2.31.2.23
--- php-src/ext/standard/basic_functions.c:1.725.2.31.2.22 Mon Aug 28 19:57:57 2006
+++ php-src/ext/standard/basic_functions.c Thu Aug 31 14:41:23 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.725.2.31.2.22 2006/08/28 19:57:57 tony2001 Exp $ */
+/* $Id: basic_functions.c,v 1.725.2.31.2.23 2006/08/31 14:41:23 tony2001 Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -5379,20 +5379,20 @@
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 (PG(safe_mode) && (!php_checkuid(Z_STRVAL_P(filename), NULL,
CHECKUID_ALLOW_ONLY_FILE))) {
+ if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_ALLOW_ONLY_FILE))) {
RETURN_FALSE;
}
- if (php_check_open_basedir(Z_STRVAL_P(filename) TSRMLS_CC)) {
+ if (php_check_open_basedir(filename TSRMLS_CC)) {
RETURN_FALSE;
}
@@ -5402,7 +5402,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;
}
@@ -5455,16 +5455,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_start_ob_buffer (NULL, 0, 1 TSRMLS_CC);
@@ -5476,7 +5476,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.58.2.6.2.4&r2=1.58.2.6.2.5&diff_format=u
Index: php-src/ext/standard/streamsfuncs.c
diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.4
php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.5
--- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.4 Fri Jul 14 20:44:04 2006
+++ php-src/ext/standard/streamsfuncs.c Thu Aug 31 14:41:24 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streamsfuncs.c,v 1.58.2.6.2.4 2006/07/14 20:44:04 tony2001 Exp $ */
+/* $Id: streamsfuncs.c,v 1.58.2.6.2.5 2006/08/31 14:41:24 tony2001 Exp $ */
#include "php.h"
#include "php_globals.h"
@@ -706,7 +706,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;
@@ -715,7 +715,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);
@@ -752,9 +752,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) {
@@ -764,10 +764,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;
}