diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-08-31 16:46:07 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-08-31 16:46:07 -0300 |
commit | e1d072571ec6f9d830e575a2ecdc95fd43428e53 (patch) | |
tree | 830fab7f2acb9adaee2d63073d339cc9557a5437 /ltm.c | |
parent | 7651a5c6b2ee6ec59cadec6199319d482071f176 (diff) | |
download | lua-e1d072571ec6f9d830e575a2ecdc95fd43428e53.tar.gz lua-e1d072571ec6f9d830e575a2ecdc95fd43428e53.tar.bz2 lua-e1d072571ec6f9d830e575a2ecdc95fd43428e53.zip |
better syntax for type casts
Diffstat (limited to 'ltm.c')
-rw-r--r-- | ltm.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -61,7 +61,7 @@ static const lu_byte luaT_validevents[NUM_TAGS][TM_N] = { | |||
61 | }; | 61 | }; |
62 | 62 | ||
63 | int luaT_validevent (int t, int e) { /* ORDER LUA_T */ | 63 | int luaT_validevent (int t, int e) { /* ORDER LUA_T */ |
64 | return (t >= NUM_TAGS) ? 1 : (int)luaT_validevents[t][e]; | 64 | return (t >= NUM_TAGS) ? 1 : cast(int, luaT_validevents[t][e]); |
65 | } | 65 | } |
66 | 66 | ||
67 | 67 | ||
@@ -88,7 +88,7 @@ int luaT_newtag (lua_State *L, const l_char *name, int basictype) { | |||
88 | TObject otag; | 88 | TObject otag; |
89 | ts = luaS_new(L, name); | 89 | ts = luaS_new(L, name); |
90 | v = luaH_getstr(G(L)->type2tag, ts); | 90 | v = luaH_getstr(G(L)->type2tag, ts); |
91 | if (ttype(v) == LUA_TNUMBER) return (int)nvalue(v); | 91 | if (ttype(v) == LUA_TNUMBER) return cast(int, nvalue(v)); |
92 | setnvalue(&otag, tag); | 92 | setnvalue(&otag, tag); |
93 | luaH_setstr(L, G(L)->type2tag, ts, &otag); | 93 | luaH_setstr(L, G(L)->type2tag, ts, &otag); |
94 | } | 94 | } |