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
This commit is contained in:
Kalle Sommer Nielsen 2010-10-05 09:40:36 +00:00
parent df2261df2a
commit 87edd143ed
2 changed files with 8 additions and 8 deletions

View File

@ -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);

View File

@ -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);