Alignment fixes for 64bit and fixing macroses

This commit is contained in:
Andrey Hristov 2007-07-25 12:42:00 +00:00
parent e9ccedf427
commit 7bb46902f8
2 changed files with 8 additions and 6 deletions

View File

@ -268,7 +268,8 @@ int mysqlnd_set_sock_no_delay(php_stream *stream)
*/
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 @@ static
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;

View File

@ -102,19 +102,19 @@ typedef uint32_t uint32;
#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