]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Remove some unused variables
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 10 Mar 2017 16:06:16 +0000 (16:06 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 10 Mar 2017 16:06:30 +0000 (16:06 +0000)
src/controller.c
src/fuzzy_storage.c
src/libmime/message.c
src/libserver/dkim.c
src/libserver/html_colors.h
src/log_helper.c
src/plugins/chartable.c
src/plugins/dkim_check.c
src/ragel/rfc2047_parser.rl

index 8406b6236b2836d7638d8b4e297de83b3a5b9d33..dd95f768d6583ff617f5f8923588d90a156df741 100644 (file)
@@ -1531,11 +1531,9 @@ static gboolean
 rspamd_controller_lua_fin_task (void *ud)
 {
        struct rspamd_task *task = ud;
-       struct rspamd_controller_session *session;
        struct rspamd_http_connection_entry *conn_ent;
 
        conn_ent = task->fin_arg;
-       session = conn_ent->ud;
 
        if (task->err != NULL) {
                rspamd_controller_send_error (conn_ent, task->err->code, "%s",
index 7b939d3f04a6882e048122ba4228a7d6252d8949..b88090228a5f5f5d7122432698e6b164fa4e62e9 100644 (file)
@@ -747,26 +747,21 @@ rspamd_fuzzy_check_callback (struct rspamd_fuzzy_reply *result, void *ud)
        struct fuzzy_session *session = ud;
        gboolean encrypted = FALSE, is_shingle = FALSE;
        struct rspamd_fuzzy_cmd *cmd = NULL;
-       gsize up_len = 0;
 
        switch (session->cmd_type) {
        case CMD_NORMAL:
                cmd = &session->cmd.normal;
-               up_len = sizeof (session->cmd.normal);
                break;
        case CMD_SHINGLE:
                cmd = &session->cmd.shingle.basic;
-               up_len = sizeof (session->cmd.shingle);
                is_shingle = TRUE;
                break;
        case CMD_ENCRYPTED_NORMAL:
                cmd = &session->cmd.enc_normal.cmd;
-               up_len = sizeof (session->cmd.normal);
                encrypted = TRUE;
                break;
        case CMD_ENCRYPTED_SHINGLE:
                cmd = &session->cmd.enc_shingle.cmd.basic;
-               up_len = sizeof (session->cmd.shingle);
                encrypted = TRUE;
                is_shingle = TRUE;
                break;
index 40769037b5c801deb57a29e2e4bf17cb3fcf4bbf..c429892aadd26e889e4fc9290f5a85d8f25d9f23 100644 (file)
@@ -287,7 +287,7 @@ rspamd_normalize_text_part (struct rspamd_task *task,
                struct rspamd_mime_text_part *part)
 {
 
-       const guchar *p, *c, *end;
+       const guchar *p, *end;
        guint i;
        goffset off;
        struct rspamd_process_exception *ex;
@@ -296,7 +296,6 @@ rspamd_normalize_text_part (struct rspamd_task *task,
        part->stripped_content = g_byte_array_sized_new (part->content->len);
        part->newlines = g_ptr_array_sized_new (128);
        p = part->content->data;
-       c = p;
        end = p + part->content->len;
 
        rspamd_strip_newlines_parse (p, end, part->stripped_content,
index 4ef2ad12211a60a8b65266007a6eb10a22b4f15a..9254443ba23c39c43c55058f7fec00175d4d9ca4 100644 (file)
@@ -1800,7 +1800,7 @@ rspamd_dkim_check (rspamd_dkim_context_t *ctx,
        rspamd_dkim_key_t *key,
        struct rspamd_task *task)
 {
-       const gchar *p, *body_end, *body_start;
+       const gchar *body_end, *body_start;
        guchar raw_digest[EVP_MAX_MD_SIZE];
        EVP_MD_CTX *cpy_ctx;
        gsize dlen;
@@ -1814,7 +1814,6 @@ rspamd_dkim_check (rspamd_dkim_context_t *ctx,
        g_return_val_if_fail (task->msg.len > 0, DKIM_ERROR);
 
        /* First of all find place of body */
-       p = task->msg.begin;
        body_end = task->msg.begin + task->msg.len;
        body_start = task->raw_headers_content.body_start;
 
@@ -2161,7 +2160,7 @@ rspamd_dkim_sign (struct rspamd_task *task,
 {
        GString *hdr;
        struct rspamd_dkim_header *dh;
-       const gchar *p, *body_end, *body_start;
+       const gchar *body_end, *body_start;
        guchar raw_digest[EVP_MAX_MD_SIZE];
        gsize dlen;
        guint i, j;
@@ -2172,7 +2171,6 @@ rspamd_dkim_sign (struct rspamd_task *task,
        g_assert (ctx != NULL);
 
        /* First of all find place of body */
-       p = task->msg.begin;
        body_end = task->msg.begin + task->msg.len;
        body_start = task->raw_headers_content.body_start;
 
index 78e727d4acdeb7361d9c1552aa7d8f1a190387da..00fa6fed54135f12b79799b4ef5265f73c6e6745 100644 (file)
@@ -25,7 +25,7 @@ struct rspamd_html_colorname {
        const gchar *name;
 };
 
-const static struct rspamd_html_colorname html_colornames[] = {
+static const struct rspamd_html_colorname html_colornames[] = {
                { {240, 248, 255}, "aliceblue"},
                { {250, 235, 215}, "antiquewhite"},
                { {255, 239, 219}, "antiquewhite1"},
index 974649d878123c576e728ef410738dd770ebfc6c..d66f49271d51db316ad06fe5caaf0333653553bf 100644 (file)
@@ -64,6 +64,7 @@ init_log_helper (struct rspamd_config *cfg)
        GQuark type;
 
        type = g_quark_try_string ("log_helper");
+       (void)type;
        ctx = rspamd_mempool_alloc (cfg->cfg_pool, sizeof (*ctx));
 
        ctx->magic = rspamd_log_helper_magic;
index c73ef13c9d213600c165d31a9858ef181b6ddd18..d6efc3ed265e7bdd1bc49d3492d344a69a441d04 100644 (file)
@@ -170,7 +170,7 @@ rspamd_chartable_process_word_utf (struct rspamd_task *task,
                rspamd_stat_token_t *w,
                gboolean is_url)
 {
-       const gchar *p, *end, *c;
+       const gchar *p, *end;
        gdouble badness = 0.0;
        UChar32 uc;
        UBlockCode sc, last_sc;
@@ -184,7 +184,6 @@ rspamd_chartable_process_word_utf (struct rspamd_task *task,
 
        p = w->begin;
        end = p + w->len;
-       c = p;
        last_sc = 0;
 
        /* We assume that w is normalized */
@@ -271,7 +270,7 @@ rspamd_chartable_process_word_ascii (struct rspamd_task *task,
                rspamd_stat_token_t *w,
                gboolean is_url)
 {
-       const guchar *p, *end, *c;
+       const guchar *p, *end;
        gdouble badness = 0.0;
        enum {
                ascii = 1,
@@ -287,7 +286,6 @@ rspamd_chartable_process_word_ascii (struct rspamd_task *task,
 
        p = w->begin;
        end = p + w->len;
-       c = p;
        last_sc = 0;
 
        if (w->len > chartable_module_ctx->max_word_len) {
index 808b19f178e6adc953fd9e3054e5f012bd97310a..87203b5d51bdfdd84716fabded3afcbb331ed20f 100644 (file)
@@ -282,7 +282,7 @@ gint
 dkim_module_config (struct rspamd_config *cfg)
 {
        const ucl_object_t *value;
-       gint res = TRUE, cb_id = -1, check_id = -1;
+       gint res = TRUE, cb_id = -1;
        guint cache_size;
        gboolean got_trusted = FALSE;
 
@@ -511,7 +511,7 @@ dkim_module_config (struct rspamd_config *cfg)
                                                        dkim_module_ctx->dkim_pool,
                                                        dkim_module_ctx->sign_condition_ref);
 
-                                       check_id = rspamd_symbols_cache_add_symbol (cfg->cache,
+                                       rspamd_symbols_cache_add_symbol (cfg->cache,
                                                        "DKIM_SIGN",
                                                        0,
                                                        dkim_sign_callback,
index 9a863fc9a9ebc665f64ab00c30f8a6fdecc95b72..05b08a6aea74396cc5f538eefcf70921e35a4fcd 100644 (file)
@@ -62,13 +62,11 @@ rspamd_rfc2047_parser (const gchar *in, gsize len, gint *pencoding,
   const gchar **charset, gsize *charset_len,
   const gchar **encoded, gsize *encoded_len)
 {
-  const char *p = in, *pe = in + len, *eof,
+  const char *p = in, *pe = in + len,
     *encoded_start = NULL, *encoded_end = NULL,
     *charset_start = NULL, *charset_end = NULL;
   gint encoding = RSPAMD_RFC2047_QP, cs = 0;
 
-  eof = pe;
-
   %% write init;
   %% write exec;