diff options
author | Lua Team <team@lua.org> | 2008-01-18 12:00:00 +0000 |
---|---|---|
committer | repogen <> | 2008-01-18 12:00:00 +0000 |
commit | 5065c5cce2d4c35d65319fede6b8eddc410fb846 (patch) | |
tree | 127eee020245a47128184a35cb78059a26d1770f | |
parent | b2874e1bcdc4d4a56d8a232a88d5e17c6a9826f5 (diff) | |
download | lua-github-5.1.3-rc2.tar.gz |
Lua 5.1.3-rc25.1.3-rc2
-rw-r--r-- | COPYRIGHT | 2 | ||||
-rw-r--r-- | doc/contents.html | 8 | ||||
-rw-r--r-- | doc/manual.html | 14 | ||||
-rw-r--r-- | etc/min.c | 2 | ||||
-rw-r--r-- | etc/strict.lua | 4 | ||||
-rw-r--r-- | src/ldblib.c | 12 | ||||
-rw-r--r-- | src/loslib.c | 3 | ||||
-rw-r--r-- | src/luaconf.h | 4 | ||||
-rw-r--r-- | src/lundump.c | 6 |
9 files changed, 32 insertions, 23 deletions
@@ -9,7 +9,7 @@ For details and rationale, see http://www.lua.org/license.html . =============================================================================== -Copyright (C) 1994-2007 Lua.org, PUC-Rio. +Copyright (C) 1994-2008 Lua.org, PUC-Rio. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/doc/contents.html b/doc/contents.html index 98562560..4d253e54 100644 --- a/doc/contents.html +++ b/doc/contents.html @@ -1,7 +1,9 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <TITLE>Lua 5.1 Reference Manual - contents</TITLE> <LINK REL="stylesheet" TYPE="text/css" HREF="lua.css"> +<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1"> <STYLE TYPE="text/css"> ul { list-style-type: none ; @@ -49,9 +51,9 @@ For a complete introduction to Lua programming, see the book · <A HREF="#index">index</A> · -<A HREF="http://www.lua.org/manual/5.1/pt/">português</A> +<A HREF="http://www.lua.org/manual/5.1/pt/">português</A> · -<A HREF="http://www.lua.org/manual/5.1/es/">español</A> +<A HREF="http://www.lua.org/manual/5.1/es/">español</A> <HR> <SMALL> Copyright © 2006-2008 Lua.org, PUC-Rio. @@ -486,7 +488,7 @@ Freely available under the terms of the <HR> <SMALL> Last update: -Thu Jan 17 14:50:23 BRST 2008 +Fri Jan 18 10:36:25 BRST 2008 </SMALL> <!-- Last change: revised for Lua 5.1.3 diff --git a/doc/manual.html b/doc/manual.html index 4df4d4be..7c0fd2b8 100644 --- a/doc/manual.html +++ b/doc/manual.html @@ -1,10 +1,11 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Lua 5.1 Reference Manual</title> <link rel="stylesheet" href="lua.css"> <link rel="stylesheet" href="manual.css"> +<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=iso-8859-1"> </head> <body> @@ -32,7 +33,7 @@ Freely available under the terms of the <!-- ====================================================================== --> <p> -<!-- $Id: manual.of,v 1.43 2008/01/17 16:19:44 roberto Exp $ --> +<!-- $Id: manual.of,v 1.44 2008/01/18 16:41:50 roberto Exp $ --> @@ -179,6 +180,7 @@ which can be specified as '<code>\0</code>'. <p> To put a double (single) quote, a newline, a backslash, +a carriage return, or an embedded zero inside a literal string enclosed by double (single) quotes you must use an escape sequence. @@ -2665,7 +2667,7 @@ of numerical arguments and returns their average and sum: <hr><h3><a name="lua_checkstack"><code>lua_checkstack</code></a></h3><p> -<span class="apii">[-0, +0, <em>-</em>]</span> +<span class="apii">[-0, +0, <em>m</em>]</span> <pre>int lua_checkstack (lua_State *L, int extra);</pre> <p> @@ -3767,7 +3769,7 @@ The reader function may return pieces of any size greater than zero. <hr><h3><a name="lua_register"><code>lua_register</code></a></h3><p> -<span class="apii">[-0, +0, <em>m</em>]</span> +<span class="apii">[-0, +0, <em>e</em>]</span> <pre>void lua_register (lua_State *L, const char *name, lua_CFunction f);</pre> @@ -4395,7 +4397,7 @@ Returns the current hook mask. <hr><h3><a name="lua_getinfo"><code>lua_getinfo</code></a></h3><p> -<span class="apii">[-(0|1), +(0|1|2), <em>-</em>]</span> +<span class="apii">[-(0|1), +(0|1|2), <em>m</em>]</span> <pre>int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar);</pre> <p> @@ -8739,7 +8741,7 @@ Here is the complete syntax of Lua in extended BNF. <HR> <SMALL> Last update: -Thu Jan 17 15:06:18 BRST 2008 +Fri Jan 18 14:50:20 BRST 2008 </SMALL> <!-- Last change: revised for Lua 5.1.3 @@ -18,7 +18,7 @@ static int print(lua_State *L) if (i>1) printf("\t"); if (lua_isstring(L,i)) printf("%s",lua_tostring(L,i)); - else if (lua_isnil(L,i)==2) + else if (lua_isnil(L,i)) printf("%s","nil"); else if (lua_isboolean(L,i)) printf("%s",lua_toboolean(L,i) ? "true" : "false"); diff --git a/etc/strict.lua b/etc/strict.lua index 16ee26b4..604619dd 100644 --- a/etc/strict.lua +++ b/etc/strict.lua @@ -6,6 +6,8 @@ -- anywhere or assigned to inside a function. -- +local getinfo, error, rawset, rawget = debug.getinfo, error, rawset, rawget + local mt = getmetatable(_G) if mt == nil then mt = {} @@ -15,7 +17,7 @@ end mt.__declared = {} local function what () - local d = debug.getinfo(3, "S") + local d = getinfo(3, "S") return d and d.what or "C" end diff --git a/src/ldblib.c b/src/ldblib.c index bb47cc72..8d631e37 100644 --- a/src/ldblib.c +++ b/src/ldblib.c @@ -1,5 +1,5 @@ /* -** $Id: ldblib.c,v 1.104.1.1 2007/12/27 13:02:25 roberto Exp $ +** $Id: ldblib.c,v 1.104.1.2 2008/01/18 16:39:45 roberto Exp $ ** Interface from Lua to its debug API ** See Copyright Notice in lua.h */ @@ -255,17 +255,18 @@ static void gethooktable (lua_State *L) { static int db_sethook (lua_State *L) { - int arg; + int arg, mask, count; + lua_Hook func; lua_State *L1 = getthread(L, &arg); if (lua_isnoneornil(L, arg+1)) { lua_settop(L, arg+1); - lua_sethook(L1, NULL, 0, 0); /* turn off hooks */ + func = NULL; mask = 0; count = 0; /* turn off hooks */ } else { const char *smask = luaL_checkstring(L, arg+2); - int count = luaL_optint(L, arg+3, 0); luaL_checktype(L, arg+1, LUA_TFUNCTION); - lua_sethook(L1, hookf, makemask(smask, count), count); + count = luaL_optint(L, arg+3, 0); + func = hookf; mask = makemask(smask, count); } gethooktable(L1); lua_pushlightuserdata(L1, L1); @@ -273,6 +274,7 @@ static int db_sethook (lua_State *L) { lua_xmove(L, L1, 1); lua_rawset(L1, -3); /* set new hook */ lua_pop(L1, 1); /* remove hook table */ + lua_sethook(L1, func, mask, count); /* set hooks */ return 0; } diff --git a/src/loslib.c b/src/loslib.c index be6e4e80..da06a572 100644 --- a/src/loslib.c +++ b/src/loslib.c @@ -1,5 +1,5 @@ /* -** $Id: loslib.c,v 1.19.1.2 2007/12/28 14:58:43 roberto Exp $ +** $Id: loslib.c,v 1.19.1.3 2008/01/18 16:38:18 roberto Exp $ ** Standard Operating System library ** See Copyright Notice in lua.h */ @@ -215,7 +215,6 @@ static int os_setlocale (lua_State *L) { static int os_exit (lua_State *L) { exit(luaL_optint(L, 1, EXIT_SUCCESS)); - return 0; /* to avoid warnings */ } static const luaL_Reg syslib[] = { diff --git a/src/luaconf.h b/src/luaconf.h index c9698b0d..eb2f5a1f 100644 --- a/src/luaconf.h +++ b/src/luaconf.h @@ -1,5 +1,5 @@ /* -** $Id: luaconf.h,v 1.82.1.5 2008/01/17 14:04:20 roberto Exp $ +** $Id: luaconf.h,v 1.82.1.6 2008/01/18 17:07:48 roberto Exp $ ** Configuration file for Lua ** See Copyright Notice in lua.h */ @@ -667,7 +667,7 @@ union luai_Cast { double l_d; long l_l; }; */ #if defined(LUA_USE_POPEN) -#define lua_popen(L,c,m) ((void)L, popen(c,m)) +#define lua_popen(L,c,m) ((void)L, fflush(NULL), popen(c,m)) #define lua_pclose(L,file) ((void)L, (pclose(file) != -1)) #elif defined(LUA_WIN) diff --git a/src/lundump.c b/src/lundump.c index 1f992f24..731c0645 100644 --- a/src/lundump.c +++ b/src/lundump.c @@ -1,5 +1,5 @@ /* -** $Id: lundump.c,v 2.7.1.1 2007/12/27 13:02:25 roberto Exp $ +** $Id: lundump.c,v 2.7.1.2 2008/01/18 16:39:11 roberto Exp $ ** load precompiled Lua chunks ** See Copyright Notice in lua.h */ @@ -29,6 +29,7 @@ typedef struct { #ifdef LUAC_TRUST_BINARIES #define IF(c,s) +#define error(S,s) #else #define IF(c,s) if (c) error(S,s) @@ -47,6 +48,7 @@ static void error(LoadState* S, const char* why) static void LoadBlock(LoadState* S, void* b, size_t size) { size_t r=luaZ_read(S->Z,b,size); + UNUSED(r); IF (r!=0, "unexpected end"); } @@ -122,7 +124,7 @@ static void LoadConstants(LoadState* S, Proto* f) setsvalue2n(S->L,o,LoadString(S)); break; default: - IF (1, "bad constant"); + error(S,"bad constant"); break; } } |