]> granicus.if.org Git - php/commitdiff
Use standard C99 64bits int types
authorGeorge Peter Banyard <girgias@php.net>
Tue, 19 Jan 2021 12:04:47 +0000 (12:04 +0000)
committerGeorge Peter Banyard <girgias@php.net>
Tue, 19 Jan 2021 13:44:36 +0000 (13:44 +0000)
Closes GH-6622

ext/pdo/pdo.c
ext/pdo/php_pdo_driver.h

index b5eb35e84117c4db36f063b731b380a5dc70fe90..835b25c24c689c09998c5e4cf3b77b89752935a7 100644 (file)
@@ -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) {
index ed5518a01700f8864a77a59adb7fce9301870ee3..91a71bd8f58a0577cc80bc4e801e938f83124d56 100644 (file)
@@ -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