Skip to content

Commit b60cf3b

Browse files
committed
replaced ZEND_ASSERT and ZEND_BYTES_SWAP
1 parent 7c7265e commit b60cf3b

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

ext/bcmath/libbcmath/src/adapter.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,9 @@ typedef zend_long bc_long;
6969
# define BC_HAVE_BUILTIN_CTZL
7070
#endif
7171

72+
#define BC_ASSERT(cond) ZEND_ASSERT(cond)
73+
74+
#define BC_BYTES_SWAP64(x) ZEND_BYTES_SWAP64(x)
75+
#define BC_BYTES_SWAP32(x) ZEND_BYTES_SWAP32(x)
76+
7277
#endif

ext/bcmath/libbcmath/src/private.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@
4545
#define SWAR_REPEAT(x) (SWAR_ONES * (x))
4646

4747
#if SIZEOF_SIZE_T >= 8
48-
# define BC_BSWAP(u) ZEND_BYTES_SWAP64(u)
48+
# define BC_BSWAP(u) BC_BYTES_SWAP64(u)
4949
typedef uint64_t BC_VECTOR;
5050
# define BC_VECTOR_SIZE 8
5151
/* The boundary number is computed from BASE ** BC_VECTOR_SIZE */
5252
# define BC_VECTOR_BOUNDARY_NUM (BC_VECTOR) 100000000
5353
#else
54-
# define BC_BSWAP(u) ZEND_BYTES_SWAP32(u)
54+
# define BC_BSWAP(u) BC_BYTES_SWAP32(u)
5555
typedef uint32_t BC_VECTOR;
5656
# define BC_VECTOR_SIZE 4
5757
/* The boundary number is computed from BASE ** BC_VECTOR_SIZE */

ext/bcmath/libbcmath/src/str2num.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ bool bc_str2num(bc_num *num, const char *str, const char *end, size_t scale, siz
112112
const char *fractional_end = NULL;
113113
bool zero_int = false;
114114

115-
ZEND_ASSERT(*num == NULL);
115+
BC_ASSERT(*num == NULL);
116116

117117
/* Check for valid number and count digits. */
118118
if ((*ptr == '+') || (*ptr == '-')) {

0 commit comments

Comments
 (0)