diff options
-rw-r--r-- | ext/ereg/ereg.c | 5 | ||||
-rw-r--r-- | ext/pcre/php_pcre.c | 3 | ||||
-rw-r--r-- | ext/standard/basic_functions.c | 12 | ||||
-rw-r--r-- | ext/standard/reg.c | 5 | ||||
-rw-r--r-- | main/configuration-parser.y | 12 |
5 files changed, 22 insertions, 15 deletions
diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c index b01f659bdd..7c8fac5758 100644 --- a/ext/ereg/ereg.c +++ b/ext/ereg/ereg.c @@ -98,9 +98,10 @@ static int _php_regcomp(regex_t *preg, const char *pattern, int cflags) return r; } -static void _free_reg_cache(reg_cache *rc) +static int _free_reg_cache(reg_cache *rc) { regfree(&rc->preg); + return 1; } #define regfree(a); @@ -108,7 +109,7 @@ static void _free_reg_cache(reg_cache *rc) static void php_reg_init_globals(php_reg_globals *reg_globals) { - _php3_hash_init(®_globals->ht_rc, 0, NULL, (void (*)(void *)) _free_reg_cache, 1); + _php3_hash_init(®_globals->ht_rc, 0, NULL, (int (*)(void *)) _free_reg_cache, 1); } static int php_minit_regex(INIT_FUNC_ARGS) diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 5b838ec055..ed1245cf02 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -84,10 +84,11 @@ static void php_pcre_free(void *ptr) } -static void _php_free_pcre_cache(void *data) +static int _php_free_pcre_cache(void *data) { pcre_cache_entry *pce = (pcre_cache_entry *) data; pefree(pce->re, 1); + return 1; } diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index d182714053..6333f7b4d1 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -64,7 +64,7 @@ static pval *user_compare_func_name; static HashTable *user_shutdown_function_names; /* some prototypes for local functions */ -void user_shutdown_function_dtor(pval *user_shutdown_function_name); +int user_shutdown_function_dtor(pval *user_shutdown_function_name); int user_shutdown_function_executor(pval *user_shutdown_function_name); void php3_call_shutdown_functions(void); @@ -332,7 +332,7 @@ php3_module_entry basic_functions_module = { #ifdef HAVE_PUTENV static HashTable putenv_ht; -static void _php3_putenv_destructor(putenv_entry *pe) +static int _php3_putenv_destructor(putenv_entry *pe) { if (pe->previous_value) { putenv(pe->previous_value); @@ -352,6 +352,7 @@ static void _php3_putenv_destructor(putenv_entry *pe) } efree(pe->putenv_string); efree(pe->key); + return 1; } #endif @@ -395,7 +396,7 @@ int php3_rinit_basic(INIT_FUNC_ARGS) { strtok_string = NULL; #ifdef HAVE_PUTENV - if (_php3_hash_init(&putenv_ht, 1, NULL, (void (*)(void *)) _php3_putenv_destructor, 0) == FAILURE) { + if (_php3_hash_init(&putenv_ht, 1, NULL, (int (*)(void *)) _php3_putenv_destructor, 0) == FAILURE) { return FAILURE; } #endif @@ -1776,7 +1777,7 @@ PHP_FUNCTION(call_user_method) } -void user_shutdown_function_dtor(pval *user_shutdown_function_name) +int user_shutdown_function_dtor(pval *user_shutdown_function_name) { pval retval; CLS_FETCH(); @@ -1785,6 +1786,7 @@ void user_shutdown_function_dtor(pval *user_shutdown_function_name) pval_destructor(&retval); } pval_destructor(user_shutdown_function_name); + return 1; } @@ -1809,7 +1811,7 @@ PHP_FUNCTION(register_shutdown_function) convert_to_string(arg); if (!user_shutdown_function_names) { user_shutdown_function_names = (HashTable *) emalloc(sizeof(HashTable)); - _php3_hash_init(user_shutdown_function_names, 0, NULL, (void (*)(void *))user_shutdown_function_dtor, 0); + _php3_hash_init(user_shutdown_function_names, 0, NULL, (int (*)(void *))user_shutdown_function_dtor, 0); } shutdown_function_name = *arg; diff --git a/ext/standard/reg.c b/ext/standard/reg.c index b01f659bdd..7c8fac5758 100644 --- a/ext/standard/reg.c +++ b/ext/standard/reg.c @@ -98,9 +98,10 @@ static int _php_regcomp(regex_t *preg, const char *pattern, int cflags) return r; } -static void _free_reg_cache(reg_cache *rc) +static int _free_reg_cache(reg_cache *rc) { regfree(&rc->preg); + return 1; } #define regfree(a); @@ -108,7 +109,7 @@ static void _free_reg_cache(reg_cache *rc) static void php_reg_init_globals(php_reg_globals *reg_globals) { - _php3_hash_init(®_globals->ht_rc, 0, NULL, (void (*)(void *)) _free_reg_cache, 1); + _php3_hash_init(®_globals->ht_rc, 0, NULL, (int (*)(void *)) _free_reg_cache, 1); } static int php_minit_regex(INIT_FUNC_ARGS) diff --git a/main/configuration-parser.y b/main/configuration-parser.y index fecfc323df..c2c9102a5b 100644 --- a/main/configuration-parser.y +++ b/main/configuration-parser.y @@ -138,20 +138,22 @@ static void yyerror(char *str) } -static void pvalue_config_destructor(pval *pvalue) +static int pvalue_config_destructor(pval *pvalue) { if (pvalue->type == IS_STRING && pvalue->value.str.val != empty_string) { free(pvalue->value.str.val); } + return 1; } -static void pvalue_browscap_destructor(pval *pvalue) +static int pvalue_browscap_destructor(pval *pvalue) { if (pvalue->type == IS_OBJECT || pvalue->type == IS_ARRAY) { _php3_hash_destroy(pvalue->value.ht); free(pvalue->value.ht); } + return 1; } @@ -159,7 +161,7 @@ int php3_init_config(void) { PLS_FETCH(); - if (_php3_hash_init(&configuration_hash, 0, NULL, (void (*)(void *))pvalue_config_destructor, 1)==FAILURE) { + if (_php3_hash_init(&configuration_hash, 0, NULL, (int (*)(void *))pvalue_config_destructor, 1)==FAILURE) { return FAILURE; } @@ -258,7 +260,7 @@ int php3_minit_browscap(INIT_FUNC_ARGS) char *browscap = INI_STR("browscap"); if (browscap) { - if (_php3_hash_init(&browser_hash, 0, NULL, (void (*)(void *))pvalue_browscap_destructor, 1)==FAILURE) { + if (_php3_hash_init(&browser_hash, 0, NULL, (int (*)(void *))pvalue_browscap_destructor, 1)==FAILURE) { return FAILURE; } @@ -411,7 +413,7 @@ statement: /*printf("'%s' (%d)\n",$1.value.str.val,$1.value.str.len+1);*/ tmp.value.ht = (HashTable *) malloc(sizeof(HashTable)); - _php3_hash_init(tmp.value.ht, 0, NULL, (void (*)(void *))pvalue_config_destructor, 1); + _php3_hash_init(tmp.value.ht, 0, NULL, (int (*)(void *))pvalue_config_destructor, 1); tmp.type = IS_OBJECT; _php3_hash_update(active__php3_hash_table, $1.value.str.val, $1.value.str.len+1, (void *) &tmp, sizeof(pval), (void **) ¤t_section); tmp.value.str.val = php3_strndup($1.value.str.val,$1.value.str.len); |