From 8fe13074a7d9fdd88c5423d1e9c5fcc4ec43a57b Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Thu, 21 Mar 2024 15:19:34 +0100 Subject: chore(config): update editorconfig (#20) Lua was duplicated and C was missing. Updated the 1 C file that deviated in whitespace as well. --- .editorconfig | 2 +- src/compat.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.editorconfig b/.editorconfig index 89cb381..05bcaee 100644 --- a/.editorconfig +++ b/.editorconfig @@ -6,7 +6,7 @@ insert_final_newline = true trim_trailing_whitespace = true charset = utf-8 -[*.lua] +[*.c;*.h] indent_style = space indent_size = 4 diff --git a/src/compat.c b/src/compat.c index d763c56..6f98854 100644 --- a/src/compat.c +++ b/src/compat.c @@ -3,15 +3,15 @@ #if LUA_VERSION_NUM == 501 void luaL_setfuncs(lua_State *L, const luaL_Reg *l, int nup) { - luaL_checkstack(L, nup+1, "too many upvalues"); - for (; l->name != NULL; l++) { /* fill the table with given functions */ - int i; - lua_pushstring(L, l->name); - for (i = 0; i < nup; i++) /* copy upvalues to the top */ - lua_pushvalue(L, -(nup+1)); - lua_pushcclosure(L, l->func, nup); /* closure with those upvalues */ - lua_settable(L, -(nup + 3)); - } - lua_pop(L, nup); /* remove upvalues */ + luaL_checkstack(L, nup+1, "too many upvalues"); + for (; l->name != NULL; l++) { /* fill the table with given functions */ + int i; + lua_pushstring(L, l->name); + for (i = 0; i < nup; i++) /* copy upvalues to the top */ + lua_pushvalue(L, -(nup+1)); + lua_pushcclosure(L, l->func, nup); /* closure with those upvalues */ + lua_settable(L, -(nup + 3)); + } + lua_pop(L, nup); /* remove upvalues */ } #endif -- cgit v1.2.3-55-g6feb