Skip to content

Commit e457b21

Browse files
committed
ext/bcmath: Remove some useless header inclusions
1 parent 4c0d504 commit e457b21

File tree

18 files changed

+17
-84
lines changed

18 files changed

+17
-84
lines changed

ext/bcmath/libbcmath/src/add.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@
2929
3030
*************************************************************************/
3131

32-
#include <config.h>
33-
#include <stdio.h>
34-
#include <stdlib.h>
35-
#include <ctype.h>
36-
#include <stdarg.h>
3732
#include "bcmath.h"
3833
#include "private.h"
3934

@@ -54,7 +49,7 @@ void bc_add (bc_num n1, bc_num n2, bc_num *result, int scale_min)
5449
} else {
5550
/* subtraction must be done. */
5651
/* Compare magnitudes. */
57-
cmp_res = _bc_do_compare(n1, n2, FALSE, FALSE);
52+
cmp_res = _bc_do_compare(n1, n2, false, false);
5853
switch (cmp_res) {
5954
case -1:
6055
/* n1 is less than n2, subtract n1 from n2. */

ext/bcmath/libbcmath/src/compare.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@
2929
3030
*************************************************************************/
3131

32-
#include <config.h>
33-
#include <stdio.h>
34-
#include <stdlib.h>
35-
#include <ctype.h>
36-
#include <stdarg.h>
3732
#include <stdbool.h>
3833
#include "bcmath.h"
3934
#include "private.h"

ext/bcmath/libbcmath/src/div.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@
2929
3030
*************************************************************************/
3131

32-
#include <config.h>
33-
#include <stdio.h>
34-
#include <stdlib.h>
35-
#include <ctype.h>
36-
#include <stdarg.h>
32+
#include "config.h" /* For safe_emalloc() */
3733
#include "bcmath.h"
3834
#include "private.h"
3935

ext/bcmath/libbcmath/src/divmod.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,7 @@
2929
3030
*************************************************************************/
3131

32-
#include <config.h>
33-
#include <stdio.h>
34-
#include <stdlib.h>
35-
#include <ctype.h>
36-
#include <stdarg.h>
3732
#include "bcmath.h"
38-
#include "private.h"
3933

4034

4135
/* Division *and* modulo for numbers. This computes both NUM1 / NUM2 and

ext/bcmath/libbcmath/src/doaddsub.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@
2929
3030
*************************************************************************/
3131

32-
#include <config.h>
33-
#include <stdio.h>
34-
#include <stdlib.h>
35-
#include <ctype.h>
36-
#include <stdarg.h>
3732
#include "bcmath.h"
3833
#include "private.h"
3934

ext/bcmath/libbcmath/src/init.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,8 @@
2929
3030
*************************************************************************/
3131

32-
#include <config.h>
33-
#include <stdio.h>
34-
#include <stdlib.h>
35-
#include <ctype.h>
36-
#include <stdarg.h>
32+
#include "config.h"
3733
#include "bcmath.h"
38-
#include "private.h"
3934

4035
/* new_num allocates a number and sets fields to known values. */
4136
bc_num _bc_new_num_ex(int length, int scale, int persistent)

ext/bcmath/libbcmath/src/int2num.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@
2929
3030
*************************************************************************/
3131

32-
#include <config.h>
3332
#include "bcmath.h"
3433

35-
3634
/* Convert an integer VAL to a bc number NUM. */
3735

3836
void bc_int2num(bc_num *num, int val)

ext/bcmath/libbcmath/src/num2long.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
3030
*************************************************************************/
3131

32-
#include <config.h>
3332
#include "bcmath.h"
3433

3534
/* Convert a number NUM to a long. The function returns only the integer

ext/bcmath/libbcmath/src/num2str.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,8 @@
2929
3030
*************************************************************************/
3131

32-
#include <config.h>
33-
#include <stdio.h>
34-
#include <stdlib.h>
35-
#include <ctype.h>
36-
#include <stdarg.h>
32+
#include "config.h" /* For zend_string */
3733
#include "bcmath.h"
38-
#include "private.h"
3934

4035
/* Convert a numbers to a string. Base 10 only.*/
4136
zend_string *bc_num2str_ex(bc_num num, int scale)

ext/bcmath/libbcmath/src/output.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,8 @@
2929
3030
*************************************************************************/
3131

32-
#include <config.h>
33-
#include <stdio.h>
34-
#include <stdlib.h>
35-
#include <ctype.h>
36-
#include <stdarg.h>
32+
#include "config.h" /* For emalloc */
3733
#include "bcmath.h"
38-
#include "private.h"
3934

4035

4136
/* The following routines provide output for bcd numbers package

ext/bcmath/libbcmath/src/raise.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,9 @@
2929
3030
*************************************************************************/
3131

32-
#include <config.h>
33-
#include <stdio.h>
34-
#include <stdlib.h>
35-
#include <ctype.h>
36-
#include <stdarg.h>
3732
#include "bcmath.h"
38-
#include "private.h"
33+
#include <stdbool.h>
34+
#include "zend_exceptions.h" /* zend_argument_value_error() */
3935

4036

4137
/* Raise NUM1 to the NUM2 power. The result is placed in RESULT.
@@ -49,7 +45,7 @@ void bc_raise(bc_num num1, bc_num num2, bc_num *result, int scale)
4945
int rscale;
5046
int pwrscale;
5147
int calcscale;
52-
char neg;
48+
bool is_neg;
5349

5450
/* Check the exponent for scale digits and convert to a long. */
5551
if (num2->n_scale != 0) {
@@ -73,11 +69,11 @@ void bc_raise(bc_num num1, bc_num num2, bc_num *result, int scale)
7369

7470
/* Other initializations. */
7571
if (exponent < 0) {
76-
neg = TRUE;
72+
is_neg = true;
7773
exponent = -exponent;
7874
rscale = scale;
7975
} else {
80-
neg = FALSE;
76+
is_neg = false;
8177
rscale = MIN (num1->n_scale*exponent, MAX(scale, num1->n_scale));
8278
}
8379

@@ -105,7 +101,7 @@ void bc_raise(bc_num num1, bc_num num2, bc_num *result, int scale)
105101
}
106102

107103
/* Assign the value. */
108-
if (neg) {
104+
if (is_neg) {
109105
bc_divide (BCG(_one_), temp, result, rscale);
110106
bc_free_num (&temp);
111107
} else {

ext/bcmath/libbcmath/src/raisemod.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,9 @@
2929
3030
*************************************************************************/
3131

32-
#include <config.h>
33-
#include <stdio.h>
34-
#include <stdlib.h>
35-
#include <ctype.h>
36-
#include <stdarg.h>
3732
#include "bcmath.h"
38-
#include "private.h"
33+
#include "config.h"
34+
#include "zend_result.h"
3935
#include "zend_exceptions.h"
4036

4137
/* Raise BASE to the EXPO power, reduced modulo MOD. The result is placed in RESULT. */

ext/bcmath/libbcmath/src/recmul.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
3030
*************************************************************************/
3131

32-
#include <config.h>
33-
#include <assert.h>
3432
#include "bcmath.h"
35-
#include "private.h"
33+
#include <assert.h>
34+
#include "config.h" /* For emalloc() */
35+
#include "private.h" /* For _bc_rm_leading_zeros() */
3636

3737
/* Recursive vs non-recursive multiply crossover ranges. */
3838
#if defined(MULDIGITS)

ext/bcmath/libbcmath/src/rmzero.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
3030
*************************************************************************/
3131

32-
#include <config.h>
3332
#include "bcmath.h"
3433
#include "private.h"
3534

ext/bcmath/libbcmath/src/sqrt.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@
2929
3030
*************************************************************************/
3131

32-
#include <config.h>
33-
#include <stdbool.h>
3432
#include "bcmath.h"
35-
#include "private.h"
33+
#include <stdbool.h>
3634

3735
/* Take the square root NUM and return it in NUM with SCALE digits
3836
after the decimal place. */

ext/bcmath/libbcmath/src/str2num.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,7 @@
2929
3030
*************************************************************************/
3131

32-
#include <config.h>
33-
#include <stdio.h>
34-
#include <stdlib.h>
35-
#include <ctype.h>
36-
#include <stdarg.h>
3732
#include "bcmath.h"
38-
#include "private.h"
3933

4034
/* Convert strings to bc numbers. Base 10 only.*/
4135

ext/bcmath/libbcmath/src/sub.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
3030
*************************************************************************/
3131

32-
#include <config.h>
3332
#include "bcmath.h"
3433
#include "private.h"
3534

ext/bcmath/libbcmath/src/zero.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,7 @@
2929
3030
*************************************************************************/
3131

32-
#include <config.h>
33-
#include <stdio.h>
34-
#include <stdlib.h>
35-
#include <ctype.h>
36-
#include <stdarg.h>
3732
#include "bcmath.h"
38-
#include "private.h"
3933

4034
/* In some places we need to check if the number NUM is zero. */
4135

0 commit comments

Comments
 (0)