]> granicus.if.org Git - php/commitdiff
64bit fixes:
authorAndrey Hristov <andrey@php.net>
Fri, 31 Oct 2008 20:30:33 +0000 (20:30 +0000)
committerAndrey Hristov <andrey@php.net>
Fri, 31 Oct 2008 20:30:33 +0000 (20:30 +0000)
- fixes to sprintf modifiers, cleaning warnings
- use _t types, like uint64_t instead of uint64, thus skipping series of
typedefs.

ext/mysqlnd/mysqlnd.c
ext/mysqlnd/mysqlnd_libmysql_compat.h
ext/mysqlnd/mysqlnd_portability.h
ext/mysqlnd/mysqlnd_priv.h
ext/mysqlnd/mysqlnd_ps.c
ext/mysqlnd/mysqlnd_ps_codec.c
ext/mysqlnd/mysqlnd_result.c
ext/mysqlnd/mysqlnd_statistics.h
ext/mysqlnd/mysqlnd_structs.h
ext/mysqlnd/mysqlnd_wireprotocol.c
ext/mysqlnd/mysqlnd_wireprotocol.h

index 6389aead837d4cb9cb70feb15a59026e92d04159..6e66531082a15cbc35bf77235814a0924122fb82 100644 (file)
@@ -1372,7 +1372,7 @@ MYSQLND_METHOD(mysqlnd_conn, field_count)(const MYSQLND * const conn)
 
 
 /* {{{ mysqlnd_conn::insert_id */
-static uint64
+static uint64_t
 MYSQLND_METHOD(mysqlnd_conn, insert_id)(const MYSQLND * const conn)
 {
        return conn->upsert_status.last_insert_id;
@@ -1381,7 +1381,7 @@ MYSQLND_METHOD(mysqlnd_conn, insert_id)(const MYSQLND * const conn)
 
 
 /* {{{ mysqlnd_conn::affected_rows */
-static uint64
+static uint64_t
 MYSQLND_METHOD(mysqlnd_conn, affected_rows)(const MYSQLND * const conn)
 {
        return conn->upsert_status.affected_rows;
@@ -1460,7 +1460,7 @@ MYSQLND_METHOD(mysqlnd_conn, charset_name)(const MYSQLND * const conn)
 
 
 /* {{{ mysqlnd_conn::thread_id */
-static uint64
+static uint64_t
 MYSQLND_METHOD(mysqlnd_conn, thread_id)(const MYSQLND * const conn)
 {
        return conn->thread_id;
index 662cc45af359df14768bdb1aa6f7fac6106c48c2..7b3dce098ce9ddca7a72156dab6aab1876f8ae14 100644 (file)
@@ -31,7 +31,7 @@
 #define MYSQL_ROW                              MYSQLND_ROW_C
 #define MYSQL                                  MYSQLND
 #define my_bool                                        zend_bool
-#define my_ulonglong                   uint64
+#define my_ulonglong                   uint64_t
 
 #define MYSQL_VERSION_ID               MYSQLND_VERSION_ID
 #define MYSQL_SERVER_VERSION   MYSQLND_VERSION
index b7c4c8f0962f8f104503fa3cc0e0ae90fd3d89c3..e4eadd9fbade85e2c3ded1b62a4c08910ef0c364 100644 (file)
@@ -61,36 +61,36 @@ This file is public domain and comes with NO WARRANTY of any kind */
 
 /* Typdefs for easyier portability */
 
-#ifndef HAVE_INT8
 #ifndef HAVE_INT8_T
-typedef signed char int8;                      /* Signed integer >= 8    bits */
+#ifndef HAVE_INT8
+typedef signed char int8_t;                    /* Signed integer >= 8    bits */
 #else
-typedef int8_t int8;                           /* Signed integer >= 8    bits */
+typedef int8 int8_t;                           /* Signed integer >= 8    bits */
 #endif
 #endif
 
 
-#ifndef HAVE_UINT8
 #ifndef HAVE_UINT8_T
-typedef unsigned char uint8;           /* Unsigned integer >= 8    bits */
+#ifndef HAVE_UINT8
+typedef unsigned char uint8_t;         /* Unsigned integer >= 8    bits */
 #else
-typedef uint8_t uint8;                         /* Signed integer >= 8    bits */
+typedef uint8 uint8_t;                         /* Signed integer >= 8    bits */
 #endif
 #endif
 
-#ifndef HAVE_INT16
 #ifndef HAVE_INT16_T
-typedef signed short int16;                    /* Signed integer >= 16 bits */
+#ifndef HAVE_INT16
+typedef signed short int16_t;          /* Signed integer >= 16 bits */
 #else
-typedef int16_t int16;                         /* Signed integer >= 16 bits */
+typedef int16 int16_t;                         /* Signed integer >= 16 bits */
 #endif
 #endif
 
-#ifndef HAVE_UINT16
 #ifndef HAVE_UINT16_T
-typedef unsigned short uint16;         /* Signed integer >= 16 bits */
+#ifndef HAVE_UINT16
+typedef unsigned short uint16_t;               /* Signed integer >= 16 bits */
 #else
-typedef uint16_t uint16;                       /* Signed integer >= 16 bits */
+typedef uint16 uint16_t;                       /* Signed integer >= 16 bits */
 #endif
 #endif
 
@@ -98,134 +98,136 @@ typedef uint16_t uint16;                  /* Signed integer >= 16 bits */
 typedef unsigned char uchar;           /* Short for unsigned char */
 #endif
 
-#ifndef HAVE_INT32
-#ifdef HAVE_INT32_T
-typedef int32_t int32;
+#ifndef HAVE_INT32_T
+#ifdef HAVE_INT32
+typedef int32 int32_t;
 #elif SIZEOF_INT == 4
-typedef signed int int32;
+typedef signed int int32_t;
 #elif SIZEOF_LONG == 4
-typedef signed long int32;
+typedef signed long int32_t;
 #else
 error "Neither int nor long is of 4 bytes width"
 #endif
-#endif /* HAVE_INT32 */
+#endif /* HAVE_INT32_T */
 
 
-#ifndef HAVE_UINT32
-#ifdef HAVE_UINT32_T
-typedef uint32_t uint32;
+#ifndef HAVE_UINT32_T
+#ifdef HAVE_UINT32
+typedef uint32 uint32_t;
 #elif SIZEOF_INT == 4
-typedef unsigned int uint32;
+typedef unsigned int uint32_t;
 #elif SIZEOF_LONG == 4
-typedef unsigned long uint32;
+typedef unsigned long uint32_t;
 #else
 #error "Neither int nor long is of 4 bytes width"
 #endif
-#endif /* HAVE_UINT32 */
+#endif /* HAVE_UINT32_T */
 
 
-#ifndef HAVE_INT64
-#ifdef HAVE_INT64_T
-typedef int64_t int64;
+#ifndef HAVE_INT64_T
+#ifdef HAVE_INT64
+typedef int64 int64_t;
 #elif SIZEOF_INT == 8
-typedef signed int int64;
+typedef signed int int64_t;
 #elif SIZEOF_LONG == 8
-typedef signed long int64;
+typedef signed long int64_t;
 #elif SIZEOF_LONG_LONG == 8
 #ifdef PHP_WIN32
-typedef __int64 int64;
+typedef __int64 int64_t;
 #else
-typedef signed long long int64;
+typedef signed long long int64_t;
 #endif
 #else
 #error "Neither int nor long nor long long is of 8 bytes width"
 #endif
-#endif /* HAVE_INT64 */
+#endif /* HAVE_INT64_T */
 
 
-#ifndef HAVE_UINT64
-#ifdef HAVE_UINT64_T
-typedef uint64_t uint64;
+#ifndef HAVE_UINT64_T
+#ifdef HAVE_UINT64
+typedef uint64 uint64_t;
 #elif SIZEOF_INT == 8
-typedef unsigned int uint64;
+typedef unsigned int uint64_t;
 #elif SIZEOF_LONG == 8
-typedef unsigned long uint64;
+typedef unsigned long uint64_t;
 #elif SIZEOF_LONG_LONG == 8
 #ifdef PHP_WIN32
-typedef unsigned __int64 uint64;
+typedef unsigned __int64 uint64_t;
 #else
-typedef unsigned long long uint64;
+typedef unsigned long long uint64_t;
 #endif
 #else
 #error "Neither int nor long nor long long is of 8 bytes width"
 #endif
-#endif /* HAVE_INT64 */
+#endif /* HAVE_INT64_T */
 
 
 #ifdef PHP_WIN32
 #define MYSQLND_LLU_SPEC "%I64u"
 #define MYSQLND_LL_SPEC "%I64d"
+#define MYSQLND_SZ_T_SPEC "%Id"
 #ifndef L64
 #define L64(x) x##i64
 #endif
 #else
 #define MYSQLND_LLU_SPEC "%llu"
 #define MYSQLND_LL_SPEC "%lld"
+#define MYSQLND_SZ_T_SPEC "%zd"
 #ifndef L64
 #define L64(x) x##LL
 #endif
 #endif
 
 
-typedef int64 longlong;
-typedef uint64 ulonglong;
+typedef int64_t longlong;
+typedef uint64_t ulonglong;
 
 
 #define int1store(T,A) do { *((zend_uchar*) (T)) = (A); } while(0)
-#define uint1korr(A)   (*(((uint8*)(A))))
+#define uint1korr(A)   (*(((uint8_t*)(A))))
 
 /* Bit values are sent in reverted order of bytes, compared to normal !!! */
-#define bit_uint2korr(A) ((uint16) (((uint16) (((uchar*) (A))[1])) +\
-                                                                       ((uint16) (((uchar*) (A))[0]) << 8)))
-#define bit_uint3korr(A) ((uint32) (((uint32) (((uchar*) (A))[2])) +\
-                                                                       (((uint32) (((uchar*) (A))[1])) << 8) +\
-                                                                       (((uint32) (((uchar*) (A))[0])) << 16)))
-
-#define bit_uint4korr(A) ((uint32) (((uint32) (((uchar*) (A))[3])) +\
-                                                                       (((uint32) (((uchar*) (A))[2])) << 8) +\
-                                                                       (((uint32) (((uchar*) (A))[1])) << 16) +\
-                                                                       (((uint32) (((uchar*) (A))[0])) << 24)))
-
-#define bit_uint5korr(A)  ((ulonglong)(((uint32) ((uchar) (A)[4])) +\
-                                  (((uint32) ((uchar) (A)[3])) << 8) +\
-                                  (((uint32) ((uchar) (A)[2])) << 16) +\
-                                  (((uint32) ((uchar) (A)[1])) << 24)) +\
+#define bit_uint2korr(A) ((uint16_t) (((uint16_t) (((uchar*) (A))[1])) +\
+                                                                       ((uint16_t) (((uchar*) (A))[0]) << 8)))
+#define bit_uint3korr(A) ((uint32_t) (((uint32_t) (((uchar*) (A))[2])) +\
+                                                                       (((uint32_t) (((uchar*) (A))[1])) << 8) +\
+                                                                       (((uint32_t) (((uchar*) (A))[0])) << 16)))
+
+#define bit_uint4korr(A) ((uint32_t) (((uint32_t) (((uchar*) (A))[3])) +\
+                                                                       (((uint32_t) (((uchar*) (A))[2])) << 8) +\
+                                                                       (((uint32_t) (((uchar*) (A))[1])) << 16) +\
+                                                                       (((uint32_t) (((uchar*) (A))[0])) << 24)))
+
+#define bit_uint5korr(A)  ((ulonglong)(((uint32_t) ((uchar) (A)[4])) +\
+                                  (((uint32_t) ((uchar) (A)[3])) << 8) +\
+                                  (((uint32_t) ((uchar) (A)[2])) << 16) +\
+                                  (((uint32_t) ((uchar) (A)[1])) << 24)) +\
                                (((ulonglong) ((uchar) (A)[0])) << 32))
 
-#define bit_uint6korr(A)       ((ulonglong)(((uint32) (((uchar*) (A))[5])) +\
-                                                                       (((uint32) (((uchar*) (A))[4])) << 8) +\
-                                                                       (((uint32) (((uchar*) (A))[3])) << 16) +\
-                                                                       (((uint32) (((uchar*) (A))[2])) << 24)) +\
-                                                                       (((ulonglong) (((uint32) (((uchar*) (A))[1])) +\
-                                                                       (((uint32) (((uchar*) (A))[0]) << 8)))) << 32))
+#define bit_uint6korr(A)       ((ulonglong)(((uint32_t) (((uchar*) (A))[5])) +\
+                                                                       (((uint32_t) (((uchar*) (A))[4])) << 8) +\
+                                                                       (((uint32_t) (((uchar*) (A))[3])) << 16) +\
+                                                                       (((uint32_t) (((uchar*) (A))[2])) << 24)) +\
+                                                                       (((ulonglong) (((uint32_t) (((uchar*) (A))[1])) +\
+                                                                       (((uint32_t) (((uchar*) (A))[0]) << 8)))) << 32))
 
-#define bit_uint7korr(A)       ((ulonglong)(((uint32) (((uchar*) (A))[6])) +\
-                                                                       (((uint32) (((uchar*) (A))[5])) << 8) +\
-                                                                       (((uint32) (((uchar*) (A))[4])) << 16) +\
-                                                                       (((uint32) (((uchar*) (A))[3])) << 24)) +\
-                                                                       (((ulonglong) (((uint32) (((uchar*) (A))[2])) +\
-                                                                       (((uint32) (((uchar*) (A))[1])) << 8) +\
-                                                                       (((uint32) (((uchar*) (A))[0])) << 16))) << 32))
+#define bit_uint7korr(A)       ((ulonglong)(((uint32_t) (((uchar*) (A))[6])) +\
+                                                                       (((uint32_t) (((uchar*) (A))[5])) << 8) +\
+                                                                       (((uint32_t) (((uchar*) (A))[4])) << 16) +\
+                                                                       (((uint32_t) (((uchar*) (A))[3])) << 24)) +\
+                                                                       (((ulonglong) (((uint32_t) (((uchar*) (A))[2])) +\
+                                                                       (((uint32_t) (((uchar*) (A))[1])) << 8) +\
+                                                                       (((uint32_t) (((uchar*) (A))[0])) << 16))) << 32))
 
 
-#define bit_uint8korr(A) ((ulonglong)(((uint32) (((uchar*) (A))[7])) +\
-                                                                       (((uint32) (((uchar*) (A))[6])) << 8) +\
-                                                                       (((uint32) (((uchar*) (A))[5])) << 16) +\
-                                                                       (((uint32) (((uchar*) (A))[4])) << 24)) +\
-                                                                       (((ulonglong) (((uint32) (((uchar*) (A))[3])) +\
-                                                                       (((uint32) (((uchar*) (A))[2])) << 8) +\
-                                                                       (((uint32) (((uchar*) (A))[1])) << 16) +\
-                                                                       (((uint32) (((uchar*) (A))[0])) << 24))) << 32))
+#define bit_uint8korr(A) ((ulonglong)(((uint32_t) (((uchar*) (A))[7])) +\
+                                                                       (((uint32_t) (((uchar*) (A))[6])) << 8) +\
+                                                                       (((uint32_t) (((uchar*) (A))[5])) << 16) +\
+                                                                       (((uint32_t) (((uchar*) (A))[4])) << 24)) +\
+                                                                       (((ulonglong) (((uint32_t) (((uchar*) (A))[3])) +\
+                                                                       (((uint32_t) (((uchar*) (A))[2])) << 8) +\
+                                                                       (((uint32_t) (((uchar*) (A))[1])) << 16) +\
+                                                                       (((uint32_t) (((uchar*) (A))[0])) << 24))) << 32))
 
 
 /*
@@ -235,31 +237,31 @@ typedef uint64 ulonglong;
 
 /* Optimized store functions for Intel x86, non-valid for WIN64 */
 #if defined(__i386__) && !defined(_WIN64)
-#define sint2korr(A)    (*((int16 *) (A)))
-#define sint3korr(A)    ((int32) ((((uchar) (A)[2]) & 128) ? \
-                   (((uint32) 255L << 24) | \
-                   (((uint32) (uchar) (A)[2]) << 16) |\
-                   (((uint32) (uchar) (A)[1]) << 8) | \
-                    ((uint32) (uchar) (A)[0])) : \
-                   (((uint32) (uchar) (A)[2]) << 16) |\
-                   (((uint32) (uchar) (A)[1]) << 8) | \
-                    ((uint32) (uchar) (A)[0])))
+#define sint2korr(A)    (*((int16_t *) (A)))
+#define sint3korr(A)    ((int32_t) ((((uchar) (A)[2]) & 128) ? \
+                   (((uint32_t) 255L << 24) | \
+                   (((uint32_t) (uchar) (A)[2]) << 16) |\
+                   (((uint32_t) (uchar) (A)[1]) << 8) | \
+                    ((uint32_t) (uchar) (A)[0])) : \
+                   (((uint32_t) (uchar) (A)[2]) << 16) |\
+                   (((uint32_t) (uchar) (A)[1]) << 8) | \
+                    ((uint32_t) (uchar) (A)[0])))
 #define sint4korr(A)  (*((long *) (A)))
 
-#define uint2korr(A)  (*((uint16 *) (A)))
-#define uint3korr(A)  (uint32) (((uint32) ((uchar) (A)[0])) +\
-                               (((uint32) ((uchar) (A)[1])) << 8) +\
-                               (((uint32) ((uchar) (A)[2])) << 16))
+#define uint2korr(A)  (*((uint16_t *) (A)))
+#define uint3korr(A)  (uint32_t) (((uint32_t) ((uchar) (A)[0])) +\
+                               (((uint32_t) ((uchar) (A)[1])) << 8) +\
+                               (((uint32_t) ((uchar) (A)[2])) << 16))
 #define uint4korr(A)  (*((unsigned long *) (A)))
 
 
 
 #define uint8korr(A)    (*((ulonglong *) (A)))
 #define sint8korr(A)    (*((longlong *) (A)))
-#define int2store(T,A)    *((uint16*) (T))= (uint16) (A)
+#define int2store(T,A)    *((uint16_t*) (T))= (uint16_t) (A)
 #define int3store(T,A)   { \
                   *(T)=  (uchar) ((A));\
-                  *(T+1)=(uchar) (((uint) (A) >> 8));\
+                  *(T+1)=(uchar) (((uint32_t) (A) >> 8));\
                   *(T+2)=(uchar) (((A) >> 16)); }
 #define int4store(T,A)    *((long *) (T))= (long) (A)
 #define int5store(T,A)    { \
@@ -278,7 +280,7 @@ typedef uint64 ulonglong;
               *(((uchar *)(T))+4))=(uchar) (((A) >> 32)); \
               *(((uchar *)(T))+5))=(uchar) (((A) >> 40)); }
 
-#define int8store(T,A)    *((ulonglong *) (T))= (ulonglong) (A)
+#define int8_tstore(T,A)    *((ulonglong *) (T))= (ulonglong) (A)
 
 typedef union {
   double v;
@@ -298,53 +300,53 @@ typedef union {
 #endif /* __i386__ */ 
 
 #ifndef sint2korr
-#define sint2korr(A)    (int16) (((int16) ((uchar) (A)[0])) +\
-                                 ((int16) ((int16) (A)[1]) << 8))
-#define sint3korr(A)    ((int32) ((((uchar) (A)[2]) & 128) ? \
-                  (((uint32) 255L << 24) | \
-                  (((uint32) (uchar) (A)[2]) << 16) |\
-                  (((uint32) (uchar) (A)[1]) << 8) | \
-                   ((uint32) (uchar) (A)[0])) : \
-                  (((uint32) (uchar) (A)[2]) << 16) |\
-                  (((uint32) (uchar) (A)[1]) << 8) | \
-                  ((uint32) (uchar) (A)[0])))
-#define sint4korr(A)  (int32) (((int32) ((uchar) (A)[0])) +\
-                              (((int32) ((uchar) (A)[1]) << 8)) +\
-                              (((int32) ((uchar) (A)[2]) << 16)) +\
-                              (((int32) ((int16) (A)[3]) << 24)))
+#define sint2korr(A)    (int16_t) (((int16_t) ((uchar) (A)[0])) +\
+                                 ((int16_t) ((int16_t) (A)[1]) << 8))
+#define sint3korr(A)    ((int32_t) ((((uchar) (A)[2]) & 128) ? \
+                  (((uint32_t) 255L << 24) | \
+                  (((uint32_t) (uchar) (A)[2]) << 16) |\
+                  (((uint32_t) (uchar) (A)[1]) << 8) | \
+                   ((uint32_t) (uchar) (A)[0])) : \
+                  (((uint32_t) (uchar) (A)[2]) << 16) |\
+                  (((uint32_t) (uchar) (A)[1]) << 8) | \
+                  ((uint32_t) (uchar) (A)[0])))
+#define sint4korr(A)  (int32_t) (((int32_t) ((uchar) (A)[0])) +\
+                              (((int32_t) ((uchar) (A)[1]) << 8)) +\
+                              (((int32_t) ((uchar) (A)[2]) << 16)) +\
+                              (((int32_t) ((int16_t) (A)[3]) << 24)))
 
 #define sint8korr(A)  (longlong) uint8korr(A)
-#define uint2korr(A)  (uint16) (((uint16) ((uchar) (A)[0])) +\
-                               ((uint16) ((uchar) (A)[1]) << 8))
-#define uint3korr(A)  (uint32) (((uint32) ((uchar) (A)[0])) +\
-                               (((uint32) ((uchar) (A)[1])) << 8) +\
-                               (((uint32) ((uchar) (A)[2])) << 16))
-#define uint4korr(A)  (uint32) (((uint32) ((uchar) (A)[0])) +\
-                               (((uint32) ((uchar) (A)[1])) << 8) +\
-                               (((uint32) ((uchar) (A)[2])) << 16) +\
-                               (((uint32) ((uchar) (A)[3])) << 24))
-
-
-#define bit_uint8korr(A) ((ulonglong)(((uint32) (((uchar*) (A))[7])) +\
-                                                                       (((uint32) (((uchar*) (A))[6])) << 8) +\
-                                                                       (((uint32) (((uchar*) (A))[5])) << 16) +\
-                                                                       (((uint32) (((uchar*) (A))[4])) << 24)) +\
-                                                                       (((ulonglong) (((uint32) (((uchar*) (A))[3])) +\
-                                                                       (((uint32) (((uchar*) (A))[2])) << 8) +\
-                                                                       (((uint32) (((uchar*) (A))[1])) << 16) +\
-                                                                       (((uint32) (((uchar*) (A))[0])) << 24))) << 32))
-
-#define uint8korr(A)   ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
-                                                                       (((uint32) ((uchar) (A)[1])) << 8) +\
-                                                                       (((uint32) ((uchar) (A)[2])) << 16) +\
-                                                                       (((uint32) ((uchar) (A)[3])) << 24)) +\
-                                                                       (((ulonglong) (((uint32) ((uchar) (A)[4])) +\
-                                                                       (((uint32) ((uchar) (A)[5])) << 8) +\
-                                                                       (((uint32) ((uchar) (A)[6])) << 16) +\
-                                                                       (((uint32) ((uchar) (A)[7])) << 24))) << 32))
-
-
-#define int2store(T,A)  do { uint def_temp= (uint) (A) ;\
+#define uint2korr(A)  (uint16_t) (((uint16_t) ((uchar) (A)[0])) +\
+                               ((uint16_t) ((uchar) (A)[1]) << 8))
+#define uint3korr(A)  (uint32_t) (((uint32_t) ((uchar) (A)[0])) +\
+                               (((uint32_t) ((uchar) (A)[1])) << 8) +\
+                               (((uint32_t) ((uchar) (A)[2])) << 16))
+#define uint4korr(A)  (uint32_t) (((uint32_t) ((uchar) (A)[0])) +\
+                               (((uint32_t) ((uchar) (A)[1])) << 8) +\
+                               (((uint32_t) ((uchar) (A)[2])) << 16) +\
+                               (((uint32_t) ((uchar) (A)[3])) << 24))
+
+
+#define bit_uint8korr(A) ((ulonglong)(((uint32_t) (((uchar*) (A))[7])) +\
+                                                                       (((uint32_t) (((uchar*) (A))[6])) << 8) +\
+                                                                       (((uint32_t) (((uchar*) (A))[5])) << 16) +\
+                                                                       (((uint32_t) (((uchar*) (A))[4])) << 24)) +\
+                                                                       (((ulonglong) (((uint32_t) (((uchar*) (A))[3])) +\
+                                                                       (((uint32_t) (((uchar*) (A))[2])) << 8) +\
+                                                                       (((uint32_t) (((uchar*) (A))[1])) << 16) +\
+                                                                       (((uint32_t) (((uchar*) (A))[0])) << 24))) << 32))
+
+#define uint8korr(A)   ((ulonglong)(((uint32_t) ((uchar) (A)[0])) +\
+                                                                       (((uint32_t) ((uchar) (A)[1])) << 8) +\
+                                                                       (((uint32_t) ((uchar) (A)[2])) << 16) +\
+                                                                       (((uint32_t) ((uchar) (A)[3])) << 24)) +\
+                                                                       (((ulonglong) (((uint32_t) ((uchar) (A)[4])) +\
+                                                                       (((uint32_t) ((uchar) (A)[5])) << 8) +\
+                                                                       (((uint32_t) ((uchar) (A)[6])) << 16) +\
+                                                                       (((uint32_t) ((uchar) (A)[7])) << 24))) << 32))
+
+
+#define int2store(T,A)  do { uint32_t def_temp= (uint32_t) (A) ;\
                   *((uchar*) (T))  =  (uchar)(def_temp); \
                   *((uchar*) (T+1)) = (uchar)((def_temp >> 8)); } while (0)
 #define int3store(T,A)  do { /*lint -save -e734 */\
@@ -371,7 +373,7 @@ typedef union {
                   *(((char *)(T))+3) = (char)(((A) >> 24)); \
                   *(((char *)(T))+4) = (char)(((A) >> 32)); \
                   *(((char *)(T))+5) = (char)(((A) >> 40)); } while (0)
-#define int8store(T,A)        { uint def_temp= (uint) (A), def_temp2= (uint) ((A) >> 32); \
+#define int8store(T,A)        { uint32_t def_temp= (uint32_t) (A), def_temp2= (uint32_t) ((A) >> 32); \
                   int4store((T),def_temp); \
                   int4store((T+4),def_temp2); \
                 }
@@ -447,24 +449,24 @@ typedef union {
 
 #ifdef WORDS_BIGENDIAN
 
-#define ushortget(V,M)  { V = (uint16) (((uint16) ((uchar) (M)[1]))+\
-                                        ((uint16) ((uint16) (M)[0]) << 8)); }
-#define shortget(V,M)   { V = (short) (((short) ((uchar) (M)[1]))+\
-                                       ((short) ((short) (M)[0]) << 8)); }
-#define longget(V,M)    do { int32 def_temp;\
+#define ushortget(V,M)  { V = (uint16_t) (((uint16_t) ((uchar) (M)[1]))+\
+                                        ((uint16_t) ((uint16_t) (M)[0]) << 8)); }
+#define shortget(V,M)   { V = (int16_t) (((int16_t) ((uchar) (M)[1]))+\
+                                       ((int16_t) ((int16_t) (M)[0]) << 8)); }
+#define longget(V,M)    do { int32_t def_temp;\
               ((char*) &def_temp)[0]=(M)[0];\
               ((char*) &def_temp)[1]=(M)[1];\
               ((char*) &def_temp)[2]=(M)[2];\
               ((char*) &def_temp)[3]=(M)[3];\
               (V)=def_temp; } while (0)
-#define ulongget(V,M)    do { uint32 def_temp;\
+#define ulongget(V,M)    do { uint32_t def_temp;\
               ((char*) &def_temp)[0]=(M)[0];\
               ((char*) &def_temp)[1]=(M)[1];\
               ((char*) &def_temp)[2]=(M)[2];\
               ((char*) &def_temp)[3]=(M)[3];\
               (V)=def_temp; }  while (0)
 #define shortstore(T,A) do { \
-              uint def_temp=(uint) (A) ;\
+              uint32_t def_temp=(uint32_t) (A) ;\
               *(((char *)(T))+1)=(char)(def_temp); \
               *(((char *)(T))+0)=(char)(def_temp >> 8); } while (0)
 #define longstore(T,A)  do { \
index 0a666cd3141ea995240098ed3ce95322067d4a04..26ee7e0fef3f500401f284041122bbc4e14edbad 100644 (file)
@@ -98,7 +98,7 @@
 #define MAX_CHARSET_LEN                        32
 
 
-#define SET_ERROR_AFF_ROWS(s)  (s)->upsert_status.affected_rows = (uint64) ~0
+#define SET_ERROR_AFF_ROWS(s)  (s)->upsert_status.affected_rows = (uint64_t) ~0
 
 /* Error handling */
 #define SET_NEW_MESSAGE(buf, buf_len, message, len, persistent) \
index 184804e768b49ce5b563b696b6279f842ffde38a..43beebc5d863a79ede49b371bf0a5ac9c4f1ddee 100644 (file)
@@ -724,7 +724,7 @@ mysqlnd_fetch_stmt_row_buffered(MYSQLND_RES *result, void *param, unsigned int f
                        zval **current_row = set->data_cursor;
 
                        if (NULL == current_row[0]) {
-                               uint64 row_num = (set->data_cursor - set->data) / field_count;
+                               uint64_t row_num = (set->data_cursor - set->data) / field_count;
                                set->initialized_rows++;
                                result->m.row_decoder(set->row_buffers[row_num],
                                                                          current_row,
@@ -1284,7 +1284,7 @@ MYSQLND_METHOD(mysqlnd_stmt, send_long_data)(MYSQLND_STMT * const stmt, unsigned
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "There was an error "
                                                         "while sending long data. Probably max_allowed_packet_size "
                                                         "is smaller than the data. You have to increase it or send "
-                                                        "smaller chunks of data. Answer was %u bytes long.", packet_len);
+                                                        "smaller chunks of data. Answer was "MYSQLND_SZ_T_SPEC" bytes long.", packet_len);
                        SET_STMT_ERROR(stmt, CR_CONNECTION_ERROR, UNKNOWN_SQLSTATE,
                                                        "Server responded to COM_STMT_SEND_LONG_DATA.");
                        ret = FAIL;
@@ -1564,7 +1564,7 @@ MYSQLND_METHOD(mysqlnd_stmt, set_result_bind_dtor)(MYSQLND_STMT * const stmt,
 
 
 /* {{{ mysqlnd_stmt::insert_id */
-static uint64
+static uint64_t
 MYSQLND_METHOD(mysqlnd_stmt, insert_id)(const MYSQLND_STMT * const stmt)
 {
        return stmt->upsert_status.last_insert_id;
@@ -1573,7 +1573,7 @@ MYSQLND_METHOD(mysqlnd_stmt, insert_id)(const MYSQLND_STMT * const stmt)
 
 
 /* {{{ mysqlnd_stmt::affected_rows */
-static uint64
+static uint64_t
 MYSQLND_METHOD(mysqlnd_stmt, affected_rows)(const MYSQLND_STMT * const stmt)
 {
        return stmt->upsert_status.affected_rows;
@@ -1582,7 +1582,7 @@ MYSQLND_METHOD(mysqlnd_stmt, affected_rows)(const MYSQLND_STMT * const stmt)
 
 
 /* {{{ mysqlnd_stmt::num_rows */
-static uint64
+static uint64_t
 MYSQLND_METHOD(mysqlnd_stmt, num_rows)(const MYSQLND_STMT * const stmt)
 {
        return stmt->result? mysqlnd_num_rows(stmt->result):0;
@@ -1646,7 +1646,7 @@ MYSQLND_METHOD(mysqlnd_stmt, sqlstate)(const MYSQLND_STMT * const stmt)
 
 /* {{{ mysqlnd_stmt::data_seek */
 static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, data_seek)(const MYSQLND_STMT * const stmt, uint64 row TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, data_seek)(const MYSQLND_STMT * const stmt, uint64_t row TSRMLS_DC)
 {
        return stmt->result? stmt->result->m.seek_data(stmt->result, row TSRMLS_CC) : FAIL;
 }
index 2b37987306aeed3c2aec57c00eb3a1c55ed6c1ee..8269d26f83d8005df84a3bd1f01ca1dae78c7ed8 100644 (file)
 #define MYSQLND_SILENT
 
 
-
-typedef int8  my_int8;
-typedef uint8  my_uint8;
-
-typedef int16 my_int16;
-typedef uint16 my_uint16;
-
-typedef int32   my_int32;
-typedef uint32 my_uint32;
-
-
 enum mysqlnd_timestamp_type
 {
   MYSQLND_TIMESTAMP_NONE= -2,
@@ -58,7 +47,6 @@ struct st_mysqlnd_time
 };
 
 
-
 struct st_mysqlnd_perm_bind mysqlnd_ps_fetch_functions[MYSQL_TYPE_LAST + 1];
 
 #define MYSQLND_PS_SKIP_RESULT_W_LEN   -1
@@ -75,17 +63,17 @@ void ps_fetch_from_1_to_8_bytes(zval *zv, const MYSQLND_FIELD * const field,
        DBG_ENTER("ps_fetch_from_1_to_8_bytes");
        DBG_INF_FMT("zv=%p byte_count=%d", zv, byte_count);
        if (field->flags & UNSIGNED_FLAG) {
-               uint64 uval = 0;
+               uint64_t uval = 0;
 
                switch (byte_count) {
-                       case 8:uval = is_bit? (uint64) bit_uint8korr(*row):(uint64) uint8korr(*row);break;
+                       case 8:uval = is_bit? (uint64_t) bit_uint8korr(*row):(uint64_t) uint8korr(*row);break;
                        case 7:uval = bit_uint7korr(*row);break;
                        case 6:uval = bit_uint6korr(*row);break;
                        case 5:uval = bit_uint5korr(*row);break;
-                       case 4:uval = is_bit? (uint64) bit_uint4korr(*row):(uint64) uint4korr(*row);break;
-                       case 3:uval = is_bit? (uint64) bit_uint3korr(*row):(uint64) uint3korr(*row);break;
-                       case 2:uval = is_bit? (uint64) bit_uint2korr(*row):(uint64) uint2korr(*row);break;
-                       case 1:uval = (uint64) uint1korr(*row);break;
+                       case 4:uval = is_bit? (uint64_t) bit_uint4korr(*row):(uint64_t) uint4korr(*row);break;
+                       case 3:uval = is_bit? (uint64_t) bit_uint3korr(*row):(uint64_t) uint3korr(*row);break;
+                       case 2:uval = is_bit? (uint64_t) bit_uint2korr(*row):(uint64_t) uint2korr(*row);break;
+                       case 1:uval = (uint64_t) uint1korr(*row);break;
                }
 
 #if SIZEOF_LONG==4
@@ -104,21 +92,21 @@ void ps_fetch_from_1_to_8_bytes(zval *zv, const MYSQLND_FIELD * const field,
                }
        } else {
                /* SIGNED */
-               int64 lval = 0;
+               int64_t lval = 0;
                switch (byte_count) {
-                       case 8:lval = (int64) sint8korr(*row);break;
+                       case 8:lval = (int64_t) sint8korr(*row);break;
                        /*
                          7, 6 and 5 are not possible.
                          BIT is only unsigned, thus only uint5|6|7 macroses exist
                        */
-                       case 4:lval = (int64) sint4korr(*row);break;
-                       case 3:lval = (int64) sint3korr(*row);break;
-                       case 2:lval = (int64) sint2korr(*row);break;
-                       case 1:lval = (int64) *(my_int8*)*row;break;
+                       case 4:lval = (int64_t) sint4korr(*row);break;
+                       case 3:lval = (int64_t) sint3korr(*row);break;
+                       case 2:lval = (int64_t) sint2korr(*row);break;
+                       case 1:lval = (int64_t) *(int8_t*)*row;break;
                }
 
 #if SIZEOF_LONG==4
-           if ((L64(2147483647) < (int64) lval) || (L64(-2147483648) > (int64) lval)) {
+           if ((L64(2147483647) < (int64_t) lval) || (L64(-2147483648) > (int64_t) lval)) {
                        DBG_INF("stringify");
                        tmp_len = sprintf((char *)&tmp, MYSQLND_LL_SPEC, lval);
                } else 
@@ -609,8 +597,8 @@ mysqlnd_stmt_execute_store_params(MYSQLND_STMT *stmt, zend_uchar **buf, zend_uch
                                                                  size_t *buf_len, unsigned int null_byte_offset TSRMLS_DC)
 {
        unsigned int i = 0;
-       unsigned left = (*buf_len - (*p - *buf));
-       unsigned int data_size = 0;
+       size_t left = (*buf_len - (*p - *buf));
+       size_t data_size = 0;
        zval **copies = NULL;/* if there are different types */
 
 /* 1. Store type information */
index c6e8a2cdf2b2d54ec224d9c2059f823ff4690d40..f6d3991d2c1cde9697b1c1ae858bd886bd26f5dd 100644 (file)
@@ -1030,7 +1030,7 @@ mysqlnd_fetch_row_buffered_c(MYSQLND_RES *result TSRMLS_DC)
                unsigned int i;
 
                if (NULL == current_row[0]) {
-                       uint64 row_num = (set->data_cursor - set->data) / result->meta->field_count;
+                       uint64_t row_num = (set->data_cursor - set->data) / result->meta->field_count;
                        set->initialized_rows++;
                        result->m.row_decoder(set->row_buffers[row_num],
                                                                  current_row,
@@ -1096,7 +1096,7 @@ mysqlnd_fetch_row_buffered(MYSQLND_RES *result, void *param, unsigned int flags,
                struct mysqlnd_field_hash_key *zend_hash_key = result->meta->zend_hash_keys;
 
                if (NULL == current_row[0]) {
-                       uint64 row_num = (set->data_cursor - set->data) / result->meta->field_count;
+                       uint64_t row_num = (set->data_cursor - set->data) / result->meta->field_count;
                        set->initialized_rows++;
                        result->m.row_decoder(set->row_buffers[row_num],
                                                                  current_row,
@@ -1220,7 +1220,7 @@ mysqlnd_store_result_fetch_data(MYSQLND * const conn, MYSQLND_RES *result,
 
        while (FAIL != (ret = PACKET_READ(row_packet, conn)) && !row_packet->eof) {
                if (!free_rows) {
-                       uint64 total_allocated_rows = free_rows = next_extend = next_extend * 11 / 10; /* extend with 10% */
+                       uint64_t total_allocated_rows = free_rows = next_extend = next_extend * 11 / 10; /* extend with 10% */
                        total_allocated_rows += set->row_count;
                        set->row_buffers = mnd_perealloc(set->row_buffers,
                                                                                         total_allocated_rows * sizeof(MYSQLND_MEMORY_POOL_CHUNK *),
@@ -1361,7 +1361,7 @@ mysqlnd_fetch_row_async_buffered(MYSQLND_RES *result, void *param, unsigned int
 
        /* At the point we are still under LOCK */
        if (set->data_cursor && (set->data_cursor - set->data) < (set->row_count)) {
-               uint64 row_num = set->data_cursor - set->data;
+               uint64_t row_num = set->data_cursor - set->data;
                zval **current_row = *set->data_cursor++;
                set->initialized_rows++;
                /* We don't forget to release the lock */
@@ -1482,8 +1482,8 @@ mysqlnd_background_store_result_fetch_data(MYSQLND_RES *result TSRMLS_DC)
        while (FAIL != (ret = PACKET_READ(row_packet, conn)) && !row_packet->eof) {
                tsrm_mutex_lock(set->LOCK);
                if (!free_rows) {
-                       uint64 total_rows = free_rows = next_extend = next_extend * 5 / 3; /* extend with 33% */
-                       uint64 old_size;
+                       uint64_t total_rows = free_rows = next_extend = next_extend * 5 / 3; /* extend with 33% */
+                       uint64_t old_size;
                        total_rows += set->row_count;
 
                        old_size = set->data_size;
@@ -1698,7 +1698,7 @@ MYSQLND_METHOD(mysqlnd_res, free_result)(MYSQLND_RES *result, zend_bool implicit
 
 /* {{{ mysqlnd_res::data_seek */
 static enum_func_status
-MYSQLND_METHOD(mysqlnd_res, data_seek)(MYSQLND_RES *result, uint64 row TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_res, data_seek)(MYSQLND_RES *result, uint64_t row TSRMLS_DC)
 {
        DBG_ENTER("mysqlnd_res::data_seek");
        DBG_INF_FMT("row=%lu", row);
@@ -1720,7 +1720,7 @@ MYSQLND_METHOD(mysqlnd_res, data_seek)(MYSQLND_RES *result, uint64 row TSRMLS_DC
 
 
 /* {{{ mysqlnd_res::num_rows */
-static uint64
+static uint64_t
 MYSQLND_METHOD(mysqlnd_res, num_rows)(const MYSQLND_RES * const result)
 {
        /* Be compatible with libmysql. We count row_count, but will return 0 */
index 1215a136814fa108426946b590c440ba1ee804bc..32177e71ba89c9e932ff412f08a60a551c9e8fd5 100644 (file)
@@ -62,8 +62,8 @@ extern const MYSQLND_STRING mysqlnd_stats_values_names[];
 #define MYSQLND_INC_GLOBAL_STATISTIC_W_VALUE2(statistic1, value1, statistic2, value2) \
  { \
        if (MYSQLND_G(collect_statistics)) { \
-               uint64 v1 = (uint64) (value1); \
-               uint64 v2 = (uint64) (value2); \
+               uint64_t v1 = (uint64_t) (value1); \
+               uint64_t v2 = (uint64_t) (value2); \
                DBG_INF_FMT("Global stat increase [%s] [%s]", mysqlnd_stats_values_names[statistic1], mysqlnd_stats_values_names[statistic2]); \
                                                                                \
                tsrm_mutex_lock(mysqlnd_global_stats->LOCK_access); \
@@ -89,7 +89,7 @@ extern const MYSQLND_STRING mysqlnd_stats_values_names[];
 #define MYSQLND_INC_CONN_STATISTIC_W_VALUE(conn_stats, statistic, value) \
  { \
        if (MYSQLND_G(collect_statistics) && statistic != STAT_LAST) { \
-               uint64 v = (uint64) (value); \
+               uint64_t v = (uint64_t) (value); \
                DBG_INF_FMT("Global&Conn stat increase w value [%s]", mysqlnd_stats_values_names[statistic]); \
                tsrm_mutex_lock(mysqlnd_global_stats->LOCK_access); \
                mysqlnd_global_stats->values[(statistic)] += v; \
@@ -103,8 +103,8 @@ extern const MYSQLND_STRING mysqlnd_stats_values_names[];
 #define MYSQLND_INC_CONN_STATISTIC_W_VALUE2(conn_stats, statistic1, value1, statistic2, value2) \
  { \
        if (MYSQLND_G(collect_statistics)) { \
-               uint64 v1 = (uint64) (value1); \
-               uint64 v2 = (uint64) (value2); \
+               uint64_t v1 = (uint64_t) (value1); \
+               uint64_t v2 = (uint64_t) (value2); \
                                                                 \
                tsrm_mutex_lock(mysqlnd_global_stats->LOCK_access); \
                if (statistic1 != STAT_LAST) mysqlnd_global_stats->values[(statistic1)]+= v1; \
@@ -121,9 +121,9 @@ extern const MYSQLND_STRING mysqlnd_stats_values_names[];
 #define MYSQLND_INC_CONN_STATISTIC_W_VALUE3(conn_stats, statistic1, value1, statistic2, value2, statistic3, value3) \
  { \
        if (MYSQLND_G(collect_statistics)) { \
-               uint64 v1 = (uint64) (value1); \
-               uint64 v2 = (uint64) (value2); \
-               uint64 v3 = (uint64) (value3); \
+               uint64_t v1 = (uint64_t) (value1); \
+               uint64_t v2 = (uint64_t) (value2); \
+               uint64_t v3 = (uint64_t) (value3); \
                                                                                \
                tsrm_mutex_lock(mysqlnd_global_stats->LOCK_access); \
                if (statistic1 != STAT_LAST) mysqlnd_global_stats->values[(statistic1)]+= v1; \
@@ -164,8 +164,8 @@ extern const MYSQLND_STRING mysqlnd_stats_values_names[];
 #define MYSQLND_INC_GLOBAL_STATISTIC_W_VALUE2(statistic1, value1, statistic2, value2) \
  { \
        if (MYSQLND_G(collect_statistics)) { \
-               uint64 v1 = (uint64) (value1); \
-               uint64 v2 = (uint64) (value2); \
+               uint64_t v1 = (uint64_t) (value1); \
+               uint64_t v2 = (uint64_t) (value2); \
                DBG_INF_FMT("Global stat increase [%s] [%s]", mysqlnd_stats_values_names[statistic1], mysqlnd_stats_values_names[statistic2]); \
                        \
                if (statistic1 != STAT_LAST) mysqlnd_global_stats->values[(statistic1)]+= v1; \
@@ -187,7 +187,7 @@ extern const MYSQLND_STRING mysqlnd_stats_values_names[];
 #define MYSQLND_INC_CONN_STATISTIC_W_VALUE(conn_stats, statistic, value) \
  { \
        if (MYSQLND_G(collect_statistics) && statistic != STAT_LAST) { \
-               uint64 v = (uint64) (value); \
+               uint64_t v = (uint64_t) (value); \
                DBG_INF_FMT("Global&Conn stats increase w value [%s]", mysqlnd_stats_values_names[statistic]); \
                mysqlnd_global_stats->values[(statistic)] += v; \
                if ((conn_stats)) { \
@@ -199,8 +199,8 @@ extern const MYSQLND_STRING mysqlnd_stats_values_names[];
 #define MYSQLND_INC_CONN_STATISTIC_W_VALUE2(conn_stats, statistic1, value1, statistic2, value2) \
  { \
        if (MYSQLND_G(collect_statistics)) { \
-               uint64 v1 = (uint64) (value1); \
-               uint64 v2 = (uint64) (value2); \
+               uint64_t v1 = (uint64_t) (value1); \
+               uint64_t v2 = (uint64_t) (value2); \
                                                                 \
                if (statistic1 != STAT_LAST) mysqlnd_global_stats->values[(statistic1)]+= v1; \
                if (statistic2 != STAT_LAST) mysqlnd_global_stats->values[(statistic2)]+= v2; \
@@ -214,9 +214,9 @@ extern const MYSQLND_STRING mysqlnd_stats_values_names[];
 #define MYSQLND_INC_CONN_STATISTIC_W_VALUE3(conn_stats, statistic1, value1, statistic2, value2, statistic3, value3) \
  { \
        if (MYSQLND_G(collect_statistics)) { \
-               uint64 v1 = (uint64) (value1); \
-               uint64 v2 = (uint64) (value2); \
-               uint64 v3 = (uint64) (value3); \
+               uint64_t v1 = (uint64_t) (value1); \
+               uint64_t v2 = (uint64_t) (value2); \
+               uint64_t v3 = (uint64_t) (value3); \
                                                                \
                if (statistic1 != STAT_LAST) mysqlnd_global_stats->values[(statistic1)]+= v1; \
                if (statistic2 != STAT_LAST) mysqlnd_global_stats->values[(statistic2)]+= v2; \
index 2385aff6aa445ff61d862a887d61274ada93d7cd..d1bd38c7277bec9accc6dd5480249632fe353111 100644 (file)
@@ -45,7 +45,7 @@ struct st_mysqlnd_memory_pool
 
 struct st_mysqlnd_memory_pool_chunk
 {
-       uint64                          app;
+       uint64_t                        app;
        MYSQLND_MEMORY_POOL *pool;
        zend_uchar                      *ptr;
        uint                            size;
@@ -94,8 +94,8 @@ typedef struct st_mysqlnd_upsert_result
 {
        unsigned int    warning_count;
        unsigned int    server_status;
-       uint64                  affected_rows;
-       uint64                  last_insert_id;
+       uint64_t                affected_rows;
+       uint64_t                last_insert_id;
 } mysqlnd_upsert_status;
 
 
@@ -210,7 +210,7 @@ typedef enum_func_status  (*mysqlnd_fetch_row_func)(MYSQLND_RES *result,
 
 typedef struct st_mysqlnd_stats
 {
-       uint64  values[STAT_LAST];
+       uint64_t        values[STAT_LAST];
 #ifdef ZTS
        MUTEX_T LOCK_access;
 #endif
@@ -257,7 +257,7 @@ struct st_mysqlnd_conn_methods
        unsigned int            (*get_error_no)(const MYSQLND * const conn);
        const char *            (*get_error_str)(const MYSQLND * const conn);
        const char *            (*get_sqlstate)(const MYSQLND * const conn);
-       uint64                          (*get_thread_id)(const MYSQLND * const conn);
+       uint64_t                        (*get_thread_id)(const MYSQLND * const conn);
        void                            (*get_statistics)(const MYSQLND * const conn, zval *return_value TSRMLS_DC ZEND_FILE_LINE_DC);
 
        unsigned long           (*get_server_version)(const MYSQLND * const conn);
@@ -270,8 +270,8 @@ struct st_mysqlnd_conn_methods
        MYSQLND_RES *           (*list_fields)(MYSQLND *conn, const char *table, const char *achtung_wild TSRMLS_DC);
        MYSQLND_RES *           (*list_method)(MYSQLND *conn, const char *query, const char *achtung_wild, char *par1 TSRMLS_DC);
 
-       uint64                          (*get_last_insert_id)(const MYSQLND * const conn);
-       uint64                          (*get_affected_rows)(const MYSQLND * const conn);
+       uint64_t                        (*get_last_insert_id)(const MYSQLND * const conn);
+       uint64_t                        (*get_affected_rows)(const MYSQLND * const conn);
        unsigned int            (*get_warning_count)(const MYSQLND * const conn);
 
        unsigned int            (*get_field_count)(const MYSQLND * const conn);
@@ -302,10 +302,10 @@ struct st_mysqlnd_res_methods
        MYSQLND_ROW_C           (*fetch_row_c)(MYSQLND_RES *result TSRMLS_DC);
        void                            (*fetch_all)(MYSQLND_RES *result, unsigned int flags, zval *return_value TSRMLS_DC ZEND_FILE_LINE_DC);
        void                            (*fetch_field_data)(MYSQLND_RES *result, unsigned int offset, zval *return_value TSRMLS_DC);
-       uint64                          (*num_rows)(const MYSQLND_RES * const result);
+       uint64_t                        (*num_rows)(const MYSQLND_RES * const result);
        unsigned int            (*num_fields)(const MYSQLND_RES * const result);
        enum_func_status        (*skip_result)(MYSQLND_RES * const result TSRMLS_DC);
-       enum_func_status        (*seek_data)(MYSQLND_RES * result, uint64 row TSRMLS_DC);
+       enum_func_status        (*seek_data)(MYSQLND_RES * result, uint64_t row TSRMLS_DC);
        MYSQLND_FIELD_OFFSET (*seek_field)(MYSQLND_RES * const result, MYSQLND_FIELD_OFFSET field_offset);
        MYSQLND_FIELD_OFFSET (*field_tell)(const MYSQLND_RES * const result);
        const MYSQLND_FIELD *(*fetch_field)(MYSQLND_RES * const result TSRMLS_DC);
@@ -347,7 +347,7 @@ struct st_mysqlnd_stmt_methods
        zend_bool                       (*more_results)(const MYSQLND_STMT * const stmt TSRMLS_DC);
        enum_func_status        (*next_result)(MYSQLND_STMT * const stmt TSRMLS_DC);
        enum_func_status        (*free_result)(MYSQLND_STMT * const stmt TSRMLS_DC);
-       enum_func_status        (*seek_data)(const MYSQLND_STMT * const stmt, uint64 row TSRMLS_DC);
+       enum_func_status        (*seek_data)(const MYSQLND_STMT * const stmt, uint64_t row TSRMLS_DC);
        enum_func_status        (*reset)(MYSQLND_STMT * const stmt TSRMLS_DC);
        enum_func_status        (*net_close)(MYSQLND_STMT * const stmt, zend_bool implicit TSRMLS_DC); /* private */
        enum_func_status        (*dtor)(MYSQLND_STMT * const stmt, zend_bool implicit TSRMLS_DC); /* use this for mysqlnd_stmt_close */
@@ -366,9 +366,9 @@ struct st_mysqlnd_stmt_methods
        MYSQLND_RES *           (*get_parameter_metadata)(MYSQLND_STMT * const stmt);
        MYSQLND_RES *           (*get_result_metadata)(MYSQLND_STMT * const stmt TSRMLS_DC);
 
-       uint64                          (*get_last_insert_id)(const MYSQLND_STMT * const stmt);
-       uint64                          (*get_affected_rows)(const MYSQLND_STMT * const stmt);
-       uint64                          (*get_num_rows)(const MYSQLND_STMT * const stmt);
+       uint64_t                        (*get_last_insert_id)(const MYSQLND_STMT * const stmt);
+       uint64_t                        (*get_affected_rows)(const MYSQLND_STMT * const stmt);
+       uint64_t                        (*get_num_rows)(const MYSQLND_STMT * const stmt);
 
        unsigned int            (*get_param_count)(const MYSQLND_STMT * const stmt);
        unsigned int            (*get_field_count)(const MYSQLND_STMT * const stmt);
@@ -395,7 +395,7 @@ struct st_mysqlnd_connection
        char                    *passwd;
        unsigned int    *passwd_len;
        char                    *scheme;
-       uint64                  thread_id;
+       uint64_t                thread_id;
        char                    *server_version;
        char                    *host_info;
        unsigned char   *scramble;
@@ -502,11 +502,11 @@ struct st_mysqlnd_result_metadata
 struct st_mysqlnd_background_buffered_result
 {
        zval                    ***data;
-       uint64                  data_size;
+       uint64_t                data_size;
        zval                    ***data_cursor;
        MYSQLND_MEMORY_POOL_CHUNK **row_buffers;
-       uint64                  row_count;
-       uint64                  initialized_rows;
+       uint64_t                row_count;
+       uint64_t                initialized_rows;
        zend_bool               persistent;
 
        MYSQLND_QCACHE  *qcache;
@@ -529,8 +529,8 @@ struct st_mysqlnd_buffered_result
        zval                            **data;
        zval                            **data_cursor;
        MYSQLND_MEMORY_POOL_CHUNK **row_buffers;
-       uint64                          row_count;
-       uint64                          initialized_rows;
+       uint64_t                        row_count;
+       uint64_t                        initialized_rows;
        zend_bool                       persistent;
 
        MYSQLND_QCACHE          *qcache;
@@ -546,7 +546,7 @@ struct st_mysqlnd_unbuffered_result
        zval                            **last_row_data;
        MYSQLND_MEMORY_POOL_CHUNK *last_row_buffer;
 
-       uint64                          row_count;
+       uint64_t                        row_count;
        zend_bool                       eof_reached;
 };
 
index d5e09a1288cf4cd6493a59b5a22011839d390521..e49c81561ade5bb0eee2c2ec7cb1acf22e81a5ef 100644 (file)
@@ -35,7 +35,6 @@
 #include <winsock.h>
 #endif
 
-
 #define USE_CORK 0
 
 #define MYSQLND_SILENT 1
@@ -159,48 +158,48 @@ unsigned long php_mysqlnd_net_field_length(zend_uchar **packet)
 
 /* {{{ php_mysqlnd_net_field_length_ll 
    Get next field's length */
-uint64 php_mysqlnd_net_field_length_ll(zend_uchar **packet)
+uint64_t php_mysqlnd_net_field_length_ll(zend_uchar **packet)
 {
        register zend_uchar *p= (zend_uchar *)*packet;
 
        if (*p < 251) {
                (*packet)++;
-               return (uint64) *p;
+               return (uint64_t) *p;
        }
 
        switch (*p) {
                case 251:
                        (*packet)++;
-                       return (uint64) MYSQLND_NULL_LENGTH;
+                       return (uint64_t) MYSQLND_NULL_LENGTH;
                case 252:
                        (*packet) += 3;
-                       return (uint64) uint2korr(p + 1);
+                       return (uint64_t) uint2korr(p + 1);
                case 253:
                        (*packet) += 4;
-                       return (uint64) uint3korr(p + 1);
+                       return (uint64_t) uint3korr(p + 1);
                default:
                        (*packet) += 9;
-                       return (uint64) uint8korr(p + 1);
+                       return (uint64_t) uint8korr(p + 1);
        }
 }
 /* }}} */
 
 
 /* {{{ php_mysqlnd_net_store_length */
-zend_uchar *php_mysqlnd_net_store_length(zend_uchar *packet, uint64 length)
+zend_uchar *php_mysqlnd_net_store_length(zend_uchar *packet, uint64_t length)
 {
-       if (length < (uint64) L64(251)) {
+       if (length < (uint64_t) L64(251)) {
                *packet = (zend_uchar) length;
                return packet + 1;
        }
 
-       if (length < (uint64) L64(65536)) {
+       if (length < (uint64_t) L64(65536)) {
                *packet++ = 252;
                int2store(packet,(uint) length);
                return packet + 2;
        }
 
-       if (length < (uint64) L64(16777216)) {
+       if (length < (uint64_t) L64(16777216)) {
                *packet++ = 253;
                int3store(packet,(ulong) length);
                return packet + 3;
@@ -248,8 +247,8 @@ size_t php_mysqlnd_consume_uneaten_data(MYSQLND * const conn, enum php_mysqlnd_s
                        DBG_ERR_FMT("Skipped %u bytes. Last command %s hasn't consumed all the output from the server",
                                                bytes_consumed, mysqlnd_command_to_text[net->last_command]);
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Skipped %u bytes. Last command %s hasn't "
-                                                        "consumed all the output from the server. PID=%d",
-                                                        bytes_consumed, mysqlnd_command_to_text[net->last_command], getpid());
+                                                        "consumed all the output from the server",
+                                                        bytes_consumed, mysqlnd_command_to_text[net->last_command]);
                }
        }
        net->last_command = cmd;
@@ -316,7 +315,7 @@ int mysqlnd_set_sock_no_delay(php_stream *stream)
 
 
 /* We assume that MYSQLND_HEADER_SIZE is 4 bytes !! */
-#define STORE_HEADER_SIZE(safe_storage, buffer)  int4store((safe_storage), (*(uint32 *)(buffer)))
+#define STORE_HEADER_SIZE(safe_storage, buffer)  int4store((safe_storage), (*(uint32_t *)(buffer)))
 #define RESTORE_HEADER_SIZE(buffer, safe_storage) STORE_HEADER_SIZE((safe_storage), (buffer))
 
 /* {{{ mysqlnd_stream_write_w_header */
@@ -499,8 +498,8 @@ mysqlnd_read_header(MYSQLND *conn, mysqlnd_packet_header *header TSRMLS_DC)
        DBG_ERR_FMT("Packets out of order. Expected %d received %d. Packet size=%d",
                                net->packet_no, header->packet_no, header->size);
 
-       php_error(E_WARNING, "Packets out of order. Expected %d received %d. Packet size=%d. PID=%d",
-                         net->packet_no, header->packet_no, header->size, getpid());
+       php_error(E_WARNING, "Packets out of order. Expected %d received %d. Packet size="MYSQLND_SZ_T_SPEC,
+                         net->packet_no, header->packet_no, header->size);
        DBG_RETURN(FAIL);
 }
 /* }}} */
@@ -629,8 +628,8 @@ php_mysqlnd_greet_read(void *_packet, MYSQLND *conn TSRMLS_DC)
 
        if (p - begin > packet->header.size) {
                DBG_ERR_FMT("GREET packet %d bytes shorter than expected", p - begin - packet->header.size);
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "GREET packet %d bytes shorter than expected. PID=%d",
-                                                p - begin - packet->header.size, getpid());
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "GREET packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+                                                p - begin - packet->header.size);
        }
 
        DBG_RETURN(PASS);
@@ -826,8 +825,8 @@ php_mysqlnd_ok_read(void *_packet, MYSQLND *conn TSRMLS_DC)
 
        if (p - begin > packet->header.size) {
                DBG_ERR_FMT("OK packet %d bytes shorter than expected", p - begin - packet->header.size);
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "OK packet %d bytes shorter than expected. PID=%d",
-                                                p - begin - packet->header.size, getpid());
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "OK packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+                                                p - begin - packet->header.size);
        }
 
        DBG_RETURN(PASS);
@@ -899,8 +898,8 @@ php_mysqlnd_eof_read(void *_packet, MYSQLND *conn TSRMLS_DC)
 
        if (p - begin > packet->header.size) {
                DBG_ERR_FMT("EOF packet %d bytes shorter than expected", p - begin - packet->header.size);
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "EOF packet %d bytes shorter than expected. PID=%d",
-                                                p - begin - packet->header.size, getpid());
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "EOF packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+                                                p - begin - packet->header.size);
        }
        
        DBG_INF_FMT("EOF packet: fields=%d status=%d warnings=%d",
@@ -1064,8 +1063,8 @@ php_mysqlnd_rset_header_read(void *_packet, MYSQLND *conn TSRMLS_DC)
        }
        if (p - begin > packet->header.size) {
                DBG_ERR_FMT("RSET_HEADER packet %d bytes shorter than expected", p - begin - packet->header.size);
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "GREET packet %d bytes shorter than expected. PID=%d",
-                                                p - begin - packet->header.size, getpid());
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "GREET packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+                                                p - begin - packet->header.size);
        }
 
        DBG_RETURN(PASS);
@@ -1204,8 +1203,8 @@ php_mysqlnd_rset_field_read(void *_packet, MYSQLND *conn TSRMLS_DC)
 
        if (p - begin > packet->header.size) {
                DBG_ERR_FMT("RSET field packet %d bytes shorter than expected", p - begin - packet->header.size);
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Result set field packet %d bytes "
-                                                "shorter than expected. PID=%d", p - begin - packet->header.size, getpid());
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Result set field packet "MYSQLND_SZ_T_SPEC" bytes "
+                                               "shorter than expected", p - begin - packet->header.size);
        }
 
        root_ptr = meta->root = mnd_emalloc(total_len);
@@ -1282,7 +1281,7 @@ void php_mysqlnd_rset_field_free_mem(void *_packet, zend_bool alloca TSRMLS_DC)
 
 static enum_func_status
 php_mysqlnd_read_row_ex(MYSQLND *conn, MYSQLND_MEMORY_POOL_CHUNK **buffer,
-                                               uint64 *data_size, zend_bool persistent_alloc,
+                                               uint64_t *data_size, zend_bool persistent_alloc,
                                                unsigned int prealloc_more_bytes TSRMLS_DC)
 {
        enum_func_status ret = PASS;
@@ -1337,7 +1336,7 @@ php_mysqlnd_read_row_ex(MYSQLND *conn, MYSQLND_MEMORY_POOL_CHUNK **buffer,
 
                if (!mysqlnd_read_body(conn, p, header.size TSRMLS_CC)) {
                        DBG_ERR("Empty row packet body");
-                       php_error(E_WARNING, "Empty row packet body. PID=%d", getpid());
+                       php_error(E_WARNING, "Empty row packet body");
                        ret = FAIL;
                        break;
                }
@@ -1560,7 +1559,7 @@ void php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer,
                                if (perm_bind.pack_len < SIZEOF_LONG)
                                {
                                        /* direct conversion */
-                                       int64 v =
+                                       int64_t v =
 #ifndef PHP_WIN32
                                                atoll((char *) p);
 #else
@@ -1568,11 +1567,11 @@ void php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer,
 #endif
                                        ZVAL_LONG(*current_field, v);
                                } else {
-                                       uint64 v =
+                                       uint64_t v =
 #ifndef PHP_WIN32
-                                               (uint64) atoll((char *) p);
+                                               (uint64_t) atoll((char *) p);
 #else
-                                               (uint64) _atoi64((char *) p);
+                                               (uint64_t) _atoi64((char *) p);
 #endif
                                        zend_bool uns = fields_metadata[i].flags & UNSIGNED_FLAG? TRUE:FALSE;
                                        /* We have to make it ASCIIZ temporarily */
@@ -1580,13 +1579,13 @@ void php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer,
                                        if (uns == TRUE && v > 9223372036854775807L)
 #elif SIZEOF_LONG==4
                                        if ((uns == TRUE && v > L64(2147483647)) || 
-                                               (uns == FALSE && (( L64(2147483647) < (int64) v) ||
-                                               (L64(-2147483648) > (int64) v))))
+                                               (uns == FALSE && (( L64(2147483647) < (int64_t) v) ||
+                                               (L64(-2147483648) > (int64_t) v))))
 #endif /* SIZEOF */
                                        {
                                                ZVAL_STRINGL(*current_field, (char *)p, len, 0);
                                        } else {
-                                               ZVAL_LONG(*current_field, (int64)v);
+                                               ZVAL_LONG(*current_field, (int64_t)v);
                                        }
                                }
                                *(p + len) = save;
@@ -1617,8 +1616,7 @@ void php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer,
                                */
                                p -= len;
                                if (Z_TYPE_PP(current_field) == IS_LONG) {
-                                       bit_area += 1 + sprintf((char *)start, MYSQLND_LLU_SPEC,
-                                                                                       (int64) Z_LVAL_PP(current_field));
+                                       bit_area += 1 + sprintf((char *)start, "%ld", Z_LVAL_PP(current_field));
 #if PHP_MAJOR_VERSION >= 6
                                        if (as_unicode) {
                                                ZVAL_UTF8_STRINGL(*current_field, start, bit_area - start - 1, 0);
@@ -1728,7 +1726,7 @@ php_mysqlnd_rowp_read(void *_packet, MYSQLND *conn TSRMLS_DC)
        size_t old_chunk_size = net->stream->chunk_size;
        php_mysql_packet_row *packet= (php_mysql_packet_row *) _packet;
        size_t post_alloc_for_bit_fields = 0;
-       uint64 data_size = 0;
+       uint64_t data_size = 0;
 
        DBG_ENTER("php_mysqlnd_rowp_read");
 
@@ -1918,7 +1916,7 @@ php_mysqlnd_prepare_read(void *_packet, MYSQLND *conn TSRMLS_DC)
                data_size != PREPARE_RESPONSE_SIZE_50 &&
                !(data_size > PREPARE_RESPONSE_SIZE_50)) {
                DBG_ERR_FMT("Wrong COM_STMT_PREPARE response size. Received %d", data_size);
-               php_error(E_WARNING, "Wrong COM_STMT_PREPARE response size. Received %d. PID=%d", data_size, getpid());
+               php_error(E_WARNING, "Wrong COM_STMT_PREPARE response size. Received %d", data_size);
                DBG_RETURN(FAIL);
        }
 
@@ -1944,8 +1942,8 @@ php_mysqlnd_prepare_read(void *_packet, MYSQLND *conn TSRMLS_DC)
 
        if (p - begin > packet->header.size) {
                DBG_ERR_FMT("PREPARE packet %d bytes shorter than expected", p - begin - packet->header.size);
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "PREPARE packet %d bytes shorter than expected. PID=%d",
-                                                p - begin - packet->header.size, getpid());
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "PREPARE packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+                                                p - begin - packet->header.size);
        }
 
        DBG_RETURN(PASS);
@@ -2004,8 +2002,8 @@ php_mysqlnd_chg_user_read(void *_packet, MYSQLND *conn TSRMLS_DC)
        }
        if (p - begin > packet->header.size) {
                DBG_ERR_FMT("CHANGE_USER packet %d bytes shorter than expected", p - begin - packet->header.size);
-               php_error_docref(NULL TSRMLS_CC, E_WARNING, "CHANGE_USER packet %d bytes shorter than expected. PID=%d",
-                                                p - begin - packet->header.size, getpid());
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "CHANGE_USER packet "MYSQLND_SZ_T_SPEC" bytes shorter than expected",
+                                                p - begin - packet->header.size);
        }
 
        DBG_RETURN(PASS);
index d27baac85bfa96c17424091caca6a9a8a3f14e98..6cc8bdd26313683aab1ff0abae2ef56aab2307c6 100644 (file)
 
 #define MYSQLND_NULL_LENGTH    (unsigned long) ~0
 
-typedef zend_uchar     mysqlnd_1b;
-typedef zend_ushort mysqlnd_2b;
-typedef zend_uint      mysqlnd_4b;
-
 /* Used in mysqlnd_debug.c */
 extern char * mysqlnd_read_header_name;
 extern char * mysqlnd_read_body_name;
@@ -137,19 +133,19 @@ typedef struct st_mysqlnd_packet_header {
 /* Server greets the client */
 typedef struct st_php_mysql_packet_greet {
        mysqlnd_packet_header           header;
-       mysqlnd_1b              protocol_version;
-       char                    *server_version;
-       mysqlnd_4b              thread_id;
-       zend_uchar              scramble_buf[SCRAMBLE_LENGTH];
+       uint8_t         protocol_version;
+       char            *server_version;
+       uint32_t        thread_id;
+       zend_uchar      scramble_buf[SCRAMBLE_LENGTH];
        /* 1 byte pad */
-       mysqlnd_2b              server_capabilities;
-       mysqlnd_1b              charset_no;
-       mysqlnd_2b              server_status;
+       uint16_t        server_capabilities;
+       uint8_t         charset_no;
+       uint16_t        server_status;
        /* 13 byte pad*/
-       zend_bool               pre41;
+       zend_bool       pre41;
        /* If error packet, we use these */
-       char                    error[MYSQLND_ERRMSG_SIZE+1];
-       char                    sqlstate[MYSQLND_SQLSTATE_LENGTH + 1];
+       char            error[MYSQLND_ERRMSG_SIZE+1];
+       char            sqlstate[MYSQLND_SQLSTATE_LENGTH + 1];
        unsigned int    error_no;
 } php_mysql_packet_greet;
 
@@ -157,9 +153,9 @@ typedef struct st_php_mysql_packet_greet {
 /* Client authenticates */
 typedef struct st_php_mysql_packet_auth {
        mysqlnd_packet_header           header;
-       mysqlnd_4b      client_flags;
-       uint32          max_packet_size;
-       mysqlnd_1b      charset_no;
+       uint32_t        client_flags;
+       uint32_t        max_packet_size;
+       uint8_t charset_no;
        /* 23 byte pad */
        const char      *user;
        /* 8 byte scramble */
@@ -176,16 +172,16 @@ typedef struct st_php_mysql_packet_auth {
 /* OK packet */
 typedef struct st_php_mysql_packet_ok {
        mysqlnd_packet_header           header;
-       mysqlnd_1b              field_count; /* always 0x0 */
-       uint64  affected_rows;
-       uint64  last_insert_id;
-       mysqlnd_2b              server_status;
-       mysqlnd_2b              warning_count;
-       char                    *message;
-       size_t                  message_len;
+       uint8_t         field_count; /* always 0x0 */
+       uint64_t        affected_rows;
+       uint64_t        last_insert_id;
+       uint16_t        server_status;
+       uint16_t        warning_count;
+       char            *message;
+       size_t          message_len;
        /* If error packet, we use these */
-       char                    error[MYSQLND_ERRMSG_SIZE+1];
-       char                    sqlstate[MYSQLND_SQLSTATE_LENGTH + 1];
+       char            error[MYSQLND_ERRMSG_SIZE+1];
+       char            sqlstate[MYSQLND_SQLSTATE_LENGTH + 1];
        unsigned int    error_no;
 } php_mysql_packet_ok;
 
@@ -202,12 +198,12 @@ typedef struct st_php_mysql_packet_command {
 /* EOF packet */
 typedef struct st_php_mysql_packet_eof {
        mysqlnd_packet_header           header;
-       mysqlnd_1b              field_count; /* 0xFE */
-       mysqlnd_2b              warning_count;
-       mysqlnd_2b              server_status;
+       uint8_t         field_count; /* 0xFE */
+       uint16_t        warning_count;
+       uint16_t        server_status;
        /* If error packet, we use these */
-       char                    error[MYSQLND_ERRMSG_SIZE+1];
-       char                    sqlstate[MYSQLND_SQLSTATE_LENGTH + 1];
+       char            error[MYSQLND_ERRMSG_SIZE+1];
+       char            sqlstate[MYSQLND_SQLSTATE_LENGTH + 1];
        unsigned int    error_no;
 } php_mysql_packet_eof;
 /* EOF packet */
@@ -227,13 +223,13 @@ typedef struct st_php_mysql_packet_rset_header {
          These are filled if no SELECT query. For SELECT warning_count
          and server status are in the last row packet, the EOF packet.
        */
-       mysqlnd_2b                      warning_count;
-       mysqlnd_2b                      server_status;
-       uint64          affected_rows;
-       uint64          last_insert_id;
+       uint16_t        warning_count;
+       uint16_t        server_status;
+       uint64_t        affected_rows;
+       uint64_t        last_insert_id;
        /* This is for both LOAD DATA or info, when no result set */
-       char                            *info_or_local_file;
-       size_t                          info_or_local_file_len;
+       char            *info_or_local_file;
+       size_t          info_or_local_file_len;
        /* If error packet, we use these */
        mysqlnd_error_info      error_info;
 } php_mysql_packet_rset_header;
@@ -252,15 +248,15 @@ typedef struct st_php_mysql_packet_res_field {
 /* Row packet */
 struct st_php_mysql_packet_row {
        mysqlnd_packet_header   header;
-       zval                    **fields;
-       mysqlnd_4b              field_count;
-       zend_bool               eof;
+       zval            **fields;
+       uint32_t        field_count;
+       zend_bool       eof;
        /*
          These are, of course, only for SELECT in the EOF packet,
          which is detected by this packet
        */
-       mysqlnd_2b              warning_count;
-       mysqlnd_2b              server_status;
+       uint16_t        warning_count;
+       uint16_t        server_status;
 
        struct st_mysqlnd_memory_pool_chunk     *row_buffer;
 
@@ -304,10 +300,10 @@ typedef struct st_php_mysql_packet_prepare_response {
 /* Statistics packet */
 typedef struct st_php_mysql_packet_chg_user_resp {
        mysqlnd_packet_header   header;
-       mysqlnd_4b                      field_count;
+       uint32_t                        field_count;
        
        /* message_len is not part of the packet*/
-       mysqlnd_2b                      server_capabilities;
+       uint16_t                        server_capabilities;
        /* If error packet, we use these */
        mysqlnd_error_info      error_info;
 } php_mysql_packet_chg_user_resp;
@@ -323,7 +319,7 @@ size_t php_mysqlnd_consume_uneaten_data(MYSQLND * const conn, enum php_mysqlnd_s
 void php_mysqlnd_scramble(zend_uchar * const buffer, const zend_uchar * const scramble, const zend_uchar * const pass);
 
 unsigned long  php_mysqlnd_net_field_length(zend_uchar **packet);
-zend_uchar *   php_mysqlnd_net_store_length(zend_uchar *packet, uint64 length);
+zend_uchar *   php_mysqlnd_net_store_length(zend_uchar *packet, uint64_t length);
 
 extern char * const mysqlnd_empty_string;