From 87edd143edef1ad072550d609c1427ad2c835a86 Mon Sep 17 00:00:00 2001 From: Kalle Sommer Nielsen Date: Tue, 5 Oct 2010 09:40:36 +0000 Subject: [PATCH] Fixed compiler warnings in mysqli - mysqli.c: Fix unused variables, they are only used in non-mysqlnd mode - mysqli_api.c (PHP_5_3 only): Fix constness, add_property_string expects a char *, not a const char * - mysqli_prop.c: Cast to long, as its below the LONG_MAX and therefore safe - mysqli_result_iterator.c: Cast to ulong as the iterator member expects that rather than a my_longlong # In trunk only warnings regarding the zend_property_info # structure is present and PHP_5_3 is warning free now --- ext/mysqli/mysqli_api.c | 10 +++++----- ext/mysqli/mysqli_prop.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 6ce166713e9..841f00f5913 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -1047,11 +1047,11 @@ PHP_FUNCTION(mysqli_stmt_fetch) /* {{{ php_add_field_properties */ static void php_add_field_properties(zval *value, const MYSQL_FIELD *field TSRMLS_DC) { - add_property_string(value, "name",(field->name ? field->name : ""), 1); - add_property_string(value, "orgname",(field->org_name ? field->org_name : ""), 1); - add_property_string(value, "table",(field->table ? field->table : ""), 1); - add_property_string(value, "orgtable",(field->org_table ? field->org_table : ""), 1); - add_property_string(value, "def",(field->def ? field->def : ""), 1); + add_property_string(value, "name", (char *) (field->name ? field->name : ""), 1); + add_property_string(value, "orgname", (char *) (field->org_name ? field->org_name : ""), 1); + add_property_string(value, "table", (char *) (field->table ? field->table : ""), 1); + add_property_string(value, "orgtable", (char *) (field->org_table ? field->org_table : ""), 1); + add_property_string(value, "def", (field->def ? field->def : ""), 1); add_property_long(value, "max_length", field->max_length); add_property_long(value, "length", field->length); diff --git a/ext/mysqli/mysqli_prop.c b/ext/mysqli/mysqli_prop.c index 98b81ee04a1..b4535654fb7 100644 --- a/ext/mysqli/mysqli_prop.c +++ b/ext/mysqli/mysqli_prop.c @@ -84,7 +84,7 @@ static int __func(mysqli_object *obj, zval **retval TSRMLS_DC) \ } 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); \ @@ -178,7 +178,7 @@ static int link_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC) } if (rc < LONG_MAX) { - ZVAL_LONG(*retval, rc); + ZVAL_LONG(*retval, (long) rc); } else { char *ret; int l = spprintf(&ret, 0, MYSQLI_LLU_SPEC, rc); @@ -295,7 +295,7 @@ static int stmt_affected_rows_read(mysqli_object *obj, zval **retval TSRMLS_DC) } if (rc < LONG_MAX) { - ZVAL_LONG(*retval, rc); + ZVAL_LONG(*retval, (long) rc); } else { char *ret; int l = spprintf(&ret, 0, MYSQLI_LLU_SPEC, rc);