aboutsummaryrefslogtreecommitdiffstats
path: root/src/symbols_cache.c
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/symbols_cache.c
parent6b86782ce21caad081d41f54ef10233a8e757189 (diff)
downloadrspamd-3f96e6a7a317e70b85b32de4aa06681c11d79006.tar.gz
rspamd-3f96e6a7a317e70b85b32de4aa06681c11d79006.zip
Fix signness in arithmetic operations.
Diffstat (limited to 'src/symbols_cache.c')
-rw-r--r--src/symbols_cache.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/symbols_cache.c b/src/symbols_cache.c
index 1f4b90198..5940bb4c2 100644
--- a/src/symbols_cache.c
+++ b/src/symbols_cache.c
@@ -364,6 +364,7 @@ register_dynamic_symbol (memory_pool_t *dynamic_pool, struct symbols_cache **cac
double *w;
guint32 mask = 0xFFFFFFFF;
struct dynamic_map_item *it;
+ gint rr;
if (*cache == NULL) {
pcache = g_new0 (struct symbols_cache, 1);
@@ -412,19 +413,19 @@ register_dynamic_symbol (memory_pool_t *dynamic_pool, struct symbols_cache **cac
t = g_list_prepend (t, item);
/* Replace pointers in radix tree and in destructor function */
memory_pool_replace_destructor (dynamic_pool, (pool_destruct_func)g_list_free, (gpointer)r, t);
- r = radix32tree_replace (pcache->negative_dynamic_map, ntohl (it->addr.s_addr), mask, (uintptr_t)t);
- if (r == -1) {
+ rr = radix32tree_replace (pcache->negative_dynamic_map, ntohl (it->addr.s_addr), mask, (uintptr_t)t);
+ if (rr == -1) {
msg_warn ("cannot replace ip to tree: %s, mask %X", inet_ntoa (it->addr), mask);
}
}
else {
t = g_list_prepend (NULL, item);
memory_pool_add_destructor (dynamic_pool, (pool_destruct_func)g_list_free, t);
- r = radix32tree_insert (pcache->negative_dynamic_map, ntohl (it->addr.s_addr), mask, (uintptr_t)t);
- if (r == -1) {
+ rr = radix32tree_insert (pcache->negative_dynamic_map, ntohl (it->addr.s_addr), mask, (uintptr_t)t);
+ if (rr == -1) {
msg_warn ("cannot insert ip to tree: %s, mask %X", inet_ntoa (it->addr), mask);
}
- else if (r == 1) {
+ else if (rr == 1) {
msg_warn ("ip %s, mask %X, value already exists", inet_ntoa (it->addr), mask);
}
}
@@ -437,19 +438,19 @@ register_dynamic_symbol (memory_pool_t *dynamic_pool, struct symbols_cache **cac
t = g_list_prepend (t, item);
/* Replace pointers in radix tree and in destructor function */
memory_pool_replace_destructor (dynamic_pool, (pool_destruct_func)g_list_free, (gpointer)r, t);
- r = radix32tree_replace (pcache->dynamic_map, ntohl (it->addr.s_addr), mask, (uintptr_t)t);
- if (r == -1) {
+ rr = radix32tree_replace (pcache->dynamic_map, ntohl (it->addr.s_addr), mask, (uintptr_t)t);
+ if (rr == -1) {
msg_warn ("cannot replace ip to tree: %s, mask %X", inet_ntoa (it->addr), mask);
}
}
else {
t = g_list_prepend (NULL, item);
memory_pool_add_destructor (dynamic_pool, (pool_destruct_func)g_list_free, t);
- r = radix32tree_insert (pcache->dynamic_map, ntohl (it->addr.s_addr), mask, (uintptr_t)t);
- if (r == -1) {
+ rr = radix32tree_insert (pcache->dynamic_map, ntohl (it->addr.s_addr), mask, (uintptr_t)t);
+ if (rr == -1) {
msg_warn ("cannot insert ip to tree: %s, mask %X", inet_ntoa (it->addr), mask);
}
- else if (r == 1) {
+ else if (rr == 1) {
msg_warn ("ip %s, mask %X, value already exists", inet_ntoa (it->addr), mask);
}
}