[PHP-CVS] svn: /php/php-src/trunk/ext/mysqlnd/ mysqlnd_loaddata.c mysqlnd_ps.c mysqlnd_structs.h

2011-03-16 Thread Andrey Hristov
andrey   Wed, 16 Mar 2011 11:51:56 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=309301

Log:
compiler warnings fixed

Changed paths:
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_loaddata.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_ps.c
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_structs.h

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_loaddata.c
===
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_loaddata.c2011-03-16 11:14:33 UTC 
(rev 309300)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_loaddata.c2011-03-16 11:51:56 UTC 
(rev 309301)
@@ -85,14 +85,14 @@

 /* {{{ mysqlnd_local_infile_read */
 static
-int mysqlnd_local_infile_read(void *ptr, char *buf, unsigned int buf_len 
TSRMLS_DC)
+int mysqlnd_local_infile_read(void *ptr, zend_uchar * buf, unsigned int 
buf_len TSRMLS_DC)
 {
MYSQLND_INFILE_INFO *info = (MYSQLND_INFILE_INFO *)ptr;
int count;

DBG_ENTER(mysqlnd_local_infile_read);

-   count = (int)php_stream_read(info-fd, buf, buf_len);
+   count = (int)php_stream_read(info-fd, (char *) buf, buf_len);

if (count  0) {
strcpy(info-error_msg, Error reading file);
@@ -173,8 +173,8 @@
 enum_func_status
 mysqlnd_handle_local_infile(MYSQLND *conn, const char *filename, zend_bool 
*is_warning TSRMLS_DC)
 {
-   char*buf = NULL;
-   charempty_packet[MYSQLND_HEADER_SIZE];
+   zend_uchar  *buf = NULL;
+   zend_uchar  empty_packet[MYSQLND_HEADER_SIZE];
enum_func_statusresult = FAIL;
unsigned intbuflen = 4096;
void*info = NULL;
@@ -194,7 +194,7 @@

infile = conn-infile;
/* allocate buffer for reading data */
-   buf = (char *)mnd_ecalloc(1, buflen);
+   buf = (zend_uchar *)mnd_ecalloc(1, buflen);

*is_warning = FALSE;


Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_ps.c
===
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_ps.c  2011-03-16 11:14:33 UTC (rev 
309300)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_ps.c  2011-03-16 11:51:56 UTC (rev 
309301)
@@ -398,7 +398,7 @@
stmt_to_prepare = s_to_prepare-data;
}

-   if (FAIL == 
stmt_to_prepare-conn-m-simple_command(stmt_to_prepare-conn, 
COM_STMT_PREPARE, query, query_len, PROT_LAST, FALSE, TRUE TSRMLS_CC) ||
+   if (FAIL == 
stmt_to_prepare-conn-m-simple_command(stmt_to_prepare-conn, 
COM_STMT_PREPARE, (const zend_uchar *) query, query_len, PROT_LAST, FALSE, TRUE 
TSRMLS_CC) ||
FAIL == mysqlnd_stmt_read_prepare_response(s_to_prepare 
TSRMLS_CC))
{
goto fail;
@@ -694,7 +694,7 @@
ret = s-m-generate_execute_request(s, request, request_len, 
free_request TSRMLS_CC);
if (ret == PASS) {
/* support for buffer types should be added here ! */
-   ret = stmt-conn-m-simple_command(stmt-conn, 
COM_STMT_EXECUTE, (char *)request, request_len,
+   ret = stmt-conn-m-simple_command(stmt-conn, 
COM_STMT_EXECUTE, request, request_len,

PROT_LAST /* we will handle the response packet*/,

FALSE, FALSE TSRMLS_CC);
} else {
@@ -1036,7 +1036,7 @@
int4store(buf, stmt-stmt_id);
int4store(buf + STMT_ID_LENGTH, 1); /* for now fetch only one row */

-   if (FAIL == stmt-conn-m-simple_command(stmt-conn, COM_STMT_FETCH, 
(char *)buf, sizeof(buf),
+   if (FAIL == stmt-conn-m-simple_command(stmt-conn, COM_STMT_FETCH, 
buf, sizeof(buf),

  PROT_LAST /* we will handle the response packet*/,

  FALSE, TRUE TSRMLS_CC)) {
stmt-error_info = stmt-conn-error_info;
@@ -1259,7 +1259,7 @@

int4store(cmd_buf, stmt-stmt_id);
if (CONN_GET_STATE(conn) == CONN_READY 
-   FAIL == (ret = conn-m-simple_command(conn, 
COM_STMT_RESET, (char *)cmd_buf,
+   FAIL == (ret = conn-m-simple_command(conn, 
COM_STMT_RESET, cmd_buf,

  sizeof(cmd_buf), PROT_OK_PACKET,

  FALSE, TRUE TSRMLS_CC))) {
stmt-error_info = conn-error_info;
@@ -1339,7 +1339,7 @@
memcpy(cmd_buf + STMT_ID_LENGTH + 2, data, length);

/* COM_STMT_SEND_LONG_DATA 

[PHP-CVS] svn: /php/php-src/trunk/ext/mysqlnd/ mysqlnd_loaddata.c

2011-03-16 Thread Andrey Hristov
andrey   Wed, 16 Mar 2011 14:10:59 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=309307

Log:
Remove unused macros

Changed paths:
U   php/php-src/trunk/ext/mysqlnd/mysqlnd_loaddata.c

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_loaddata.c
===
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_loaddata.c2011-03-16 14:07:22 UTC 
(rev 309306)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_loaddata.c2011-03-16 14:10:59 UTC 
(rev 309307)
@@ -25,25 +25,6 @@
 #include mysqlnd_priv.h
 #include mysqlnd_debug.h

-
-#define ALLOC_CALLBACK_ARGS(a, b, c)\
-if (c) {\
-   a = (zval ***)safe_emalloc(c, sizeof(zval **), 0);\
-   for (i = b; i  c; i++) {\
-   a[i] = mnd_emalloc(sizeof(zval *));\
-   MAKE_STD_ZVAL(*a[i]);\
-   }\
-}
-
-#define FREE_CALLBACK_ARGS(a, b, c)\
-if (a) {\
-   for (i = b; i  c; i++) {\
-   zval_ptr_dtor(a[i]);\
-   mnd_efree(a[i]);\
-   }\
-   mnd_efree(a);\
-}
-
 /* {{{ mysqlnd_local_infile_init */
 static
 int mysqlnd_local_infile_init(void **ptr, char *filename, void **userdata 
TSRMLS_DC)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php