From 5187b13d01f5f600f82f2487c3a3a5bd8862c463 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 22 Mar 2018 15:24:46 +0000 Subject: [PATCH] [Minor] Fix some warnings --- contrib/lpeg/lptypes.h | 7 ++++++- contrib/torch/torch7/utils.c | 2 +- src/lua/lua_task.c | 4 +--- src/lua/lua_util.c | 5 ----- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/contrib/lpeg/lptypes.h b/contrib/lpeg/lptypes.h index 5eb7987b7..78dff6220 100644 --- a/contrib/lpeg/lptypes.h +++ b/contrib/lpeg/lptypes.h @@ -36,11 +36,16 @@ #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 diff --git a/contrib/torch/torch7/utils.c b/contrib/torch/torch7/utils.c index 894bb6ee2..974d0ac08 100644 --- a/contrib/torch/torch7/utils.c +++ b/contrib/torch/torch7/utils.c @@ -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) diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 643737086..bd7d693d0 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -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); diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c index ad38e771e..a14de69f3 100644 --- a/src/lua/lua_util.c +++ b/src/lua/lua_util.c @@ -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) { -- 2.39.5