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 @@
1/*1/*
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 $
3** Interface from Lua to its debug API3** Interface from Lua to its debug API
4** See Copyright Notice in lua.h4** See Copyright Notice in lua.h
5*/5*/
@@ -255,17 +255,18 @@ static void gethooktable (lua_State *L) { · 249 unmodified lines
255 255
256 256
257static int db_sethook (lua_State *L) {257static int db_sethook (lua_State *L) {
258 int arg;258 int arg, mask, count;
259 lua_Hook func;
259 lua_State *L1 = getthread(L, &arg);260 lua_State *L1 = getthread(L, &arg);
260 if (lua_isnoneornil(L, arg+1)) {261 if (lua_isnoneornil(L, arg+1)) {
261 lua_settop(L, arg+1);262 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 */
263 }264 }
264 else {265 else {
265 const char *smask = luaL_checkstring(L, arg+2);266 const char *smask = luaL_checkstring(L, arg+2);
266 int count = luaL_optint(L, arg+3, 0);
267 luaL_checktype(L, arg+1, LUA_TFUNCTION);267 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);
269 }270 }
270 gethooktable(L1);271 gethooktable(L1);
271 lua_pushlightuserdata(L1, L1);272 lua_pushlightuserdata(L1, L1);
@@ -273,6 +274,7 @@ static int db_sethook (lua_State *L) { · 1 unmodified line
273 lua_xmove(L, L1, 1);274 lua_xmove(L, L1, 1);
274 lua_rawset(L1, -3); /* set new hook */275 lua_rawset(L1, -3); /* set new hook */
275 lua_pop(L1, 1); /* remove hook table */276 lua_pop(L1, 1); /* remove hook table */
277 lua_sethook(L1, func, mask, count); /* set hooks */
276 return 0;278 return 0;
277}279}
278 280
src/loslib.c+1−2
@@ -1,5 +1,5 @@
1/*1/*
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 $
3** Standard Operating System library3** Standard Operating System library
4** See Copyright Notice in lua.h4** See Copyright Notice in lua.h
5*/5*/
@@ -215,7 +215,6 @@ static int os_setlocale (lua_State *L) { · 209 unmodified lines
215 215
216static int os_exit (lua_State *L) {216static int os_exit (lua_State *L) {
217 exit(luaL_optint(L, 1, EXIT_SUCCESS));217 exit(luaL_optint(L, 1, EXIT_SUCCESS));
218 return 0; /* to avoid warnings */
219}218}
220 219
221static const luaL_Reg syslib[] = {220static const luaL_Reg syslib[] = {
src/luaconf.h+2−2
@@ -1,5 +1,5 @@
1/*1/*
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 $
3** Configuration file for Lua3** Configuration file for Lua
4** See Copyright Notice in lua.h4** See Copyright Notice in lua.h
5*/5*/
@@ -667,7 +667,7 @@ union luai_Cast { double l_d; long l_l; }; · 661 unmodified lines
667*/667*/
668#if defined(LUA_USE_POPEN)668#if defined(LUA_USE_POPEN)
669 669
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))
671#define lua_pclose(L,file) ((void)L, (pclose(file) != -1))671#define lua_pclose(L,file) ((void)L, (pclose(file) != -1))
672 672
673#elif defined(LUA_WIN)673#elif defined(LUA_WIN)
src/lundump.c+4−2
@@ -1,5 +1,5 @@
1/*1/*
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 $
3** load precompiled Lua chunks3** load precompiled Lua chunks
4** See Copyright Notice in lua.h4** See Copyright Notice in lua.h
5*/5*/
@@ -29,6 +29,7 @@ typedef struct { · 23 unmodified lines
29 29
30#ifdef LUAC_TRUST_BINARIES30#ifdef LUAC_TRUST_BINARIES
31#define IF(c,s)31#define IF(c,s)
32#define error(S,s)
32#else33#else
33#define IF(c,s) if (c) error(S,s)34#define IF(c,s) if (c) error(S,s)
34 35
@@ -47,6 +48,7 @@ static void error(LoadState* S, const char* why) · 12 unmodified lines
47static void LoadBlock(LoadState* S, void* b, size_t size)48static void LoadBlock(LoadState* S, void* b, size_t size)
48{49{
49 size_t r=luaZ_read(S->Z,b,size);50 size_t r=luaZ_read(S->Z,b,size);
51 UNUSED(r);
50 IF (r!=0, "unexpected end");52 IF (r!=0, "unexpected end");
51}53}
52 54
@@ -122,7 +124,7 @@ static void LoadConstants(LoadState* S, Proto* f) · 69 unmodified lines
122 setsvalue2n(S->L,o,LoadString(S));124 setsvalue2n(S->L,o,LoadString(S));
123 break;125 break;
124 default:126 default:
125 IF (1, "bad constant");127 error(S,"bad constant");
126 break;128 break;
127 }129 }
128 }130 }

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