diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-03-18 14:56:16 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-03-18 14:56:16 +0000 |
commit | 6b2b4167187fee09365271cca182866ecb029af3 (patch) | |
tree | a085717bc896b25ff4280eb86abecca0d5c36767 /src/libserver/logger | |
parent | 47bcfc8360dfa1754474580e779314b8d6a78da6 (diff) | |
download | rspamd-6b2b4167187fee09365271cca182866ecb029af3.tar.gz rspamd-6b2b4167187fee09365271cca182866ecb029af3.zip |
[Rework] Remove some of the GLib types in lieu of standard ones
This types have constant conflicts with the system ones especially on OSX.
Diffstat (limited to 'src/libserver/logger')
-rw-r--r-- | src/libserver/logger/logger.c | 10 | ||||
-rw-r--r-- | src/libserver/logger/logger_file.c | 12 | ||||
-rw-r--r-- | src/libserver/logger/logger_private.h | 8 |
3 files changed, 15 insertions, 15 deletions
diff --git a/src/libserver/logger/logger.c b/src/libserver/logger/logger.c index 2dae6329b..202837563 100644 --- a/src/libserver/logger/logger.c +++ b/src/libserver/logger/logger.c @@ -373,7 +373,7 @@ rspamd_log_write_ringbuffer(rspamd_logger_t *rspamd_log, const gchar *module, const gchar *id, const gchar *data, glong len) { - guint32 row_num; + uint32_t row_num; struct rspamd_logger_error_log *elog; struct rspamd_logger_error_elt *elt; @@ -644,7 +644,7 @@ bool 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, - gint mod_id, const gchar *module, guint64 id, + gint mod_id, const gchar *module, uint64_t id, const gchar *function, const gchar *fmt, ...) { static gchar logbuf[LOGBUF_LEN], idbuf[64]; @@ -725,7 +725,7 @@ void rspamd_log_nodebug(rspamd_logger_t *rspamd_log) rspamd_log->is_debug = FALSE; } -const guint64 * +const uint64_t * rspamd_log_counters(rspamd_logger_t *logger) { if (logger) { @@ -905,7 +905,7 @@ rspamd_log_line_hex_escape(const guchar *src, gsize srclen, static const gchar hexdigests[16] = "0123456789ABCDEF"; gchar *d = dst; - static guint32 escape[] = { + static uint32_t escape[] = { 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ /* ?>=< ;:98 7654 3210 /.-, +*)( '&%$ #"! */ @@ -952,7 +952,7 @@ rspamd_log_line_hex_escape(const guchar *src, gsize srclen, gsize rspamd_log_line_need_escape(const guchar *src, gsize srclen) { - static guint32 escape[] = { + static uint32_t escape[] = { 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */ /* ?>=< ;:98 7654 3210 /.-, +*)( '&%$ #"! */ diff --git a/src/libserver/logger/logger_file.c b/src/libserver/logger/logger_file.c index 20b04b852..f45d61cf1 100644 --- a/src/libserver/logger/logger_file.c +++ b/src/libserver/logger/logger_file.c @@ -27,8 +27,8 @@ struct rspamd_file_logger_priv { gint fd; struct { - guint32 size; - guint32 used; + uint32_t size; + uint32_t used; u_char *buf; } io_buf; gboolean throttling; @@ -36,8 +36,8 @@ struct rspamd_file_logger_priv { gboolean is_buffered; gboolean log_severity; time_t throttling_time; - guint32 repeats; - guint64 last_line_cksum; + uint32_t repeats; + uint64_t last_line_cksum; gchar *saved_message; gsize saved_mlen; gchar *saved_function; @@ -49,7 +49,7 @@ struct rspamd_file_logger_priv { /** * Calculate checksum for log line (used for repeating logic) */ -static inline guint64 +static inline uint64_t rspamd_log_calculate_cksum(const gchar *message, size_t mlen) { return rspamd_cryptobox_fast_hash(message, mlen, rspamd_hash_seed()); @@ -376,7 +376,7 @@ bool rspamd_log_file_log(const gchar *module, const gchar *id, { struct rspamd_file_logger_priv *priv = (struct rspamd_file_logger_priv *) arg; gdouble now; - guint64 cksum; + uint64_t cksum; gboolean got_time = FALSE; diff --git a/src/libserver/logger/logger_private.h b/src/libserver/logger/logger_private.h index 234a207e5..d155bdcb0 100644 --- a/src/libserver/logger/logger_private.h +++ b/src/libserver/logger/logger_private.h @@ -48,10 +48,10 @@ struct rspamd_logger_error_elt { struct rspamd_logger_error_log { struct rspamd_logger_error_elt *elts; rspamd_mempool_t *pool; - guint32 max_elts; - guint32 elt_len; + uint32_t max_elts; + uint32_t elt_len; /* Avoid false cache sharing */ - guchar __padding[64 - sizeof(gpointer) * 2 - sizeof(guint64)]; + guchar __padding[64 - sizeof(gpointer) * 2 - sizeof(uint64_t)]; guint cur_row; }; @@ -78,7 +78,7 @@ struct rspamd_logger_s { struct rspamd_radix_map_helper *debug_ip; rspamd_mempool_mutex_t *mtx; rspamd_mempool_t *pool; - guint64 log_cnt[4]; + uint64_t log_cnt[4]; }; /* |