Fixed hook_id declarations to be gulong instead of guint.
[claws.git] / src / plugins / bsfilter / bsfilter.c
index 9390983f50a45b22735aa80fc63f1c391aa1d200..58e012687c530b07c45c05c62a145c6e81eadfb3 100644 (file)
@@ -81,7 +81,7 @@
 
 #define PLUGIN_NAME (_("Bsfilter"))
 
-static guint hook_id = -1;
+static gulong hook_id = HOOK_NONE;
 static MessageCallback message_callback;
 
 static BsfilterConfig config;
@@ -530,7 +530,7 @@ void bsfilter_set_message_callback(MessageCallback callback)
 gint plugin_init(gchar **error)
 {
        gchar *rcpath;
-       hook_id = -1;
+       hook_id = HOOK_NONE;
 
        if (!check_plugin_version(MAKE_NUMERIC_VERSION(2,9,2,72),
                                VERSION_NUMERIC, PLUGIN_NAME, error))
@@ -592,7 +592,7 @@ FolderItem *bsfilter_get_spam_folder(MsgInfo *msginfo)
 
 gboolean plugin_done(void)
 {
-       if (hook_id != (guint) -1) {
+       if (hook_id != HOOK_NONE) {
                bsfilter_unregister_hook();
        }
 #ifdef USE_PTHREAD
@@ -654,9 +654,9 @@ struct PluginFeature *plugin_provides(void)
 
 void bsfilter_register_hook(void)
 {
-       if (hook_id == (guint) -1)
+       if (hook_id == HOOK_NONE)
                hook_id = hooks_register_hook(MAIL_FILTERING_HOOKLIST, mail_filtering_hook, NULL);
-       if (hook_id == (guint) -1) {
+       if (hook_id == HOOK_NONE) {
                g_warning("Failed to register mail filtering hook");
                config.process_emails = FALSE;
        }
@@ -664,8 +664,8 @@ void bsfilter_register_hook(void)
 
 void bsfilter_unregister_hook(void)
 {
-       if (hook_id != (guint) -1) {
+       if (hook_id != HOOK_NONE) {
                hooks_unregister_hook(MAIL_FILTERING_HOOKLIST, hook_id);
        }
-       hook_id = -1;
+       hook_id = HOOK_NONE;
 }