History

Lua 5.1.2-rc3

Lua Team committed 19 years ago

Commit f4079ca1 parent de7f97f7 files · +30 −27Browse files

Unified · Split

7 files
  1. COPYRIGHT +1 −1
  2. HISTORY +1 −1
  3. INSTALL +6 −3
  4. doc/manual.html +5 −5
  5. src/loadlib.c +14 −13
  6. src/lvm.c +2 −2
  7. src/print.c +1 −2
COPYRIGHT+1−1
@@ -9,7 +9,7 @@ For details and rationale, see http://www.lua.org/license.html . · 8 unmodified lines
99
1010 ===============================================================================
1111
12−Copyright (C) 1994-2006 Lua.org, PUC-Rio.
12+Copyright (C) 1994-2007 Lua.org, PUC-Rio.
1313
1414 Permission is hereby granted, free of charge, to any person obtaining a copy
1515 of this software and associated documentation files (the "Software"), to deal
HISTORY+1−1
@@ -14,7 +14,7 @@ HISTORY for Lua 5.1 · 13 unmodified lines
1414 API:
1515 + new functions: lua_createtable, lua_get(set)field, lua_push(to)integer.
1616 + user supplies memory allocator (lua_open becomes lua_newstate).
17− + luaopen_* functionst must be called through Lua.
17+ + luaopen_* functions must be called through Lua.
1818 Implementation:
1919 + new configuration scheme via luaconf.h.
2020 + incremental garbage collection.
INSTALL+6−3
@@ -8,7 +8,10 @@ INSTALL for Lua 5.1 · 7 unmodified lines
88 Building Lua on Unix systems should be very easy. First do "make" and
99 see if your platform is listed. If so, just do "make xxx", where xxx
1010 is your platform name. The platforms currently supported are:
11− ansi bsd generic linux macosx mingw posix solaris
11+ aix ansi bsd freebsd generic linux macosx mingw posix solaris
12+
13+ If your platform is not listed, try the closest one or posix, generic,
14+ ansi, in this order.
1215
1316 See below for customization instructions and for instructions on how
1417 to build with other Windows compilers.
@@ -81,8 +84,8 @@ INSTALL for Lua 5.1 · 66 unmodified lines
8184
8285 compiler: library, luac.c print.c
8386
84− If you use Visual Studio .NET, you can use etc/luavs.bat
85− in its "Command Prompt".
87+ If you use Visual Studio .NET, you can use etc/luavs.bat in its
88+ "Command Prompt".
8689
8790 If all you want is to build the Lua interpreter, you may put all .c files
8891 in a single project, except for luac.c and print.c. Or just use etc/all.c.
doc/manual.html+5−5
@@ -890,8 +890,8 @@ function definitions are explained in <a href="#2.5.9">&sect;2.5.9</a>; · 889 unmodified lines
890890 function calls are explained in <a href="#2.5.8">&sect;2.5.8</a>;
891891 table constructors are explained in <a href="#2.5.7">&sect;2.5.7</a>.
892892 Vararg expressions,
893−denoted by three dots ('<code>...</code>'), can only be used inside
894−vararg functions;
893+denoted by three dots ('<code>...</code>'), can only be used when
894+directly inside a vararg function;
895895 they are explained in <a href="#2.5.9">&sect;2.5.9</a>.
896896
897897
@@ -3222,7 +3222,7 @@ and returns this address. · 2324 unmodified lines
32223222
32233223
32243224 <p>
3225−Userdata represents C&nbsp;values in Lua.
3225+Userdata represent C&nbsp;values in Lua.
32263226 A <em>full userdata</em> represents a block of memory.
32273227 It is an object (like a table):
32283228 you must create it, it can have its own metatable,
@@ -3498,7 +3498,7 @@ Pushes a light userdata onto the stack. · 269 unmodified lines
34983498
34993499
35003500 <p>
3501−Userdata represents C&nbsp;values in Lua.
3501+Userdata represent C&nbsp;values in Lua.
35023502 A <em>light userdata</em> represents a pointer.
35033503 It is a value (like a number):
35043504 you do not create it, it has no individual metatable,
@@ -8511,7 +8511,7 @@ Here is the complete syntax of Lua in extended BNF. · 5006 unmodified lines
85118511 <HR>
85128512 <SMALL>
85138513 Last update:
8514−Fri Mar 23 14:37:09 BRT 2007
8514+Mon Mar 26 12:59:26 BRT 2007
85158515 </SMALL>
85168516 <!--
85178517 Last change: ready for Lua 5.1.2
src/loadlib.c+14−13
@@ -1,5 +1,5 @@
11 /*
2−** $Id: loadlib.c,v 1.52 2006/04/10 18:27:23 roberto Exp $
2+** $Id: loadlib.c,v 1.54a 2006/07/03 20:16:49 roberto Exp $
33 ** Dynamic library loader for Lua
44 ** See Copyright Notice in lua.h
55 **
@@ -16,9 +16,9 @@ · 10 unmodified lines
1616 #define loadlib_c
1717 #define LUA_LIB
1818
19−#include "lauxlib.h"
20−#include "lobject.h"
2119 #include "lua.h"
20+
21+#include "lauxlib.h"
2222 #include "lualib.h"
2323
2424
@@ -356,15 +356,16 @@ static const char *findfile (lua_State *L, const char *name, · 331 unmodified lines
356356 path = lua_tostring(L, -1);
357357 if (path == NULL)
358358 luaL_error(L, LUA_QL("package.%s") " must be a string", pname);
359− lua_pushstring(L, ""); /* error accumulator */
359+ lua_pushliteral(L, ""); /* error accumulator */
360360 while ((path = pushnexttemplate(L, path)) != NULL) {
361361 const char *filename;
362362 filename = luaL_gsub(L, lua_tostring(L, -1), LUA_PATH_MARK, name);
363+ lua_remove(L, -2); /* remove path template */
363364 if (readable(filename)) /* does file exist and is readable? */
364365 return filename; /* return that file name */
365− lua_pop(L, 2); /* remove path template and file name */
366− luaO_pushfstring(L, "\n\tno file " LUA_QS, filename);
367− lua_concat(L, 2);
366+ lua_pushfstring(L, "\n\tno file " LUA_QS, filename);
367+ lua_remove(L, -2); /* remove file name */
368+ lua_concat(L, 2); /* add entry to possible error message */
368369 }
369370 return NULL; /* not found */
370371 }
@@ -423,8 +424,8 @@ static int loader_Croot (lua_State *L) { · 52 unmodified lines
423424 funcname = mkfuncname(L, name);
424425 if ((stat = ll_loadfunc(L, filename, funcname)) != 0) {
425426 if (stat != ERRFUNC) loaderror(L, filename); /* real error */
426− luaO_pushfstring(L, "\n\tno module " LUA_QS " in file " LUA_QS,
427− name, filename);
427+ lua_pushfstring(L, "\n\tno module " LUA_QS " in file " LUA_QS,
428+ name, filename);
428429 return 1; /* function not found */
429430 }
430431 return 1;
@@ -438,7 +439,7 @@ static int loader_preload (lua_State *L) { · 7 unmodified lines
438439 luaL_error(L, LUA_QL("package.preload") " must be a table");
439440 lua_getfield(L, -1, name);
440441 if (lua_isnil(L, -1)) /* not found? */
441− luaO_pushfstring(L, "\n\tno field package.preload['%s']", name);
442+ lua_pushfstring(L, "\n\tno field package.preload['%s']", name);
442443 return 1;
443444 }
444445
@@ -462,7 +463,7 @@ static int ll_require (lua_State *L) { · 17 unmodified lines
462463 lua_getfield(L, LUA_ENVIRONINDEX, "loaders");
463464 if (!lua_istable(L, -1))
464465 luaL_error(L, LUA_QL("package.loaders") " must be a table");
465− lua_pushstring(L, ""); /* error message accumulator */
466+ lua_pushliteral(L, ""); /* error message accumulator */
466467 for (i=1; ; i++) {
467468 lua_rawgeti(L, -2, i); /* get a loader */
468469 if (lua_isnil(L, -1))
@@ -646,8 +647,8 @@ LUALIB_API int luaopen_package (lua_State *L) { · 177 unmodified lines
646647 setpath(L, "path", LUA_PATH, LUA_PATH_DEFAULT); /* set field `path' */
647648 setpath(L, "cpath", LUA_CPATH, LUA_CPATH_DEFAULT); /* set field `cpath' */
648649 /* store config information */
649− lua_pushstring(L, LUA_DIRSEP "\n" LUA_PATHSEP "\n" LUA_PATH_MARK "\n"
650− LUA_EXECDIR "\n" LUA_IGMARK);
650+ lua_pushliteral(L, LUA_DIRSEP "\n" LUA_PATHSEP "\n" LUA_PATH_MARK "\n"
651+ LUA_EXECDIR "\n" LUA_IGMARK);
651652 lua_setfield(L, -2, "config");
652653 /* set field `loaded' */
653654 luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 2);
src/lvm.c+2−2
@@ -165,7 +165,7 @@ static int call_binTM (lua_State *L, const TValue *p1, const TValue *p2, · 164 unmodified lines
165165 const TValue *tm = luaT_gettmbyobj(L, p1, event); /* try first operand */
166166 if (ttisnil(tm))
167167 tm = luaT_gettmbyobj(L, p2, event); /* try second operand */
168− if (!ttisfunction(tm)) return 0;
168+ if (ttisnil(tm)) return 0;
169169 callTMres(L, res, tm, p1, p2);
170170 return 1;
171171 }
@@ -285,7 +285,7 @@ void luaV_concat (lua_State *L, int total, int last) { · 113 unmodified lines
285285 if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT))
286286 luaG_concaterror(L, top-2, top-1);
287287 } else if (tsvalue(top-1)->len == 0) /* second op is empty? */
288− tostring(L, top - 2); /* result is first op (as string) */
288+ (void)tostring(L, top - 2); /* result is first op (as string) */
289289 else {
290290 /* at least two string values; get as many as possible */
291291 size_t tl = tsvalue(top-1)->len;
src/print.c+1−2
@@ -23,8 +23,7 @@ · 22 unmodified lines
2323 static void PrintString(const TString* ts)
2424 {
2525 const char* s=getstr(ts);
26− int n=ts->tsv.len;
27− int i;
26+ size_t i,n=ts->tsv.len;
2827 putchar('"');
2928 for (i=0; i<n; i++)
3029 {