summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Peter Banyard <girgias@php.net>2021-01-19 12:04:47 +0000
committerGeorge Peter Banyard <girgias@php.net>2021-01-19 13:44:36 +0000
commita6e8ebf99a5a41c92010a5f9ecf96bc444ac8900 (patch)
tree64439465dcde7afb20878398b350433ecb482ba1
parentb44e29f8430189914ad4047176527918f80b935c (diff)
downloadphp-git-a6e8ebf99a5a41c92010a5f9ecf96bc444ac8900.tar.gz
Use standard C99 64bits int types
Closes GH-6622
-rw-r--r--ext/pdo/pdo.c8
-rw-r--r--ext/pdo/php_pdo_driver.h9
2 files changed, 5 insertions, 12 deletions
diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c
index b5eb35e841..835b25c24c 100644
--- a/ext/pdo/pdo.c
+++ b/ext/pdo/pdo.c
@@ -250,7 +250,7 @@ PDO_API int php_pdo_parse_data_source(const char *data_source, zend_ulong data_s
/* TODO Refactor */
static const char digit_vec[] = "0123456789";
-PDO_API zend_string *php_pdo_int64_to_str(pdo_int64_t i64) /* {{{ */
+PDO_API zend_string *php_pdo_int64_to_str(int64_t i64) /* {{{ */
{
char buffer[65];
char outbuf[65] = "";
@@ -270,11 +270,11 @@ PDO_API zend_string *php_pdo_int64_to_str(pdo_int64_t i64) /* {{{ */
p = &buffer[sizeof(buffer)-1];
*p = '\0';
- while ((pdo_uint64_t)i64 > (pdo_uint64_t)ZEND_LONG_MAX) {
- pdo_uint64_t quo = (pdo_uint64_t)i64 / (unsigned int)10;
+ while ((uint64_t)i64 > (uint64_t)ZEND_LONG_MAX) {
+ uint64_t quo = (uint64_t)i64 / (unsigned int)10;
unsigned int rem = (unsigned int)(i64 - quo*10U);
*--p = digit_vec[rem];
- i64 = (pdo_int64_t)quo;
+ i64 = (int64_t)quo;
}
long_val = (zend_long)i64;
while (long_val != 0) {
diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h
index ed5518a017..91a71bd8f5 100644
--- a/ext/pdo/php_pdo_driver.h
+++ b/ext/pdo/php_pdo_driver.h
@@ -26,14 +26,7 @@ typedef struct _pdo_stmt_t pdo_stmt_t;
typedef struct _pdo_row_t pdo_row_t;
struct pdo_bound_param_data;
-#ifdef PHP_WIN32
-typedef __int64 pdo_int64_t;
-typedef unsigned __int64 pdo_uint64_t;
-#else
-typedef long long int pdo_int64_t;
-typedef unsigned long long int pdo_uint64_t;
-#endif
-PDO_API zend_string *php_pdo_int64_to_str(pdo_int64_t i64);
+PDO_API zend_string *php_pdo_int64_to_str(int64_t i64);
#ifndef TRUE
# define TRUE 1