Skip to content

Commit 10e18fd

Browse files
committed
Changed const bc_num back to bc_num
1 parent 6096a20 commit 10e18fd

File tree

13 files changed

+27
-27
lines changed

13 files changed

+27
-27
lines changed

ext/bcmath/bcmath.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ static void bcmath_number_register_class(void)
10191019
}
10201020

10211021
static zend_always_inline void bcmath_number_add_internal(
1022-
const bc_num n1, const bc_num n2, bc_num *ret,
1022+
bc_num n1, bc_num n2, bc_num *ret,
10231023
size_t n1_full_scale, size_t n2_full_scale, size_t *scale, bool auto_scale
10241024
) {
10251025
if (auto_scale) {
@@ -1031,7 +1031,7 @@ static zend_always_inline void bcmath_number_add_internal(
10311031
}
10321032

10331033
static zend_always_inline void bcmath_number_sub_internal(
1034-
const bc_num n1, const bc_num n2, bc_num *ret,
1034+
bc_num n1, bc_num n2, bc_num *ret,
10351035
size_t n1_full_scale, size_t n2_full_scale, size_t *scale, bool auto_scale
10361036
) {
10371037
if (auto_scale) {
@@ -1043,7 +1043,7 @@ static zend_always_inline void bcmath_number_sub_internal(
10431043
}
10441044

10451045
static zend_always_inline zend_result bcmath_number_mul_internal(
1046-
const bc_num n1, const bc_num n2, bc_num *ret,
1046+
bc_num n1, bc_num n2, bc_num *ret,
10471047
size_t n1_full_scale, size_t n2_full_scale, size_t *scale, bool auto_scale
10481048
) {
10491049
if (auto_scale) {
@@ -1060,7 +1060,7 @@ static zend_always_inline zend_result bcmath_number_mul_internal(
10601060
}
10611061

10621062
static zend_always_inline zend_result bcmath_number_div_internal(
1063-
const bc_num n1, const bc_num n2, bc_num *ret,
1063+
bc_num n1, bc_num n2, bc_num *ret,
10641064
size_t n1_full_scale, size_t *scale, bool auto_scale
10651065
) {
10661066
if (auto_scale) {
@@ -1083,7 +1083,7 @@ static zend_always_inline zend_result bcmath_number_div_internal(
10831083
}
10841084

10851085
static zend_always_inline zend_result bcmath_number_mod_internal(
1086-
const bc_num n1, const bc_num n2, bc_num *ret,
1086+
bc_num n1, bc_num n2, bc_num *ret,
10871087
size_t n1_full_scale, size_t n2_full_scale, size_t *scale, bool auto_scale
10881088
) {
10891089
if (auto_scale) {

ext/bcmath/libbcmath/src/add.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
N1 is added to N2 and the result placed into RESULT. SCALE_MIN
4040
is the minimum scale for the result. */
4141

42-
bc_num bc_add(const bc_num n1, const bc_num n2, size_t scale_min)
42+
bc_num bc_add(bc_num n1, bc_num n2, size_t scale_min)
4343
{
4444
bc_num sum = NULL;
4545

ext/bcmath/libbcmath/src/compare.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
than N2 and +1 if N1 is greater than N2. If USE_SIGN is false, just
4040
compare the magnitudes. */
4141

42-
bcmath_compare_result _bc_do_compare(const bc_num n1, const bc_num n2, size_t scale, bool use_sign)
42+
bcmath_compare_result _bc_do_compare(bc_num n1, bc_num n2, size_t scale, bool use_sign)
4343
{
4444
/* First, compare signs. */
4545
if (use_sign && n1->n_sign != n2->n_sign) {
@@ -149,7 +149,7 @@ bcmath_compare_result _bc_do_compare(const bc_num n1, const bc_num n2, size_t sc
149149

150150

151151
/* This is the "user callable" routine to compare numbers N1 and N2. */
152-
bcmath_compare_result bc_compare(const bc_num n1, const bc_num n2, size_t scale)
152+
bcmath_compare_result bc_compare(bc_num n1, bc_num n2, size_t scale)
153153
{
154154
return _bc_do_compare(n1, n2, scale, true);
155155
}

ext/bcmath/libbcmath/src/div.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ static void bc_do_div(
300300
}
301301
}
302302

303-
static inline void bc_divide_by_one(const bc_num numerator, bc_num *quot, size_t quot_scale)
303+
static inline void bc_divide_by_one(bc_num numerator, bc_num *quot, size_t quot_scale)
304304
{
305305
quot_scale = MIN(numerator->n_scale, quot_scale);
306306
*quot = bc_new_num_nonzeroed(numerator->n_len, quot_scale);
@@ -332,7 +332,7 @@ static inline void bc_divide_by_pow_10(
332332
}
333333
}
334334

335-
bool bc_divide(const bc_num numerator, const bc_num divisor, bc_num *quot, size_t scale)
335+
bool bc_divide(bc_num numerator, bc_num divisor, bc_num *quot, size_t scale)
336336
{
337337
/* divide by zero */
338338
if (bc_is_zero(divisor)) {

ext/bcmath/libbcmath/src/divmod.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
true otherwise for success.
4242
*/
4343

44-
bool bc_divmod(const bc_num num1, const bc_num num2, bc_num *quot, bc_num *rem, size_t scale)
44+
bool bc_divmod(bc_num num1, bc_num num2, bc_num *quot, bc_num *rem, size_t scale)
4545
{
4646
bc_num quotient = NULL;
4747
bc_num temp;
@@ -84,7 +84,7 @@ bool bc_divmod(const bc_num num1, const bc_num num2, bc_num *quot, bc_num *rem,
8484
/* Modulo for numbers. This computes NUM1 % NUM2 and puts the
8585
result in RESULT. */
8686

87-
bool bc_modulo(const bc_num num1, const bc_num num2, bc_num *result, size_t scale)
87+
bool bc_modulo(bc_num num1, bc_num num2, bc_num *result, size_t scale)
8888
{
8989
return bc_divmod(num1, num2, NULL, result, scale);
9090
}

ext/bcmath/libbcmath/src/doaddsub.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
returned. The signs of N1 and N2 are ignored.
3939
SCALE_MIN is to set the minimum scale of the result. */
4040

41-
bc_num _bc_do_add(const bc_num n1, const bc_num n2)
41+
bc_num _bc_do_add(bc_num n1, bc_num n2)
4242
{
4343
bc_num sum;
4444
size_t sum_len = MAX(n1->n_len, n2->n_len) + 1;
@@ -169,7 +169,7 @@ bc_num _bc_do_add(const bc_num n1, const bc_num n2)
169169
returned. The signs of N1 and N2 are ignored. Also, N1 is
170170
assumed to be larger than N2. SCALE_MIN is the minimum scale
171171
of the result. */
172-
bc_num _bc_do_sub(const bc_num n1, const bc_num n2)
172+
bc_num _bc_do_sub(bc_num n1, bc_num n2)
173173
{
174174
bc_num diff;
175175
/* The caller is guaranteed that n1 is always large. */

ext/bcmath/libbcmath/src/floor_or_ceil.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "private.h"
1919
#include <stddef.h>
2020

21-
bc_num bc_floor_or_ceil(const bc_num num, bool is_floor)
21+
bc_num bc_floor_or_ceil(bc_num num, bool is_floor)
2222
{
2323
/* Initialize result */
2424
bc_num result = bc_new_num(num->n_len, 0);

ext/bcmath/libbcmath/src/private.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ static const BC_VECTOR BC_POW_10_LUT[9] = {
8181

8282

8383
/* routines */
84-
bcmath_compare_result _bc_do_compare (const bc_num n1, const bc_num n2, size_t scale, bool use_sign);
85-
bc_num _bc_do_add (const bc_num n1, const bc_num n2);
86-
bc_num _bc_do_sub (const bc_num n1, const bc_num n2);
84+
bcmath_compare_result _bc_do_compare (bc_num n1, bc_num n2, size_t scale, bool use_sign);
85+
bc_num _bc_do_add (bc_num n1, bc_num n2);
86+
bc_num _bc_do_sub (bc_num n1, bc_num n2);
8787
void _bc_rm_leading_zeros (bc_num num);
8888

8989
#endif

ext/bcmath/libbcmath/src/recmul.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static inline void bc_mul_carry_calc(BC_VECTOR *prod_vector, size_t prod_arr_siz
5252
* If the n_values of n1 and n2 are both 4 (32-bit) or 8 (64-bit) digits or less,
5353
* the calculation will be performed at high speed without using an array.
5454
*/
55-
static inline void bc_fast_mul(const bc_num n1, size_t n1len, const bc_num n2, size_t n2len, bc_num *prod)
55+
static inline void bc_fast_mul(bc_num n1, size_t n1len, bc_num n2, size_t n2len, bc_num *prod)
5656
{
5757
const char *n1end = n1->n_value + n1len - 1;
5858
const char *n2end = n2->n_value + n2len - 1;
@@ -76,7 +76,7 @@ static inline void bc_fast_mul(const bc_num n1, size_t n1len, const bc_num n2, s
7676
* Equivalent of bc_fast_mul for small numbers to perform computations
7777
* without using array.
7878
*/
79-
static inline void bc_fast_square(const bc_num n1, size_t n1len, bc_num *prod)
79+
static inline void bc_fast_square(bc_num n1, size_t n1len, bc_num *prod)
8080
{
8181
const char *n1end = n1->n_value + n1len - 1;
8282

@@ -119,7 +119,7 @@ static inline void bc_mul_finish_from_vector(BC_VECTOR *prod_vector, size_t prod
119119
* Multiply and add these groups of numbers to perform multiplication fast.
120120
* How much to shift the digits when adding values can be calculated from the index of the array.
121121
*/
122-
static void bc_standard_mul(const bc_num n1, size_t n1len, const bc_num n2, size_t n2len, bc_num *prod)
122+
static void bc_standard_mul(bc_num n1, size_t n1len, bc_num n2, size_t n2len, bc_num *prod)
123123
{
124124
size_t i;
125125
const char *n1end = n1->n_value + n1len - 1;
@@ -181,7 +181,7 @@ static void bc_standard_mul(const bc_num n1, size_t n1len, const bc_num n2, size
181181
}
182182

183183
/** This is bc_standard_mul implementation for square */
184-
static void bc_standard_square(const bc_num n1, size_t n1len, bc_num *prod)
184+
static void bc_standard_square(bc_num n1, size_t n1len, bc_num *prod)
185185
{
186186
size_t i;
187187
const char *n1end = n1->n_value + n1len - 1;

ext/bcmath/libbcmath/src/round.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <stddef.h>
2020

2121
/* Returns the scale of the value after rounding. */
22-
size_t bc_round(const bc_num num, zend_long precision, zend_long mode, bc_num *result)
22+
size_t bc_round(bc_num num, zend_long precision, zend_long mode, bc_num *result)
2323
{
2424
/* clear result */
2525
bc_free_num(result);

0 commit comments

Comments
 (0)