Skip to content

Commit

Permalink
Remove useless code in ext-enchant (#16940)
Browse files Browse the repository at this point in the history
The MSHUTDOWN() does nothing, and the GET_BROKER macros are duplicated.
  • Loading branch information
nielsdos authored Nov 26, 2024
1 parent ba6c005 commit afa08b5
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions ext/enchant/enchant.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ zend_module_entry enchant_module_entry = {
"enchant",
ext_functions,
PHP_MINIT(enchant),
PHP_MSHUTDOWN(enchant),
NULL,
NULL, /* Replace with NULL if there's nothing to do at request start */
NULL, /* Replace with NULL if there's nothing to do at request end */
PHP_MINFO(enchant),
Expand Down Expand Up @@ -213,13 +213,6 @@ PHP_MINIT_FUNCTION(enchant)
}
/* }}} */

/* {{{ PHP_MSHUTDOWN_FUNCTION */
PHP_MSHUTDOWN_FUNCTION(enchant)
{
return SUCCESS;
}
/* }}} */

static void __enumerate_providers_fn (const char * const name,
const char * const desc,
const char * const file,
Expand Down Expand Up @@ -353,13 +346,11 @@ PHP_FUNCTION(enchant_broker_set_dict_path)

switch (dict_type) {
case PHP_ENCHANT_MYSPELL:
PHP_ENCHANT_GET_BROKER;
enchant_broker_set_param(pbroker->pbroker, "enchant.myspell.dictionary.path", (const char *)value);
RETURN_TRUE;
break;

case PHP_ENCHANT_ISPELL:
PHP_ENCHANT_GET_BROKER;
enchant_broker_set_param(pbroker->pbroker, "enchant.ispell.dictionary.path", (const char *)value);
RETURN_TRUE;
break;
Expand Down Expand Up @@ -389,12 +380,10 @@ PHP_FUNCTION(enchant_broker_get_dict_path)

switch (dict_type) {
case PHP_ENCHANT_MYSPELL:
PHP_ENCHANT_GET_BROKER;
value = enchant_broker_get_param(pbroker->pbroker, "enchant.myspell.dictionary.path");
break;

case PHP_ENCHANT_ISPELL:
PHP_ENCHANT_GET_BROKER;
value = enchant_broker_get_param(pbroker->pbroker, "enchant.ispell.dictionary.path");
break;

Expand Down

0 comments on commit afa08b5

Please sign in to comment.