cvs: php-src /ext/bcmath bcmath.c
| From: | Antony Dovgal | Date: | Wed, 06 Jun 2007 22:08:53 +0000 |
| Subject: | cvs: php-src /ext/bcmath bcmath.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-44711@lists.php.net to get a copy of this message | ||
tony2001 Wed Jun 6 22:08:53 2007 UTC
Modified files:
/php-src/ext/bcmath bcmath.c
Log:
improve the checks
http://cvs.php.net/viewvc.cgi/php-src/ext/bcmath/bcmath.c?r1=1.71&r2=1.72&diff_format=u
Index: php-src/ext/bcmath/bcmath.c
diff -u php-src/ext/bcmath/bcmath.c:1.71 php-src/ext/bcmath/bcmath.c:1.72
--- php-src/ext/bcmath/bcmath.c:1.71 Thu May 10 09:53:28 2007
+++ php-src/ext/bcmath/bcmath.c Wed Jun 6 22:08:53 2007
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: bcmath.c,v 1.71 2007/05/10 09:53:28 tony2001 Exp $ */
+/* $Id: bcmath.c,v 1.72 2007/06/06 22:08:53 tony2001 Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -31,7 +31,7 @@
#include "php_bcmath.h"
#include "libbcmath/src/bcmath.h"
-ZEND_DECLARE_MODULE_GLOBALS(bcmath);
+ZEND_DECLARE_MODULE_GLOBALS(bcmath)
static PHP_GINIT_FUNCTION(bcmath);
static PHP_GSHUTDOWN_FUNCTION(bcmath);
@@ -210,7 +210,6 @@
}
/* }}} */
-
/* {{{ proto string bcadd(string left_operand, string right_operand [, int scale]) U
Returns the sum of two arbitrary precision numbers */
PHP_FUNCTION(bcadd)
@@ -224,7 +223,7 @@
return;
}
- if (scale < 0) {
+ if ((int)scale < 0) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid scale given, using zero");
scale = 0;
}
@@ -261,7 +260,7 @@
return;
}
- if (scale < 0) {
+ if ((int)scale < 0) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid scale given, using zero");
scale = 0;
}
@@ -298,7 +297,7 @@
return;
}
- if (scale < 0) {
+ if ((int)scale < 0) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid scale given, using zero");
scale = 0;
}
@@ -335,7 +334,7 @@
return;
}
- if (scale < 0) {
+ if ((int)scale < 0) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid scale given, using zero");
scale = 0;
}
@@ -406,7 +405,7 @@
return;
}
- if (scale < 0) {
+ if ((int)scale < 0) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid scale given, using zero");
scale = 0;
}
@@ -449,7 +448,7 @@
return;
}
- if (scale < 0) {
+ if ((int)scale < 0) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid scale given, using zero");
scale = 0;
}
@@ -488,7 +487,7 @@
return;
}
- if (scale < 0) {
+ if ((int)scale < 0) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid scale given, using zero");
scale = 0;
}
@@ -521,7 +520,7 @@
return;
}
- if (scale < 0) {
+ if ((int)scale < 0) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid scale given, using zero");
scale = 0;
}
@@ -549,9 +548,9 @@
return;
}
- if (scale < 0) {
+ if ((int)scale < 0) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Invalid scale given, using zero");
- scale = 0;
+ RETURN_FALSE;
}
BCG(bc_precision) = scale;