From 7d23fa0293648ce431f10af8379917927bb85b39 Mon Sep 17 00:00:00 2001 From: Shmuel Zeigerman Date: Thu, 23 Nov 2023 00:00:42 +0200 Subject: [PATCH] Warnings --- plugins/luamacro/_globalinfo.lua | 2 +- plugins/luamacro/changelog | 4 ++++ plugins/luamacro/luafar/service.c | 16 ++++++++-------- plugins/luamacro/luafar/version.h | 2 +- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/plugins/luamacro/_globalinfo.lua b/plugins/luamacro/_globalinfo.lua index dba13eba80..acb4e7c1c4 100644 --- a/plugins/luamacro/_globalinfo.lua +++ b/plugins/luamacro/_globalinfo.lua @@ -1,6 +1,6 @@ function export.GetGlobalInfo() return { - Version = { 3, 0, 0, 789 }, + Version = { 3, 0, 0, 790 }, MinFarVersion = { 3, 0, 0, 5171 }, Guid = win.Uuid("4EBBEFC8-2084-4B7F-94C0-692CE136894D"), Title = "LuaMacro", diff --git a/plugins/luamacro/changelog b/plugins/luamacro/changelog index bd48c28433..752b92906d 100644 --- a/plugins/luamacro/changelog +++ b/plugins/luamacro/changelog @@ -1,3 +1,7 @@ +shmuel 2023-11-22 23:56:58+02:00 - build 790 + +1. LuaFAR: warnings. + shmuel 2023-11-21 20:39:31+02:00 - build 789 1. Far.GetConfig() is implemented entirely in Far.exe (was: Far + LuaMacro). diff --git a/plugins/luamacro/luafar/service.c b/plugins/luamacro/luafar/service.c index 09e49cef10..a851a8cba6 100644 --- a/plugins/luamacro/luafar/service.c +++ b/plugins/luamacro/luafar/service.c @@ -776,7 +776,7 @@ static int _EditorGetString(lua_State *L, int is_wide) intptr_t line_num = luaL_optinteger(L, 2, 0) - 1; intptr_t mode = luaL_optinteger(L, 3, 0); BOOL res = 0; - struct EditorGetString egs; + struct EditorGetString egs = {}; egs.StructSize = sizeof(egs); if(mode == 0 || mode == 3) @@ -4381,12 +4381,12 @@ static int far_LStrnicmp(lua_State *L) // @Flags: PN_SKIPPATH, PN_SHOWERRORMESSAGE // @Size: integer 0...0xFFFF // @Result: boolean -static int _ProcessName (lua_State *L, int Op) +static int _ProcessName (lua_State *L, UINT64 Op) { struct FarStandardFunctions *FSF = GetPluginData(L)->FSF; int pos2=2, pos3=3, pos4=4; - if (Op == -1) + if (Op == 0xFFFFFFFF) Op = CheckFlags(L, 1); else { --pos2, --pos3, --pos4; @@ -4398,8 +4398,8 @@ static int _ProcessName (lua_State *L, int Op) int Flags = Op | OptFlags(L, pos4, 0); if(Op == PN_CMPNAME || Op == PN_CMPNAMELIST || Op == PN_CHECKMASK) { - int result = FSF->ProcessName(Mask, (wchar_t*)Name, 0, Flags); - lua_pushboolean(L, result); + size_t result = FSF->ProcessName(Mask, (wchar_t*)Name, 0, Flags); + lua_pushboolean(L, (int)result); } else if (Op == PN_GENERATENAME) { UINT64 Size = luaL_optinteger(L, pos4+1, 0) & 0xFFFF; @@ -4408,11 +4408,11 @@ static int _ProcessName (lua_State *L, int Op) wcsncpy(buf, Mask, BUFSIZE-1); buf[BUFSIZE-1] = 0; - int result = FSF->ProcessName(Name, buf, BUFSIZE, Flags|Size); + size_t result = FSF->ProcessName(Name, buf, BUFSIZE, Flags|Size); if (result) push_utf8_string(L, buf, -1); else - lua_pushboolean(L, result); + lua_pushboolean(L, (int)result); } else luaL_argerror(L, 1, "command not supported"); @@ -4420,7 +4420,7 @@ static int _ProcessName (lua_State *L, int Op) return 1; } -static int far_ProcessName (lua_State *L) { return _ProcessName(L, -1); } +static int far_ProcessName (lua_State *L) { return _ProcessName(L, 0xFFFFFFFF); } static int far_CmpName (lua_State *L) { return _ProcessName(L, PN_CMPNAME); } static int far_CmpNameList (lua_State *L) { return _ProcessName(L, PN_CMPNAMELIST); } static int far_CheckMask (lua_State *L) { return _ProcessName(L, PN_CHECKMASK); } diff --git a/plugins/luamacro/luafar/version.h b/plugins/luamacro/luafar/version.h index 4d8f898fa3..3cfae8cc3e 100644 --- a/plugins/luamacro/luafar/version.h +++ b/plugins/luamacro/luafar/version.h @@ -1,3 +1,3 @@ #include -#define PLUGIN_BUILD 789 +#define PLUGIN_BUILD 790