From 6d11468059eecb5cf7592e0cdd08910b99bed3fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 16 Mar 2025 15:47:18 +0100 Subject: [PATCH] spell: rename variable "broker" to "spell_enchant_broker" --- src/plugins/spell/spell-command.c | 3 ++- src/plugins/spell/spell-completion.c | 2 +- src/plugins/spell/spell-speller.c | 6 +++--- src/plugins/spell/spell.c | 14 ++++++++------ src/plugins/spell/spell.h | 2 +- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/plugins/spell/spell-command.c b/src/plugins/spell/spell-command.c index 35da2df22..f5c400474 100644 --- a/src/plugins/spell/spell-command.c +++ b/src/plugins/spell/spell-command.c @@ -153,7 +153,8 @@ spell_command_speller_list_dicts (void) SPELL_PLUGIN_NAME); #ifdef USE_ENCHANT - enchant_broker_list_dicts (broker, spell_enchant_dict_describe_cb, + enchant_broker_list_dicts (spell_enchant_broker, + spell_enchant_dict_describe_cb, NULL); #else config = new_aspell_config (); diff --git a/src/plugins/spell/spell-completion.c b/src/plugins/spell/spell-completion.c index c7d9d5448..c93cde05e 100644 --- a/src/plugins/spell/spell-completion.c +++ b/src/plugins/spell/spell-completion.c @@ -102,7 +102,7 @@ spell_completion_dicts_cb (const void *pointer, void *data, (void) buffer; #ifdef USE_ENCHANT - enchant_broker_list_dicts (broker, + enchant_broker_list_dicts (spell_enchant_broker, spell_completion_enchant_add_dict_cb, completion); #else diff --git a/src/plugins/spell/spell-speller.c b/src/plugins/spell/spell-speller.c index 7e8b3c803..482edb420 100644 --- a/src/plugins/spell/spell-speller.c +++ b/src/plugins/spell/spell-speller.c @@ -54,7 +54,7 @@ int spell_speller_dict_supported (const char *lang) { #ifdef USE_ENCHANT - return enchant_broker_dict_exists (broker, lang); + return enchant_broker_dict_exists (spell_enchant_broker, lang); #else struct AspellConfig *config; AspellDictInfoList *list; @@ -164,7 +164,7 @@ spell_speller_new (const char *lang) } #ifdef USE_ENCHANT - new_speller = enchant_broker_request_dict (broker, lang); + new_speller = enchant_broker_request_dict (spell_enchant_broker, lang); if (!new_speller) { weechat_printf (NULL, @@ -353,7 +353,7 @@ spell_speller_free_value_cb (struct t_hashtable *hashtable, /* free speller */ #ifdef USE_ENCHANT ptr_speller = (EnchantDict *)value; - enchant_broker_free_dict (broker, ptr_speller); + enchant_broker_free_dict (spell_enchant_broker, ptr_speller); #else ptr_speller = (AspellSpeller *)value; aspell_speller_save_all_word_lists (ptr_speller); diff --git a/src/plugins/spell/spell.c b/src/plugins/spell/spell.c index 10a7e0c26..9e6848168 100644 --- a/src/plugins/spell/spell.c +++ b/src/plugins/spell/spell.c @@ -58,7 +58,7 @@ char *spell_nick_completer = NULL; int spell_len_nick_completer = 0; #ifdef USE_ENCHANT -EnchantBroker *broker = NULL; +EnchantBroker *spell_enchant_broker = NULL; #endif /* USE_ENCHANT */ /* @@ -1177,11 +1177,13 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) #ifdef USE_ENCHANT /* acquire enchant broker */ - broker = enchant_broker_init (); - if (!broker) + spell_enchant_broker = enchant_broker_init (); + if (!spell_enchant_broker) return WEECHAT_RC_ERROR; #ifdef ENCHANT_MYSPELL_DICT_DIR - enchant_broker_set_param(broker, "enchant.myspell.dictionary.path", ENCHANT_MYSPELL_DICT_DIR); + enchant_broker_set_param(spell_enchant_broker, + "enchant.myspell.dictionary.path", + ENCHANT_MYSPELL_DICT_DIR); #endif #endif /* USE_ENCHANT */ @@ -1247,8 +1249,8 @@ weechat_plugin_end (struct t_weechat_plugin *plugin) #ifdef USE_ENCHANT /* release enchant broker */ - enchant_broker_free (broker); - broker = NULL; + enchant_broker_free (spell_enchant_broker); + spell_enchant_broker = NULL; #endif /* USE_ENCHANT */ if (spell_nick_completer) diff --git a/src/plugins/spell/spell.h b/src/plugins/spell/spell.h index 3d5950197..1e90948c0 100644 --- a/src/plugins/spell/spell.h +++ b/src/plugins/spell/spell.h @@ -38,7 +38,7 @@ struct t_spell_code }; #ifdef USE_ENCHANT -extern EnchantBroker *broker; +extern EnchantBroker *spell_enchant_broker; #endif /* USE_ENCHANT */ extern struct t_weechat_plugin *weechat_spell_plugin;