diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-05-21 16:41:49 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-05-21 16:41:49 -0300 |
| commit | cdd0fe99464d7fb754f409dfec3277956eb30b83 (patch) | |
| tree | e14aa7bdec23d04bd63b331a735831c791fb4acb /ltm.c | |
| parent | bc8619342ae67226b55598047ab677bd93dfba5e (diff) | |
| download | lua-cdd0fe99464d7fb754f409dfec3277956eb30b83.tar.gz lua-cdd0fe99464d7fb754f409dfec3277956eb30b83.tar.bz2 lua-cdd0fe99464d7fb754f409dfec3277956eb30b83.zip | |
some C compilers cannot initialize a local struct
Diffstat (limited to 'ltm.c')
| -rw-r--r-- | ltm.c | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltm.c,v 1.23 1999/02/25 19:13:56 roberto Exp roberto $ | 2 | ** $Id: ltm.c,v 1.24 1999/02/26 15:48:55 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 | */ |
| @@ -129,7 +129,7 @@ TObject *luaT_gettagmethod (int t, char *event) { | |||
| 129 | 129 | ||
| 130 | 130 | ||
| 131 | void luaT_settagmethod (int t, char *event, TObject *func) { | 131 | void luaT_settagmethod (int t, char *event, TObject *func) { |
| 132 | TObject temp = *func; | 132 | TObject temp; |
| 133 | int e = luaI_checkevent(event, luaT_eventname); | 133 | int e = luaI_checkevent(event, luaT_eventname); |
| 134 | checktag(t); | 134 | checktag(t); |
| 135 | if (!luaT_validevent(t, e)) | 135 | if (!luaT_validevent(t, e)) |
| @@ -137,6 +137,7 @@ void luaT_settagmethod (int t, char *event, TObject *func) { | |||
| 137 | luaT_eventname[e], luaO_typenames[-t], | 137 | luaT_eventname[e], luaO_typenames[-t], |
| 138 | (t == LUA_T_ARRAY || t == LUA_T_USERDATA) ? " with default tag" | 138 | (t == LUA_T_ARRAY || t == LUA_T_USERDATA) ? " with default tag" |
| 139 | : ""); | 139 | : ""); |
| 140 | temp = *func; | ||
| 140 | *func = *luaT_getim(t,e); | 141 | *func = *luaT_getim(t,e); |
| 141 | *luaT_getim(t, e) = temp; | 142 | *luaT_getim(t, e) = temp; |
| 142 | } | 143 | } |
