]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Get rid of some compiler warnings
authorVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 4 Nov 2022 21:11:33 +0000 (21:11 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 4 Nov 2022 21:11:33 +0000 (21:11 +0000)
src/libserver/fuzzy_backend/fuzzy_backend_redis.c
src/libserver/http/http_connection.c
src/libstat/tokenizers/tokenizers.c
src/libutil/expression.c
src/lua/lua_mimepart.c
src/lua/lua_url.c
src/rspamd.c

index efed2fea2e2a7e628c25e373b7521133721a0f86..0b7953bfe9f184fe763e3cfd2a609e16910a309f 100644 (file)
@@ -1426,7 +1426,7 @@ rspamd_fuzzy_backend_update_redis (struct rspamd_fuzzy_backend *bk,
        GString *key;
        struct fuzzy_peer_cmd *io_cmd;
        struct rspamd_fuzzy_cmd *cmd = NULL;
-       guint nargs, ncommands, cur_shift;
+       guint nargs, cur_shift;
 
        g_assert (backend != NULL);
 
@@ -1463,7 +1463,6 @@ rspamd_fuzzy_backend_update_redis (struct rspamd_fuzzy_backend *bk,
         * DECR <prefix||fuzzy_count>
         */
 
-       ncommands = 3; /* For MULTI + EXEC + INCR <src> */
        nargs = 4;
 
        for (i = 0; i < updates->len; i ++) {
@@ -1477,33 +1476,27 @@ rspamd_fuzzy_backend_update_redis (struct rspamd_fuzzy_backend *bk,
                }
 
                if (cmd->cmd == FUZZY_WRITE) {
-                       ncommands += 5;
                        nargs += 17;
                        session->nadded ++;
 
                        if (io_cmd->is_shingle) {
-                               ncommands += RSPAMD_SHINGLE_SIZE;
                                nargs += RSPAMD_SHINGLE_SIZE * 4;
                        }
 
                }
                else if (cmd->cmd == FUZZY_DEL) {
-                       ncommands += 2;
                        nargs += 4;
                        session->ndeleted ++;
 
                        if (io_cmd->is_shingle) {
-                               ncommands += RSPAMD_SHINGLE_SIZE;
                                nargs += RSPAMD_SHINGLE_SIZE * 2;
                        }
                }
                else if (cmd->cmd == FUZZY_REFRESH) {
-                       ncommands += 1;
                        nargs += 3;
                        session->nextended ++;
 
                        if (io_cmd->is_shingle) {
-                               ncommands += RSPAMD_SHINGLE_SIZE;
                                nargs += RSPAMD_SHINGLE_SIZE * 3;
                        }
                }
index 599810c2060b9623c6e8593e9284711232af9792..a0cbf0dcedd4b480daea066bfe7c004d4ad7b0a3 100644 (file)
@@ -1256,10 +1256,6 @@ rspamd_http_connection_new_client_keepalive (struct rspamd_http_context *ctx,
                        opts & RSPAMD_HTTP_CLIENT_SSL);
 
        if (conn) {
-               struct rspamd_http_connection_private *priv;
-
-               priv = conn->priv;
-
                return conn;
        }
 
index b4f8ac75cbfde64d557a4daa1b47232941b8774c..55ee62f851809148242aa43a3574aaf304519dcc 100644 (file)
@@ -193,7 +193,7 @@ rspamd_tokenize_check_limit (gboolean decay,
                                *prob = G_MAXUINT64;
                        }
                        else {
-                               *prob = decay_prob * G_MAXUINT64;
+                               *prob = (guint64)(decay_prob * (double)G_MAXUINT64);
                        }
 
                        return TRUE;
index e6992a2d8bb4d9f2261fce2b4309c643278b4dd1..40fcc259111ecd278e885fc16ca1c0891e73243d 100644 (file)
@@ -1339,7 +1339,7 @@ rspamd_ast_process_node (struct rspamd_expression *e, GNode *node,
        float t1, t2;
        gdouble val;
        gboolean calc_ticks = FALSE;
-       const gchar *op_name = NULL;
+       __attribute__((unused)) const gchar *op_name = NULL;
 
        elt = node->data;
 
@@ -1382,7 +1382,9 @@ rspamd_ast_process_node (struct rspamd_expression *e, GNode *node,
                break;
        case ELT_OP:
                g_assert (node->children != NULL);
+#ifdef DEBUG_EXPRESSIONS
                op_name = rspamd_expr_op_to_str (elt->p.op.op);
+#endif
 
                if (elt->p.op.op_flags & RSPAMD_EXPRESSION_NARY) {
                        msg_debug_expression_verbose ("proceed nary operation %s", op_name);
index 459a78e69b4cbbb4f1cb27a5f4448aa490ff2176..cfc7d3942db6e3652c04374b5e50d028618c0799 100644 (file)
@@ -796,7 +796,6 @@ lua_textpart_get_content_oneline (lua_State * L)
 {
        LUA_TRACE_POINT;
        struct rspamd_mime_text_part *part = lua_check_textpart (L);
-       struct rspamd_lua_text *t;
 
        if (part == NULL || IS_TEXT_PART_EMPTY (part)) {
                lua_pushnil (L);
index a2ce1d987fad17b981d9c54c68c0b90b52ca02fb..39b0293aae8e5d5b19979b6482a01f6e3b374ccd 100644 (file)
@@ -742,7 +742,6 @@ lua_url_create (lua_State *L)
        LUA_TRACE_POINT;
        rspamd_mempool_t *pool;
        struct rspamd_lua_text *t;
-       gboolean own_pool = FALSE;
        struct rspamd_lua_url *u;
 
        if (lua_type (L, 1) == LUA_TUSERDATA) {
@@ -750,7 +749,6 @@ lua_url_create (lua_State *L)
                t = lua_check_text_or_string (L, 2);
        }
        else {
-               own_pool = TRUE;
                pool = static_lua_url_pool;
                t = lua_check_text_or_string (L, 2);
        }
index 17c5fc4933636c4002eae3cfaeedc8cf1fd031ef..464dff9f976f18bc5f6ed85e4a83ae744d3b53f7 100644 (file)
@@ -1122,7 +1122,7 @@ rspamd_stat_update_handler (struct ev_loop *loop, ev_timer *w, int revents)
                                (new_spam - old_spam) / w->repeat,
                                (new_ham - old_ham) / w->repeat,
                                cnt > 0 ? sum / cnt : 0);
-               setproctitle (proctitle);
+               setproctitle ("%s", proctitle);
        }
 
        memcpy (&old_stat, &cur_stat, sizeof (cur_stat));