@@ -148,7 +148,7 @@ PHP_FUNCTION(bcadd)
148
148
zend_string * left , * right ;
149
149
zend_long scale_param ;
150
150
bool scale_param_is_null = 1 ;
151
- bc_num first , second , result ;
151
+ bc_num first = NULL , second = NULL , result ;
152
152
int scale ;
153
153
154
154
ZEND_PARSE_PARAMETERS_START (2 , 3 )
@@ -167,8 +167,6 @@ PHP_FUNCTION(bcadd)
167
167
scale = (int ) scale_param ;
168
168
}
169
169
170
- bc_init_num (& first );
171
- bc_init_num (& second );
172
170
bc_init_num (& result );
173
171
174
172
if (php_str2num (& first , ZSTR_VAL (left )) == FAILURE ) {
@@ -199,7 +197,7 @@ PHP_FUNCTION(bcsub)
199
197
zend_string * left , * right ;
200
198
zend_long scale_param ;
201
199
bool scale_param_is_null = 1 ;
202
- bc_num first , second , result ;
200
+ bc_num first = NULL , second = NULL , result ;
203
201
int scale ;
204
202
205
203
ZEND_PARSE_PARAMETERS_START (2 , 3 )
@@ -218,8 +216,6 @@ PHP_FUNCTION(bcsub)
218
216
scale = (int ) scale_param ;
219
217
}
220
218
221
- bc_init_num (& first );
222
- bc_init_num (& second );
223
219
bc_init_num (& result );
224
220
225
221
if (php_str2num (& first , ZSTR_VAL (left )) == FAILURE ) {
@@ -250,7 +246,7 @@ PHP_FUNCTION(bcmul)
250
246
zend_string * left , * right ;
251
247
zend_long scale_param ;
252
248
bool scale_param_is_null = 1 ;
253
- bc_num first , second , result ;
249
+ bc_num first = NULL , second = NULL , result ;
254
250
int scale ;
255
251
256
252
ZEND_PARSE_PARAMETERS_START (2 , 3 )
@@ -269,8 +265,6 @@ PHP_FUNCTION(bcmul)
269
265
scale = (int ) scale_param ;
270
266
}
271
267
272
- bc_init_num (& first );
273
- bc_init_num (& second );
274
268
bc_init_num (& result );
275
269
276
270
if (php_str2num (& first , ZSTR_VAL (left )) == FAILURE ) {
@@ -301,7 +295,7 @@ PHP_FUNCTION(bcdiv)
301
295
zend_string * left , * right ;
302
296
zend_long scale_param ;
303
297
bool scale_param_is_null = 1 ;
304
- bc_num first , second , result ;
298
+ bc_num first = NULL , second = NULL , result ;
305
299
int scale = BCG (bc_precision );
306
300
307
301
ZEND_PARSE_PARAMETERS_START (2 , 3 )
@@ -320,8 +314,6 @@ PHP_FUNCTION(bcdiv)
320
314
scale = (int ) scale_param ;
321
315
}
322
316
323
- bc_init_num (& first );
324
- bc_init_num (& second );
325
317
bc_init_num (& result );
326
318
327
319
if (php_str2num (& first , ZSTR_VAL (left )) == FAILURE ) {
@@ -355,7 +347,7 @@ PHP_FUNCTION(bcmod)
355
347
zend_string * left , * right ;
356
348
zend_long scale_param ;
357
349
bool scale_param_is_null = 1 ;
358
- bc_num first , second , result ;
350
+ bc_num first = NULL , second = NULL , result ;
359
351
int scale = BCG (bc_precision );
360
352
361
353
ZEND_PARSE_PARAMETERS_START (2 , 3 )
@@ -374,8 +366,6 @@ PHP_FUNCTION(bcmod)
374
366
scale = (int ) scale_param ;
375
367
}
376
368
377
- bc_init_num (& first );
378
- bc_init_num (& second );
379
369
bc_init_num (& result );
380
370
381
371
if (php_str2num (& first , ZSTR_VAL (left )) == FAILURE ) {
@@ -409,7 +399,7 @@ PHP_FUNCTION(bcpowmod)
409
399
zend_string * base_str , * exponent_str , * modulus_str ;
410
400
zend_long scale_param ;
411
401
bool scale_param_is_null = 1 ;
412
- bc_num bc_base , bc_expo , bc_modulus , result ;
402
+ bc_num bc_base = NULL , bc_expo = NULL , bc_modulus = NULL , result ;
413
403
int scale = BCG (bc_precision );
414
404
415
405
ZEND_PARSE_PARAMETERS_START (3 , 4 )
@@ -429,9 +419,6 @@ PHP_FUNCTION(bcpowmod)
429
419
scale = (int ) scale_param ;
430
420
}
431
421
432
- bc_init_num (& bc_base );
433
- bc_init_num (& bc_expo );
434
- bc_init_num (& bc_modulus );
435
422
bc_init_num (& result );
436
423
437
424
if (php_str2num (& bc_base , ZSTR_VAL (base_str )) == FAILURE ) {
@@ -487,7 +474,7 @@ PHP_FUNCTION(bcpow)
487
474
zend_string * base_str , * exponent_str ;
488
475
zend_long scale_param ;
489
476
bool scale_param_is_null = 1 ;
490
- bc_num first , bc_exponent , result ;
477
+ bc_num first = NULL , bc_exponent = NULL , result ;
491
478
int scale = BCG (bc_precision );
492
479
493
480
ZEND_PARSE_PARAMETERS_START (2 , 3 )
@@ -506,8 +493,6 @@ PHP_FUNCTION(bcpow)
506
493
scale = (int ) scale_param ;
507
494
}
508
495
509
- bc_init_num (& first );
510
- bc_init_num (& bc_exponent );
511
496
bc_init_num (& result );
512
497
513
498
if (php_str2num (& first , ZSTR_VAL (base_str )) == FAILURE ) {
@@ -549,7 +534,7 @@ PHP_FUNCTION(bcsqrt)
549
534
zend_string * left ;
550
535
zend_long scale_param ;
551
536
bool scale_param_is_null = 1 ;
552
- bc_num result ;
537
+ bc_num result = NULL ;
553
538
int scale = BCG (bc_precision );
554
539
555
540
ZEND_PARSE_PARAMETERS_START (1 , 2 )
@@ -567,8 +552,6 @@ PHP_FUNCTION(bcsqrt)
567
552
scale = (int ) scale_param ;
568
553
}
569
554
570
- bc_init_num (& result );
571
-
572
555
if (php_str2num (& result , ZSTR_VAL (left )) == FAILURE ) {
573
556
zend_argument_value_error (1 , "is not well-formed" );
574
557
goto cleanup ;
@@ -592,7 +575,7 @@ PHP_FUNCTION(bccomp)
592
575
zend_string * left , * right ;
593
576
zend_long scale_param ;
594
577
bool scale_param_is_null = 1 ;
595
- bc_num first , second ;
578
+ bc_num first = NULL , second = NULL ;
596
579
int scale = BCG (bc_precision );
597
580
598
581
ZEND_PARSE_PARAMETERS_START (2 , 3 )
@@ -611,9 +594,6 @@ PHP_FUNCTION(bccomp)
611
594
scale = (int ) scale_param ;
612
595
}
613
596
614
- bc_init_num (& first );
615
- bc_init_num (& second );
616
-
617
597
if (!bc_str2num (& first , ZSTR_VAL (left ), scale , false)) {
618
598
zend_argument_value_error (1 , "is not well-formed" );
619
599
goto cleanup ;
@@ -637,13 +617,12 @@ PHP_FUNCTION(bccomp)
637
617
static void bcfloor_or_bcceil (INTERNAL_FUNCTION_PARAMETERS , bool is_floor )
638
618
{
639
619
zend_string * numstr ;
640
- bc_num num , result ;
620
+ bc_num num = NULL , result ;
641
621
642
622
ZEND_PARSE_PARAMETERS_START (1 , 1 )
643
623
Z_PARAM_STR (numstr )
644
624
ZEND_PARSE_PARAMETERS_END ();
645
625
646
- bc_init_num (& num );
647
626
bc_init_num (& result );
648
627
649
628
if (php_str2num (& num , ZSTR_VAL (numstr )) == FAILURE ) {
@@ -681,7 +660,7 @@ PHP_FUNCTION(bcround)
681
660
zend_string * numstr ;
682
661
zend_long precision = 0 ;
683
662
zend_long mode = PHP_ROUND_HALF_UP ;
684
- bc_num num , result ;
663
+ bc_num num = NULL , result ;
685
664
686
665
ZEND_PARSE_PARAMETERS_START (1 , 3 )
687
666
Z_PARAM_STR (numstr )
@@ -705,7 +684,6 @@ PHP_FUNCTION(bcround)
705
684
return ;
706
685
}
707
686
708
- bc_init_num (& num );
709
687
bc_init_num (& result );
710
688
711
689
if (php_str2num (& num , ZSTR_VAL (numstr )) == FAILURE ) {
0 commit comments