]> source.dussan.org Git - rspamd.git/commitdiff
Remove some warnings.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 14 Oct 2011 16:06:02 +0000 (19:06 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 14 Oct 2011 16:06:02 +0000 (19:06 +0300)
src/map.c
src/message.c
src/plugins/regexp.c
src/plugins/surbl.c
src/printf.c
src/radix.c
src/settings.c
src/statfile.c
src/upstream.c
src/util.c

index 300f2eb8356813295020e7bd7779a57f81126016..b37082bd04e75830d57efa575d540f37474c2094 100644 (file)
--- a/src/map.c
+++ b/src/map.c
@@ -1044,14 +1044,6 @@ start_map_watch (void)
 void 
 remove_all_maps (void)
 {
-       GList                          *cur = maps;
-       struct rspamd_map              *map;
-
-       /* First of all do synced read of data */
-       while (cur) {
-               map = cur->data;
-               cur = g_list_next (cur);
-       }
        g_list_free (maps);
        maps = NULL;
        if (map_pool != NULL) {
index c0937e0bebbbd01fef05db07b89693f5423f642d..0298a97e5cdb7051a49f2603be1c6b52fd777d02 100644 (file)
@@ -36,7 +36,7 @@
 GByteArray                     *
 strip_html_tags (struct worker_task *task, memory_pool_t * pool, struct mime_text_part *part, GByteArray * src, gint *stateptr)
 {
-       uint8_t                        *tbuf = NULL, *p, *tp = NULL, *rp, *tbegin = NULL, *end, c, lc;
+       uint8_t                        *p, *rp, *tbegin = NULL, *end, c, lc;
        gint                            br, i = 0, depth = 0, in_q = 0;
        gint                            state = 0;
        GByteArray                     *buf;
@@ -124,19 +124,16 @@ unbreak_tag:
                        case 2:                 /* PHP */
                                if (!br && lc != '\"' && *(p - 1) == '?') {
                                        in_q = state = 0;
-                                       tp = tbuf;
                                }
                                break;
 
                        case 3:
                                in_q = state = 0;
-                               tp = tbuf;
                                break;
 
                        case 4:                 /* JavaScript/CSS/etc... */
                                if (p >= src->data + 2 && *(p - 1) == '-' && *(p - 2) == '-') {
                                        in_q = state = 0;
-                                       tp = tbuf;
                                }
                                break;
 
index b7999739420173ddab84a40e46dd83df7f0da8a6..df3675e93355ff31f6b7cf8c8136324ef7210f77 100644 (file)
@@ -302,7 +302,6 @@ json_regexp_fin_cb (memory_pool_t * pool, struct map_cb_data *data)
        json_error_t                    je;
        gchar                           *cur_rule, *cur_symbol;
        double                          score;
-       gboolean                        enabled;
        struct regexp_module_item      *cur_item;
        GList                          *cur_networks = NULL;
        struct dynamic_map_item        *cur_nitem;
@@ -356,7 +355,6 @@ json_regexp_fin_cb (memory_pool_t * pool, struct map_cb_data *data)
        for (i = 0; i < nelts; i++) {
                cur_networks = NULL;
                cur_rule = NULL;
-               enabled = TRUE;
 
                cur_elt = json_array_get (js, i);
                if (!cur_elt || !json_is_object (cur_elt)) {
index d0a51d59bf9b1c50f0293afe17f0aac7c9ca7627..3c4a0e53fcfffa068112be7238fcaf4d11f96d37 100644 (file)
@@ -1004,7 +1004,6 @@ surbl_tree_url_callback (gpointer key, gpointer value, void *data)
        struct redirector_param        *param = data;
        struct worker_task             *task;
        struct uri                     *url = value;
-       f_str_t                         f;
        gchar                          *red_domain;
        const gchar                    *pos;
        GRegex                         *re;
@@ -1018,8 +1017,6 @@ surbl_tree_url_callback (gpointer key, gpointer value, void *data)
        }
 
        if (surbl_module_ctx->use_redirector) {
-               f.begin = url->host;
-               f.len = url->hostlen;
                /* Search in trie */
                if (surbl_module_ctx->redirector_trie &&
                                (pos = rspamd_trie_lookup (surbl_module_ctx->redirector_trie, url->host, url->hostlen, &idx)) != NULL &&
index 97b326547bf8688a29049ccf3c33876192cacb33..54919a5c1a93f48b8c02821b4ac7b9be71c75318 100644 (file)
@@ -172,13 +172,12 @@ rspamd_sprintf_num (gchar *buf, gchar *last, guint64 ui64, gchar zero,
 gint
 rspamd_fprintf (FILE *f, const gchar *fmt, ...)
 {
-       gchar   *p;
        va_list   args;
     gchar buf[BUFSIZ];
     gint r;
 
        va_start (args, fmt);
-       p = rspamd_vsnprintf (buf, sizeof (buf), fmt, args);
+       rspamd_vsnprintf (buf, sizeof (buf), fmt, args);
        va_end (args);
 
     r = fprintf (f, "%s", buf);
@@ -277,7 +276,7 @@ rspamd_vsnprintf (gchar *buf, glong max, const gchar *fmt, va_list args)
        size_t              len, slen;
        gint64              i64;
        guint64             ui64;
-       guint               width, sign, hex, humanize, bytes, max_width, frac_width, i;
+       guint               width, sign, hex, humanize, bytes, frac_width, i;
        f_str_t                    *v;
        GString            *gs;
 
@@ -305,7 +304,6 @@ rspamd_vsnprintf (gchar *buf, glong max, const gchar *fmt, va_list args)
                        hex = 0;
                        bytes = 0;
                        humanize = 0;
-                       max_width = 0;
                        frac_width = 0;
                        slen = (size_t) -1;
 
@@ -323,7 +321,6 @@ rspamd_vsnprintf (gchar *buf, glong max, const gchar *fmt, va_list args)
                                        continue;
 
                                case 'm':
-                                       max_width = 1;
                                        fmt++;
                                        continue;
 
index e8a68848df06dff458289f8ebb9a2d330cb43bba..8bcd910bf3487a37e870e41bbf70de9c5b01251f 100644 (file)
@@ -197,7 +197,6 @@ radix32tree_delete (radix_tree_t * tree, guint32 key, guint32 mask)
 {
        guint32                         bit;
        radix_node_t                   *node;
-       radix_node_t                   *tmp;
 
        bit = 0x80000000;
        node = tree->root;
@@ -236,7 +235,6 @@ radix32tree_delete (radix_tree_t * tree, guint32 key, guint32 mask)
                        node->parent->left = NULL;
                }
 
-               tmp = node;
                node = node->parent;
 
                if (node->right || node->left) {
index 31cc95b1c70e6f01fbc7e32ad00a049fc1d5cf4e..47766865e68b568b3c780e76f8c380feec104178 100644 (file)
@@ -510,7 +510,6 @@ check_metric_action_settings (struct worker_task *task, struct metric_result *re
        GList                          *cur;
        enum rspamd_metric_action       r = METRIC_ACTION_NOACTION;
        gboolean                        black;
-       double                          rej = 0.;
 
        if (us != NULL) {
                /* Check whitelist and set appropriate action for whitelisted users */
@@ -530,9 +529,6 @@ check_metric_action_settings (struct worker_task *task, struct metric_result *re
                                        r = act->action;
                                        sel = act;
                                }
-                               if (r == METRIC_ACTION_REJECT) {
-                                       rej = act->score;
-                               }
                                cur = g_list_next (cur);
                        }
                }
index efdb6ad56f18c8bea164b5e900ad32268ca5f577..26d96a38cd286d305be48846637127cb14775aae 100644 (file)
@@ -288,7 +288,8 @@ statfile_pool_reindex (statfile_pool_t * pool, gchar *filename, size_t old_size,
 static void
 statfile_preload (stat_file_t *file)
 {
-       guint8                         *pos, *end, t;
+       guint8                         *pos, *end;
+       volatile guint8                                 t;
        gsize                           size;
 
        pos = (guint8 *)file->map;
@@ -306,6 +307,7 @@ statfile_preload (stat_file_t *file)
 #endif
                while (pos < end) {
                        t = *pos;
+                       (void)t;
                        pos += size;
                }
        }
@@ -550,7 +552,6 @@ double
 statfile_pool_get_block (statfile_pool_t * pool, stat_file_t * file, guint32 h1, guint32 h2, time_t now)
 {
        struct stat_file_block         *block;
-       struct stat_file_header        *header;
        guint                           i, blocknum;
        u_char                         *c;
 
@@ -561,7 +562,6 @@ statfile_pool_get_block (statfile_pool_t * pool, stat_file_t * file, guint32 h1,
        }
 
        blocknum = h1 % file->cur_section.length;
-       header = (struct stat_file_header *)file->map;
        c = (u_char *) file->map + file->seek_pos + blocknum * sizeof (struct stat_file_block);
        block = (struct stat_file_block *)c;
 
index d167c88ec56607ca2ba6f8f89a8459d16cda1804..b3f282d59f773ab9aa57ef0c8d45113cec7f7c18 100644 (file)
@@ -334,12 +334,12 @@ get_upstream_by_hash (void *ups, size_t members, size_t msize, time_t now, time_
 struct upstream                *
 get_upstream_round_robin (void *ups, size_t members, size_t msize, time_t now, time_t error_timeout, time_t revive_timeout, size_t max_errors)
 {
-       guint                            alive, max_weight, i;
+       guint                           max_weight, i;
        struct upstream                *cur, *selected = NULL;
        u_char                         *p;
 
        /* Recheck all upstreams */
-       alive = rescan_upstreams (ups, members, msize, now, error_timeout, revive_timeout, max_errors);
+       (void)rescan_upstreams (ups, members, msize, now, error_timeout, revive_timeout, max_errors);
 
        p = ups;
        max_weight = 0;
@@ -383,12 +383,12 @@ get_upstream_round_robin (void *ups, size_t members, size_t msize, time_t now, t
 struct upstream                *
 get_upstream_master_slave (void *ups, size_t members, size_t msize, time_t now, time_t error_timeout, time_t revive_timeout, size_t max_errors)
 {
-       guint                            alive, max_weight, i;
+       guint                           max_weight, i;
        struct upstream                *cur, *selected = NULL;
        u_char                         *p;
 
        /* Recheck all upstreams */
-       alive = rescan_upstreams (ups, members, msize, now, error_timeout, revive_timeout, max_errors);
+       (void)rescan_upstreams (ups, members, msize, now, error_timeout, revive_timeout, max_errors);
 
        p = ups;
        max_weight = 0;
index 9956b8da0687c24ce96bf83667e7674473277a83..01936474ebb33051bd01ba69228550291bbdd00e 100644 (file)
@@ -282,7 +282,7 @@ make_unix_socket (const gchar *path, struct sockaddr_un *addr, gboolean is_serve
 gint
 make_socketpair (gint pair[2])
 {
-       gint                            s_error, r, optlen, serrno, on = 1;
+       gint                            r;
 
        r = socketpair (PF_LOCAL, SOCK_STREAM, 0, pair);
 
@@ -303,10 +303,8 @@ make_socketpair (gint pair[2])
        return 0;
 
 out:
-       serrno = errno;
        close (pair[0]);
        close (pair[1]);
-       errno = serrno;
        return (-1);
 }