@@ -97,7 +97,11 @@ PHP_RINIT_FUNCTION(bcmath)
97
97
if (cfg_get_long ("bcmath.scale" , & bc_precision ) == FAILURE ) {
98
98
bc_precision = 0 ;
99
99
}
100
- if (bc_precision < 0 ) bc_precision = 0 ;
100
+
101
+ if (bc_precision < 0 ) {
102
+ bc_precision = 0 ;
103
+ }
104
+
101
105
bc_init_numbers (TSRMLS_C );
102
106
103
107
return SUCCESS ;
@@ -145,7 +149,7 @@ PHP_FUNCTION(bcadd)
145
149
WRONG_PARAM_COUNT ;
146
150
}
147
151
convert_to_long_ex (scale_param );
148
- scale = (int ) (Z_LVAL_PP (scale_param )< 0 ) ? 0 : Z_LVAL_PP (scale_param );
152
+ scale = (int ) (Z_LVAL_PP (scale_param ) < 0 ) ? 0 : Z_LVAL_PP (scale_param );
149
153
break ;
150
154
default :
151
155
WRONG_PARAM_COUNT ;
@@ -191,7 +195,7 @@ PHP_FUNCTION(bcsub)
191
195
WRONG_PARAM_COUNT ;
192
196
}
193
197
convert_to_long_ex (scale_param );
194
- scale = (int ) (Z_LVAL_PP (scale_param )< 0 ) ? 0 : Z_LVAL_PP (scale_param );
198
+ scale = (int ) (Z_LVAL_PP (scale_param ) < 0 ) ? 0 : Z_LVAL_PP (scale_param );
195
199
break ;
196
200
default :
197
201
WRONG_PARAM_COUNT ;
@@ -237,7 +241,7 @@ PHP_FUNCTION(bcmul)
237
241
WRONG_PARAM_COUNT ;
238
242
}
239
243
convert_to_long_ex (scale_param );
240
- scale = (int ) (Z_LVAL_PP (scale_param )< 0 ) ? 0 : Z_LVAL_PP (scale_param );
244
+ scale = (int ) (Z_LVAL_PP (scale_param ) < 0 ) ? 0 : Z_LVAL_PP (scale_param );
241
245
break ;
242
246
default :
243
247
WRONG_PARAM_COUNT ;
@@ -283,7 +287,7 @@ PHP_FUNCTION(bcdiv)
283
287
WRONG_PARAM_COUNT ;
284
288
}
285
289
convert_to_long_ex (scale_param );
286
- scale = (int ) (Z_LVAL_PP (scale_param )< 0 ) ? 0 : Z_LVAL_PP (scale_param );
290
+ scale = (int ) (Z_LVAL_PP (scale_param ) < 0 ) ? 0 : Z_LVAL_PP (scale_param );
287
291
break ;
288
292
default :
289
293
WRONG_PARAM_COUNT ;
@@ -296,7 +300,7 @@ PHP_FUNCTION(bcdiv)
296
300
bc_init_num (& result TSRMLS_CC );
297
301
php_str2num (& first , Z_STRVAL_PP (left ) TSRMLS_CC );
298
302
php_str2num (& second , Z_STRVAL_PP (right ) TSRMLS_CC );
299
- switch (bc_divide (first , second , & result , scale TSRMLS_CC )) {
303
+ switch (bc_divide (first , second , & result , scale TSRMLS_CC )) {
300
304
case 0 : /* OK */
301
305
if (result -> n_scale > scale ) {
302
306
result -> n_scale = scale ;
@@ -411,7 +415,7 @@ PHP_FUNCTION(bcpow)
411
415
WRONG_PARAM_COUNT ;
412
416
}
413
417
convert_to_long_ex (scale_param );
414
- scale = (int ) (Z_LVAL_PP (scale_param )< 0 ) ? 0 : Z_LVAL_PP (scale_param );
418
+ scale = (int ) (Z_LVAL_PP (scale_param ) < 0 ) ? 0 : Z_LVAL_PP (scale_param );
415
419
break ;
416
420
default :
417
421
WRONG_PARAM_COUNT ;
@@ -457,7 +461,7 @@ PHP_FUNCTION(bcsqrt)
457
461
WRONG_PARAM_COUNT ;
458
462
}
459
463
convert_to_long_ex (scale_param );
460
- scale = (int ) (Z_LVAL_PP (scale_param )< 0 ) ? 0 : Z_LVAL_PP (scale_param );
464
+ scale = (int ) (Z_LVAL_PP (scale_param ) < 0 ) ? 0 : Z_LVAL_PP (scale_param );
461
465
break ;
462
466
default :
463
467
WRONG_PARAM_COUNT ;
@@ -500,7 +504,7 @@ PHP_FUNCTION(bccomp)
500
504
WRONG_PARAM_COUNT ;
501
505
}
502
506
convert_to_long_ex (scale_param );
503
- scale = (int ) (Z_LVAL_PP (scale_param )< 0 ) ? 0 : Z_LVAL_PP (scale_param );
507
+ scale = (int ) (Z_LVAL_PP (scale_param ) < 0 ) ? 0 : Z_LVAL_PP (scale_param );
504
508
break ;
505
509
default :
506
510
WRONG_PARAM_COUNT ;
@@ -534,7 +538,7 @@ PHP_FUNCTION(bcscale)
534
538
}
535
539
536
540
convert_to_long_ex (new_scale );
537
- bc_precision = (Z_LVAL_PP (new_scale )< 0 ) ? 0 : Z_LVAL_PP (new_scale );
541
+ bc_precision = (Z_LVAL_PP (new_scale ) < 0 ) ? 0 : Z_LVAL_PP (new_scale );
538
542
539
543
RETURN_TRUE ;
540
544
}
0 commit comments