Avoid compiler warnings about redefined C++ keywords.

This commit is contained in:
Mike Pall 2012-07-09 16:02:05 +02:00
parent 6e4d0fdc8e
commit f20ff8a30d
6 changed files with 10 additions and 10 deletions

View File

@ -257,7 +257,7 @@ LJLIB_ASM(tostring) LJLIB_REC(.)
if (tvisfunc(o) && isffunc(funcV(o))) if (tvisfunc(o) && isffunc(funcV(o)))
lua_pushfstring(L, "function: fast#%d", funcV(o)->c.ffid); lua_pushfstring(L, "function: fast#%d", funcV(o)->c.ffid);
else 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. */ /* Note: lua_pushfstring calls the GC which may invalidate o. */
s = strV(L->top-1); s = strV(L->top-1);
} }

View File

@ -157,7 +157,7 @@ LJLIB_CF(table_concat)
lua_rawgeti(L, 1, i); lua_rawgeti(L, 1, i);
o = L->top-1; o = L->top-1;
if (!(tvisstr(o) || tvisnumber(o))) 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); luaL_addvalue(&b);
if (i++ == e) break; if (i++ == e) break;
if (seplen) if (seplen)

View File

@ -213,7 +213,7 @@ static int lj_carith_meta(lua_State *L, CTState *cts, CDArith *ca, MMS mm)
if (ca->ct[i]) if (ca->ct[i])
repr[i] = strdata(lj_ctype_repr(L, ctype_typeid(cts, ca->ct[i]), NULL)); repr[i] = strdata(lj_ctype_repr(L, ctype_typeid(cts, ca->ct[i]), NULL));
else 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 : lj_err_callerv(L, mm == MM_len ? LJ_ERR_FFI_BADLEN :
mm == MM_concat ? LJ_ERR_FFI_BADCONCAT : mm == MM_concat ? LJ_ERR_FFI_BADCONCAT :

View File

@ -38,7 +38,7 @@ LJ_NORET static void cconv_err_convtv(CTState *cts, CType *d, TValue *o,
CTInfo flags) CTInfo flags)
{ {
const char *dst = strdata(lj_ctype_repr(cts->L, ctype_typeid(cts, d), NULL)); 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)) if (CCF_GETARG(flags))
lj_err_argv(cts->L, CCF_GETARG(flags), LJ_ERR_FFI_BADCONV, src, dst); lj_err_argv(cts->L, CCF_GETARG(flags), LJ_ERR_FFI_BADCONV, src, dst);
else else

View File

@ -598,7 +598,7 @@ LJ_NOINLINE void lj_err_lex(lua_State *L, GCstr *src, const char *tok,
/* Typecheck error for operands. */ /* Typecheck error for operands. */
LJ_NOINLINE void lj_err_optype(lua_State *L, cTValue *o, ErrMsg opm) 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); const char *opname = err2msg(opm);
if (curr_funcisL(L)) { if (curr_funcisL(L)) {
GCproto *pt = curr_proto(L); GCproto *pt = curr_proto(L);
@ -614,8 +614,8 @@ LJ_NOINLINE void lj_err_optype(lua_State *L, cTValue *o, ErrMsg opm)
/* Typecheck error for ordered comparisons. */ /* Typecheck error for ordered comparisons. */
LJ_NOINLINE void lj_err_comp(lua_State *L, cTValue *o1, cTValue *o2) LJ_NOINLINE void lj_err_comp(lua_State *L, cTValue *o1, cTValue *o2)
{ {
const char *t1 = typename(o1); const char *t1 = lj_typename(o1);
const char *t2 = typename(o2); const char *t2 = lj_typename(o2);
err_msgv(L, t1 == t2 ? LJ_ERR_BADCMPV : LJ_ERR_BADCMPT, t1, t2); 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. */ /* This assumes the two "boolean" entries are commoned by the C compiler. */
} }
@ -629,7 +629,7 @@ LJ_NOINLINE void lj_err_optype_call(lua_State *L, TValue *o)
*/ */
const BCIns *pc = cframe_Lpc(L); const BCIns *pc = cframe_Lpc(L);
if (((ptrdiff_t)pc & FRAME_TYPE) != FRAME_LUA) { if (((ptrdiff_t)pc & FRAME_TYPE) != FRAME_LUA) {
const char *tname = typename(o); const char *tname = lj_typename(o);
setframe_pc(o, pc); setframe_pc(o, pc);
setframe_gc(o, obj2gco(L)); setframe_gc(o, obj2gco(L));
L->top = L->base = o+1; L->top = L->base = o+1;
@ -722,7 +722,7 @@ LJ_NOINLINE void lj_err_arg(lua_State *L, int narg, ErrMsg em)
LJ_NOINLINE void lj_err_argtype(lua_State *L, int narg, const char *xname) 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; 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); const char *msg = lj_str_pushf(L, err2msg(LJ_ERR_BADTYPE), xname, tname);
err_argmsg(L, narg, msg); err_argmsg(L, narg, msg);
} }

View File

@ -842,7 +842,7 @@ static LJ_AINLINE lua_Number numberVnum(cTValue *o)
LJ_DATA const char *const lj_obj_typename[1+LUA_TCDATA+1]; LJ_DATA const char *const lj_obj_typename[1+LUA_TCDATA+1];
LJ_DATA const char *const lj_obj_itypename[~LJ_TNUMX+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. */ /* Compare two objects without calling metamethods. */
LJ_FUNC int lj_obj_equal(cTValue *o1, cTValue *o2); LJ_FUNC int lj_obj_equal(cTValue *o1, cTValue *o2);