]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix some warnings
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 22 Mar 2018 15:24:46 +0000 (15:24 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 22 Mar 2018 15:32:33 +0000 (15:32 +0000)
contrib/lpeg/lptypes.h
contrib/torch/torch7/utils.c
src/lua/lua_task.c
src/lua/lua_util.c

index 5eb7987b7b8688d9e08429106a5904a2b0c65b9f..78dff6220aa0c5790caf63fec32a51ca39e315f3 100644 (file)
 #define lua_getuservalue       lua_getfenv
 #define lua_setuservalue       lua_setfenv
 
+#ifndef lua_rawlen
 #define lua_rawlen             lua_objlen
+#endif
 
+#ifndef luaL_setfuncs
 #define luaL_setfuncs(L,f,n)   luaL_register(L,NULL,f)
+#endif
+#ifndef luaL_newlib
 #define luaL_newlib(L,f)       luaL_register(L,"lpeg",f)
-
+#endif
 #endif
 
 
index 894bb6ee2224766d22799a72d4d3deb39c176bce..974d0ac08a56332e3aa334451dca01468ea92f0e 100644 (file)
@@ -74,7 +74,7 @@ static int torch_isatty(lua_State *L)
   return 1;
 }
 
-static double real_time()
+static double real_time(void)
 {
 #ifdef _WIN32
   if (ticksPerSecond.QuadPart == 0)
index 64373708663120ab0ca24b2f2976423a13193bc1..bd7d693d0cc41a0b1a7570d35e5d5f20d6e821f4 100644 (file)
@@ -1345,12 +1345,10 @@ static gint
 lua_task_set_pre_result (lua_State * L)
 {
        struct rspamd_task *task = lua_check_task (L, 1);
-       struct rspamd_config *cfg;
        gchar *action_str;
        gint action = METRIC_ACTION_MAX;
 
        if (task != NULL) {
-               cfg = task->cfg;
 
                if (lua_type (L, 2) == LUA_TNUMBER) {
                        action = lua_tointeger (L, 2);
@@ -1378,6 +1376,7 @@ lua_task_set_pre_result (lua_State * L)
                        else {
                                task->pre_result.str = "unknown";
                        }
+
                        msg_info_task ("<%s>: set pre-result to %s: '%s'",
                                                task->message_id, rspamd_action_to_str (action),
                                                task->pre_result.str);
@@ -4225,7 +4224,6 @@ lua_task_disable_action (lua_State *L)
 {
        struct rspamd_task *task = lua_check_task (L, 1);
        const gchar *action_name;
-       struct rspamd_metric_result *metric_res;
        gint action;
 
        action_name = luaL_checkstring (L, 2);
index ad38e771ec848ab835fdd57b31e72159f488f49e..a14de69f3adca5ffa5e4af8866ed39301ee806d9 100644 (file)
@@ -2154,14 +2154,9 @@ lua_util_readline (lua_State *L)
 static gint
 lua_util_readpassphrase (lua_State *L)
 {
-       const gchar *prompt = NULL;
        gchar test_password[8192];
        gsize r;
 
-       if (lua_type (L, 1) == LUA_TSTRING) {
-               prompt = lua_tostring (L, 1);
-       }
-
        r = rspamd_read_passphrase (test_password, sizeof (test_password), 0, NULL);
 
        if (r > 0) {