From 88d2e43db3d372b6f0c7dea142d53be36af8622d Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 30 Oct 2014 14:36:57 +0100 Subject: fix datatype mismatch warnings --- ext/bcmath/bcmath.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'ext') diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c index 7ef30cad5e..5c4e8740e4 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); -- cgit v1.2.1