From 46e34b0826ec1142faa7483a00fea65acee302ac Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 19 May 2022 14:40:27 -0700 Subject: [PATCH] lua 'index' Having the preprocessor rename a variable called 'index' to one called 'strchr' is not the source of any bugs (in execution; it can cause pain when trying to ask a debugger to display the value and then be told no such thing exists). Change the name to 'indx' to avoid any confusion. If we switch to strchr() we should still avoid using 'index' as a variable name. --- src/nhlobj.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nhlobj.c b/src/nhlobj.c index fa574ea2d..cb5390606 100644 --- a/src/nhlobj.c +++ b/src/nhlobj.c @@ -31,12 +31,12 @@ static int l_obj_bury(lua_State *); #define lobj_is_ok(lo) ((lo) && (lo)->obj && (lo)->obj->where != OBJ_LUAFREE) static struct _lua_obj * -l_obj_check(lua_State *L, int index) +l_obj_check(lua_State *L, int indx) { struct _lua_obj *lo; - luaL_checktype(L, index, LUA_TUSERDATA); - lo = (struct _lua_obj *)luaL_checkudata(L, index, "obj"); + luaL_checktype(L, indx, LUA_TUSERDATA); + lo = (struct _lua_obj *) luaL_checkudata(L, indx, "obj"); if (!lo) nhl_error(L, "Obj error"); return lo; -- 2.50.1