From: Wez Furlong Date: Mon, 17 May 2004 17:00:35 +0000 (+0000) Subject: Some pedantic fixes for gcc. X-Git-Tag: RELEASE_0_1~178 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=79c513db9607d12561bdeabb7106ef717cd5114e;p=php Some pedantic fixes for gcc. --- diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index a97ce4a644..2529506390 100755 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -392,7 +392,7 @@ static zend_object_handlers pdo_dbh_object_handlers = { NULL }; -static void pdo_dbh_free_storage(void *object TSRMLS_DC) +static void pdo_dbh_free_storage(zend_object *object TSRMLS_DC) { pdo_dbh_t *dbh = (pdo_dbh_t*)object; diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index cddd11b3c0..b1fdd7694a 100755 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -114,8 +114,8 @@ static int describe_columns(pdo_stmt_t *stmt TSRMLS_DC) static void param_dtor(void *data) { - TSRMLS_FETCH(); struct pdo_bound_param_data *param = (struct pdo_bound_param_data *)data; + TSRMLS_FETCH(); /* tell the driver that it is going away */ if (param->stmt->methods->param_hook) { @@ -179,9 +179,9 @@ static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_s if (param->name) { param->name = estrndup(param->name, param->namelen); - zend_hash_update(hash, param->name, param->namelen, param, sizeof(*param), &pparam); + zend_hash_update(hash, param->name, param->namelen, param, sizeof(*param), (void**)&pparam); } else { - zend_hash_index_update(hash, param->paramno, param, sizeof(*param), &pparam); + zend_hash_index_update(hash, param->paramno, param, sizeof(*param), (void**)&pparam); } /* tell the driver we just created a parameter */ @@ -467,7 +467,7 @@ static PHP_METHOD(PDOStatement, rowCount) -extern function_entry pdo_dbstmt_functions[] = { +function_entry pdo_dbstmt_functions[] = { PHP_ME(PDOStatement, execute, NULL, ZEND_ACC_PUBLIC) PHP_ME(PDOStatement, fetch, NULL, ZEND_ACC_PUBLIC) PHP_ME(PDOStatement, bindParam, second_arg_force_ref, ZEND_ACC_PUBLIC) @@ -607,7 +607,7 @@ zend_object_handlers pdo_dbstmt_object_handlers = { NULL }; -void pdo_dbstmt_free_storage(void *object TSRMLS_DC) +void pdo_dbstmt_free_storage(zend_object *object TSRMLS_DC) { pdo_stmt_t *stmt = (pdo_stmt_t*)object; diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h index 34e88404dc..0c2ef803f1 100755 --- a/ext/pdo/php_pdo_driver.h +++ b/ext/pdo/php_pdo_driver.h @@ -21,6 +21,14 @@ /* forward declarations */ typedef struct _pdo_dbh_t pdo_dbh_t; typedef struct _pdo_stmt_t pdo_stmt_t; +struct pdo_bound_param_data; + +#ifndef TRUE +# define TRUE 1 +#endif +#ifndef FALSE +# define FALSE 0 +#endif #define PDO_DRIVER_API 20040513 diff --git a/ext/pdo/php_pdo_int.h b/ext/pdo/php_pdo_int.h index 5d0a3c9ee2..97e969889b 100755 --- a/ext/pdo/php_pdo_int.h +++ b/ext/pdo/php_pdo_int.h @@ -31,7 +31,7 @@ extern zend_class_entry *pdo_dbh_ce; extern zend_object_value pdo_dbstmt_new(zend_class_entry *ce TSRMLS_DC); extern function_entry pdo_dbstmt_functions[]; extern zend_class_entry *pdo_dbstmt_ce; -void pdo_dbstmt_free_storage(void *object TSRMLS_DC); +void pdo_dbstmt_free_storage(zend_object *object TSRMLS_DC); extern zend_object_handlers pdo_dbstmt_object_handlers; extern pdo_driver_t *pdo_find_driver(const char *name, int namelen);