Skip to content

Commit 91a13de

Browse files
committed
bcmath fixing wrong warning due to likely old fashion C
1 parent 1889d15 commit 91a13de

File tree

11 files changed

+14
-38
lines changed

11 files changed

+14
-38
lines changed

ext/bcmath/libbcmath/src/add.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@
4343
is the minimum scale for the result. */
4444

4545
void
46-
bc_add (n1, n2, result, scale_min)
47-
bc_num n1, n2, *result;
48-
int scale_min;
46+
bc_add (bc_num n1, bc_num n2, bc_num *result, int scale_min)
4947
{
5048
bc_num sum = NULL;
5149
int cmp_res;

ext/bcmath/libbcmath/src/compare.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@
4343
compare the magnitudes. */
4444

4545
int
46-
_bc_do_compare (n1, n2, use_sign, ignore_last)
47-
bc_num n1, n2;
48-
int use_sign;
49-
int ignore_last;
46+
_bc_do_compare (bc_num n1, bc_num n2, int use_sign, int ignore_last)
5047
{
5148
char *n1ptr, *n2ptr;
5249
int count;
@@ -152,8 +149,7 @@ _bc_do_compare (n1, n2, use_sign, ignore_last)
152149
/* This is the "user callable" routine to compare numbers N1 and N2. */
153150

154151
int
155-
bc_compare (n1, n2)
156-
bc_num n1, n2;
152+
bc_compare (bc_num n1, bc_num n2)
157153
{
158154
return _bc_do_compare (n1, n2, TRUE, FALSE);
159155
}

ext/bcmath/libbcmath/src/doaddsub.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@
4343
SCALE_MIN is to set the minimum scale of the result. */
4444

4545
bc_num
46-
_bc_do_add (n1, n2, scale_min)
47-
bc_num n1, n2;
48-
int scale_min;
46+
_bc_do_add (bc_num n1, bc_num n2, int scale_min)
4947
{
5048
bc_num sum;
5149
int sum_scale, sum_digits;
@@ -135,9 +133,7 @@ _bc_do_add (n1, n2, scale_min)
135133
of the result. */
136134

137135
bc_num
138-
_bc_do_sub (n1, n2, scale_min)
139-
bc_num n1, n2;
140-
int scale_min;
136+
_bc_do_sub (bc_num n1, bc_num n2, int scale_min)
141137
{
142138
bc_num diff;
143139
int diff_scale, diff_len;

ext/bcmath/libbcmath/src/init.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@
4040
/* new_num allocates a number and sets fields to known values. */
4141

4242
bc_num
43-
_bc_new_num_ex (length, scale, persistent)
44-
int length, scale, persistent;
43+
_bc_new_num_ex (int length, int scale, int persistent)
4544
{
4645
bc_num temp;
4746
/* PHP Change: malloc() -> pemalloc(), removed free_list code */
@@ -62,9 +61,7 @@ _bc_new_num_ex (length, scale, persistent)
6261
frees the storage if reference count is zero. */
6362

6463
void
65-
_bc_free_num_ex (num, persistent)
66-
bc_num *num;
67-
int persistent;
64+
_bc_free_num_ex (bc_num *num, int persistent)
6865
{
6966
if (*num == NULL) return;
7067
(*num)->n_refs--;

ext/bcmath/libbcmath/src/int2num.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@
4141
/* Convert an integer VAL to a bc number NUM. */
4242

4343
void
44-
bc_int2num (num, val)
45-
bc_num *num;
46-
int val;
44+
bc_int2num (bc_num *num, int val)
4745
{
4846
char buffer[30];
4947
char *bptr, *vptr;

ext/bcmath/libbcmath/src/nearzero.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@
4242
Last digit is defined by scale. */
4343

4444
char
45-
bc_is_near_zero (num, scale)
46-
bc_num num;
47-
int scale;
45+
bc_is_near_zero (bc_num num, int scale)
4846
{
4947
int count;
5048
char *nptr;

ext/bcmath/libbcmath/src/neg.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@
4040
/* In some places we need to check if the number is negative. */
4141

4242
char
43-
bc_is_neg (num)
44-
bc_num num;
43+
bc_is_neg (bc_num num)
4544
{
4645
return num->n_sign == MINUS;
4746
}

ext/bcmath/libbcmath/src/num2long.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@
4343
the NUM for zero after having a zero returned. */
4444

4545
long
46-
bc_num2long (num)
47-
bc_num num;
46+
bc_num2long (bc_num num)
4847
{
4948
long val;
5049
char *nptr;

ext/bcmath/libbcmath/src/num2str.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@
4040
/* Convert a numbers to a string. Base 10 only.*/
4141

4242
zend_string
43-
*bc_num2str_ex (num, scale)
44-
bc_num num;
45-
int scale;
43+
*bc_num2str_ex (bc_num num, int scale)
4644
{
4745
zend_string *str;
4846
char *sptr;

ext/bcmath/libbcmath/src/rmzero.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@
4242
correct place and adjusts the length. */
4343

4444
void
45-
_bc_rm_leading_zeros (num)
46-
bc_num num;
45+
_bc_rm_leading_zeros (bc_num num)
4746
{
4847
/* We can move n_value to point to the first non zero digit! */
4948
while (*num->n_value == 0 && num->n_len > 1) {

ext/bcmath/libbcmath/src/sub.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@
4343
is the minimum scale for the result. */
4444

4545
void
46-
bc_sub (n1, n2, result, scale_min)
47-
bc_num n1, n2, *result;
48-
int scale_min;
46+
bc_sub (bc_num n1, bc_num n2, bc_num *result, int scale_min)
4947
{
5048
bc_num diff = NULL;
5149
int cmp_res;

0 commit comments

Comments
 (0)