diff options
author | Oliver Schneider <oliver@assarbad.net> | 2018-04-05 23:20:34 +0300 |
---|---|---|
committer | Oliver Schneider <oliver@assarbad.net> | 2018-04-05 23:20:34 +0300 |
commit | ca2892052b5ad03e5745c5f62ef7eeb791ba52b8 (patch) | |
tree | 3fcb456be7cfada6ee1e9a3d00baa7dbb55d19c5 /windirstat | |
parent | f57ac71db43c6218ee0e611751a3d345f02df902 (diff) |
Improved logic in wow64.c
Diffstat (limited to 'windirstat')
-rw-r--r-- | windirstat/WDS_Lua_C.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/windirstat/WDS_Lua_C.c b/windirstat/WDS_Lua_C.c index 7d12dc7..768a12c 100644 --- a/windirstat/WDS_Lua_C.c +++ b/windirstat/WDS_Lua_C.c @@ -3,9 +3,9 @@ #include "WDS_Lua_C.h" #ifdef _WIN64 -# pragma warning(push) -# pragma warning(disable:4324) -# pragma warning(disable:4334) +#pragma warning(push) +#pragma warning(disable : 4324) +#pragma warning(disable : 4334) #endif // Modules/Packages, individual functions @@ -18,22 +18,23 @@ // Cheat a bit to redefine the list of "default" libraries ... #ifndef WDS_LUA_NO_INIT static const luaL_Reg lualibs[] = { - {"", luaopen_base}, - {LUA_LOADLIBNAME, luaopen_package}, - {LUA_TABLIBNAME, luaopen_table}, - {LUA_IOLIBNAME, luaopen_io}, - {LUA_OSLIBNAME, luaopen_os}, - {LUA_STRLIBNAME, luaopen_string}, - {LUA_MATHLIBNAME, luaopen_math}, - {LUA_DBLIBNAME, luaopen_debug}, - {LUA_WINREGNAME, luaopen_winreg}, - {NULL, NULL}, + { "", luaopen_base }, + { LUA_LOADLIBNAME, luaopen_package }, + { LUA_TABLIBNAME, luaopen_table }, + { LUA_IOLIBNAME, luaopen_io }, + { LUA_OSLIBNAME, luaopen_os }, + { LUA_STRLIBNAME, luaopen_string }, + { LUA_MATHLIBNAME, luaopen_math }, + { LUA_DBLIBNAME, luaopen_debug }, + { LUA_WINREGNAME, luaopen_winreg }, + { NULL, NULL }, }; -static void luaWDS_openlibs_(lua_State *L) +static void luaWDS_openlibs_(lua_State* L) { - const luaL_Reg *lib = lualibs; - for (; lib->func; lib++) { + const luaL_Reg* lib = lualibs; + for (; lib->func; lib++) + { lua_pushcfunction(L, lib->func); lua_pushstring(L, lib->name); lua_call(L, 1, 0); @@ -44,10 +45,10 @@ static void luaWDS_openlibs_(lua_State *L) lua_State* luaWDS_open() { lua_State* L = lua_open(); - if(L) + if (L) { - lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */ - luaWDS_openlibs_(L); /* open libraries */ + lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */ + luaWDS_openlibs_(L); /* open libraries */ luaL_register(L, LUA_OSLIBNAME, wow64_funcs); luaL_register(L, LUA_OSLIBNAME, isadmin_funcs); luaL_register(L, LUA_OSLIBNAME, dbgprint_funcs); @@ -57,5 +58,5 @@ lua_State* luaWDS_open() } #ifdef _WIN64 -# pragma warning(pop) +#pragma warning(pop) #endif |