kalle Wed May 20 08:29:23 2009 UTC Modified files: /php-src/ext/mysql php_mysql.c /php-src/ext/mysqli mysqli_api.c mysqli_driver.c mysqli_prop.c /php-src/ext/pdo_mysql mysql_statement.c Log: Fix compiler warnings in ext/mysql, ext/mysqli and ext/pdo_mysql
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/php_mysql.c?r1=1.276&r2=1.277&diff_format=u Index: php-src/ext/mysql/php_mysql.c diff -u php-src/ext/mysql/php_mysql.c:1.276 php-src/ext/mysql/php_mysql.c:1.277 --- php-src/ext/mysql/php_mysql.c:1.276 Fri Mar 27 22:22:02 2009 +++ php-src/ext/mysql/php_mysql.c Wed May 20 08:29:22 2009 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_mysql.c,v 1.276 2009/03/27 22:22:02 tony2001 Exp $ */ +/* $Id: php_mysql.c,v 1.277 2009/05/20 08:29:22 kalle Exp $ */ /* TODO: * @@ -625,7 +625,9 @@ int hashed_details_length, port = MYSQL_PORT; long client_flags = 0; php_mysql_conn *mysql=NULL; +#if !defined(MYSQL_USE_MYSQLND) && !defined(MYSQL_HASH_SET_CHARSET) char *encoding; +#endif #if MYSQL_VERSION_ID <= 32230 void (*handler) (int); #endif @@ -1185,7 +1187,7 @@ } ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, &mysql_link, id, "MySQL-Link", le_link, le_plink); - RETURN_LONG(mysql_thread_id(mysql->conn)); + RETURN_LONG((long) mysql_thread_id(mysql->conn)); } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli_api.c?r1=1.173&r2=1.174&diff_format=u Index: php-src/ext/mysqli/mysqli_api.c diff -u php-src/ext/mysqli/mysqli_api.c:1.173 php-src/ext/mysqli/mysqli_api.c:1.174 --- php-src/ext/mysqli/mysqli_api.c:1.173 Fri Mar 27 19:28:26 2009 +++ php-src/ext/mysqli/mysqli_api.c Wed May 20 08:29:23 2009 @@ -17,7 +17,7 @@ | Ulf Wendel <u...@php.net> | +----------------------------------------------------------------------+ - $Id: mysqli_api.c,v 1.173 2009/03/27 19:28:26 felipe Exp $ + $Id: mysqli_api.c,v 1.174 2009/05/20 08:29:23 kalle Exp $ */ #ifdef HAVE_CONFIG_H @@ -158,7 +158,7 @@ int mysqli_stmt_bind_param_do_bind(MY_STMT *stmt, unsigned int argc, unsigned int num_vars, zval ***args, unsigned int start, const char * const types TSRMLS_DC) { - int i; + unsigned int i; MYSQLND_PARAM_BIND *params; enum_func_status ret = FAIL; @@ -1123,7 +1123,7 @@ MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, &mysql_result, "mysqli_result", MYSQLI_STATUS_VALID); - if (offset < 0 || offset >= mysql_num_fields(result)) { + if (offset < 0 || offset >= (long) mysql_num_fields(result)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field offset is invalid for resultset"); RETURN_FALSE; } @@ -2142,7 +2142,7 @@ return; } MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link", MYSQLI_STATUS_INITIALIZED); - RETURN_BOOL(!mysql_refresh(mysql->mysql, options)); + RETURN_BOOL(!mysql_refresh(mysql->mysql, (uint8_t) options)); } /* }}} */ @@ -2416,7 +2416,7 @@ } MYSQLI_FETCH_RESOURCE(mysql, MY_MYSQL *, &mysql_link, "mysqli_link", MYSQLI_STATUS_VALID); - RETURN_LONG(mysql_thread_id(mysql->mysql)); + RETURN_LONG((long) mysql_thread_id(mysql->mysql)); } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli_driver.c?r1=1.18&r2=1.19&diff_format=u Index: php-src/ext/mysqli/mysqli_driver.c diff -u php-src/ext/mysqli/mysqli_driver.c:1.18 php-src/ext/mysqli/mysqli_driver.c:1.19 --- php-src/ext/mysqli/mysqli_driver.c:1.18 Wed Dec 31 11:12:33 2008 +++ php-src/ext/mysqli/mysqli_driver.c Wed May 20 08:29:23 2009 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: mysqli_driver.c,v 1.18 2008/12/31 11:12:33 sebastian Exp $ */ +/* $Id: mysqli_driver.c,v 1.19 2009/05/20 08:29:23 kalle Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -134,12 +134,14 @@ ZEND_FUNCTION(mysqli_driver_construct) { +#if G0 MYSQLI_RESOURCE *mysqli_resource; mysqli_resource = (MYSQLI_RESOURCE *)ecalloc (1, sizeof(MYSQLI_RESOURCE)); mysqli_resource->ptr = 1; mysqli_resource->status = (ZEND_NUM_ARGS() == 1) ? MYSQLI_STATUS_INITIALIZED : MYSQLI_STATUS_VALID; ((mysqli_object *) zend_object_store_get_object(getThis() TSRMLS_CC))->ptr = mysqli_resource; +#endif } const mysqli_property_entry mysqli_driver_property_entries[] = { http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/mysqli_prop.c?r1=1.42&r2=1.43&diff_format=u Index: php-src/ext/mysqli/mysqli_prop.c diff -u php-src/ext/mysqli/mysqli_prop.c:1.42 php-src/ext/mysqli/mysqli_prop.c:1.43 --- php-src/ext/mysqli/mysqli_prop.c:1.42 Mon Jan 12 12:54:17 2009 +++ php-src/ext/mysqli/mysqli_prop.c Wed May 20 08:29:23 2009 @@ -17,7 +17,7 @@ | Ulf Wendel <u...@php.net> | +----------------------------------------------------------------------+ - $Id: mysqli_prop.c,v 1.42 2009/01/12 12:54:17 johannes Exp $ + $Id: mysqli_prop.c,v 1.43 2009/05/20 08:29:23 kalle Exp $ */ #ifdef HAVE_CONFIG_H @@ -85,7 +85,7 @@ } else {\ l = (__ret_type)__int_func(p);\ if (l < LONG_MAX) {\ - ZVAL_LONG(*retval, l);\ + ZVAL_LONG(*retval, (long) l);\ } else { \ char *ret; \ int ret_len = spprintf(&ret, 0, __ret_type_sprint_mod, l); \ @@ -158,7 +158,7 @@ static int link_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC) { MY_MYSQL *mysql; - my_ulonglong rc; + long rc; MAKE_STD_ZVAL(*retval); @@ -171,9 +171,9 @@ } else { CHECK_STATUS(MYSQLI_STATUS_VALID); - rc = mysql_affected_rows(mysql->mysql); + rc = (long) mysql_affected_rows(mysql->mysql); - if (rc == (my_ulonglong)-1) { + if (rc == (long)-1) { ZVAL_LONG(*retval, -1); return SUCCESS; } @@ -279,7 +279,7 @@ static int stmt_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC) { MY_STMT *p; - my_ulonglong rc; + long rc; MAKE_STD_ZVAL(*retval); CHECK_STATUS(MYSQLI_STATUS_VALID); @@ -289,9 +289,9 @@ if (!p) { ZVAL_NULL(*retval); } else { - rc = mysql_stmt_affected_rows(p->stmt); + rc = (long) mysql_stmt_affected_rows(p->stmt); - if (rc == (my_ulonglong)-1) { + if (rc == (long)-1) { ZVAL_LONG(*retval, -1); return SUCCESS; } @@ -300,7 +300,7 @@ ZVAL_LONG(*retval, rc); } else { char *ret; - int l = spprintf(&ret, 0, MYSQLI_LLU_SPEC, rc); + int l = spprintf(&ret, 0, MYSQLI_LLU_SPEC, (my_longlong) rc); ZVAL_STRINGL(*retval, ret, l, 0); } } http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_mysql/mysql_statement.c?r1=1.66&r2=1.67&diff_format=u Index: php-src/ext/pdo_mysql/mysql_statement.c diff -u php-src/ext/pdo_mysql/mysql_statement.c:1.66 php-src/ext/pdo_mysql/mysql_statement.c:1.67 --- php-src/ext/pdo_mysql/mysql_statement.c:1.66 Tue Mar 10 23:39:28 2009 +++ php-src/ext/pdo_mysql/mysql_statement.c Wed May 20 08:29:23 2009 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: mysql_statement.c,v 1.66 2009/03/10 23:39:28 helly Exp $ */ +/* $Id: mysql_statement.c,v 1.67 2009/05/20 08:29:23 kalle Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -122,10 +122,10 @@ static void pdo_mysql_stmt_set_row_count(pdo_stmt_t *stmt) /* {{{ */ { - my_ulonglong row_count; + long row_count; pdo_mysql_stmt *S = stmt->driver_data; - row_count = mysql_stmt_affected_rows(S->stmt); - if (row_count != (my_ulonglong)-1) { + row_count = (long) mysql_stmt_affected_rows(S->stmt); + if (row_count != (long)-1) { stmt->row_count = row_count; } } @@ -248,7 +248,7 @@ { pdo_mysql_stmt *S = stmt->driver_data; pdo_mysql_db_handle *H = S->H; - unsigned int i; + int i; PDO_DBG_ENTER("pdo_mysql_stmt_execute_prepared_mysqlnd"); @@ -325,13 +325,13 @@ PDO_DBG_RETURN(0); } - stmt->row_count = mysql_num_rows(S->result); + stmt->row_count = (long) mysql_num_rows(S->result); stmt->column_count = (int) mysql_num_fields(S->result); S->fields = mysql_fetch_fields(S->result); } else { /* this was a DML or DDL query (INSERT, UPDATE, DELETE, ... */ - stmt->row_count = row_count; + stmt->row_count = (long) row_count; } PDO_DBG_RETURN(1); @@ -343,7 +343,7 @@ #if HAVE_MYSQL_NEXT_RESULT || PDO_USE_MYSQLND pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data; pdo_mysql_db_handle *H = S->H; - my_ulonglong row_count; + long row_count; int ret; PDO_DBG_ENTER("pdo_mysql_stmt_next_rowset"); PDO_DBG_INF_FMT("stmt=%p", S->stmt); @@ -374,7 +374,7 @@ } { /* for SHOW/DESCRIBE and others the column/field count is not available before execute */ - unsigned int i; + int i; stmt->column_count = S->stmt->field_count; for (i = 0; i < stmt->column_count; i++) { @@ -392,8 +392,8 @@ PDO_DBG_RETURN(1); } } - row_count = mysql_stmt_affected_rows(S->stmt); - if (row_count != (my_ulonglong)-1) { + row_count = (long) mysql_stmt_affected_rows(S->stmt); + if (row_count != (long)-1) { stmt->row_count = row_count; } PDO_DBG_RETURN(1); @@ -436,7 +436,7 @@ PDO_DBG_RETURN(0); } - stmt->row_count = row_count; + stmt->row_count = (long) row_count; stmt->column_count = (int) mysql_num_fields(S->result); S->fields = mysql_fetch_fields(S->result); PDO_DBG_RETURN(1); @@ -493,7 +493,7 @@ PDO_DBG_RETURN(1); case PDO_PARAM_EVT_EXEC_PRE: - if (S->params_given < S->num_params) { + if (S->params_given < (unsigned int) S->num_params) { /* too few parameter bound */ PDO_DBG_ERR("too few parameters bound"); strcpy(stmt->error_code, "HY093"); @@ -671,7 +671,7 @@ { pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data; struct pdo_column_data *cols = stmt->columns; - unsigned int i; + int i; PDO_DBG_ENTER("pdo_mysql_stmt_describe"); PDO_DBG_INF_FMT("stmt=%p", S->stmt); @@ -690,7 +690,7 @@ if (cols[0].name) { PDO_DBG_RETURN(1); } - for (i=0; i < stmt->column_count; i++) { + for (i = 0; i < stmt->column_count; i++) { int namelen; if (S->H->fetch_table_names) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php