com php-src: fix datatype mismatch warnings: ext/bcmath/bcmath.c
| From: | Anatol Belski | Date: | Thu, 30 Oct 2014 19:06:47 +0000 |
| Subject: | com php-src: fix datatype mismatch warnings: ext/bcmath/bcmath.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82905@lists.php.net to get a copy of this message | ||
Commit: 88d2e43db3d372b6f0c7dea142d53be36af8622d
Author: Anatol Belski <ab@php.net> Thu, 30 Oct 2014 14:36:57 +0100
Parents: 12fba83c488843393db8dd04112927e498dc5cf2
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=88d2e43db3d372b6f0c7dea142d53be36af8622d
Log:
fix datatype mismatch warnings
Changed paths:
M ext/bcmath/bcmath.c
Diff:
diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c
index 7ef30ca..5c4e874 100644
--- a/ext/bcmath/bcmath.c
+++ b/ext/bcmath/bcmath.c
@@ -209,14 +209,14 @@ PHP_FUNCTION(bcadd)
zend_long scale_param = 0;
bc_num first, second, result;
size_t left_len, right_len;
- int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
+ int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right,
&right_len, &scale_param) == FAILURE) {
return;
}
if (argc == 3) {
- scale = (int) ((int)scale_param < 0) ? 0 : scale_param;
+ scale = (int) (scale_param < 0 ? 0 : scale_param);
}
bc_init_num(&first TSRMLS_CC);
@@ -246,14 +246,14 @@ PHP_FUNCTION(bcsub)
size_t left_len, right_len;
zend_long scale_param = 0;
bc_num first, second, result;
- int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
+ int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right,
&right_len, &scale_param) == FAILURE) {
return;
}
if (argc == 3) {
- scale = (int) ((int)scale_param < 0) ? 0 : scale_param;
+ scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
bc_init_num(&first TSRMLS_CC);
@@ -283,14 +283,14 @@ PHP_FUNCTION(bcmul)
size_t left_len, right_len;
zend_long scale_param = 0;
bc_num first, second, result;
- int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
+ int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right,
&right_len, &scale_param) == FAILURE) {
return;
}
if (argc == 3) {
- scale = (int) ((int)scale_param < 0) ? 0 : scale_param;
+ scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
bc_init_num(&first TSRMLS_CC);
@@ -320,14 +320,14 @@ PHP_FUNCTION(bcdiv)
size_t left_len, right_len;
zend_long scale_param = 0;
bc_num first, second, result;
- int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
+ int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right,
&right_len, &scale_param) == FAILURE) {
return;
}
if (argc == 3) {
- scale = (int) ((int)scale_param < 0) ? 0 : scale_param;
+ scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
bc_init_num(&first TSRMLS_CC);
@@ -411,11 +411,11 @@ PHP_FUNCTION(bcpowmod)
php_str2num(&second, right TSRMLS_CC);
php_str2num(&mod, modulous TSRMLS_CC);
- scale_int = (int) ((int)scale < 0) ? 0 : scale;
+ scale_int = (int) ((int)scale < 0 ? 0 : scale);
if (bc_raisemod(first, second, mod, &result, scale_int TSRMLS_CC) != -1) {
if (result->n_scale > scale) {
- result->n_scale = scale;
+ result->n_scale = (int)scale;
}
RETVAL_STR(bc_num2str(result));
} else {
@@ -438,14 +438,14 @@ PHP_FUNCTION(bcpow)
size_t left_len, right_len;
zend_long scale_param = 0;
bc_num first, second, result;
- int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
+ int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right,
&right_len, &scale_param) == FAILURE) {
return;
}
if (argc == 3) {
- scale = (int) ((int)scale_param < 0) ? 0 : scale_param;
+ scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
bc_init_num(&first TSRMLS_CC);
@@ -475,14 +475,14 @@ PHP_FUNCTION(bcsqrt)
size_t left_len;
zend_long scale_param = 0;
bc_num result;
- int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
+ int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "s|l", &left, &left_len,
&scale_param) == FAILURE) {
return;
}
if (argc == 2) {
- scale = (int) ((int)scale_param < 0) ? 0 : scale_param;
+ scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
bc_init_num(&result TSRMLS_CC);
@@ -510,14 +510,14 @@ PHP_FUNCTION(bccomp)
size_t left_len, right_len;
zend_long scale_param = 0;
bc_num first, second;
- int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
+ int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right,
&right_len, &scale_param) == FAILURE) {
return;
}
if (argc == 3) {
- scale = (int) ((int)scale_param < 0) ? 0 : scale_param;
+ scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
bc_init_num(&first TSRMLS_CC);