iliaa Wed Oct 27 19:12:06 2004 EDT Modified files: /php-src/ext/standard microtime.c Log: Simplify and cleanup code. http://cvs.php.net/diff.php/php-src/ext/standard/microtime.c?r1=1.48&r2=1.49&ty=u Index: php-src/ext/standard/microtime.c diff -u php-src/ext/standard/microtime.c:1.48 php-src/ext/standard/microtime.c:1.49 --- php-src/ext/standard/microtime.c:1.48 Mon Oct 25 09:28:56 2004 +++ php-src/ext/standard/microtime.c Wed Oct 27 19:12:05 2004 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: microtime.c,v 1.48 2004/10/25 13:28:56 iliaa Exp $ */ +/* $Id: microtime.c,v 1.49 2004/10/27 23:12:05 iliaa Exp $ */ #include "php.h" @@ -107,20 +107,15 @@ Returns an array of usage statistics */ PHP_FUNCTION(getrusage) { - struct rusage usg; - int ac = ZEND_NUM_ARGS(); - pval **pwho; + struct rusage usg = {0}; + long pwho = 0; int who = RUSAGE_SELF; - if(ac == 1 && - zend_get_parameters_ex(ac, &pwho) != FAILURE) { - convert_to_long_ex(pwho); - if(Z_LVAL_PP(pwho) == 1) - who = RUSAGE_CHILDREN; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &pwho) != FAILURE && pwho == 1) { + who = RUSAGE_CHILDREN; } - memset(&usg, 0, sizeof(usg)); - if(getrusage(who, &usg) == -1) { + if (getrusage(who, &usg) == -1) { RETURN_FALSE; }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php