diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-11-30 16:50:47 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-11-30 16:50:47 -0200 |
commit | 01b00cc29261579600ce414b470c339510ac49d5 (patch) | |
tree | d485971f691e6914b92d52a4ba6976f6f3357a23 /ltm.c | |
parent | fc7b167ae0a0d65f0050299101e7d177550d7120 (diff) | |
download | lua-01b00cc29261579600ce414b470c339510ac49d5.tar.gz lua-01b00cc29261579600ce414b470c339510ac49d5.tar.bz2 lua-01b00cc29261579600ce414b470c339510ac49d5.zip |
better control over extensions of char/short to int
Diffstat (limited to 'ltm.c')
-rw-r--r-- | ltm.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltm.c,v 1.55 2000/10/20 16:39:03 roberto Exp roberto $ | 2 | ** $Id: ltm.c,v 1.56 2000/10/31 13:10:24 roberto Exp roberto $ |
3 | ** Tag methods | 3 | ** Tag methods |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -51,7 +51,7 @@ static int luaI_checkevent (lua_State *L, const char *name, int t) { | |||
51 | * 'placeholder' for "default" fallbacks | 51 | * 'placeholder' for "default" fallbacks |
52 | */ | 52 | */ |
53 | /* ORDER LUA_T, ORDER TM */ | 53 | /* ORDER LUA_T, ORDER TM */ |
54 | static const char luaT_validevents[NUM_TAGS][TM_N] = { | 54 | static const unsigned char luaT_validevents[NUM_TAGS][TM_N] = { |
55 | {1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}, /* LUA_TUSERDATA */ | 55 | {1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}, /* LUA_TUSERDATA */ |
56 | {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* LUA_TNIL */ | 56 | {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, /* LUA_TNIL */ |
57 | {1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}, /* LUA_TNUMBER */ | 57 | {1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}, /* LUA_TNUMBER */ |
@@ -61,7 +61,7 @@ static const char 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 : luaT_validevents[t][e]; | 64 | return (t >= NUM_TAGS) ? 1 : (int)luaT_validevents[t][e]; |
65 | } | 65 | } |
66 | 66 | ||
67 | 67 | ||