summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKalle Sommer Nielsen <kalle@php.net>2010-10-05 09:40:36 +0000
committerKalle Sommer Nielsen <kalle@php.net>2010-10-05 09:40:36 +0000
commit87edd143edef1ad072550d609c1427ad2c835a86 (patch)
tree60aed0c929cefab2799f8819811d81ed366497ae
parentdf2261df2a915d0355b16c66b3c3a9496d8cab43 (diff)
downloadphp-git-87edd143edef1ad072550d609c1427ad2c835a86.tar.gz
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
-rw-r--r--ext/mysqli/mysqli_api.c10
-rw-r--r--ext/mysqli/mysqli_prop.c6
2 files changed, 8 insertions, 8 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 6ce166713e..841f00f591 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 98b81ee04a..b4535654fb 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);