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.
This commit is contained in:
PatR
2022-05-19 14:40:27 -07:00
parent c6a3ae5c6c
commit 46e34b0826

View File

@@ -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;