cvs: php4 /ext/standard file.c

From: Date: Sat, 04 May 2002 17:12:27 +0000
Subject: cvs: php4 /ext/standard file.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-11669@lists.php.net to get a copy of this message
sas Sat May 4 13:12:27 2002 EDT Modified files: /php4/ext/standard file.c Log: Make this code work on compilers which don't consider the address of a variable on the stack available at compile time. Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.226 php4/ext/standard/file.c:1.227 --- php4/ext/standard/file.c:1.226 Tue Apr 30 00:27:52 2002 +++ php4/ext/standard/file.c Sat May 4 13:12:26 2002 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.c,v 1.226 2002/04/30 04:27:52 sebastian Exp $ */ +/* $Id: file.c,v 1.227 2002/05/04 17:12:26 sas Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -588,30 +588,29 @@ { zval *callback = (zval*)context->notifier->ptr; zval *retval = NULL; - zval zcode, zseverity, zmsg, zxcode, zsofar, zmax; - zval *ptrs[6] = {&zcode, &zseverity, &zmsg, &zxcode, &zsofar, &zmax}; - zval **args[6] = {&ptrs[0], &ptrs[1], &ptrs[2], &ptrs[3], &ptrs[4], &ptrs[5]}; + zval zvs[6]; + zval *ps[6]; + zval **ptps[6]; + int i; - INIT_ZVAL(zcode); - INIT_ZVAL(zseverity); - INIT_ZVAL(zmsg); - INIT_ZVAL(zxcode); - INIT_ZVAL(zsofar); - INIT_ZVAL(zmax); - - ZVAL_LONG(&zcode, notifycode); - ZVAL_LONG(&zseverity, severity); - ZVAL_LONG(&zxcode, xcode); - ZVAL_LONG(&zsofar, bytes_sofar); - ZVAL_LONG(&zmax, bytes_max); - + for (i = 0; i < 6; i++) { + INIT_ZVAL(zvs[i]); + ps[i] = &zvs[i]; + ptps[i] = &ps[i]; + } + + ZVAL_LONG(ps[0], notifycode); + ZVAL_LONG(ps[1], severity); if (xmsg) { - ZVAL_STRING(&zmsg, xmsg, 0); + ZVAL_STRING(ps[2], xmsg, 0); } else { - ZVAL_NULL(&zmsg); + ZVAL_NULL(ps[2]); } + ZVAL_LONG(ps[3], xcode); + ZVAL_LONG(ps[4], bytes_sofar); + ZVAL_LONG(ps[5], bytes_max); - if (FAILURE == call_user_function_ex(EG(function_table), NULL, callback, &retval, 6, args, 0, NULL TSRMLS_CC)) { + if (FAILURE == call_user_function_ex(EG(function_table), NULL, callback, &retval, 6, ptps, 0, NULL TSRMLS_CC)) { zend_error(E_WARNING, "failed to call user notifier"); } if (retval)

« previous php.cvs (#11669) next »