diff options
Diffstat (limited to 'loslib.c')
-rw-r--r-- | loslib.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: loslib.c,v 1.2 2004/08/05 19:30:37 roberto Exp roberto $ | 2 | ** $Id: loslib.c,v 1.3 2004/10/08 18:57:16 roberto Exp roberto $ |
3 | ** Standard Operating System library | 3 | ** Standard Operating System library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -91,15 +91,13 @@ static int io_clock (lua_State *L) { | |||
91 | */ | 91 | */ |
92 | 92 | ||
93 | static void setfield (lua_State *L, const char *key, int value) { | 93 | static void setfield (lua_State *L, const char *key, int value) { |
94 | lua_pushstring(L, key); | ||
95 | lua_pushinteger(L, value); | 94 | lua_pushinteger(L, value); |
96 | lua_rawset(L, -3); | 95 | lua_setfield(L, -2, key); |
97 | } | 96 | } |
98 | 97 | ||
99 | static void setboolfield (lua_State *L, const char *key, int value) { | 98 | static void setboolfield (lua_State *L, const char *key, int value) { |
100 | lua_pushstring(L, key); | ||
101 | lua_pushboolean(L, value); | 99 | lua_pushboolean(L, value); |
102 | lua_rawset(L, -3); | 100 | lua_setfield(L, -2, key); |
103 | } | 101 | } |
104 | 102 | ||
105 | static int getboolfield (lua_State *L, const char *key) { | 103 | static int getboolfield (lua_State *L, const char *key) { |