Author: ahristov
Date: 2007-07-25 14:41:31 +0200 (Wed, 25 Jul 2007)
New Revision: 841
Modified:
trunk/mysqlnd/mysqlnd_wireprotocol.c
trunk/mysqlnd/portability.h
Log:
Alignment fixes
Modified: trunk/mysqlnd/mysqlnd_wireprotocol.c
===================================================================
--- trunk/mysqlnd/mysqlnd_wireprotocol.c 2007-07-25 11:50:23 UTC (rev 840)
+++ trunk/mysqlnd/mysqlnd_wireprotocol.c 2007-07-25 12:41:31 UTC (rev 841)
@@ -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;
Modified: trunk/mysqlnd/portability.h
===================================================================
--- trunk/mysqlnd/portability.h 2007-07-25 11:50:23 UTC (rev 840)
+++ trunk/mysqlnd/portability.h 2007-07-25 12:41:31 UTC (rev 841)
@@ -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
| Thread |
|---|
| • PHP mysqlnd svn commit: r841 - trunk/mysqlnd | ahristov | 25 Jul |