if (tvisfunc(o) && isffunc(funcV(o)))
lua_pushfstring(L, "function: fast#%d", funcV(o)->c.ffid);
else
- lua_pushfstring(L, "%s: %p", typename(o), lua_topointer(L, 1));
+ lua_pushfstring(L, "%s: %p", lj_typename(o), lua_topointer(L, 1));
/* Note: lua_pushfstring calls the GC which may invalidate o. */
s = strV(L->top-1);
}
lua_rawgeti(L, 1, i);
o = L->top-1;
if (!(tvisstr(o) || tvisnumber(o)))
- lj_err_callerv(L, LJ_ERR_TABCAT, typename(o), i);
+ lj_err_callerv(L, LJ_ERR_TABCAT, lj_typename(o), i);
luaL_addvalue(&b);
if (i++ == e) break;
if (seplen)
if (ca->ct[i])
repr[i] = strdata(lj_ctype_repr(L, ctype_typeid(cts, ca->ct[i]), NULL));
else
- repr[i] = typename(&L->base[i]);
+ repr[i] = lj_typename(&L->base[i]);
}
lj_err_callerv(L, mm == MM_len ? LJ_ERR_FFI_BADLEN :
mm == MM_concat ? LJ_ERR_FFI_BADCONCAT :
CTInfo flags)
{
const char *dst = strdata(lj_ctype_repr(cts->L, ctype_typeid(cts, d), NULL));
- const char *src = typename(o);
+ const char *src = lj_typename(o);
if (CCF_GETARG(flags))
lj_err_argv(cts->L, CCF_GETARG(flags), LJ_ERR_FFI_BADCONV, src, dst);
else
/* Typecheck error for operands. */
LJ_NOINLINE void lj_err_optype(lua_State *L, cTValue *o, ErrMsg opm)
{
- const char *tname = typename(o);
+ const char *tname = lj_typename(o);
const char *opname = err2msg(opm);
if (curr_funcisL(L)) {
GCproto *pt = curr_proto(L);
/* Typecheck error for ordered comparisons. */
LJ_NOINLINE void lj_err_comp(lua_State *L, cTValue *o1, cTValue *o2)
{
- const char *t1 = typename(o1);
- const char *t2 = typename(o2);
+ const char *t1 = lj_typename(o1);
+ const char *t2 = lj_typename(o2);
err_msgv(L, t1 == t2 ? LJ_ERR_BADCMPV : LJ_ERR_BADCMPT, t1, t2);
/* This assumes the two "boolean" entries are commoned by the C compiler. */
}
*/
const BCIns *pc = cframe_Lpc(L);
if (((ptrdiff_t)pc & FRAME_TYPE) != FRAME_LUA) {
- const char *tname = typename(o);
+ const char *tname = lj_typename(o);
setframe_pc(o, pc);
setframe_gc(o, obj2gco(L));
L->top = L->base = o+1;
LJ_NOINLINE void lj_err_argtype(lua_State *L, int narg, const char *xname)
{
TValue *o = narg < 0 ? L->top + narg : L->base + narg-1;
- const char *tname = o < L->top ? typename(o) : lj_obj_typename[0];
+ const char *tname = o < L->top ? lj_typename(o) : lj_obj_typename[0];
const char *msg = lj_str_pushf(L, err2msg(LJ_ERR_BADTYPE), xname, tname);
err_argmsg(L, narg, msg);
}
LJ_DATA const char *const lj_obj_typename[1+LUA_TCDATA+1];
LJ_DATA const char *const lj_obj_itypename[~LJ_TNUMX+1];
-#define typename(o) (lj_obj_itypename[itypemap(o)])
+#define lj_typename(o) (lj_obj_itypename[itypemap(o)])
/* Compare two objects without calling metamethods. */
LJ_FUNC int lj_obj_equal(cTValue *o1, cTValue *o2);