summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-03-18 14:56:16 +0000
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-03-18 14:56:16 +0000
commit6b2b4167187fee09365271cca182866ecb029af3 (patch)
treea085717bc896b25ff4280eb86abecca0d5c36767 /src/plugins
parent47bcfc8360dfa1754474580e779314b8d6a78da6 (diff)
downloadrspamd-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/plugins')
-rw-r--r--src/plugins/chartable.cxx8
-rw-r--r--src/plugins/dkim_check.c8
-rw-r--r--src/plugins/fuzzy_check.c26
-rw-r--r--src/plugins/regexp.c4
4 files changed, 23 insertions, 23 deletions
diff --git a/src/plugins/chartable.cxx b/src/plugins/chartable.cxx
index 704f12ab7..172242ba3 100644
--- a/src/plugins/chartable.cxx
+++ b/src/plugins/chartable.cxx
@@ -1,11 +1,11 @@
-/*-
- * Copyright 2016 Vsevolod Stakhov
+/*
+ * Copyright 2024 Vsevolod Stakhov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -1725,7 +1725,7 @@ rspamd_chartable_process_word_utf(struct rspamd_task *task,
while (p < end) {
uc = *p++;
- if (((gint32) uc) < 0) {
+ if (((int32_t) uc) < 0) {
break;
}
diff --git a/src/plugins/dkim_check.c b/src/plugins/dkim_check.c
index 29ab34d74..1e1b13c73 100644
--- a/src/plugins/dkim_check.c
+++ b/src/plugins/dkim_check.c
@@ -1,11 +1,11 @@
-/*-
- * Copyright 2016 Vsevolod Stakhov
+/*
+ * Copyright 2024 Vsevolod Stakhov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -695,7 +695,7 @@ static gint
lua_dkim_sign_handler(lua_State *L)
{
struct rspamd_task *task = lua_check_task(L, 1);
- gint64 arc_idx = 0, expire = 0;
+ int64_t arc_idx = 0, expire = 0;
enum rspamd_dkim_type sign_type = RSPAMD_DKIM_NORMAL;
GError *err = NULL;
GString *hdr;
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c
index 15f556c40..0bc7bd69d 100644
--- a/src/plugins/fuzzy_check.c
+++ b/src/plugins/fuzzy_check.c
@@ -63,7 +63,7 @@ static const gchar *M = "fuzzy check";
struct fuzzy_ctx;
struct fuzzy_mapping {
- guint64 fuzzy_flag;
+ uint64_t fuzzy_flag;
const gchar *symbol;
double weight;
};
@@ -89,7 +89,7 @@ struct fuzzy_rule {
gboolean no_share;
gboolean no_subject;
gint learn_condition_cb;
- guint32 retransmits;
+ uint32_t retransmits;
struct rspamd_hash_map_helper *skip_map;
struct fuzzy_ctx *ctx;
gint lua_id;
@@ -109,7 +109,7 @@ struct fuzzy_ctx {
gint check_mime_part_ref; /* Lua callback */
gint process_rule_ref; /* Lua callback */
gint cleanup_rules_ref;
- guint32 retransmits;
+ uint32_t retransmits;
gboolean enabled;
};
@@ -170,8 +170,8 @@ struct fuzzy_learn_session {
#define FUZZY_CHECK_FLAG_NOTEXT (1 << 2)
struct fuzzy_cmd_io {
- guint32 tag;
- guint32 flags;
+ uint32_t tag;
+ uint32_t flags;
struct iovec io;
struct rspamd_mime_part *part;
struct rspamd_fuzzy_cmd cmd;
@@ -297,7 +297,7 @@ parse_fuzzy_headers(struct rspamd_config *cfg, const gchar *str)
}
static double
-fuzzy_normalize(gint32 in, double weight)
+fuzzy_normalize(int32_t in, double weight)
{
if (weight == 0) {
return 0;
@@ -1335,7 +1335,7 @@ static struct fuzzy_cmd_io *
fuzzy_cmd_stat(struct fuzzy_rule *rule,
int c,
gint flag,
- guint32 weight,
+ uint32_t weight,
rspamd_mempool_t *pool)
{
struct rspamd_fuzzy_cmd *cmd;
@@ -1431,7 +1431,7 @@ fuzzy_cmd_hash(struct fuzzy_rule *rule,
int c,
const rspamd_ftok_t *hash,
gint flag,
- guint32 weight,
+ uint32_t weight,
rspamd_mempool_t *pool)
{
struct rspamd_fuzzy_cmd *cmd;
@@ -1708,7 +1708,7 @@ fuzzy_cmd_from_text_part(struct rspamd_task *task,
struct fuzzy_rule *rule,
int c,
gint flag,
- guint32 weight,
+ uint32_t weight,
gboolean short_text,
struct rspamd_mime_text_part *part,
struct rspamd_mime_part *mp)
@@ -1940,7 +1940,7 @@ static struct fuzzy_cmd_io *
fuzzy_cmd_from_image_part (struct fuzzy_rule *rule,
int c,
gint flag,
- guint32 weight,
+ uint32_t weight,
struct rspamd_task *task,
struct rspamd_image *img,
struct rspamd_mime_part *mp)
@@ -2038,7 +2038,7 @@ static struct fuzzy_cmd_io *
fuzzy_cmd_from_data_part(struct fuzzy_rule *rule,
int c,
gint flag,
- guint32 weight,
+ uint32_t weight,
struct rspamd_task *task,
guchar digest[rspamd_cryptobox_HASHBYTES],
struct rspamd_mime_part *mp)
@@ -2477,7 +2477,7 @@ fuzzy_check_try_read(struct fuzzy_client_session *session)
g_hash_table_insert(stats_hash, (char *) pval->name, pval);
}
- pval->fuzzy_cnt = (((guint64) rep->v1.value) << 32) + rep->v1.flag;
+ pval->fuzzy_cnt = (((uint64_t) rep->v1.value) << 32) + rep->v1.flag;
}
}
else if (rep->v1.value == 403) {
@@ -3089,7 +3089,7 @@ cleanup:
static GPtrArray *
fuzzy_generate_commands(struct rspamd_task *task, struct fuzzy_rule *rule,
- gint c, gint flag, guint32 value, guint flags)
+ gint c, gint flag, uint32_t value, guint flags)
{
struct rspamd_mime_text_part *part;
struct rspamd_mime_part *mime_part;
diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c
index 83d2fc963..510e1f70b 100644
--- a/src/plugins/regexp.c
+++ b/src/plugins/regexp.c
@@ -25,10 +25,10 @@
#include "libserver/maps/map.h"
#include "lua/lua_common.h"
-static const guint64 rspamd_regexp_cb_magic = 0xca9d9649fc3e2659ULL;
+static const uint64_t rspamd_regexp_cb_magic = 0xca9d9649fc3e2659ULL;
struct regexp_module_item {
- guint64 magic;
+ uint64_t magic;
struct rspamd_expression *expr;
const gchar *symbol;
struct ucl_lua_funcdata *lua_function;