History

Lua 5.1.3-rc2

Lua Team committed 18 years ago

Commit aeb9dbd1 parent ea97e799 files · +32 −23Browse files

Showing the changes to src (4 of 9 files). Show all

Unified · Split

4 files
  1. src/ldblib.c +7 −5
  2. src/loslib.c +1 −2
  3. src/luaconf.h +2 −2
  4. src/lundump.c +4 −2
src/ldblib.c+7−5
@@ -1,5 +1,5 @@
11 /*
2−** $Id: ldblib.c,v 1.104.1.1 2007/12/27 13:02:25 roberto Exp $
2+** $Id: ldblib.c,v 1.104.1.2 2008/01/18 16:39:45 roberto Exp $
33 ** Interface from Lua to its debug API
44 ** See Copyright Notice in lua.h
55 */
@@ -255,17 +255,18 @@ static void gethooktable (lua_State *L) { · 249 unmodified lines
255255
256256
257257 static int db_sethook (lua_State *L) {
258− int arg;
258+ int arg, mask, count;
259+ lua_Hook func;
259260 lua_State *L1 = getthread(L, &arg);
260261 if (lua_isnoneornil(L, arg+1)) {
261262 lua_settop(L, arg+1);
262− lua_sethook(L1, NULL, 0, 0); /* turn off hooks */
263+ func = NULL; mask = 0; count = 0; /* turn off hooks */
263264 }
264265 else {
265266 const char *smask = luaL_checkstring(L, arg+2);
266− int count = luaL_optint(L, arg+3, 0);
267267 luaL_checktype(L, arg+1, LUA_TFUNCTION);
268− lua_sethook(L1, hookf, makemask(smask, count), count);
268+ count = luaL_optint(L, arg+3, 0);
269+ func = hookf; mask = makemask(smask, count);
269270 }
270271 gethooktable(L1);
271272 lua_pushlightuserdata(L1, L1);
@@ -273,6 +274,7 @@ static int db_sethook (lua_State *L) { · 1 unmodified line
273274 lua_xmove(L, L1, 1);
274275 lua_rawset(L1, -3); /* set new hook */
275276 lua_pop(L1, 1); /* remove hook table */
277+ lua_sethook(L1, func, mask, count); /* set hooks */
276278 return 0;
277279 }
278280
src/loslib.c+1−2
@@ -1,5 +1,5 @@
11 /*
2−** $Id: loslib.c,v 1.19.1.2 2007/12/28 14:58:43 roberto Exp $
2+** $Id: loslib.c,v 1.19.1.3 2008/01/18 16:38:18 roberto Exp $
33 ** Standard Operating System library
44 ** See Copyright Notice in lua.h
55 */
@@ -215,7 +215,6 @@ static int os_setlocale (lua_State *L) { · 209 unmodified lines
215215
216216 static int os_exit (lua_State *L) {
217217 exit(luaL_optint(L, 1, EXIT_SUCCESS));
218− return 0; /* to avoid warnings */
219218 }
220219
221220 static const luaL_Reg syslib[] = {
src/luaconf.h+2−2
@@ -1,5 +1,5 @@
11 /*
2−** $Id: luaconf.h,v 1.82.1.5 2008/01/17 14:04:20 roberto Exp $
2+** $Id: luaconf.h,v 1.82.1.6 2008/01/18 17:07:48 roberto Exp $
33 ** Configuration file for Lua
44 ** See Copyright Notice in lua.h
55 */
@@ -667,7 +667,7 @@ union luai_Cast { double l_d; long l_l; }; · 661 unmodified lines
667667 */
668668 #if defined(LUA_USE_POPEN)
669669
670−#define lua_popen(L,c,m) ((void)L, popen(c,m))
670+#define lua_popen(L,c,m) ((void)L, fflush(NULL), popen(c,m))
671671 #define lua_pclose(L,file) ((void)L, (pclose(file) != -1))
672672
673673 #elif defined(LUA_WIN)
src/lundump.c+4−2
@@ -1,5 +1,5 @@
11 /*
2−** $Id: lundump.c,v 2.7.1.1 2007/12/27 13:02:25 roberto Exp $
2+** $Id: lundump.c,v 2.7.1.2 2008/01/18 16:39:11 roberto Exp $
33 ** load precompiled Lua chunks
44 ** See Copyright Notice in lua.h
55 */
@@ -29,6 +29,7 @@ typedef struct { · 23 unmodified lines
2929
3030 #ifdef LUAC_TRUST_BINARIES
3131 #define IF(c,s)
32+#define error(S,s)
3233 #else
3334 #define IF(c,s) if (c) error(S,s)
3435
@@ -47,6 +48,7 @@ static void error(LoadState* S, const char* why) · 12 unmodified lines
4748 static void LoadBlock(LoadState* S, void* b, size_t size)
4849 {
4950 size_t r=luaZ_read(S->Z,b,size);
51+ UNUSED(r);
5052 IF (r!=0, "unexpected end");
5153 }
5254
@@ -122,7 +124,7 @@ static void LoadConstants(LoadState* S, Proto* f) · 69 unmodified lines
122124 setsvalue2n(S->L,o,LoadString(S));
123125 break;
124126 default:
125− IF (1, "bad constant");
127+ error(S,"bad constant");
126128 break;
127129 }
128130 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t