cvs: php-src /ext/mysqli/mysqlnd mysqlnd_wireprotocol.c portability.h
| From: | Andrey Hristov | Date: | Wed, 25 Jul 2007 12:42:00 +0000 |
| Subject: | cvs: php-src /ext/mysqli/mysqlnd mysqlnd_wireprotocol.c portability.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-45599@lists.php.net to get a copy of this message | ||
andrey Wed Jul 25 12:42:00 2007 UTC
Modified files:
/php-src/ext/mysqli/mysqlnd mysqlnd_wireprotocol.c portability.h
Log:
Alignment fixes for 64bit and fixing macroses
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqlnd/mysqlnd_wireprotocol.c?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/mysqli/mysqlnd/mysqlnd_wireprotocol.c
diff -u php-src/ext/mysqli/mysqlnd/mysqlnd_wireprotocol.c:1.1
php-src/ext/mysqli/mysqlnd/mysqlnd_wireprotocol.c:1.2
--- php-src/ext/mysqli/mysqlnd/mysqlnd_wireprotocol.c:1.1 Tue Jul 24 16:13:26 2007
+++ php-src/ext/mysqli/mysqlnd/mysqlnd_wireprotocol.c Wed Jul 25 12:42:00 2007
@@ -268,7 +268,8 @@
*/
size_t mysqlnd_stream_write_w_header(MYSQLND * const conn, char * const buf, size_t count
TSRMLS_DC)
{
- zend_uchar safe_storage[MYSQLND_HEADER_SIZE];
+ zend_uchar safe_buf[((MYSQLND_HEADER_SIZE) + (sizeof(zend_uchar)) - 1) / (sizeof(zend_uchar))];
+ zend_uchar *safe_storage = (char *) &safe_buf;
MYSQLND_NET *net = &conn->net;
size_t old_chunk_size = net->stream->chunk_size;
size_t ret, left = count, packets_sent = 1;
@@ -315,7 +316,8 @@
size_t mysqlnd_stream_write_w_command(MYSQLND * const conn, enum php_mysqlnd_server_command
command,
const char * const buf, size_t count TSRMLS_DC)
{
- zend_uchar safe_storage[MYSQLND_HEADER_SIZE + 1];
+ zend_uchar safe_buf[((MYSQLND_HEADER_SIZE) + (sizeof(zend_uchar)) - 1) / (sizeof(zend_uchar))];
+ zend_uchar *safe_storage = (char *) &safe_buf;
MYSQLND_NET *net = &conn->net;
size_t old_chunk_size = net->stream->chunk_size;
size_t ret, left = count, header_len = MYSQLND_HEADER_SIZE + 1, packets_sent = 1;
http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqlnd/portability.h?r1=1.2&r2=1.3&diff_format=u
Index: php-src/ext/mysqli/mysqlnd/portability.h
diff -u php-src/ext/mysqli/mysqlnd/portability.h:1.2 php-src/ext/mysqli/mysqlnd/portability.h:1.3
--- php-src/ext/mysqli/mysqlnd/portability.h:1.2 Tue Jul 24 19:20:28 2007
+++ php-src/ext/mysqli/mysqlnd/portability.h Wed Jul 25 12:42:00 2007
@@ -102,19 +102,19 @@
#elif SIZEOF_INT == 4
-#ifndef (SIZEOF_INT32 == 0)
+#if (SIZEOF_INT32 == 0)
typedef signed int int32;
#endif
-#ifndef (SIZEOF_UINT32 == 0)
+#if (SIZEOF_UINT32 == 0)
typedef unsigned int uint32;
#endif
#elif SIZEOF_LONG == 4
-#ifndef (SIZEOF_INT32 == 0)
+#if (SIZEOF_INT32 == 0)
typedef signed long int32;
#endif
-#ifndef (SIZEOF_UINT32 == 0)
+#if (SIZEOF_UINT32 == 0)
typedef unsigned long uint32;
#endif