com php-src: Merge branch 'pull-request/778' into bcscale-return-old-value: ext/bcmath/bcmath.c

From: Date: Wed, 06 Sep 2017 12:28:51 +0000
Subject: com php-src: Merge branch 'pull-request/778' into bcscale-return-old-value: ext/bcmath/bcmath.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-99421@lists.php.net to get a copy of this message
Commit: cf61ec64a4f1aedf244e052e5e633c7ef009f145 Author: Christoph M. Becker <cmbecker69@gmx.de> Wed, 6 Sep 2017 14:28:51 +0200 Parents: 8e6619445f0029ade97581839f99645215a416c4 1e3435b2898ea2b9e16ca92064edd8fa1a07b44c Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cf61ec64a4f1aedf244e052e5e633c7ef009f145 Log: Merge branch 'pull-request/778' into bcscale-return-old-value Changed paths: MM ext/bcmath/bcmath.c Diff: diff --cc ext/bcmath/bcmath.c index e8b87dc,39228ba..6020a7c --- a/ext/bcmath/bcmath..c +++ b/ext/bcmath/bcmath.c @@@ -581,15 -537,19 +581,20 @@@ PHP_FUNCTION(bccomp Sets default scale parameter for all bc math functions */ PHP_FUNCTION(bcscale) { - zend_long new_scale; - long old_scale, new_scale; ++ zend_long old_scale, new_scale; - ZEND_PARSE_PARAMETERS_START(1, 1) - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &new_scale) == FAILURE) { - return; - } ++ ZEND_PARSE_PARAMETERS_START(0, 1) ++ Z_PARAM_OPTIONAL + Z_PARAM_LONG(new_scale) + ZEND_PARSE_PARAMETERS_END(); + old_scale = BCG(bc_precision); + + if (ZEND_NUM_ARGS() == 1) { - BCG(bc_precision) = ((int)new_scale < 0) ? 0 : new_scale; + BCG(bc_precision) = ((int)new_scale < 0) ? 0 : new_scale; + } - RETURN_TRUE; + RETURN_LONG(old_scale); } /* }}} */

« previous php.cvs (#99421) next »