andrey Thu Nov 6 10:37:48 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/mysqlnd config-win.h mysqlnd.c mysqlnd.h
mysqlnd_block_alloc.c mysqlnd_charset.c
mysqlnd_debug.c mysqlnd_debug.h
mysqlnd_loaddata.c mysqlnd_portability.h
mysqlnd_priv.h mysqlnd_ps.c mysqlnd_ps_codec.c
mysqlnd_result.c mysqlnd_structs.h
mysqlnd_wireprotocol.c mysqlnd_wireprotocol.h
Log:
MFH:
Get rid of many defines (which simplifies the code a lot),
as well as uint->unsigned int
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/config-win.h?r1=1.1.2.3&r2=1.1.2.4&diff_format=u
Index: php-src/ext/mysqlnd/config-win.h
diff -u php-src/ext/mysqlnd/config-win.h:1.1.2.3
php-src/ext/mysqlnd/config-win.h:1.1.2.4
--- php-src/ext/mysqlnd/config-win.h:1.1.2.3 Sat Nov 1 21:22:29 2008
+++ php-src/ext/mysqlnd/config-win.h Thu Nov 6 10:37:47 2008
@@ -18,10 +18,7 @@
#define SYSTEM_TYPE "Win95/Win98"
#endif
-#ifdef _WIN64
-#define MACHINE_TYPE "ia64" /* Define to machine type name */
-#else
-#define MACHINE_TYPE "i32" /* Define to machine type name */
+#ifndef _WIN64
#ifndef _WIN32
#define _WIN32 /* Compatible with old source */
#endif
@@ -40,10 +37,7 @@
/* Type information */
/*
-typedef unsigned short ushort;
typedef unsigned int uint;
-typedef unsigned __int64 ulonglong;
-typedef __int64 longlong;
*/
typedef int sigset_t;
#define longlong_defined
@@ -58,43 +52,40 @@
#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])))
+
(((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 *) (A)))
#define uint2korr(A) (*((uint16_t *) (A)))
#define uint3korr(A) (int32_t) (*((uint32_t *) (A)) & 0xFFFFFF)
#define uint4korr(A) (*((uint32_t *) (A)))
#define uint5korr(A) ((uint64_t)(((uint32_t) ((uchar) (A)[0])) +\
- (((uint32_t) ((uchar) (A)[1])) << 8) +\
- (((uint32_t) ((uchar) (A)[2])) << 16) +\
- (((uint32_t) ((uchar) (A)[3])) << 24)) +\
- (((uint64_t) ((uchar) (A)[4])) << 32))
+
(((uint32_t) ((uchar) (A)[1])) << 8) +\
+
(((uint32_t) ((uchar) (A)[2])) << 16) +\
+
(((uint32_t) ((uchar) (A)[3])) << 24)) +\
+
(((uint64_t) ((uchar) (A)[4])) << 32))
#define uint8korr(A) (*((uint64_t *) (A)))
#define sint8korr(A) (*((int64_t *) (A)))
#define int2store(T,A) *((uint16_t*) (T))= (uint16_t) (A)
-#define int3store(T,A) { *(T)= (uchar) ((A));\
- *(T+1)=(uchar) (((uint32_t) (A) >> 8));\
- *(T+2)=(uchar) (((A) >> 16)); }
+#define int3store(T,A) { *(T)= (uchar) ((A));\
+ *(T+1)=(uchar)
(((uint32_t) (A) >> 8));\
+ *(T+2)=(uchar)
(((A) >> 16)); }
#define int4store(T,A) *((int32_t *) (T))= (int32_t) (A)
-#define int5store(T,A) { *(T)= (uchar)((A));\
- *((T)+1)=(uchar) (((A) >> 8));\
- *((T)+2)=(uchar) (((A) >> 16));\
- *((T)+3)=(uchar) (((A) >> 24)); \
- *((T)+4)=(uchar) (((A) >> 32)); }
+#define int5store(T,A) { *(T)= (uchar)((A));\
+ *((T)+1)=(uchar) (((A)
>> 8));\
+ *((T)+2)=(uchar) (((A)
>> 16));\
+ *((T)+3)=(uchar) (((A)
>> 24)); \
+ *((T)+4)=(uchar) (((A)
>> 32)); }
#define int8store(T,A) *((uint64_t *) (T))= (uint64_t) (A)
-#define doubleget(V,M) { *((int32_t *) &V) = *((int32_t*) M); \
- *(((int32_t *) &V)+1) = *(((int32_t*) M)+1); }
-#define doublestore(T,V) { *((int32_t *) T) = *((int32_t*) &V); \
- *(((int32_t *) T)+1) = *(((int32_t*) &V)+1); }
+#define float8get(V,M) { *((int32_t *) &V) = *((int32_t*) M); \
+ *(((int32_t *) &V)+1) =
*(((int32_t*) M)+1); }
+#define float8store(T,V) { *((int32_t *) T) = *((int32_t*) &V); \
+ *(((int32_t *) T)+1) =
*(((int32_t*) &V)+1); }
#define float4get(V,M) { *((int32_t *) &(V)) = *((int32_t*) (M)); }
-#define float8get(V,M) doubleget((V),(M))
-#define float4store(V,M) memcpy((char*) V,(char*) (&M),sizeof(float))
-#define float8store(V,M) doublestore((V),(M))
#endif /* _WIN64 */
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.c?r1=1.5.2.30&r2=1.5.2.31&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd.c
diff -u php-src/ext/mysqlnd/mysqlnd.c:1.5.2.30
php-src/ext/mysqlnd/mysqlnd.c:1.5.2.31
--- php-src/ext/mysqlnd/mysqlnd.c:1.5.2.30 Fri Oct 31 20:32:17 2008
+++ php-src/ext/mysqlnd/mysqlnd.c Thu Nov 6 10:37:47 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysqlnd.c,v 1.5.2.30 2008/10/31 20:32:17 andrey Exp $ */
+/* $Id: mysqlnd.c,v 1.5.2.31 2008/11/06 10:37:47 andrey Exp $ */
#include "php.h"
#include "mysqlnd.h"
#include "mysqlnd_wireprotocol.h"
@@ -439,7 +439,7 @@
char buffer[2];
DBG_ENTER("mysqlnd_conn::set_server_option");
- int2store(buffer, (uint) option);
+ int2store(buffer, (unsigned int) option);
ret = mysqlnd_simple_command(conn, COM_SET_OPTION, buffer,
sizeof(buffer),
PROT_EOF_PACKET, FALSE, TRUE TSRMLS_CC);
DBG_RETURN(ret);
@@ -758,12 +758,12 @@
mysqlnd_local_infile_default(conn);
{
- uint buf_size;
- buf_size = MYSQLND_G(net_read_buffer_size); /* this is
long, cast to uint*/
+ unsigned int buf_size;
+ buf_size = MYSQLND_G(net_read_buffer_size); /* this is
long, cast to unsigned int*/
conn->m->set_client_option(conn,
MYSQLND_OPT_NET_READ_BUFFER_SIZE,
(char *)&buf_size TSRMLS_CC);
- buf_size = MYSQLND_G(net_cmd_buffer_size); /* this is
long, cast to uint*/
+ buf_size = MYSQLND_G(net_cmd_buffer_size); /* this is
long, cast to unsigned int*/
conn->m->set_client_option(conn,
MYSQLND_OPT_NET_CMD_BUFFER_SIZE,
(char *)&buf_size TSRMLS_CC);
}
@@ -781,7 +781,7 @@
conn->result_set_memory_pool = mysqlnd_mempool_create(16000
TSRMLS_CC);
#if PHP_MAJOR_VERSION >= 6
{
- uint as_unicode = 1;
+ unsigned int as_unicode = 1;
conn->m->set_client_option(conn,
MYSQLND_OPT_NUMERIC_AND_DATETIME_AS_UNICODE,
(char *)&as_unicode TSRMLS_CC);
DBG_INF("unicode set");
@@ -1702,11 +1702,11 @@
switch (option) {
#if PHP_MAJOR_VERSION >= 6
case MYSQLND_OPT_NUMERIC_AND_DATETIME_AS_UNICODE:
- conn->options.numeric_and_datetime_as_unicode =
*(uint*) value;
+ conn->options.numeric_and_datetime_as_unicode =
*(unsigned int*) value;
break;
#endif
case MYSQLND_OPT_NET_CMD_BUFFER_SIZE:
- conn->net.cmd_buffer.length = *(uint*) value;
+ conn->net.cmd_buffer.length = *(unsigned int*) value;
if (!conn->net.cmd_buffer.buffer) {
conn->net.cmd_buffer.buffer =
mnd_pemalloc(conn->net.cmd_buffer.length, conn->persistent);
} else {
@@ -1716,26 +1716,26 @@
}
break;
case MYSQLND_OPT_NET_READ_BUFFER_SIZE:
- conn->options.net_read_buffer_size = *(uint*) value;
+ conn->options.net_read_buffer_size = *(unsigned int*)
value;
break;
#ifdef MYSQLND_STRING_TO_INT_CONVERSION
case MYSQLND_OPT_INT_AND_FLOAT_NATIVE:
- conn->options.int_and_float_native = *(uint*) value;
+ conn->options.int_and_float_native = *(unsigned int*)
value;
break;
#endif
case MYSQL_OPT_CONNECT_TIMEOUT:
- conn->options.timeout_connect = *(uint*) value;
+ conn->options.timeout_connect = *(unsigned int*) value;
break;
#ifdef WHEN_SUPPORTED_BY_MYSQLI
case MYSQL_OPT_READ_TIMEOUT:
- conn->options.timeout_read = *(uint*) value;
+ conn->options.timeout_read = *(unsigned int*) value;
break;
case MYSQL_OPT_WRITE_TIMEOUT:
- conn->options.timeout_write = *(uint*) value;
+ conn->options.timeout_write = *(unsigned int*) value;
break;
#endif
case MYSQL_OPT_LOCAL_INFILE:
- if (!value || (*(uint*) value) ? 1 : 0) {
+ if (!value || (*(unsigned int*) value) ? 1 : 0) {
conn->options.flags |= CLIENT_LOCAL_FILES;
} else {
conn->options.flags &= ~CLIENT_LOCAL_FILES;
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd.h?r1=1.3.2.17&r2=1.3.2.18&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd.h
diff -u php-src/ext/mysqlnd/mysqlnd.h:1.3.2.17
php-src/ext/mysqlnd/mysqlnd.h:1.3.2.18
--- php-src/ext/mysqlnd/mysqlnd.h:1.3.2.17 Mon Sep 15 14:07:44 2008
+++ php-src/ext/mysqlnd/mysqlnd.h Thu Nov 6 10:37:47 2008
@@ -18,13 +18,13 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysqlnd.h,v 1.3.2.17 2008/09/15 14:07:44 andrey Exp $ */
+/* $Id: mysqlnd.h,v 1.3.2.18 2008/11/06 10:37:47 andrey Exp $ */
#ifndef MYSQLND_H
#define MYSQLND_H
-#define MYSQLND_VERSION "mysqlnd 5.0.4-dev - 080501 - $Revision: 1.3.2.17 $"
-#define MYSQLND_VERSION_ID 50004
+#define MYSQLND_VERSION "mysqlnd 5.0.5-dev - 081106 - $Revision: 1.3.2.18 $"
+#define MYSQLND_VERSION_ID 50005
/* This forces inlining of some accessor functions */
#define MYSQLND_USE_OPTIMISATIONS 1
@@ -74,7 +74,7 @@
PHPAPI void mysqlnd_minfo_print_hash(zval *values);
#define mysqlnd_thread_safe() TRUE
-PHPAPI const MYSQLND_CHARSET * mysqlnd_find_charset_nr(uint charsetno);
+PHPAPI const MYSQLND_CHARSET * mysqlnd_find_charset_nr(unsigned int charsetno);
PHPAPI const MYSQLND_CHARSET * mysqlnd_find_charset_name(const char * const
charsetname);
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_block_alloc.c?r1=1.1.2.3&r2=1.1.2.4&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_block_alloc.c
diff -u php-src/ext/mysqlnd/mysqlnd_block_alloc.c:1.1.2.3
php-src/ext/mysqlnd/mysqlnd_block_alloc.c:1.1.2.4
--- php-src/ext/mysqlnd/mysqlnd_block_alloc.c:1.1.2.3 Mon Feb 4 17:33:46 2008
+++ php-src/ext/mysqlnd/mysqlnd_block_alloc.c Thu Nov 6 10:37:47 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysqlnd_block_alloc.c,v 1.1.2.3 2008/02/04 17:33:46 andrey Exp $ */
+/* $Id: mysqlnd_block_alloc.c,v 1.1.2.4 2008/11/06 10:37:47 andrey Exp $ */
#include "php.h"
#include "mysqlnd.h"
@@ -31,7 +31,7 @@
static void
mysqlnd_mempool_free_contents(MYSQLND_MEMORY_POOL * pool TSRMLS_DC)
{
- uint i;
+ unsigned int i;
DBG_ENTER("mysqlnd_mempool_dtor");
for (i = 0; i < pool->free_chunk_list_elements; i++) {
MYSQLND_MEMORY_POOL_CHUNK * chunk = pool->free_chunk_list[i];
@@ -76,7 +76,7 @@
/* {{{ mysqlnd_mempool_resize_chunk */
static void
-mysqlnd_mempool_resize_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, uint size
TSRMLS_DC)
+mysqlnd_mempool_resize_chunk(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int
size TSRMLS_DC)
{
DBG_ENTER("mysqlnd_mempool_resize_chunk");
if (chunk->from_pool) {
@@ -124,7 +124,7 @@
/* {{{ mysqlnd_mempool_get_chunk */
static
-MYSQLND_MEMORY_POOL_CHUNK * mysqlnd_mempool_get_chunk(MYSQLND_MEMORY_POOL *
pool, uint size TSRMLS_DC)
+MYSQLND_MEMORY_POOL_CHUNK * mysqlnd_mempool_get_chunk(MYSQLND_MEMORY_POOL *
pool, unsigned int size TSRMLS_DC)
{
MYSQLND_MEMORY_POOL_CHUNK *chunk = NULL;
DBG_ENTER("mysqlnd_mempool_get_chunk");
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_charset.c?r1=1.2.2.6&r2=1.2.2.7&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_charset.c
diff -u php-src/ext/mysqlnd/mysqlnd_charset.c:1.2.2.6
php-src/ext/mysqlnd/mysqlnd_charset.c:1.2.2.7
--- php-src/ext/mysqlnd/mysqlnd_charset.c:1.2.2.6 Tue Mar 25 18:27:17 2008
+++ php-src/ext/mysqlnd/mysqlnd_charset.c Thu Nov 6 10:37:47 2008
@@ -25,7 +25,7 @@
/* {{{ utf8 functions */
-static uint check_mb_utf8_sequence(const char *start, const char *end)
+static unsigned int check_mb_utf8_sequence(const char *start, const char *end)
{
zend_uchar c;
@@ -63,13 +63,13 @@
return 0;
}
-static uint check_mb_utf8_valid(const char *start, const char *end)
+static unsigned int check_mb_utf8_valid(const char *start, const char *end)
{
- uint len = check_mb_utf8_sequence(start, end);
+ unsigned int len = check_mb_utf8_sequence(start, end);
return (len > 1)? len:0;
}
-static uint mysqlnd_mbcharlen_utf8(uint utf8)
+static unsigned int mysqlnd_mbcharlen_utf8(unsigned int utf8)
{
if (utf8 < 0x80) {
return 1; /* single byte character */
@@ -91,19 +91,19 @@
/* {{{ big5 functions */
-#define valid_big5head(c) (0xA1 <= (uint)(c) && (uint)(c) <= 0xF9)
-#define valid_big5tail(c) ((0x40 <= (uint)(c) && (uint)(c) <= 0x7E) || \
- (0xA1 <= (uint)(c) &&
(uint)(c) <= 0xFE))
+#define valid_big5head(c) (0xA1 <= (unsigned int)(c) && (unsigned int)(c)
<= 0xF9)
+#define valid_big5tail(c) ((0x40 <= (unsigned int)(c) && (unsigned
int)(c) <= 0x7E) || \
+ (0xA1 <= (unsigned
int)(c) && (unsigned int)(c) <= 0xFE))
#define isbig5code(c,d) (isbig5head(c) && isbig5tail(d))
-static uint check_mb_big5(const char *start, const char *end)
+static unsigned int check_mb_big5(const char *start, const char *end)
{
return (valid_big5head(*(start)) && (end - start) > 1 &&
valid_big5tail(*(start + 1)) ? 2 : 0);
}
-static uint mysqlnd_mbcharlen_big5(uint big5)
+static unsigned int mysqlnd_mbcharlen_big5(unsigned int big5)
{
return (valid_big5head(big5)) ? 2 : 1;
}
@@ -115,14 +115,14 @@
#define valid_cp932tail(c) ((0x40 <= (c) && (c) <= 0x7E) || (0x80 <= (c) && c
<= 0xFC))
-static uint check_mb_cp932(const char *start, const char *end)
+static unsigned int check_mb_cp932(const char *start, const char *end)
{
return (valid_cp932head((zend_uchar)start[0]) && (end - start > 1) &&
valid_cp932tail((zend_uchar)start[1])) ? 2 : 0;
}
-static uint mysqlnd_mbcharlen_cp932(uint cp932)
+static unsigned int mysqlnd_mbcharlen_cp932(unsigned int cp932)
{
return (valid_cp932head((zend_uchar)cp932)) ? 2 : 1;
}
@@ -132,7 +132,7 @@
/* {{{ euckr functions */
#define valid_euckr(c) ((0xA1 <= (zend_uchar)(c) && (zend_uchar)(c) <= 0xFE))
-static uint check_mb_euckr(const char *start, const char *end)
+static unsigned int check_mb_euckr(const char *start, const char *end)
{
if (end - start <= 1) {
return 0; /* invalid length */
@@ -147,7 +147,7 @@
}
-static uint mysqlnd_mbcharlen_euckr(uint kr)
+static unsigned int mysqlnd_mbcharlen_euckr(unsigned int kr)
{
return (valid_euckr(kr)) ? 2 : 1;
}
@@ -160,7 +160,7 @@
#define valid_eucjpms_ss2(c) (((c) & 0xFF) == 0x8E)
#define valid_eucjpms_ss3(c) (((c) & 0xFF) == 0x8F)
-static uint check_mb_eucjpms(const char *start, const char *end)
+static unsigned int check_mb_eucjpms(const char *start, const char *end)
{
if (*((zend_uchar *)start) < 0x80) {
return 0; /* invalid eucjpms character */
@@ -179,7 +179,7 @@
}
-static uint mysqlnd_mbcharlen_eucjpms(uint jpms)
+static unsigned int mysqlnd_mbcharlen_eucjpms(unsigned int jpms)
{
if (valid_eucjpms(jpms) || valid_eucjpms_ss2(jpms)) {
return 2;
@@ -197,14 +197,14 @@
#define valid_gb2312_tail(c) (0xA1 <= (zend_uchar)(c) && (zend_uchar)(c) <=
0xFE)
-static uint check_mb_gb2312(const char *start, const char *end)
+static unsigned int check_mb_gb2312(const char *start, const char *end)
{
- return (valid_gb2312_head((uint)start[0]) && end - start > 1 &&
- valid_gb2312_tail((uint)start[1])) ? 2 : 0;
+ return (valid_gb2312_head((unsigned int)start[0]) && end - start > 1 &&
+ valid_gb2312_tail((unsigned int)start[1])) ? 2 : 0;
}
-static uint mysqlnd_mbcharlen_gb2312(uint gb)
+static unsigned int mysqlnd_mbcharlen_gb2312(unsigned int gb)
{
return (valid_gb2312_head(gb)) ? 2 : 1;
}
@@ -215,12 +215,12 @@
#define valid_gbk_head(c) (0x81<=(zend_uchar)(c) && (zend_uchar)(c)<=0xFE)
#define valid_gbk_tail(c) ((0x40<=(zend_uchar)(c) &&
(zend_uchar)(c)<=0x7E) || (0x80<=(zend_uchar)(c) && (zend_uchar)(c)<=0xFE))
-static uint check_mb_gbk(const char *start, const char *end)
+static unsigned int check_mb_gbk(const char *start, const char *end)
{
return (valid_gbk_head(start[0]) && (end) - (start) > 1 &&
valid_gbk_tail(start[1])) ? 2 : 0;
}
-static uint mysqlnd_mbcharlen_gbk(uint gbk)
+static unsigned int mysqlnd_mbcharlen_gbk(unsigned int gbk)
{
return (valid_gbk_head(gbk) ? 2 : 1);
}
@@ -234,13 +234,13 @@
(0x80 <= (c) && (c) <=
0x7C))
-static uint check_mb_sjis(const char *start, const char *end)
+static unsigned int check_mb_sjis(const char *start, const char *end)
{
return (valid_sjis_head((zend_uchar)start[0]) && (end - start) > 1 &&
valid_sjis_tail((zend_uchar)start[1])) ? 2 : 0;
}
-static uint mysqlnd_mbcharlen_sjis(uint sjis)
+static unsigned int mysqlnd_mbcharlen_sjis(unsigned int sjis)
{
return (valid_sjis_head((zend_uchar)sjis)) ? 2 : 1;
}
@@ -248,12 +248,12 @@
/* {{{ ucs2 functions */
-static uint check_mb_ucs2(const char *start __attribute((unused)), const char
*end __attribute((unused)))
+static unsigned int check_mb_ucs2(const char *start __attribute((unused)),
const char *end __attribute((unused)))
{
return 2; /* always 2 */
}
-static uint mysqlnd_mbcharlen_ucs2(uint ucs2 __attribute((unused)))
+static unsigned int mysqlnd_mbcharlen_ucs2(unsigned int ucs2
__attribute((unused)))
{
return 2; /* always 2 */
}
@@ -266,7 +266,7 @@
#define valid_ujis_ss2(c) (((c)&0xFF) == 0x8E)
#define valid_ujis_ss3(c) (((c)&0xFF) == 0x8F)
-static uint check_mb_ujis(const char *start, const char *end)
+static unsigned int check_mb_ujis(const char *start, const char *end)
{
if (*(uchar*)start < 0x80) {
return 0; /* invalid ujis character */
@@ -284,7 +284,7 @@
}
-static uint mysqlnd_mbcharlen_ujis(uint ujis)
+static unsigned int mysqlnd_mbcharlen_ujis(unsigned int ujis)
{
return (valid_ujis(ujis)? 2: valid_ujis_ss2(ujis)? 2:
valid_ujis_ss3(ujis)? 3: 1);
}
@@ -430,7 +430,7 @@
/* {{{ mysqlnd_find_charset_nr */
-PHPAPI const MYSQLND_CHARSET * mysqlnd_find_charset_nr(uint charsetnr)
+PHPAPI const MYSQLND_CHARSET * mysqlnd_find_charset_nr(unsigned int charsetnr)
{
const MYSQLND_CHARSET * c = mysqlnd_charsets;
@@ -473,7 +473,7 @@
DBG_ENTER("mysqlnd_cset_escape_quotes");
for (;escapestr < end; escapestr++) {
- uint len = 0;
+ unsigned int len = 0;
/* check unicode characters */
if (cset->char_maxlen > 1 && (len = cset->mb_valid(escapestr,
end))) {
@@ -528,7 +528,7 @@
for (;escapestr < end; escapestr++) {
char esc = '\0';
- uint len = 0;
+ unsigned int len = 0;
/* check unicode characters */
if (cset->char_maxlen > 1 && (len = cset->mb_valid(escapestr,
end))) {
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_debug.c?r1=1.1.2.11&r2=1.1.2.12&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_debug.c
diff -u php-src/ext/mysqlnd/mysqlnd_debug.c:1.1.2.11
php-src/ext/mysqlnd/mysqlnd_debug.c:1.1.2.12
--- php-src/ext/mysqlnd/mysqlnd_debug.c:1.1.2.11 Fri Sep 12 15:08:41 2008
+++ php-src/ext/mysqlnd/mysqlnd_debug.c Thu Nov 6 10:37:47 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysqlnd_debug.c,v 1.1.2.11 2008/09/12 15:08:41 andrey Exp $ */
+/* $Id: mysqlnd_debug.c,v 1.1.2.12 2008/11/06 10:37:47 andrey Exp $ */
#include "php.h"
#include "mysqlnd.h"
@@ -89,7 +89,7 @@
enum_func_status ret;
int i;
char * message_line;
- uint message_line_len;
+ unsigned int message_line_len;
unsigned int flags = self->flags;
char pid_buffer[10], time_buffer[30], file_buffer[200],
line_buffer[6], level_buffer[7];
@@ -194,7 +194,7 @@
int i;
enum_func_status ret;
char * message_line, *buffer;
- uint message_line_len;
+ unsigned int message_line_len;
va_list args;
unsigned int flags = self->flags;
char pid_buffer[10], time_buffer[30], file_buffer[200],
@@ -301,7 +301,7 @@
static zend_bool
MYSQLND_METHOD(mysqlnd_debug, func_enter)(MYSQLND_DEBUG * self,
unsigned int line, const char * const file,
-
char * func_name, uint func_name_len)
+
char * func_name, unsigned int func_name_len)
{
#ifdef MYSQLND_THREADED
MYSQLND_ZTS(self);
@@ -422,7 +422,7 @@
static void
MYSQLND_METHOD(mysqlnd_debug, set_mode)(MYSQLND_DEBUG * self, const char *
const mode)
{
- uint mode_len = strlen(mode), i;
+ unsigned int mode_len = strlen(mode), i;
enum mysqlnd_debug_parser_state state = PARSER_WAIT_MODIFIER;
self->flags = 0;
@@ -487,7 +487,7 @@
if (mode[j] == ',' || mode[j]
== ':') {
if (j > i + 2) {
char
func_name[1024];
- uint
func_name_len = MIN(sizeof(func_name) - 1, j - i - 1);
+ unsigned int
func_name_len = MIN(sizeof(func_name) - 1, j - i - 1);
memcpy(func_name, mode + i + 1, func_name_len);
func_name[func_name_len] = '\0';
@@ -719,7 +719,7 @@
/* {{{ _mysqlnd_ecalloc */
-void * _mysqlnd_ecalloc(uint nmemb, size_t size MYSQLND_MEM_D)
+void * _mysqlnd_ecalloc(unsigned int nmemb, size_t size MYSQLND_MEM_D)
{
void *ret;
DBG_ENTER(mysqlnd_ecalloc_name);
@@ -744,7 +744,7 @@
/* {{{ _mysqlnd_pecalloc */
-void * _mysqlnd_pecalloc(uint nmemb, size_t size, zend_bool persistent
MYSQLND_MEM_D)
+void * _mysqlnd_pecalloc(unsigned int nmemb, size_t size, zend_bool persistent
MYSQLND_MEM_D)
{
void *ret;
DBG_ENTER(mysqlnd_pecalloc_name);
@@ -889,7 +889,7 @@
/* {{{ _mysqlnd_calloc */
-void * _mysqlnd_calloc(uint nmemb, size_t size MYSQLND_MEM_D)
+void * _mysqlnd_calloc(unsigned int nmemb, size_t size MYSQLND_MEM_D)
{
void *ret;
DBG_ENTER(mysqlnd_calloc_name);
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_debug.h?r1=1.1.2.8&r2=1.1.2.9&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_debug.h
diff -u php-src/ext/mysqlnd/mysqlnd_debug.h:1.1.2.8
php-src/ext/mysqlnd/mysqlnd_debug.h:1.1.2.9
--- php-src/ext/mysqlnd/mysqlnd_debug.h:1.1.2.8 Wed Apr 16 12:57:38 2008
+++ php-src/ext/mysqlnd/mysqlnd_debug.h Thu Nov 6 10:37:47 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysqlnd_debug.h,v 1.1.2.8 2008/04/16 12:57:38 andrey Exp $ */
+/* $Id: mysqlnd_debug.h,v 1.1.2.9 2008/11/06 10:37:47 andrey Exp $ */
#ifndef MYSQLND_DEBUG_H
#define MYSQLND_DEBUG_H
@@ -36,7 +36,7 @@
enum_func_status (*log_va)(MYSQLND_DEBUG *self, unsigned int line,
const char * const file,
unsigned int level,
const char * type, const char *format, ...);
zend_bool (*func_enter)(MYSQLND_DEBUG *self, unsigned int line, const
char * const file,
- char * func_name, uint
func_name_len);
+ char * func_name,
unsigned int func_name_len);
enum_func_status (*func_leave)(MYSQLND_DEBUG *self, unsigned int line,
const char * const file);
enum_func_status (*close)(MYSQLND_DEBUG *self);
enum_func_status (*free_handle)(MYSQLND_DEBUG *self);
@@ -65,14 +65,14 @@
void * _mysqlnd_emalloc(size_t size MYSQLND_MEM_D);
void * _mysqlnd_pemalloc(size_t size, zend_bool persistent MYSQLND_MEM_D);
-void * _mysqlnd_ecalloc(uint nmemb, size_t size MYSQLND_MEM_D);
-void * _mysqlnd_pecalloc(uint nmemb, size_t size, zend_bool persistent
MYSQLND_MEM_D);
+void * _mysqlnd_ecalloc(unsigned int nmemb, size_t size MYSQLND_MEM_D);
+void * _mysqlnd_pecalloc(unsigned int nmemb, size_t size, zend_bool persistent
MYSQLND_MEM_D);
void * _mysqlnd_erealloc(void *ptr, size_t new_size MYSQLND_MEM_D);
void * _mysqlnd_perealloc(void *ptr, size_t new_size, zend_bool persistent
MYSQLND_MEM_D);
void _mysqlnd_efree(void *ptr MYSQLND_MEM_D);
void _mysqlnd_pefree(void *ptr, zend_bool persistent MYSQLND_MEM_D);
void * _mysqlnd_malloc(size_t size MYSQLND_MEM_D);
-void * _mysqlnd_calloc(uint nmemb, size_t size MYSQLND_MEM_D);
+void * _mysqlnd_calloc(unsigned int nmemb, size_t size MYSQLND_MEM_D);
void * _mysqlnd_realloc(void *ptr, size_t new_size MYSQLND_MEM_D);
void _mysqlnd_free(void *ptr MYSQLND_MEM_D);
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_loaddata.c?r1=1.2.2.7&r2=1.2.2.8&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_loaddata.c
diff -u php-src/ext/mysqlnd/mysqlnd_loaddata.c:1.2.2.7
php-src/ext/mysqlnd/mysqlnd_loaddata.c:1.2.2.8
--- php-src/ext/mysqlnd/mysqlnd_loaddata.c:1.2.2.7 Mon Oct 27 17:21:22 2008
+++ php-src/ext/mysqlnd/mysqlnd_loaddata.c Thu Nov 6 10:37:47 2008
@@ -86,7 +86,7 @@
/* {{{ mysqlnd_local_infile_read */
static
-int mysqlnd_local_infile_read(void *ptr, char *buf, uint buf_len TSRMLS_DC)
+int mysqlnd_local_infile_read(void *ptr, char *buf, unsigned int buf_len
TSRMLS_DC)
{
MYSQLND_INFILE_INFO *info = (MYSQLND_INFILE_INFO *)ptr;
int count;
@@ -107,7 +107,7 @@
/* {{{ mysqlnd_local_infile_error */
static
-int mysqlnd_local_infile_error(void *ptr, char *error_buf, uint
error_buf_len TSRMLS_DC)
+int mysqlnd_local_infile_error(void *ptr, char *error_buf, unsigned int
error_buf_len TSRMLS_DC)
{
MYSQLND_INFILE_INFO *info = (MYSQLND_INFILE_INFO *)ptr;
@@ -177,7 +177,7 @@
char *buf;
char empty_packet[MYSQLND_HEADER_SIZE];
enum_func_status result = FAIL;
- uint buflen = 4096;
+ unsigned int buflen = 4096;
void *info = NULL;
int bufsize;
size_t ret;
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_portability.h?r1=1.4.2.7&r2=1.4.2.8&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_portability.h
diff -u php-src/ext/mysqlnd/mysqlnd_portability.h:1.4.2.7
php-src/ext/mysqlnd/mysqlnd_portability.h:1.4.2.8
--- php-src/ext/mysqlnd/mysqlnd_portability.h:1.4.2.7 Fri Oct 31 21:29:54 2008
+++ php-src/ext/mysqlnd/mysqlnd_portability.h Thu Nov 6 10:37:47 2008
@@ -179,10 +179,6 @@
#endif
-typedef int64_t longlong;
-typedef uint64_t ulonglong;
-
-
#define int1store(T,A) do { *((zend_uchar*) (T)) = (A); } while(0)
#define uint1korr(A) (*(((uint8_t*)(A))))
@@ -198,33 +194,33 @@
(((uint32_t) (((uchar*) (A))[1])) << 16) +\
(((uint32_t) (((uchar*) (A))[0])) << 24)))
-#define bit_uint5korr(A) ((ulonglong)(((uint32_t) ((uchar) (A)[4])) +\
+#define bit_uint5korr(A) ((uint64_t)(((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))
+ (((uint64_t) ((uchar) (A)[0])) << 32))
-#define bit_uint6korr(A) ((ulonglong)(((uint32_t) (((uchar*) (A))[5])) +\
+#define bit_uint6korr(A) ((uint64_t)(((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])) +\
+
(((uint64_t) (((uint32_t) (((uchar*) (A))[1])) +\
(((uint32_t) (((uchar*) (A))[0]) << 8)))) << 32))
-#define bit_uint7korr(A) ((ulonglong)(((uint32_t) (((uchar*) (A))[6])) +\
+#define bit_uint7korr(A) ((uint64_t)(((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])) +\
+
(((uint64_t) (((uint32_t) (((uchar*) (A))[2])) +\
(((uint32_t) (((uchar*) (A))[1])) << 8) +\
(((uint32_t) (((uchar*) (A))[0])) << 16))) << 32))
-#define bit_uint8korr(A) ((ulonglong)(((uint32_t) (((uchar*) (A))[7])) +\
+#define bit_uint8korr(A) ((uint64_t)(((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])) +\
+
(((uint64_t) (((uint32_t) (((uchar*) (A))[3])) +\
(((uint32_t) (((uchar*) (A))[2])) << 8) +\
(((uint32_t) (((uchar*) (A))[1])) << 16) +\
(((uint32_t) (((uchar*) (A))[0])) << 24))) << 32))
@@ -256,8 +252,8 @@
-#define uint8korr(A) (*((ulonglong *) (A)))
-#define sint8korr(A) (*((longlong *) (A)))
+#define uint8korr(A) (*((uint64_t *) (A)))
+#define sint8korr(A) (*((int64_t *) (A)))
#define int2store(T,A) *((uint16_t*) (T))= (uint16_t) (A)
#define int3store(T,A) { \
*(T)= (uchar) ((A));\
@@ -280,25 +276,23 @@
*(((uchar *)(T))+4))=(uchar) (((A) >> 32)); \
*(((uchar *)(T))+5))=(uchar) (((A) >> 40)); }
-#define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A)
+#define int8store(T,A) *((uint64_t *) (T))= (uint64_t) (A)
typedef union {
double v;
long m[2];
-} doubleget_union;
-#define doubleget(V,M) { ((doubleget_union *)&(V))->m[0] = *((long*) (M)); \
- ((doubleget_union *)&(V))->m[1] = *(((long*)
(M))+1); }
-#define doublestore(T,V) { *((long *) (T)) = ((doubleget_union
*)&(V))->m[0]; \
- *(((long *) (T))+1) = ((doubleget_union
*)&(V))->m[1]; }
+} float8get_union;
+#define float8get(V,M) { ((float8get_union *)&(V))->m[0] = *((long*) (M)); \
+ ((float8get_union *)&(V))->m[1] = *(((long*)
(M))+1); }
+#define float8store(T,V) { *((long *) (T)) = ((float8get_union
*)&(V))->m[0]; \
+ *(((long *) (T))+1) = ((float8get_union
*)&(V))->m[1]; }
#define float4get(V,M) { *((float *) &(V)) = *((float*) (M)); }
-#define float8get(V,M) doubleget((V),(M))
-/* From Andrey Hristov based on doubleget */
+/* From Andrey Hristov based on float8get */
#define floatget(V,M) memcpy((char*) &(V),(char*) (M),sizeof(float))
-#define floatstore float4store
-#define float4store(V,M) memcpy((char*) (V),(char*) (&M),sizeof(float))
-#define float8store(V,M) doublestore((V),(M))
#endif /* __i386__ */
+
+/* If we haven't defined sint2korr, which is because the platform is not x86
or it's WIN64 */
#ifndef sint2korr
#define sint2korr(A) (int16_t) (((int16_t) ((uchar) (A)[0])) +\
((int16_t) ((int16_t) (A)[1]) << 8))
@@ -315,7 +309,7 @@
(((int32_t) ((uchar) (A)[2]) << 16)) +\
(((int32_t) ((int16_t) (A)[3]) << 24)))
-#define sint8korr(A) (longlong) uint8korr(A)
+#define sint8korr(A) (int64_t) uint8korr(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])) +\
@@ -327,20 +321,20 @@
(((uint32_t) ((uchar) (A)[3])) << 24))
-#define bit_uint8korr(A) ((ulonglong)(((uint32_t) (((uchar*) (A))[7])) +\
+#define bit_uint8korr(A) ((uint64_t)(((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])) +\
+
(((uint64_t) (((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])) +\
+#define uint8korr(A) ((uint64_t)(((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])) +\
+
(((uint64_t) (((uint32_t) ((uchar) (A)[4])) +\
(((uint32_t) ((uchar) (A)[5])) << 8) +\
(((uint32_t) ((uchar) (A)[6])) << 16) +\
(((uint32_t) ((uchar) (A)[7])) << 24))) << 32))
@@ -378,12 +372,6 @@
int4store((T+4),def_temp2); \
}
#ifdef WORDS_BIGENDIAN
-#define float4store(T,A) do { \
- *(((char *)(T))) = (char) ((char *) &A)[3];\
- *(((char *)(T))+1) = (char) ((char *) &A)[2];\
- *(((char *)(T))+2) = (char) ((char *) &A)[1];\
- *(((char *)(T))+3) = (char) ((char *) &A)[0]; }
while (0)
-
#define float4get(V,M) do { float def_temp;\
((char*) &def_temp)[0] = (M)[3];\
((char*) &def_temp)[1] = (M)[2];\
@@ -413,10 +401,9 @@
} while (0)
#else
#define float4get(V,M) memcpy((char*) &(V),(char*) (M),sizeof(float))
-#define float4store(V,M) memcpy((char*) (V),(char*) (&M),sizeof(float))
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
-#define doublestore(T,V) do { \
+#define float8store(T,V) do { \
*(((char *)(T)))= ((char *) &(V))[4];\
*(((char *)(T))+1)=(char) ((char *) &(V))[5];\
*(((char *)(T))+2)=(char) ((char *) &(V))[6];\
@@ -425,7 +412,7 @@
*(((char *)(T))+5)=(char) ((char *) &(V))[1];\
*(((char *)(T))+6)=(char) ((char *) &(V))[2];\
*(((char *)(T))+7)=(char) ((char *) &(V))[3];} while
(0)
-#define doubleget(V,M) do { double def_temp;\
+#define float8get(V,M) do { double def_temp;\
((char*) &def_temp)[0]=(M)[4];\
((char*) &def_temp)[1]=(M)[5];\
((char*) &def_temp)[2]=(M)[6];\
@@ -437,11 +424,11 @@
(V) = def_temp; } while (0)
#endif /* __FLOAT_WORD_ORDER */
-#define float8get(V,M) doubleget((V),(M))
-#define float8store(V,M) doublestore((V),(M))
#endif /* WORDS_BIGENDIAN */
#endif /* sint2korr */
+/* To here if the platform is not x86 or it's WIN64 */
+
/* Define-funktions for reading and storing in machine format from/to
short/long to/from some place in memory V should be a (not
@@ -449,51 +436,15 @@
#ifdef WORDS_BIGENDIAN
-#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_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 { \
- 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 { \
- *(((char *)(T))+3)=(char)((A));\
- *(((char *)(T))+2)=(char)(((A) >> 8));\
- *(((char *)(T))+1)=(char)(((A) >> 16));\
- *(((char *)(T))+0)=(char)(((A) >> 24)); } while (0)
-
-#define doubleget(V,M) memcpy((char*) &(V),(char*) (M),
sizeof(double))
-#define doublestore(T,V) memcpy((char*) (T),(char*) &(V),
sizeof(double))
-#define longlongget(V,M) memcpy((char*) &(V),(char*) (M),
sizeof(ulonglong))
-#define longlongstore(T,V) memcpy((char*) (T),(char*) &(V),
sizeof(ulonglong))
+#define float8get(V,M) memcpy((char*) &(V),(char*) (M),
sizeof(double))
+#define float8store(T,V) memcpy((char*) (T),(char*) &(V),
sizeof(double))
#else
-#define ushortget(V,M) { V = uint2korr((M)); }
-#define shortget(V,M) { V = sint2korr((M)); }
-#define longget(V,M) { V = sint4korr((M)); }
-#define ulongget(V,M) { V = uint4korr((M)); }
-#define shortstore(T,V) int2store((T),(V))
-#define longstore(T,V) int4store((T),(V))
-#ifndef doubleget
-#define doubleget(V,M) memcpy((char*) &(V),(char*) (M),sizeof(double))
-#define doublestore(T,V) memcpy((char*) (T),(char*) &(V),sizeof(double))
-#endif /* doubleget */
-#define longlongget(V,M) memcpy((char*) &(V),(char*) (M),sizeof(ulonglong))
-#define longlongstore(T,V) memcpy((char*) (T),(char*) &(V),sizeof(ulonglong))
+#ifndef float8get
+#define float8get(V,M) memcpy((char*) &(V),(char*) (M),sizeof(double))
+#define float8store(T,V) memcpy((char*) (T),(char*) &(V),sizeof(double))
+#endif /* float8get */
#endif /* WORDS_BIGENDIAN */
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_priv.h?r1=1.4.2.14&r2=1.4.2.15&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_priv.h
diff -u php-src/ext/mysqlnd/mysqlnd_priv.h:1.4.2.14
php-src/ext/mysqlnd/mysqlnd_priv.h:1.4.2.15
--- php-src/ext/mysqlnd/mysqlnd_priv.h:1.4.2.14 Fri Oct 31 20:32:17 2008
+++ php-src/ext/mysqlnd/mysqlnd_priv.h Thu Nov 6 10:37:47 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysqlnd_priv.h,v 1.4.2.14 2008/10/31 20:32:17 andrey Exp $ */
+/* $Id: mysqlnd_priv.h,v 1.4.2.15 2008/11/06 10:37:47 andrey Exp $ */
#ifndef MYSQLND_PRIV_H
#define MYSQLND_PRIV_H
@@ -150,7 +150,7 @@
/* PS stuff */
typedef void (*ps_field_fetch_func)(zval *zv, const MYSQLND_FIELD * const
field,
- uint
pack_len, zend_uchar **row,
+
unsigned int pack_len, zend_uchar **row,
zend_bool everything_as_unicode TSRMLS_DC);
struct st_mysqlnd_perm_bind {
ps_field_fetch_func func;
@@ -173,7 +173,7 @@
void _mysqlnd_init_ps_subsystem();/* This one is private,
mysqlnd_library_init() will call it */
void ps_fetch_from_1_to_8_bytes(zval *zv, const MYSQLND_FIELD * const field,
- uint pack_len,
zend_uchar **row, zend_bool as_unicode,
+ unsigned int
pack_len, zend_uchar **row, zend_bool as_unicode,
unsigned int
byte_count TSRMLS_DC);
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_ps.c?r1=1.3.2.20&r2=1.3.2.21&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_ps.c
diff -u php-src/ext/mysqlnd/mysqlnd_ps.c:1.3.2.20
php-src/ext/mysqlnd/mysqlnd_ps.c:1.3.2.21
--- php-src/ext/mysqlnd/mysqlnd_ps.c:1.3.2.20 Fri Oct 31 20:32:17 2008
+++ php-src/ext/mysqlnd/mysqlnd_ps.c Thu Nov 6 10:37:47 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysqlnd_ps.c,v 1.3.2.20 2008/10/31 20:32:17 andrey Exp $ */
+/* $Id: mysqlnd_ps.c,v 1.3.2.21 2008/11/06 10:37:47 andrey Exp $ */
#include "php.h"
#include "mysqlnd.h"
#include "mysqlnd_wireprotocol.h"
@@ -58,7 +58,7 @@
zend_bool *fetched_anything TSRMLS_DC);
static void mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const stmt
TSRMLS_DC);
-static void mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const stmt,
uint param_no TSRMLS_DC);
+static void mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const stmt,
unsigned int param_no TSRMLS_DC);
static void mysqlnd_internal_free_stmt_content(MYSQLND_STMT * const stmt
TSRMLS_DC);
static enum_func_status mysqlnd_stmt_execute_parse_response(MYSQLND_STMT *
const stmt TSRMLS_DC);
@@ -653,7 +653,7 @@
}
if (stmt->param_count) {
- uint i, not_bound = 0;
+ unsigned int i, not_bound = 0;
if (!stmt->param_bind) {
SET_STMT_ERROR(stmt, CR_PARAMS_NOT_BOUND,
UNKNOWN_SQLSTATE,
"No data supplied for
parameters in prepared statement");
@@ -708,7 +708,7 @@
{
MYSQLND_STMT *stmt = (MYSQLND_STMT *) param;
MYSQLND_RES_BUFFERED *set = result->stored_data;
- uint field_count = result->meta->field_count;
+ unsigned int field_count = result->meta->field_count;
DBG_ENTER("mysqlnd_fetch_stmt_row_buffered");
DBG_INF_FMT("stmt=%lu", stmt->stmt_id);
@@ -1477,7 +1477,7 @@
SET_EMPTY_ERROR(stmt->conn->error_info);
if (stmt->field_count) {
- uint i = 0;
+ unsigned int i = 0;
if (!result_bind) {
DBG_ERR("no result bind passed");
@@ -1508,7 +1508,7 @@
/* {{{ mysqlnd_stmt::bind_result */
static enum_func_status
-MYSQLND_METHOD(mysqlnd_stmt, bind_one_result)(MYSQLND_STMT * const stmt, uint
param_no TSRMLS_DC)
+MYSQLND_METHOD(mysqlnd_stmt, bind_one_result)(MYSQLND_STMT * const stmt,
unsigned int param_no TSRMLS_DC)
{
DBG_ENTER("mysqlnd_stmt::bind_result");
DBG_INF_FMT("stmt=%lu field_count=%u", stmt->stmt_id,
stmt->field_count);
@@ -1887,7 +1887,7 @@
/* {{{ mysqlnd_stmt_separate_one_result_bind */
-void mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const stmt, uint
param_no TSRMLS_DC)
+void mysqlnd_stmt_separate_one_result_bind(MYSQLND_STMT * const stmt, unsigned
int param_no TSRMLS_DC)
{
DBG_ENTER("mysqlnd_stmt_separate_one_result_bind");
DBG_INF_FMT("stmt=%lu result_bind=%p field_count=%u param_no=%d",
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_ps_codec.c?r1=1.3.2.11&r2=1.3.2.12&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_ps_codec.c
diff -u php-src/ext/mysqlnd/mysqlnd_ps_codec.c:1.3.2.11
php-src/ext/mysqlnd/mysqlnd_ps_codec.c:1.3.2.12
--- php-src/ext/mysqlnd/mysqlnd_ps_codec.c:1.3.2.11 Fri Oct 31 20:32:17 2008
+++ php-src/ext/mysqlnd/mysqlnd_ps_codec.c Thu Nov 6 10:37:47 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysqlnd_ps_codec.c,v 1.3.2.11 2008/10/31 20:32:17 andrey Exp $ */
+/* $Id: mysqlnd_ps_codec.c,v 1.3.2.12 2008/11/06 10:37:47 andrey Exp $ */
#include "php.h"
#include "mysqlnd.h"
#include "mysqlnd_wireprotocol.h"
@@ -54,7 +54,7 @@
/* {{{ ps_fetch_from_1_to_8_bytes */
void ps_fetch_from_1_to_8_bytes(zval *zv, const MYSQLND_FIELD * const field,
- uint pack_len,
zend_uchar **row, zend_bool as_unicode,
+ unsigned int
pack_len, zend_uchar **row, zend_bool as_unicode,
unsigned int
byte_count TSRMLS_DC)
{
char tmp[22];
@@ -137,7 +137,7 @@
/* {{{ ps_fetch_null */
static
void ps_fetch_null(zval *zv, const MYSQLND_FIELD * const field,
- uint pack_len, zend_uchar **row,
+ unsigned int pack_len, zend_uchar **row,
zend_bool as_unicode TSRMLS_DC)
{
ZVAL_NULL(zv);
@@ -148,7 +148,7 @@
/* {{{ ps_fetch_int8 */
static
void ps_fetch_int8(zval *zv, const MYSQLND_FIELD * const field,
- uint pack_len, zend_uchar **row,
+ unsigned int pack_len, zend_uchar **row,
zend_bool as_unicode TSRMLS_DC)
{
ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, as_unicode, 1
TSRMLS_CC);
@@ -159,7 +159,7 @@
/* {{{ ps_fetch_int16 */
static
void ps_fetch_int16(zval *zv, const MYSQLND_FIELD * const field,
- uint pack_len, zend_uchar **row,
+ unsigned int pack_len, zend_uchar **row,
zend_bool as_unicode TSRMLS_DC)
{
ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, as_unicode, 2
TSRMLS_CC);
@@ -170,7 +170,7 @@
/* {{{ ps_fetch_int32 */
static
void ps_fetch_int32(zval *zv, const MYSQLND_FIELD * const field,
- uint pack_len, zend_uchar **row,
+ unsigned int pack_len, zend_uchar **row,
zend_bool as_unicode TSRMLS_DC)
{
ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, as_unicode, 4
TSRMLS_CC);
@@ -181,7 +181,7 @@
/* {{{ ps_fetch_int64 */
static
void ps_fetch_int64(zval *zv, const MYSQLND_FIELD * const field,
- uint pack_len, zend_uchar **row,
+ unsigned int pack_len, zend_uchar **row,
zend_bool as_unicode TSRMLS_DC)
{
ps_fetch_from_1_to_8_bytes(zv, field, pack_len, row, as_unicode, 8
TSRMLS_CC);
@@ -192,7 +192,7 @@
/* {{{ ps_fetch_float */
static
void ps_fetch_float(zval *zv, const MYSQLND_FIELD * const field,
- uint pack_len, zend_uchar **row,
+ unsigned int pack_len, zend_uchar **row,
zend_bool as_unicode TSRMLS_DC)
{
float value;
@@ -209,7 +209,7 @@
/* {{{ ps_fetch_double */
static
void ps_fetch_double(zval *zv, const MYSQLND_FIELD * const field,
- uint pack_len, zend_uchar **row,
+ unsigned int pack_len, zend_uchar **row,
zend_bool as_unicode TSRMLS_DC)
{
double value;
@@ -226,7 +226,7 @@
/* {{{ ps_fetch_time */
static
void ps_fetch_time(zval *zv, const MYSQLND_FIELD * const field,
- uint pack_len, zend_uchar **row,
+ unsigned int pack_len, zend_uchar **row,
zend_bool as_unicode TSRMLS_DC)
{
struct st_mysqlnd_time t;
@@ -284,7 +284,7 @@
/* {{{ ps_fetch_date */
static
void ps_fetch_date(zval *zv, const MYSQLND_FIELD * const field,
- uint pack_len, zend_uchar **row,
+ unsigned int pack_len, zend_uchar **row,
zend_bool as_unicode TSRMLS_DC)
{
struct st_mysqlnd_time t = {0};
@@ -335,7 +335,7 @@
/* {{{ ps_fetch_datetime */
static
void ps_fetch_datetime(zval *zv, const MYSQLND_FIELD * const field,
- uint pack_len, zend_uchar **row,
+ unsigned int pack_len, zend_uchar
**row,
zend_bool as_unicode TSRMLS_DC)
{
struct st_mysqlnd_time t;
@@ -394,7 +394,7 @@
/* {{{ ps_fetch_string */
static
void ps_fetch_string(zval *zv, const MYSQLND_FIELD * const field,
- uint pack_len, zend_uchar **row,
+ unsigned int pack_len, zend_uchar
**row,
zend_bool as_unicode TSRMLS_DC)
{
/*
@@ -424,7 +424,7 @@
/* {{{ ps_fetch_bit */
static
void ps_fetch_bit(zval *zv, const MYSQLND_FIELD * const field,
- uint pack_len, zend_uchar **row,
+ unsigned int pack_len, zend_uchar **row,
zend_bool as_unicode TSRMLS_DC)
{
unsigned long length= php_mysqlnd_net_field_length(row);
@@ -578,7 +578,7 @@
/* {{{ mysqlnd_stmt_copy_it */
static void
-mysqlnd_stmt_copy_it(zval *** copies, zval *original, uint param_count, uint
current)
+mysqlnd_stmt_copy_it(zval *** copies, zval *original, unsigned int
param_count, unsigned int current)
{
if (!*copies) {
*copies = ecalloc(param_count, sizeof(zval *));
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_result.c?r1=1.4.2.22&r2=1.4.2.23&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_result.c
diff -u php-src/ext/mysqlnd/mysqlnd_result.c:1.4.2.22
php-src/ext/mysqlnd/mysqlnd_result.c:1.4.2.23
--- php-src/ext/mysqlnd/mysqlnd_result.c:1.4.2.22 Fri Oct 31 20:32:17 2008
+++ php-src/ext/mysqlnd/mysqlnd_result.c Thu Nov 6 10:37:47 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysqlnd_result.c,v 1.4.2.22 2008/10/31 20:32:17 andrey Exp $ */
+/* $Id: mysqlnd_result.c,v 1.4.2.23 2008/11/06 10:37:47 andrey Exp $ */
#include "php.h"
#include "mysqlnd.h"
#include "mysqlnd_wireprotocol.h"
@@ -95,11 +95,11 @@
/* {{{ mysqlnd_res_initialize_result_set_rest */
void mysqlnd_res_initialize_result_set_rest(MYSQLND_RES * const result
TSRMLS_DC)
{
- uint i;
+ unsigned int i;
zval **data_cursor = result->stored_data->data;
zval **data_begin = result->stored_data->data;
- uint field_count = result->meta->field_count;
- uint row_count = result->stored_data->row_count;
+ unsigned int field_count = result->meta->field_count;
+ unsigned int row_count = result->stored_data->row_count;
if (!data_cursor || row_count == result->stored_data->initialized_rows)
{
return;
}
@@ -1500,7 +1500,7 @@
set->data[set->row_count] = row_packet->fields;
if (set->decode_in_foreground == FALSE) {
- uint i;
+ unsigned int i;
result->m.row_decoder(set->row_buffers[set->row_count],
set->data[set->row_count],
result->meta->field_count,
@@ -1902,7 +1902,7 @@
DBG_VOID_RETURN;
}
- mysqlnd_array_init(return_value, (uint) set->row_count);
+ mysqlnd_array_init(return_value, (unsigned int) set->row_count);
while (set->data_cursor &&
(set->data_cursor - set->data) < (set->row_count *
result->meta->field_count))
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_structs.h?r1=1.2.2.15&r2=1.2.2.16&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_structs.h
diff -u php-src/ext/mysqlnd/mysqlnd_structs.h:1.2.2.15
php-src/ext/mysqlnd/mysqlnd_structs.h:1.2.2.16
--- php-src/ext/mysqlnd/mysqlnd_structs.h:1.2.2.15 Fri Oct 31 20:32:17 2008
+++ php-src/ext/mysqlnd/mysqlnd_structs.h Thu Nov 6 10:37:47 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysqlnd_structs.h,v 1.2.2.15 2008/10/31 20:32:17 andrey Exp $ */
+/* $Id: mysqlnd_structs.h,v 1.2.2.16 2008/11/06 10:37:47 andrey Exp $ */
#ifndef MYSQLND_STRUCTS_H
#define MYSQLND_STRUCTS_H
@@ -33,14 +33,14 @@
struct st_mysqlnd_memory_pool
{
zend_uchar *arena;
- uint refcount;
- uint arena_size;
- uint free_size;
+ unsigned int refcount;
+ unsigned int arena_size;
+ unsigned int free_size;
MYSQLND_MEMORY_POOL_CHUNK*
free_chunk_list[MYSQLND_MEMORY_POOL_CHUNK_LIST_SIZE];
- uint free_chunk_list_elements;
+ unsigned int free_chunk_list_elements;
- MYSQLND_MEMORY_POOL_CHUNK* (*get_chunk)(MYSQLND_MEMORY_POOL *
pool, uint size TSRMLS_DC);
+ MYSQLND_MEMORY_POOL_CHUNK* (*get_chunk)(MYSQLND_MEMORY_POOL *
pool, unsigned int size TSRMLS_DC);
};
struct st_mysqlnd_memory_pool_chunk
@@ -48,8 +48,8 @@
uint64_t app;
MYSQLND_MEMORY_POOL *pool;
zend_uchar *ptr;
- uint size;
- void
(*resize_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk, uint size TSRMLS_DC);
+ unsigned int size;
+ void
(*resize_chunk)(MYSQLND_MEMORY_POOL_CHUNK * chunk, unsigned int size TSRMLS_DC);
void (*free_chunk)(MYSQLND_MEMORY_POOL_CHUNK
* chunk, zend_bool cache_it TSRMLS_DC);
zend_bool from_pool;
};
@@ -124,14 +124,14 @@
/* character set information */
typedef struct st_mysqlnd_charset
{
- uint nr;
+ unsigned int nr;
const char *name;
const char *collation;
- uint char_minlen;
- uint char_maxlen;
+ unsigned int char_minlen;
+ unsigned int char_maxlen;
const char *comment;
- uint (*mb_charlen)(uint c);
- uint (*mb_valid)(const char *start, const char *end);
+ unsigned int (*mb_charlen)(unsigned int c);
+ unsigned int (*mb_valid)(const char *start, const char *end);
} MYSQLND_CHARSET;
@@ -139,8 +139,8 @@
typedef struct st_mysqlnd_infile
{
int (*local_infile_init)(void **ptr, char *filename, void
**userdata TSRMLS_DC);
- int (*local_infile_read)(void *ptr, char *buf, uint buf_len
TSRMLS_DC);
- int (*local_infile_error)(void *ptr, char *error_msg, uint
error_msg_len TSRMLS_DC);
+ int (*local_infile_read)(void *ptr, char *buf, unsigned int
buf_len TSRMLS_DC);
+ int (*local_infile_error)(void *ptr, char *error_msg,
unsigned int error_msg_len TSRMLS_DC);
void (*local_infile_end)(void *ptr TSRMLS_DC);
zval *callback;
void *userdata;
@@ -149,14 +149,14 @@
typedef struct st_mysqlnd_option
{
/* timeouts */
- uint timeout_connect;
- uint timeout_read;
- uint timeout_write;
+ unsigned int timeout_connect;
+ unsigned int timeout_read;
+ unsigned int timeout_write;
ulong flags;
/* init commands - we need to send them to server directly after
connect */
- uint num_commands;
+ unsigned int num_commands;
char **init_commands;
/* configuration file information */
@@ -320,7 +320,7 @@
void (*free_result_contents)(MYSQLND_RES
*result TSRMLS_DC);
/* for decoding - binary or text protocol */
- void
(*row_decoder)(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval ** fields, uint
field_count, MYSQLND_FIELD *fields_metadata, MYSQLND *conn TSRMLS_DC);
+ void
(*row_decoder)(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval ** fields, unsigned
int field_count, MYSQLND_FIELD *fields_metadata, MYSQLND *conn TSRMLS_DC);
};
@@ -359,7 +359,7 @@
enum_func_status (*refresh_bind_param)(MYSQLND_STMT * const stmt
TSRMLS_DC);
void (*set_param_bind_dtor)(MYSQLND_STMT *
const stmt, void (*param_bind_dtor)(MYSQLND_PARAM_BIND *) TSRMLS_DC);
enum_func_status (*bind_result)(MYSQLND_STMT * const stmt,
MYSQLND_RESULT_BIND * const result_bind TSRMLS_DC);
- enum_func_status (*bind_one_result)(MYSQLND_STMT * const stmt,
uint param_no TSRMLS_DC);
+ enum_func_status (*bind_one_result)(MYSQLND_STMT * const stmt,
unsigned int param_no TSRMLS_DC);
void (*set_result_bind_dtor)(MYSQLND_STMT *
const stmt, void (*result_bind_dtor)(MYSQLND_RESULT_BIND *) TSRMLS_DC);
enum_func_status (*send_long_data)(MYSQLND_STMT * const stmt,
unsigned int param_num,
const char * const data, unsigned long length TSRMLS_DC);
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_wireprotocol.c?r1=1.4.2.21&r2=1.4.2.22&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_wireprotocol.c
diff -u php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.4.2.21
php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.4.2.22
--- php-src/ext/mysqlnd/mysqlnd_wireprotocol.c:1.4.2.21 Fri Oct 31 20:32:17 2008
+++ php-src/ext/mysqlnd/mysqlnd_wireprotocol.c Thu Nov 6 10:37:47 2008
@@ -195,7 +195,7 @@
if (length < (uint64_t) L64(65536)) {
*packet++ = 252;
- int2store(packet,(uint) length);
+ int2store(packet,(unsigned int) length);
return packet + 2;
}
@@ -1356,7 +1356,7 @@
/* {{{ php_mysqlnd_rowp_read_binary_protocol */
void php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK *
row_buffer, zval ** fields,
-
uint field_count, MYSQLND_FIELD *fields_metadata,
+
unsigned int field_count, MYSQLND_FIELD *fields_metadata,
MYSQLND *conn TSRMLS_DC)
{
int i;
@@ -1455,7 +1455,7 @@
/* {{{ php_mysqlnd_rowp_read_text_protocol */
void php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK *
row_buffer, zval ** fields,
-
uint field_count, MYSQLND_FIELD *fields_metadata,
+
unsigned int field_count, MYSQLND_FIELD *fields_metadata,
MYSQLND *conn TSRMLS_DC)
{
int i;
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqlnd/mysqlnd_wireprotocol.h?r1=1.4.2.10&r2=1.4.2.11&diff_format=u
Index: php-src/ext/mysqlnd/mysqlnd_wireprotocol.h
diff -u php-src/ext/mysqlnd/mysqlnd_wireprotocol.h:1.4.2.10
php-src/ext/mysqlnd/mysqlnd_wireprotocol.h:1.4.2.11
--- php-src/ext/mysqlnd/mysqlnd_wireprotocol.h:1.4.2.10 Fri Oct 31 20:32:17 2008
+++ php-src/ext/mysqlnd/mysqlnd_wireprotocol.h Thu Nov 6 10:37:47 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mysqlnd_wireprotocol.h,v 1.4.2.10 2008/10/31 20:32:17 andrey Exp $ */
+/* $Id: mysqlnd_wireprotocol.h,v 1.4.2.11 2008/11/06 10:37:47 andrey Exp $ */
#ifndef MYSQLND_WIREPROTOCOL_H
#define MYSQLND_WIREPROTOCOL_H
@@ -325,10 +325,10 @@
void php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK *
row_buffer, zval ** fields,
-
uint field_count, MYSQLND_FIELD *fields_metadata, MYSQLND *conn TSRMLS_DC);
+
unsigned int field_count, MYSQLND_FIELD *fields_metadata, MYSQLND *conn
TSRMLS_DC);
void php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK *
row_buffer, zval ** fields,
-
uint field_count, MYSQLND_FIELD *fields_metadata, MYSQLND *conn TSRMLS_DC);
+
unsigned int field_count, MYSQLND_FIELD *fields_metadata, MYSQLND *conn
TSRMLS_DC);
#endif /* MYSQLND_WIREPROTOCOL_H */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php