Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/bcmath/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PHP_ARG_ENABLE([bcmath],
if test "$PHP_BCMATH" != "no"; then
PHP_NEW_EXTENSION(bcmath, bcmath.c \
libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/raisemod.c libbcmath/src/sub.c \
libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \
libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/recmul.c \
libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/doaddsub.c libbcmath/src/floor_or_ceil.c libbcmath/src/nearzero.c libbcmath/src/num2str.c \
libbcmath/src/raise.c libbcmath/src/rmzero.c libbcmath/src/round.c libbcmath/src/str2num.c libbcmath/src/convert.c,
$ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
Expand Down
2 changes: 1 addition & 1 deletion ext/bcmath/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if (PHP_BCMATH == "yes") {
EXTENSION("bcmath", "bcmath.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES("ext/bcmath/libbcmath/src", "add.c div.c init.c neg.c \
raisemod.c sub.c compare.c divmod.c int2num.c \
num2long.c output.c recmul.c sqrt.c zero.c doaddsub.c \
num2long.c recmul.c sqrt.c zero.c doaddsub.c \
floor_or_ceil.c nearzero.c num2str.c raise.c rmzero.c str2num.c \
round.c convert.c", "bcmath");

Expand Down
2 changes: 1 addition & 1 deletion ext/bcmath/libbcmath/src/add.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ bc_num bc_add(bc_num n1, bc_num n2, size_t scale_min)
} else {
/* subtraction must be done. */
/* Compare magnitudes. */
switch (_bc_do_compare(n1, n2, false, false)) {
switch (_bc_do_compare(n1, n2, false)) {
case -1:
/* n1 is less than n2, subtract n1 from n2. */
sum = _bc_do_sub(n2, n1, scale_min);
Expand Down
2 changes: 0 additions & 2 deletions ext/bcmath/libbcmath/src/bcmath.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ void bc_raise_bc_exponent(bc_num base, bc_num exponent, bc_num *resul, size_t sc

bool bc_sqrt(bc_num *num, size_t scale);

void bc_out_num(bc_num num, int o_base, void (* out_char)(char), bool leading_zero);

/* Prototypes needed for external utility routines. */
#define bc_new_num(length, scale) _bc_new_num_ex((length), (scale), 0)
#define bc_free_num(num) _bc_free_num_ex((num), 0)
Expand Down
7 changes: 2 additions & 5 deletions ext/bcmath/libbcmath/src/compare.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
than N2 and +1 if N1 is greater than N2. If USE_SIGN is false, just
compare the magnitudes. */

int _bc_do_compare(bc_num n1, bc_num n2, bool use_sign, bool ignore_last)
int _bc_do_compare(bc_num n1, bc_num n2, bool use_sign)
{
char *n1ptr, *n2ptr;

Expand Down Expand Up @@ -85,9 +85,6 @@ int _bc_do_compare(bc_num n1, bc_num n2, bool use_sign, bool ignore_last)
count--;
}

if (ignore_last && count == 1 && n1->n_scale == n2->n_scale) {
return (0);
}
if (count != 0) {
if (*n1ptr > *n2ptr) {
/* Magnitude of n1 > n2. */
Expand Down Expand Up @@ -141,5 +138,5 @@ int _bc_do_compare(bc_num n1, bc_num n2, bool use_sign, bool ignore_last)
/* This is the "user callable" routine to compare numbers N1 and N2. */
int bc_compare(bc_num n1, bc_num n2)
{
return _bc_do_compare(n1, n2, true, false);
return _bc_do_compare(n1, n2, true);
}
188 changes: 0 additions & 188 deletions ext/bcmath/libbcmath/src/output.c

This file was deleted.

2 changes: 1 addition & 1 deletion ext/bcmath/libbcmath/src/private.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include <stddef.h>

/* routines */
int _bc_do_compare (bc_num n1, bc_num n2, bool use_sign, bool ignore_last);
int _bc_do_compare (bc_num n1, bc_num n2, bool use_sign);
bc_num _bc_do_add (bc_num n1, bc_num n2, size_t scale_min);
bc_num _bc_do_sub (bc_num n1, bc_num n2, size_t scale_min);
void _bc_rm_leading_zeros (bc_num num);
2 changes: 1 addition & 1 deletion ext/bcmath/libbcmath/src/sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ bc_num bc_sub(bc_num n1, bc_num n2, size_t scale_min)
} else {
/* subtraction must be done. */
/* Compare magnitudes. */
switch (_bc_do_compare(n1, n2, false, false)) {
switch (_bc_do_compare(n1, n2, false)) {
case -1:
/* n1 is less than n2, subtract n1 from n2. */
diff = _bc_do_sub(n2, n1, scale_min);
Expand Down