summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend_compile.c5
-rw-r--r--Zend/zend_compile.h8
-rw-r--r--Zend/zend_constants.c3
-rw-r--r--Zend/zend_constants.h4
-rw-r--r--Zend/zend_execute_API.c3
-rw-r--r--Zend/zend_hash.c15
-rw-r--r--Zend/zend_hash.h14
-rw-r--r--Zend/zend_list.c6
-rw-r--r--Zend/zend_list.h4
-rw-r--r--Zend/zend_modules.h2
-rw-r--r--Zend/zend_opcode.c8
-rw-r--r--Zend/zend_variables.c13
-rw-r--r--Zend/zend_variables.h12
-rw-r--r--ext/ereg/ereg.c5
-rw-r--r--ext/pcre/php_pcre.c3
-rw-r--r--ext/standard/basic_functions.c12
-rw-r--r--ext/standard/fsock.c5
-rw-r--r--ext/standard/fsock.h2
-rw-r--r--ext/standard/reg.c5
-rw-r--r--main/configuration-parser.y12
-rw-r--r--sapi/apache/mod_php4.c5
21 files changed, 62 insertions, 84 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index badda32a90..48f5eafcde 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -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);
}
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 2b95d352fe..59ffd41009 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -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);
diff --git a/Zend/zend_constants.c b/Zend/zend_constants.c
index 6ac7a25fbd..0b95f9f66b 100644
--- a/Zend/zend_constants.c
+++ b/Zend/zend_constants.c
@@ -25,13 +25,12 @@
#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;
}
diff --git a/Zend/zend_constants.h b/Zend/zend_constants.h
index 9722979f94..9ebb7409a0 100644
--- a/Zend/zend_constants.h
+++ b/Zend/zend_constants.h
@@ -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
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 8e3c1fcf93..1d06a76e7f 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -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;
}
diff --git a/Zend/zend_hash.c b/Zend/zend_hash.c
index db53b4ab04..f14da0efe9 100644
--- a/Zend/zend_hash.c
+++ b/Zend/zend_hash.c
@@ -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);
diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h
index 60ac82d65c..c91f2f4166 100644
--- a/Zend/zend_hash.h
+++ b/Zend/zend_hash.h
@@ -34,6 +34,11 @@
#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);
diff --git a/Zend/zend_list.c b/Zend/zend_list.c
index 570ceb31b0..1d64603d33 100644
--- a/Zend/zend_list.c
+++ b/Zend/zend_list.c
@@ -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;
}
diff --git a/Zend/zend_list.h b/Zend/zend_list.h
index 816b52e398..c306fc1940 100644
--- a/Zend/zend_list.h
+++ b/Zend/zend_list.h
@@ -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);
diff --git a/Zend/zend_modules.h b/Zend/zend_modules.h
index e028ef2e4f..b9b5ac85c5 100644
--- a/Zend/zend_modules.h
+++ b/Zend/zend_modules.h
@@ -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
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 3f40aad847..4ca0b43eed 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -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;
}
diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c
index ae795524cd..99bf710936 100644
--- a/Zend/zend_variables.c
+++ b/Zend/zend_variables.c
@@ -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);
}
diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h
index 312939c582..b2488fb3e0 100644
--- a/Zend/zend_variables.h
+++ b/Zend/zend_variables.h
@@ -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);
diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c
index 421d1f802b..bed5eec901 100644
--- a/ext/ereg/ereg.c
+++ b/ext/ereg/ereg.c
@@ -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)
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 2624084184..1a16bc5705 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -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;
}
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index a8b1d4dc42..594a588097 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -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++) {
diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c
index 60ff1a3dc9..eb7f173e8d 100644
--- a/ext/standard/fsock.c
+++ b/ext/standard/fsock.c
@@ -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;
}
diff --git a/ext/standard/fsock.h b/ext/standard/fsock.h
index 4bebecb09c..24bbef6810 100644
--- a/ext/standard/fsock.h
+++ b/ext/standard/fsock.h
@@ -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);
diff --git a/ext/standard/reg.c b/ext/standard/reg.c
index 421d1f802b..bed5eec901 100644
--- a/ext/standard/reg.c
+++ b/ext/standard/reg.c
@@ -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)
diff --git a/main/configuration-parser.y b/main/configuration-parser.y
index e3830b85c6..28b3994b31 100644
--- a/main/configuration-parser.y
+++ b/main/configuration-parser.y
@@ -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);
diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c
index 246312be38..0f89fb241f 100644
--- a/sapi/apache/mod_php4.c
+++ b/sapi/apache/mod_php4.c
@@ -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;