aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-08-04 20:31:24 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-08-04 20:31:24 +0400
commit3f96e6a7a317e70b85b32de4aa06681c11d79006 (patch)
tree70343e3fb1a43d29d9c4f454fa47b2dcad6249ad /src/plugins
parent6b86782ce21caad081d41f54ef10233a8e757189 (diff)
downloadrspamd-3f96e6a7a317e70b85b32de4aa06681c11d79006.tar.gz
rspamd-3f96e6a7a317e70b85b32de4aa06681c11d79006.zip
Fix signness in arithmetic operations.
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/chartable.c2
-rw-r--r--src/plugins/fuzzy_check.c10
-rw-r--r--src/plugins/regexp.c8
-rw-r--r--src/plugins/surbl.c8
4 files changed, 14 insertions, 14 deletions
diff --git a/src/plugins/chartable.c b/src/plugins/chartable.c
index cdf7e3e4e..6458b3e2d 100644
--- a/src/plugins/chartable.c
+++ b/src/plugins/chartable.c
@@ -146,7 +146,7 @@ check_part (struct mime_text_part *part, gboolean raw_mode)
}
scc = g_unichar_get_script (c);
- if (scc < G_N_ELEMENTS (scripts)) {
+ if (scc < (gint)G_N_ELEMENTS (scripts)) {
scripts[scc] ++;
}
p1 = g_utf8_next_char (p);
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c
index 0e581e41f..622d169fa 100644
--- a/src/plugins/fuzzy_check.c
+++ b/src/plugins/fuzzy_check.c
@@ -84,13 +84,13 @@ struct fuzzy_ctx {
gint servers_num;
memory_pool_t *fuzzy_pool;
double max_score;
- gint32 min_hash_len;
+ guint32 min_hash_len;
radix_tree_t *whitelist;
GHashTable *mappings;
GList *mime_types;
- gint32 min_bytes;
- gint32 min_height;
- gint32 min_width;
+ guint32 min_bytes;
+ guint32 min_height;
+ guint32 min_width;
guint32 io_timeout;
};
@@ -240,7 +240,7 @@ parse_servers_string (gchar *str)
if ((p = strchr (strvec[i], ':')) != NULL) {
j = 0;
p++;
- while (g_ascii_isdigit (*(p + j)) && j < sizeof (portbuf) - 1) {
+ while (g_ascii_isdigit (*(p + j)) && j < (gint)sizeof (portbuf) - 1) {
portbuf[j] = *(p + j);
j++;
}
diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c
index 644522d87..008d85f39 100644
--- a/src/plugins/regexp.c
+++ b/src/plugins/regexp.c
@@ -169,7 +169,7 @@ parse_regexp_ipmask (const gchar *begin, struct dynamic_map_item *addr)
break;
case 1:
/* Begin parse ip */
- if (p - ip_buf >= sizeof (ip_buf) || dots > 3) {
+ if (p - ip_buf >= (gint)sizeof (ip_buf) || dots > 3) {
return FALSE;
}
if (g_ascii_isdigit (*pos)) {
@@ -254,10 +254,10 @@ read_regexp_expression (memory_pool_t * pool, struct regexp_module_item *chain,
/* Callbacks for reading json dynamic rules */
gchar *
-json_regexp_read_cb (memory_pool_t * pool, gchar * chunk, size_t len, struct map_cb_data *data)
+json_regexp_read_cb (memory_pool_t * pool, gchar * chunk, gint len, struct map_cb_data *data)
{
struct regexp_json_buf *jb;
- size_t free, off;
+ gint free, off;
if (data->cur_data == NULL) {
jb = g_malloc (sizeof (struct regexp_json_buf));
@@ -297,7 +297,7 @@ void
json_regexp_fin_cb (memory_pool_t * pool, struct map_cb_data *data)
{
struct regexp_json_buf *jb;
- gint nelts, i, j;
+ guint nelts, i, j;
json_t *js, *cur_elt, *cur_nm, *it_val;
json_error_t je;
gchar *cur_rule, *cur_symbol;
diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c
index 700c86ad1..d0a51d59b 100644
--- a/src/plugins/surbl.c
+++ b/src/plugins/surbl.c
@@ -105,7 +105,7 @@ exception_insert (gpointer st, gconstpointer key, gpointer value)
}
static gchar *
-read_exceptions_list (memory_pool_t * pool, gchar * chunk, size_t len, struct map_cb_data *data)
+read_exceptions_list (memory_pool_t * pool, gchar * chunk, gint len, struct map_cb_data *data)
{
if (data->cur_data == NULL) {
data->cur_data = memory_pool_alloc0 (pool, sizeof (GHashTable *) * MAX_LEVELS);
@@ -179,7 +179,7 @@ redirector_item_free (gpointer p)
}
static gchar *
-read_redirectors_list (memory_pool_t * pool, gchar * chunk, size_t len, struct map_cb_data *data)
+read_redirectors_list (memory_pool_t * pool, gchar * chunk, gint len, struct map_cb_data *data)
{
if (data->cur_data == NULL) {
data->cur_data = g_hash_table_new_full (rspamd_strcase_hash, rspamd_strcase_equal, g_free, redirector_item_free);
@@ -500,7 +500,7 @@ format_surbl_request (memory_pool_t * pool, f_str_t * hostname, struct suffix_it
len = hostname->len + slen + 2;
p = hostname->begin;
- while (p - hostname->begin < hostname->len && dots_num < MAX_LEVELS) {
+ while (p - hostname->begin < (gint)hostname->len && dots_num < MAX_LEVELS) {
if (*p == '.') {
dots[dots_num] = p;
dots_num ++;
@@ -748,7 +748,7 @@ memcached_callback (memcached_ctx_t * ctx, memc_error_t error, void *data)
else {
url_count = (gint *)param->ctx->param->buf;
/* Do not check DNS for urls that have count more than max_urls */
- if (*url_count > surbl_module_ctx->max_urls) {
+ if (*url_count > (gint)surbl_module_ctx->max_urls) {
msg_info ("url '%s' has count %d, max: %d", struri (param->url), *url_count, surbl_module_ctx->max_urls);
/*
* XXX: try to understand why we should use memcached here