Skip to content

Commit a6e8ebf

Browse files
committed
Use standard C99 64bits int types
Closes GH-6622
1 parent b44e29f commit a6e8ebf

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

ext/pdo/pdo.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ PDO_API int php_pdo_parse_data_source(const char *data_source, zend_ulong data_s
250250

251251
/* TODO Refactor */
252252
static const char digit_vec[] = "0123456789";
253-
PDO_API zend_string *php_pdo_int64_to_str(pdo_int64_t i64) /* {{{ */
253+
PDO_API zend_string *php_pdo_int64_to_str(int64_t i64) /* {{{ */
254254
{
255255
char buffer[65];
256256
char outbuf[65] = "";
@@ -270,11 +270,11 @@ PDO_API zend_string *php_pdo_int64_to_str(pdo_int64_t i64) /* {{{ */
270270
p = &buffer[sizeof(buffer)-1];
271271
*p = '\0';
272272

273-
while ((pdo_uint64_t)i64 > (pdo_uint64_t)ZEND_LONG_MAX) {
274-
pdo_uint64_t quo = (pdo_uint64_t)i64 / (unsigned int)10;
273+
while ((uint64_t)i64 > (uint64_t)ZEND_LONG_MAX) {
274+
uint64_t quo = (uint64_t)i64 / (unsigned int)10;
275275
unsigned int rem = (unsigned int)(i64 - quo*10U);
276276
*--p = digit_vec[rem];
277-
i64 = (pdo_int64_t)quo;
277+
i64 = (int64_t)quo;
278278
}
279279
long_val = (zend_long)i64;
280280
while (long_val != 0) {

ext/pdo/php_pdo_driver.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,7 @@ typedef struct _pdo_stmt_t pdo_stmt_t;
2626
typedef struct _pdo_row_t pdo_row_t;
2727
struct pdo_bound_param_data;
2828

29-
#ifdef PHP_WIN32
30-
typedef __int64 pdo_int64_t;
31-
typedef unsigned __int64 pdo_uint64_t;
32-
#else
33-
typedef long long int pdo_int64_t;
34-
typedef unsigned long long int pdo_uint64_t;
35-
#endif
36-
PDO_API zend_string *php_pdo_int64_to_str(pdo_int64_t i64);
29+
PDO_API zend_string *php_pdo_int64_to_str(int64_t i64);
3730

3831
#ifndef TRUE
3932
# define TRUE 1

0 commit comments

Comments
 (0)