]> granicus.if.org Git - php/commitdiff
Destructors no longer return ints, the low level problem it was intended to solve...
authorZeev Suraski <zeev@php.net>
Mon, 17 Jan 2000 17:33:37 +0000 (17:33 +0000)
committerZeev Suraski <zeev@php.net>
Mon, 17 Jan 2000 17:33:37 +0000 (17:33 +0000)
21 files changed:
Zend/zend_compile.c
Zend/zend_compile.h
Zend/zend_constants.c
Zend/zend_constants.h
Zend/zend_execute_API.c
Zend/zend_hash.c
Zend/zend_hash.h
Zend/zend_list.c
Zend/zend_list.h
Zend/zend_modules.h
Zend/zend_opcode.c
Zend/zend_variables.c
Zend/zend_variables.h
ext/ereg/ereg.c
ext/pcre/php_pcre.c
ext/standard/basic_functions.c
ext/standard/fsock.c
ext/standard/fsock.h
ext/standard/reg.c
main/configuration-parser.y
sapi/apache/mod_php4.c

index badda32a90127dd1f0302e9b6a6293e53a07c06a..48f5eafcde8996e74c6f73b6619b8afd3a627be4 100644 (file)
@@ -79,10 +79,9 @@ static void build_runtime_defined_function_key(zval *result, zval *name, zend_op
 }
 
 
-static int zend_open_file_dtor_wrapper(zend_file_handle *fh)
+static void zend_open_file_dtor_wrapper(zend_file_handle *fh)
 {
        zend_open_file_dtor(fh);
-       return 1;
 }
 
 
@@ -104,7 +103,7 @@ void init_compiler(CLS_D ELS_DC)
        init_resource_list(ELS_C);
        CG(unclean_shutdown) = 0;
        zend_llist_init(&CG(open_files), sizeof(zend_file_handle), (void (*)(void *)) zend_open_file_dtor, 0);
-       zend_hash_init(&CG(used_files), 5, NULL, (int (*)(void *)) zend_open_file_dtor_wrapper, 0);
+       zend_hash_init(&CG(used_files), 5, NULL, (void (*)(void *)) zend_open_file_dtor_wrapper, 0);
 }
 
 
index 2b95d352fe7390c3423ae9cbcc33fe5cf51bd605..59ffd41009d55b13ae180e3046180d8c57cdf865 100644 (file)
@@ -362,12 +362,12 @@ ZEND_API void zend_close_file_handle(zend_file_handle *file_handle CLS_DC);
 ZEND_API void zend_open_file_dtor(zend_file_handle *fh);
 END_EXTERN_C()
 
-ZEND_API int destroy_zend_function(zend_function *function);
-ZEND_API int destroy_zend_class(zend_class_entry *ce);
+ZEND_API void destroy_zend_function(zend_function *function);
+ZEND_API void destroy_zend_class(zend_class_entry *ce);
 void zend_class_add_ref(zend_class_entry *ce);
 
-#define ZEND_FUNCTION_DTOR (int (*)(void *)) destroy_zend_function
-#define ZEND_CLASS_DTOR (int (*)(void *)) destroy_zend_class
+#define ZEND_FUNCTION_DTOR (void (*)(void *)) destroy_zend_function
+#define ZEND_CLASS_DTOR (void (*)(void *)) destroy_zend_class
 
 zend_op *get_next_op(zend_op_array *op_array CLS_DC);
 void init_op(zend_op *op CLS_DC);
index 6ac7a25fbda4fe256bfad9696235a4baa500bfaa..0b95f9f66b0c854d7b1f615a3fac18b2cfb68827 100644 (file)
 #include "zend_globals.h"
 
 
-int free_zend_constant(zend_constant *c)
+void free_zend_constant(zend_constant *c)
 {
        if (!(c->flags & CONST_PERSISTENT)) {
                zval_dtor(&c->value);
        }
        free(c->name);
-       return 1;
 }
 
 
index 9722979f94c373d4844b1782d40fc8c0e3edd56a..9ebb7409a000c4652a4b511eda4e28969e1d8193 100644 (file)
@@ -45,7 +45,7 @@ typedef struct _zend_constant {
 #define REGISTER_MAIN_STRINGL_CONSTANT(name,str,len,flags)  zend_register_stringl_constant((name),sizeof(name),(str),(len),(flags),0 ELS_CC)
 
 void clean_module_constants(int module_number);
-int free_zend_constant(zend_constant *c);
+void free_zend_constant(zend_constant *c);
 int zend_startup_constants(ELS_D);
 int zend_shutdown_constants(ELS_D);
 void zend_register_standard_constants(ELS_D);
@@ -59,6 +59,6 @@ ZEND_API void zend_register_constant(zend_constant *c ELS_DC);
 void zend_copy_constants(HashTable *target, HashTable *sourc);
 void copy_zend_constant(zend_constant *c);
 
-#define ZEND_CONSTANT_DTOR (int (*)(void *)) free_zend_constant
+#define ZEND_CONSTANT_DTOR (void (*)(void *)) free_zend_constant
 
 #endif
index 8e3c1fcf93a0cc086bf3060300237e86f9839a14..1d06a76e7fcde83f83cbb23d74b5eaa89d2dcad6 100644 (file)
@@ -206,7 +206,7 @@ ZEND_API inline void safe_free_zval_ptr(zval *p)
 }
 
 
-ZEND_API int _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC)
+ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC)
 {
 #if DEBUG_ZEND>=2
        printf("Reducing refcount for %x (%x):  %d->%d\n", *zval_ptr, zval_ptr, (*zval_ptr)->refcount, (*zval_ptr)->refcount-1);
@@ -216,7 +216,6 @@ ZEND_API int _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC)
                zval_dtor(*zval_ptr);
                safe_free_zval_ptr(*zval_ptr);
        }
-       return 1;
 }
 
 
index db53b4ab04005bc6b5801bd4a8718eb8fb435b1e..f14da0efe9e2dbae2d860cc26a47bbafa84fabba 100644 (file)
@@ -101,7 +101,7 @@ ZEND_API ulong hashpjw(char *arKey, uint nKeyLength)
 }
 
 
-ZEND_API int zend_hash_init(HashTable *ht, uint nSize, ulong(*pHashFunction) (char *arKey, uint nKeyLength), int (*pDestructor) (void *pData),int persistent)
+ZEND_API int zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, int persistent)
 {
        uint i;
 
@@ -771,7 +771,6 @@ ZEND_API int zend_hash_del_key_or_index(HashTable *ht, char *arKey, uint nKeyLen
 ZEND_API void zend_hash_destroy(HashTable *ht)
 {
        Bucket *p, *q;
-       int delete_bucket;
 
        IS_CONSISTENT(ht);
 
@@ -783,19 +782,13 @@ ZEND_API void zend_hash_destroy(HashTable *ht)
                p = p->pListNext;
                if (!q->bIsPointer) {
                        if (ht->pDestructor) {
-                               delete_bucket = ht->pDestructor(q->pData);
-                       } else {
-                               delete_bucket = 1;
+                               ht->pDestructor(q->pData);
                        }
-                       if (!q->pDataPtr && q->pData && delete_bucket) {
+                       if (!q->pDataPtr && q->pData) {
                                pefree(q->pData,ht->persistent);
                        }
-               } else {
-                       delete_bucket = 1;
-               }
-               if (delete_bucket) {
-                       pefree(q,ht->persistent);
                }
+               pefree(q,ht->persistent);
        }
        pefree(ht->arBuckets,ht->persistent);
 
index 60ac82d65c080b02fa0bb025d4e4ec10a0cd5d27..c91f2f41665579195157f9510bf5533ce44f9712 100644 (file)
 #define HASH_DEL_KEY 0
 #define HASH_DEL_INDEX 1
 
+typedef int  (*compare_func_t)(const void *, const void *);
+typedef void (*sort_func_t)(void *, size_t, register size_t, compare_func_t);
+typedef void (*dtor_func_t)(void *pDest);
+typedef ulong (*hash_func_t)(char *arKey, uint nKeyLength);
+
 struct hashtable;
 
 typedef struct bucket {
@@ -53,25 +58,22 @@ typedef struct hashtable {
        uint nHashSizeIndex;
        uint nNumOfElements;
        ulong nNextFreeElement;
-       ulong(*pHashFunction) (char *arKey, uint nKeyLength);
+       hash_func_t pHashFunction;
        Bucket *pInternalPointer;       /* Used for element traversal */
        Bucket *pListHead;
        Bucket *pListTail;
        Bucket **arBuckets;
-       int (*pDestructor) (void *pData);
+       dtor_func_t pDestructor;
        unsigned char persistent;
 #if ZEND_DEBUG
        int inconsistent;
 #endif
 } HashTable;
 
-typedef int  (*compare_func_t) (const void *, const void *);
-typedef void (*sort_func_t) (void *, size_t, register size_t, compare_func_t);
-
 BEGIN_EXTERN_C()
 
 /* startup/shutdown */
-ZEND_API int zend_hash_init(HashTable *ht, uint nSize, ulong(*pHashFunction) (char *arKey, uint nKeyLength), int (*pDestructor) (void *pData), int persistent);
+ZEND_API int zend_hash_init(HashTable *ht, uint nSize, hash_func_t pHashFunction, dtor_func_t pDestructor, int persistent);
 ZEND_API void zend_hash_destroy(HashTable *ht);
 
 ZEND_API void zend_hash_clean(HashTable *ht);
index 570ceb31b032ff669d917d6a80fc13f785c5d729..1d64603d33c97a724a7f4aa2e98a5c02f40e7c4c 100644 (file)
@@ -204,7 +204,7 @@ ZEND_API void *zend_fetch_resource(zval **passed_id, int default_id, char *resou
 }
 
 
-int list_entry_destructor(void *ptr)
+void list_entry_destructor(void *ptr)
 {
        list_entry *le = (list_entry *) ptr;
        list_destructors_entry *ld;
@@ -216,11 +216,10 @@ int list_entry_destructor(void *ptr)
        } else {
                zend_error(E_WARNING,"Unknown list entry type in request shutdown (%d)",le->type);
        }
-       return 1;
 }
 
 
-int plist_entry_destructor(void *ptr)
+void plist_entry_destructor(void *ptr)
 {
        list_entry *le = (list_entry *) ptr;
        list_destructors_entry *ld;
@@ -232,7 +231,6 @@ int plist_entry_destructor(void *ptr)
        } else {
                zend_error(E_WARNING,"Unknown persistent list entry type in module shutdown (%d)",le->type);
        }
-       return 1;
 }
 
 
index 816b52e398ee8948a352a35b5045673bed74f556..c306fc1940f591d2f2f08e898297e3b6080bcb60 100644 (file)
@@ -46,8 +46,8 @@ enum list_entry_type {
        LE_DB=1000
 };
 
-int list_entry_destructor(void *ptr);
-int plist_entry_destructor(void *ptr);
+void list_entry_destructor(void *ptr);
+void plist_entry_destructor(void *ptr);
 
 int clean_module_resource_destructors(list_destructors_entry *ld, int *module_number);
 int init_resource_list(ELS_D);
index e028ef2e4f9b862bc51dd09444c1b1dc6d8150af..b9b5ac85c58392bbc4cc1f0be944fca3154f3bf5 100644 (file)
@@ -60,5 +60,5 @@ void module_destructor(zend_module_entry *module);
 int module_registry_cleanup(zend_module_entry *module);
 int module_registry_request_startup(zend_module_entry *module);
 
-#define ZEND_MODULE_DTOR (int (*)(void *)) module_destructor
+#define ZEND_MODULE_DTOR (void (*)(void *)) module_destructor
 #endif
index 3f40aad84795cd04965365edf7b01ff719cebced..4ca0b43eed1e5f74a36d16920d93ea8ae1775730 100644 (file)
@@ -105,7 +105,7 @@ void init_op_array(zend_op_array *op_array, int initial_ops_size)
 }
 
 
-ZEND_API int destroy_zend_function(zend_function *function)
+ZEND_API void destroy_zend_function(zend_function *function)
 {
        switch (function->type) {
                case ZEND_USER_FUNCTION:
@@ -115,14 +115,13 @@ ZEND_API int destroy_zend_function(zend_function *function)
                        /* do nothing */
                        break;
        }
-       return 1;
 }
 
 
-ZEND_API int destroy_zend_class(zend_class_entry *ce)
+ZEND_API void destroy_zend_class(zend_class_entry *ce)
 {
        if (--(*ce->refcount)>0) {
-               return 1;
+               return;
        }
        switch (ce->type) {
                case ZEND_USER_CLASS:
@@ -138,7 +137,6 @@ ZEND_API int destroy_zend_class(zend_class_entry *ce)
                        zend_hash_destroy(&ce->default_properties);
                        break;
        }
-       return 1;
 }
 
 
index ae795524cd73ec299db143ec470322fed6685a8b..99bf710936279ca8ea3cee2cabe31e769a4e6b63 100644 (file)
@@ -52,10 +52,10 @@ ZEND_API inline void var_uninit(zval *var)
 }
                
 
-ZEND_API int _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC)
+ZEND_API void _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC)
 {
        if (zvalue->type==IS_LONG) {
-               return 1;
+               return;
        }
        switch(zvalue->type) {
                case IS_STRING:
@@ -84,10 +84,9 @@ ZEND_API int _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC)
                case IS_BOOL:
                case IS_NULL:
                default:
-                       return 1;
+                       return;
                        break;
        }
-       return 1;
 }
 
 
@@ -169,14 +168,14 @@ ZEND_API int _zval_copy_ctor_wrapper(zval *zvalue)
 }
 
 
-ZEND_API int _zval_dtor_wrapper(zval *zvalue)
+ZEND_API void _zval_dtor_wrapper(zval *zvalue)
 {
-       return zval_dtor(zvalue);
+       zval_dtor(zvalue);
 }
 
 
 
-ZEND_API int _zval_ptr_dtor_wrapper(zval **zval_ptr)
+ZEND_API void _zval_ptr_dtor_wrapper(zval **zval_ptr)
 {
        return zval_ptr_dtor(zval_ptr);
 }
index 312939c58290ad034e007ed32b5e9cf773eb5db8..b2488fb3e0a730e55cef758a49f5d98ab8eb0065 100644 (file)
@@ -26,16 +26,16 @@ ZEND_API int zend_print_variable(zval *var);
 
 BEGIN_EXTERN_C()
 ZEND_API int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC);
-ZEND_API int _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC);
-ZEND_API int _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC);
+ZEND_API void _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC);
+ZEND_API void _zval_ptr_dtor(zval **zval_ptr ZEND_FILE_LINE_DC);
 #define zval_copy_ctor(zvalue) _zval_copy_ctor((zvalue) ZEND_FILE_LINE_CC)
 #define zval_dtor(zvalue) _zval_dtor((zvalue) ZEND_FILE_LINE_CC)
 #define zval_ptr_dtor(zval_ptr) _zval_ptr_dtor((zval_ptr) ZEND_FILE_LINE_CC)
 
 #if ZEND_DEBUG
 ZEND_API int _zval_copy_ctor_wrapper(zval *zvalue);
-ZEND_API int _zval_dtor_wrapper(zval *zvalue);
-ZEND_API int _zval_ptr_dtor_wrapper(zval **zval_ptr);
+ZEND_API void _zval_dtor_wrapper(zval *zvalue);
+ZEND_API void _zval_ptr_dtor_wrapper(zval **zval_ptr);
 #define zval_copy_ctor_wrapper _zval_copy_ctor_wrapper
 #define zval_dtor_wrapper _zval_dtor_wrapper
 #define zval_ptr_dtor_wrapper _zval_ptr_dtor_wrapper
@@ -51,8 +51,8 @@ END_EXTERN_C()
 void zval_add_ref(zval **p);
 void zval_del_ref(zval **p);
 
-#define ZVAL_DESTRUCTOR (int (*)(void *)) zval_dtor_wrapper
-#define ZVAL_PTR_DTOR (int (*)(void *)) zval_ptr_dtor_wrapper
+#define ZVAL_DESTRUCTOR (void (*)(void *)) zval_dtor_wrapper
+#define ZVAL_PTR_DTOR (void (*)(void *)) zval_ptr_dtor_wrapper
 #define ZVAL_COPY_CTOR (void (*)(void *)) zval_copy_ctor_wrapper
 
 ZEND_API void var_reset(zval *var);
index 421d1f802bd696c17f1dd827d553cd0abbddc591..bed5eec9018b10ccc581b8d23b137540de241a91 100644 (file)
@@ -86,10 +86,9 @@ static int _php_regcomp(regex_t *preg, const char *pattern, int cflags)
        return r;
 }
 
-static int _free_reg_cache(reg_cache *rc) 
+static void _free_reg_cache(reg_cache *rc) 
 {
        regfree(&rc->preg);
-       return 1;
 }
 
 #undef regfree
@@ -99,7 +98,7 @@ static int _free_reg_cache(reg_cache *rc)
        
 static void php_reg_init_globals(php_reg_globals *reg_globals) 
 {
-       zend_hash_init(&reg_globals->ht_rc, 0, NULL, (int (*)(void *)) _free_reg_cache, 1);
+       zend_hash_init(&reg_globals->ht_rc, 0, NULL, (void (*)(void *)) _free_reg_cache, 1);
 }
 
 static PHP_MINIT_FUNCTION(regex)
index 2624084184d8645ef10a92f7994106877d257e5d..1a16bc5705b12f413aa85d8167a7fccc9e7d82e5 100644 (file)
@@ -60,14 +60,13 @@ static void php_pcre_free(void *ptr)
 }
 
 
-static int _php_free_pcre_cache(void *data)
+static void _php_free_pcre_cache(void *data)
 {
        pcre_cache_entry *pce = (pcre_cache_entry *) data;
        pefree(pce->re, 1);
 #if HAVE_SETLOCALE
        pefree((void*)pce->tables, 1);
 #endif
-       return 1;
 }
 
 
index a8b1d4dc422ae7c26094981fb3c5b7b413bc1b07..594a588097534885e029111254405b615bbf0a20 100644 (file)
@@ -69,7 +69,7 @@ typedef struct _php_shutdown_function_entry {
 } php_shutdown_function_entry;
 
 /* some prototypes for local functions */
-static int user_shutdown_function_dtor(php_shutdown_function_entry *shutdown_function_entry);
+static void user_shutdown_function_dtor(php_shutdown_function_entry *shutdown_function_entry);
 pval test_class_get_property(zend_property_reference *property_reference);
 int test_class_set_property(zend_property_reference *property_reference, pval *value);
 void test_class_call_function(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference);
@@ -326,7 +326,7 @@ zend_module_entry basic_functions_module = {
 
 #if defined(HAVE_PUTENV)
 
-static int php_putenv_destructor(putenv_entry *pe)
+static void php_putenv_destructor(putenv_entry *pe)
 {
        if (pe->previous_value) {
                putenv(pe->previous_value);
@@ -346,7 +346,6 @@ static int php_putenv_destructor(putenv_entry *pe)
        }
        efree(pe->putenv_string);
        efree(pe->key);
-       return 1;
 }
 #endif
 
@@ -405,7 +404,7 @@ PHP_RINIT_FUNCTION(basic)
        BG(page_inode) = -1;
        BG(page_mtime) = -1;
 #ifdef HAVE_PUTENV
-       if (zend_hash_init(&BG(putenv_ht), 1, NULL, (int (*)(void *)) php_putenv_destructor, 0) == FAILURE) {
+       if (zend_hash_init(&BG(putenv_ht), 1, NULL, (void (*)(void *)) php_putenv_destructor, 0) == FAILURE) {
                return FAILURE;
        }
 #endif
@@ -986,7 +985,7 @@ PHP_FUNCTION(call_user_method)
 }
 
 
-int user_shutdown_function_dtor(php_shutdown_function_entry *shutdown_function_entry)
+void user_shutdown_function_dtor(php_shutdown_function_entry *shutdown_function_entry)
 {
        pval retval;
        int i;
@@ -999,7 +998,6 @@ int user_shutdown_function_dtor(php_shutdown_function_entry *shutdown_function_e
                zval_ptr_dtor(&shutdown_function_entry->arguments[i]);
        }
        efree(shutdown_function_entry->arguments);
-       return 1;
 }
 
 
@@ -1034,7 +1032,7 @@ PHP_FUNCTION(register_shutdown_function)
        convert_to_string(shutdown_function_entry.arguments[0]);
        if (!BG(user_shutdown_function_names)) {
                BG(user_shutdown_function_names) = (HashTable *) emalloc(sizeof(HashTable));
-               zend_hash_init(BG(user_shutdown_function_names), 0, NULL, (int (*)(void *))user_shutdown_function_dtor, 0);
+               zend_hash_init(BG(user_shutdown_function_names), 0, NULL, (void (*)(void *))user_shutdown_function_dtor, 0);
        }
 
        for (i=0; i<shutdown_function_entry.arg_count; i++) {
index 60ff1a3dc9d81022177a14ca2a1addd99bda3835..eb7f173e8db9aa12208793fa6fbb91936a580f1f 100644 (file)
@@ -752,17 +752,16 @@ size_t php_sock_fread(char *ptr, size_t size, int socket)
 /* {{{ module start/shutdown functions */
 
        /* {{{ php_msock_destroy */
-int php_msock_destroy(int *data)
+void php_msock_destroy(int *data)
 {
        close(*data);
-       return 1;
 }
 /* }}} */
 
 static void fsock_globals_ctor(FLS_D)
 {
        zend_hash_init(&FG(ht_fsock_keys), 0, NULL, NULL, 1);
-       zend_hash_init(&FG(ht_fsock_socks), 0, NULL, (int (*)(void *))php_msock_destroy, 1);
+       zend_hash_init(&FG(ht_fsock_socks), 0, NULL, (void (*)(void *))php_msock_destroy, 1);
        FG(def_chunk_size) = CHUNK_SIZE;
        FG(phpsockbuf) = NULL;
 }
index 4bebecb09ca3053b60aff676cb0b28b0069064d6..24bbef68109a0924033e56db43a306eef759e5b9 100644 (file)
@@ -71,7 +71,7 @@ void php_sockset_timeout(int socket, struct timeval *timeout);
 int php_sockdestroy(int socket);
 int php_sock_close(int socket);
 size_t php_sock_set_def_chunk_size(size_t size);
-int php_msock_destroy(int *data);
+void php_msock_destroy(int *data);
 
 PHPAPI int connect_nonb(int sockfd, struct sockaddr *addr, socklen_t addrlen, struct timeval *timeout);
 
index 421d1f802bd696c17f1dd827d553cd0abbddc591..bed5eec9018b10ccc581b8d23b137540de241a91 100644 (file)
@@ -86,10 +86,9 @@ static int _php_regcomp(regex_t *preg, const char *pattern, int cflags)
        return r;
 }
 
-static int _free_reg_cache(reg_cache *rc) 
+static void _free_reg_cache(reg_cache *rc) 
 {
        regfree(&rc->preg);
-       return 1;
 }
 
 #undef regfree
@@ -99,7 +98,7 @@ static int _free_reg_cache(reg_cache *rc)
        
 static void php_reg_init_globals(php_reg_globals *reg_globals) 
 {
-       zend_hash_init(&reg_globals->ht_rc, 0, NULL, (int (*)(void *)) _free_reg_cache, 1);
+       zend_hash_init(&reg_globals->ht_rc, 0, NULL, (void (*)(void *)) _free_reg_cache, 1);
 }
 
 static PHP_MINIT_FUNCTION(regex)
index e3830b85c61b253a5e44c573ef83bf2bd2f1bd4f..28b3994b3159ad2ca0293dd5456291cf382cee27 100644 (file)
@@ -124,22 +124,20 @@ static void yyerror(char *str)
 }
 
 
-static int pvalue_config_destructor(pval *pvalue)
+static void pvalue_config_destructor(pval *pvalue)
 {
        if (pvalue->type == IS_STRING && pvalue->value.str.val != empty_string) {
                free(pvalue->value.str.val);
        }
-       return 1;
 }
 
 
-static int pvalue_browscap_destructor(pval *pvalue)
+static void pvalue_browscap_destructor(pval *pvalue)
 {
        if (pvalue->type == IS_OBJECT || pvalue->type == IS_ARRAY) {
                zend_hash_destroy(pvalue->value.ht);
                free(pvalue->value.ht);
        }
-       return 1;
 }
 
 
@@ -147,7 +145,7 @@ int php_init_config(void)
 {
        PLS_FETCH();
 
-       if (zend_hash_init(&configuration_hash, 0, NULL, (int (*)(void *))pvalue_config_destructor, 1)==FAILURE) {
+       if (zend_hash_init(&configuration_hash, 0, NULL, (void (*)(void *))pvalue_config_destructor, 1)==FAILURE) {
                return FAILURE;
        }
 
@@ -246,7 +244,7 @@ PHP_MINIT_FUNCTION(browscap)
        char *browscap = INI_STR("browscap");
 
        if (browscap) {
-               if (zend_hash_init(&browser_hash, 0, NULL, (int (*)(void *))pvalue_browscap_destructor, 1)==FAILURE) {
+               if (zend_hash_init(&browser_hash, 0, NULL, (void (*)(void *))pvalue_browscap_destructor, 1)==FAILURE) {
                        return FAILURE;
                }
 
@@ -461,7 +459,7 @@ statement:
 
                                /*printf("'%s' (%d)\n",$1.value.str.val,$1.value.str.len+1);*/
                                tmp.value.ht = (HashTable *) malloc(sizeof(HashTable));
-                               zend_hash_init(tmp.value.ht, 0, NULL, (int (*)(void *))pvalue_config_destructor, 1);
+                               zend_hash_init(tmp.value.ht, 0, NULL, (void (*)(void *))pvalue_config_destructor, 1);
                                tmp.type = IS_OBJECT;
                                zend_hash_update(activezend_hash_table, $1.value.str.val, $1.value.str.len+1, (void *) &tmp, sizeof(pval), (void **) &current_section);
                                tmp.value.str.val = zend_strndup($1.value.str.val,$1.value.str.len);
index 246312be3875dbf9db5f6e2da2a50de149caad55..0f89fb241f3e5fe531b6629d66630c1d6a0ea5c1 100644 (file)
@@ -389,11 +389,10 @@ int send_parsed_php_source(request_rec * r)
 }
 
 
-static int destroy_per_dir_entry(php_per_dir_entry *per_dir_entry)
+static void destroy_per_dir_entry(php_per_dir_entry *per_dir_entry)
 {
        free(per_dir_entry->key);
        free(per_dir_entry->value);
-       return 1;
 }
 
 static void copy_per_dir_entry(php_per_dir_entry *per_dir_entry)
@@ -421,7 +420,7 @@ static void *php_create_dir(pool *p, char *dummy)
        HashTable *per_dir_info;
 
        per_dir_info = (HashTable *) malloc(sizeof(HashTable));
-       zend_hash_init(per_dir_info, 5, NULL, (int (*)(void *)) destroy_per_dir_entry, 1);
+       zend_hash_init(per_dir_info, 5, NULL, (void (*)(void *)) destroy_per_dir_entry, 1);
        register_cleanup(p, (void *) per_dir_info, (void (*)(void *)) php_destroy_per_dir_info, (void (*)(void *)) zend_hash_destroy);
 
        return per_dir_info;