]> granicus.if.org Git - php/commitdiff
- Fix warnings by doing it the Zend way
authorMarcus Boerger <helly@php.net>
Sat, 19 Mar 2005 10:51:42 +0000 (10:51 +0000)
committerMarcus Boerger <helly@php.net>
Sat, 19 Mar 2005 10:51:42 +0000 (10:51 +0000)
ext/pdo/pdo_stmt.c
ext/pdo/php_pdo_int.h

index cc84eef89636dbc2e05ca2f8b7c76322b30f02ad..6f0b9e0e337fb061d261e7e344a23c101516b6d2 100755 (executable)
@@ -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;
index fed5c861f447524b82dfefbd7ac40898bee69b2e..41b3f1ccf1d9de0c978db67b27bdc62bbbae3bb8 100755 (executable)
@@ -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);