From: Marcus Boerger Date: Sat, 19 Mar 2005 10:51:42 +0000 (+0000) Subject: - Fix warnings by doing it the Zend way X-Git-Tag: php-5.0.1b1~753 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7b2bee1d5b806cdb8c58aa423dc1123c67708b43;p=php - Fix warnings by doing it the Zend way --- diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index cc84eef896..6f0b9e0e33 100755 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -203,7 +203,7 @@ static void get_lazy_object(pdo_stmt_t *stmt, zval *return_value TSRMLS_DC) /* { { if (Z_TYPE(stmt->lazy_object_ref) == IS_NULL) { Z_TYPE(stmt->lazy_object_ref) = IS_OBJECT; - Z_OBJ_HANDLE(stmt->lazy_object_ref) = zend_objects_store_put(stmt, (zend_objects_store_dtor_t)zend_objects_destroy_object, pdo_row_free_storage, NULL TSRMLS_CC); + Z_OBJ_HANDLE(stmt->lazy_object_ref) = zend_objects_store_put(stmt, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)pdo_row_free_storage, NULL TSRMLS_CC); Z_OBJ_HT(stmt->lazy_object_ref) = &pdo_row_object_handlers; stmt->refcount++; } @@ -1869,10 +1869,8 @@ static void free_statement(pdo_stmt_t *stmt TSRMLS_DC) efree(stmt); } -void pdo_dbstmt_free_storage(zend_object *object TSRMLS_DC) +void pdo_dbstmt_free_storage(pdo_stmt_t *stmt TSRMLS_DC) { - pdo_stmt_t *stmt = (pdo_stmt_t*)object; - if (--stmt->refcount == 0) { free_statement(stmt TSRMLS_CC); } @@ -1890,7 +1888,7 @@ zend_object_value pdo_dbstmt_new(zend_class_entry *ce TSRMLS_DC) ALLOC_HASHTABLE(stmt->properties); zend_hash_init(stmt->properties, 0, NULL, ZVAL_PTR_DTOR, 0); - retval.handle = zend_objects_store_put(stmt, (zend_objects_store_dtor_t)zend_objects_destroy_object, pdo_dbstmt_free_storage, NULL TSRMLS_CC); + retval.handle = zend_objects_store_put(stmt, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)pdo_dbstmt_free_storage, NULL TSRMLS_CC); retval.handlers = &pdo_dbstmt_object_handlers; return retval; @@ -2190,10 +2188,8 @@ zend_object_handlers pdo_row_object_handlers = { NULL }; -void pdo_row_free_storage(zend_object *object TSRMLS_DC) +void pdo_row_free_storage(pdo_stmt_t *stmt TSRMLS_DC) { - pdo_stmt_t *stmt = (pdo_stmt_t*)object; - ZVAL_NULL(&stmt->lazy_object_ref); if (--stmt->refcount == 0) { @@ -2205,7 +2201,7 @@ zend_object_value pdo_row_new(zend_class_entry *ce TSRMLS_DC) { zend_object_value retval; - retval.handle = zend_objects_store_put(NULL, (zend_objects_store_dtor_t)zend_objects_destroy_object, pdo_row_free_storage, NULL TSRMLS_CC); + retval.handle = zend_objects_store_put(NULL, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)pdo_row_free_storage, NULL TSRMLS_CC); retval.handlers = &pdo_row_object_handlers; return retval; diff --git a/ext/pdo/php_pdo_int.h b/ext/pdo/php_pdo_int.h index fed5c861f4..41b3f1ccf1 100755 --- a/ext/pdo/php_pdo_int.h +++ b/ext/pdo/php_pdo_int.h @@ -33,7 +33,7 @@ extern ZEND_RSRC_DTOR_FUNC(php_pdo_pdbh_dtor); 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(zend_object *object TSRMLS_DC); +void pdo_dbstmt_free_storage(pdo_stmt_t *stmt TSRMLS_DC); zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC); extern zend_object_handlers pdo_dbstmt_object_handlers; int pdo_stmt_describe_columns(pdo_stmt_t *stmt TSRMLS_DC); @@ -42,7 +42,7 @@ int pdo_stmt_setup_fetch_mode(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt, in extern zend_object_value pdo_row_new(zend_class_entry *ce TSRMLS_DC); extern function_entry pdo_row_functions[]; extern zend_class_entry *pdo_row_ce; -void pdo_row_free_storage(zend_object *object TSRMLS_DC); +void pdo_row_free_storage(pdo_stmt_t *stmt TSRMLS_DC); extern zend_object_handlers pdo_row_object_handlers; zend_object_iterator *php_pdo_dbstmt_iter_get(zend_class_entry *ce, zval *object TSRMLS_DC);