com php-src: Correct intdiv() argument names and description: ext/standard/basic_functions.c ext/standard/math.c

From: Date: Thu, 08 Oct 2015 14:45:22 +0000
Subject: com php-src: Correct intdiv() argument names and description: ext/standard/basic_functions.c ext/standard/math.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-89338@lists.php.net to get a copy of this message
Commit: fa23bebe94d7149d7bb55d3482f4802546198c24 Author: Andrea Faulds <ajf@ajf.me> Tue, 6 Oct 2015 16:12:48 +0100 Parents: 3815e9713601a637b30bb99d631fc68df97f9288 Branches: PHP-7.0 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fa23bebe94d7149d7bb55d3482f4802546198c24 Log: Correct intdiv() argument names and description Changed paths: M ext/standard/basic_functions.c M ext/standard/math.c Diff: diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 83b977a..8da45c4 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -1763,7 +1763,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_fmod, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO(arginfo_intdiv, 0) - ZEND_ARG_INFO(0, numerator) + ZEND_ARG_INFO(0, dividend) ZEND_ARG_INFO(0, divisor) ZEND_END_ARG_INFO() /* }}} */ diff --git a/ext/standard/math.c b/ext/standard/math.c index 9ab457b..6059f3d 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -1456,27 +1456,27 @@ PHP_FUNCTION(fmod) } /* }}} */ -/* {{{ proto int intdiv(int numerator, int divisor) - Returns the integer division of the numerator by the divisor */ +/* {{{ proto int intdiv(int dividend, int divisor) + Returns the integer quotient of the division of dividend by divisor */ PHP_FUNCTION(intdiv) { - zend_long numerator, divisor; + zend_long dividend, divisor; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &numerator, &divisor) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &dividend, &divisor) == FAILURE) { return; } if (divisor == 0) { zend_throw_exception_ex(zend_ce_division_by_zero_error, 0, "Division by zero"); return; - } else if (divisor == -1 && numerator == ZEND_LONG_MIN) { + } else if (divisor == -1 && dividend == ZEND_LONG_MIN) { /* Prevent overflow error/crash ... really should not happen: We don't return a float here as that violates function contract */ zend_throw_exception_ex(zend_ce_arithmetic_error, 0, "Division of PHP_INT_MIN by -1 is not an integer"); return; } - RETURN_LONG(numerator / divisor); + RETURN_LONG(dividend / divisor); } /* }}} */

« previous php.cvs (#89338) next »