MCPcopy Create free account
hub / github.com/DFHack/dfhack / check_valid_ptr_index

Function check_valid_ptr_index

library/LuaTools.cpp:236–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236static void check_valid_ptr_index(lua_State *state, int val_index)
237{
238 if (lua_type(state, val_index) == LUA_TNONE)
239 {
240 if (val_index > 0)
241 luaL_argerror(state, val_index, "pointer expected");
242 else
243 luaL_error(state, "at index %d: pointer expected", val_index);
244 }
245}
246
247static void signal_typeid_error(color_ostream* out, lua_State* state,
248 const type_identity* type, std::string_view msg,

Callers 2

CheckDFObjectMethod · 0.85
doAssignDFObjectFunction · 0.85

Calls 3

lua_typeFunction · 0.85
luaL_argerrorFunction · 0.85
luaL_errorFunction · 0.85

Tested by

no test coverage detected