]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Finish transition to signed log id
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 27 Sep 2021 14:14:45 +0000 (15:14 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 27 Sep 2021 14:14:45 +0000 (15:14 +0100)
src/libserver/css/css.hxx
src/libserver/logger.h
src/libserver/logger/logger.c
src/libstat/classifiers/classifiers.h

index 2d1ece7576494670b2047eab742077d67a2d282a..7768bde5531628f1818ac850f5c51aae1534ae43 100644 (file)
@@ -32,7 +32,7 @@ struct html_block;
 
 namespace rspamd::css {
 
-extern unsigned int rspamd_css_log_id;
+extern int rspamd_css_log_id;
 
 #define msg_debug_css(...)  rspamd_conditional_debug_fast (NULL, NULL, \
         rspamd_css_log_id, "css", pool->tag.uid, \
index b646aa3fd68fc7501e87dfbdd5017f794527d8d5..8f1177666ddf4f259a9ae9321e52d1d2a5f98d6b 100644 (file)
@@ -156,14 +156,14 @@ gint rspamd_logger_add_debug_module (const gchar *mod);
  * Macro to use for faster debug modules
  */
 #define INIT_LOG_MODULE(mname) \
-    static guint rspamd_##mname##_log_id = (guint)-1; \
+    static gint rspamd_##mname##_log_id = -1; \
     RSPAMD_CONSTRUCTOR(rspamd_##mname##_log_init) { \
         rspamd_##mname##_log_id = rspamd_logger_add_debug_module(#mname); \
 }
 
 
 #define INIT_LOG_MODULE_PUBLIC(mname) \
-    guint rspamd_##mname##_log_id = (guint)-1; \
+    gint rspamd_##mname##_log_id = -1; \
     RSPAMD_CONSTRUCTOR(rspamd_##mname##_log_init) { \
         rspamd_##mname##_log_id = rspamd_logger_add_debug_module(#mname); \
 }
@@ -179,17 +179,17 @@ bool rspamd_conditional_debug (rspamd_logger_t *logger,
 
 bool rspamd_conditional_debug_fast (rspamd_logger_t *logger,
                                                                        rspamd_inet_addr_t *addr,
-                                                                       guint mod_id,
+                                                                       gint mod_id,
                                                                        const gchar *module, const gchar *id,
                                                                        const gchar *function, const gchar *fmt, ...);
 bool rspamd_conditional_debug_fast_num_id (rspamd_logger_t *logger,
                                                                        rspamd_inet_addr_t *addr,
-                                                                       guint mod_id,
+                                                                       gint mod_id,
                                                                        const gchar *module, guint64 id,
                                                                        const gchar *function, const gchar *fmt, ...);
 gboolean rspamd_logger_need_log (rspamd_logger_t *rspamd_log,
                                                                 GLogLevelFlags log_level,
-                                                                guint module_id);
+                                                                gint module_id);
 
 /**
  * Function with variable number of arguments support that uses static default logger
index 4fdfd3cbaff12d6bc771f8126485fc7b92d1467c..846c6d3a9e8fbd3258f9ae8d79a45110ca573ae0 100644 (file)
@@ -319,7 +319,7 @@ rspamd_log_on_fork (GQuark ptype, struct rspamd_config *cfg,
 
 inline gboolean
 rspamd_logger_need_log (rspamd_logger_t *rspamd_log, GLogLevelFlags log_level,
-               guint module_id)
+               gint module_id)
 {
        g_assert (rspamd_log != NULL);
 
@@ -328,7 +328,7 @@ rspamd_logger_need_log (rspamd_logger_t *rspamd_log, GLogLevelFlags log_level,
                return TRUE;
        }
 
-       if (module_id != (guint)-1 && isset (log_modules->bitset, module_id)) {
+       if (module_id != -1 && isset (log_modules->bitset, module_id)) {
                return TRUE;
        }
 
@@ -582,7 +582,7 @@ rspamd_conditional_debug (rspamd_logger_t *rspamd_log,
        static gchar logbuf[LOGBUF_LEN];
        va_list vp;
        gchar *end;
-       guint mod_id;
+       gint mod_id;
 
        if (rspamd_log == NULL) {
                rspamd_log = default_logger;
@@ -618,7 +618,7 @@ rspamd_conditional_debug (rspamd_logger_t *rspamd_log,
 bool
 rspamd_conditional_debug_fast (rspamd_logger_t *rspamd_log,
                rspamd_inet_addr_t *addr,
-               guint mod_id, const gchar *module, const gchar *id,
+               gint mod_id, const gchar *module, const gchar *id,
                const gchar *function, const gchar *fmt, ...)
 {
        static gchar logbuf[LOGBUF_LEN];
@@ -657,7 +657,7 @@ rspamd_conditional_debug_fast (rspamd_logger_t *rspamd_log,
 bool
 rspamd_conditional_debug_fast_num_id (rspamd_logger_t *rspamd_log,
                                                           rspamd_inet_addr_t *addr,
-                                                          guint mod_id, const gchar *module, guint64 id,
+                                                          gint mod_id, const gchar *module, guint64 id,
                                                           const gchar *function, const gchar *fmt, ...)
 {
        static gchar logbuf[LOGBUF_LEN], idbuf[64];
index 4e159fb1347f4a1b77c64735b794cffa6b986565..32473cdd1fe94dc5608a557f9c411e569bffd40a 100644 (file)
@@ -75,7 +75,7 @@ gboolean lua_classifier_learn_spam (struct rspamd_classifier *ctx,
                                                                        gboolean unlearn,
                                                                        GError **err);
 
-extern guint rspamd_bayes_log_id;
+extern gint rspamd_bayes_log_id;
 #define msg_debug_bayes(...)  rspamd_conditional_debug_fast (NULL, task->from_addr, \
         rspamd_bayes_log_id, "bayes", task->task_pool->tag.uid, \
         G_STRFUNC, \