History

Lua 5.1-rc3

Lua Team committed 20 years ago

Commit 010ebd01 parent 2fee0d617 files · +480 −377Browse files

Showing the changes to src (6 of 17 files). Show all

Unified · Split

6 files
  1. src/Makefile +2 −0
  2. src/liolib.c +2 −2
  3. src/llex.c +2 −2
  4. src/loslib.c +5 −4
  5. src/lstate.h +5 −5
  6. src/luaconf.h +2 −2
src/Makefile+2−0
@@ -107,6 +107,8 @@ posix: · 106 unmodified lines
107107 solaris:
108108 $(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-ldl"
109109
110+# list targets that do not create files (but not all makes understand .PHONY)
111+.PHONY: all $(PLATS) default o a clean depend echo none
110112
111113 # DO NOT DELETE
112114
src/liolib.c+2−2
@@ -1,5 +1,5 @@
11 /*
2−** $Id: liolib.c,v 2.71 2006/01/17 13:54:02 roberto Exp $
2+** $Id: liolib.c,v 2.72 2006/01/28 12:59:13 roberto Exp $
33 ** Standard I/O (and system) library
44 ** See Copyright Notice in lua.h
55 */
@@ -283,7 +283,7 @@ static int read_line (lua_State *L, FILE *f) { · 277 unmodified lines
283283 return (lua_strlen(L, -1) > 0); /* check whether read something */
284284 }
285285 l = strlen(p);
286− if (p[l-1] != '\n')
286+ if (l == 0 || p[l-1] != '\n')
287287 luaL_addsize(&b, l);
288288 else {
289289 luaL_addsize(&b, l - 1); /* do not include `eol' */
src/llex.c+2−2
@@ -1,5 +1,5 @@
11 /*
2−** $Id: llex.c,v 2.18 2006/01/23 20:06:19 roberto Exp $
2+** $Id: llex.c,v 2.19 2006/02/06 18:28:16 roberto Exp $
33 ** Lexical Analyzer
44 ** See Copyright Notice in lua.h
55 */
@@ -166,7 +166,7 @@ static int check_next (LexState *ls, const char *set) { · 160 unmodified lines
166166
167167
168168 static void buffreplace (LexState *ls, char from, char to) {
169− int n = luaZ_bufflen(ls->buff);
169+ size_t n = luaZ_bufflen(ls->buff);
170170 char *p = luaZ_buffer(ls->buff);
171171 while (n--)
172172 if (p[n] == from) p[n] = to;
src/loslib.c+5−4
@@ -1,5 +1,5 @@
11 /*
2−** $Id: loslib.c,v 1.16 2005/12/22 16:19:56 roberto Exp $
2+** $Id: loslib.c,v 1.17 2006/01/27 13:54:31 roberto Exp $
33 ** Standard Operating System library
44 ** See Copyright Notice in lua.h
55 */
@@ -21,6 +21,7 @@ · 15 unmodified lines
2121
2222
2323 static int os_pushresult (lua_State *L, int i, const char *filename) {
24+ int en = errno; /* calls to Lua API may change this value */
2425 if (i) {
2526 lua_pushboolean(L, 1);
2627 return 1;
@@ -28,10 +29,10 @@ static int os_pushresult (lua_State *L, int i, const char *filename) { · 1 unmodified line
2829 else {
2930 lua_pushnil(L);
3031 if (filename)
31− lua_pushfstring(L, "%s: %s", filename, strerror(errno));
32+ lua_pushfstring(L, "%s: %s", filename, strerror(en));
3233 else
33− lua_pushfstring(L, "%s", strerror(errno));
34− lua_pushinteger(L, errno);
34+ lua_pushfstring(L, "%s", strerror(en));
35+ lua_pushinteger(L, en);
3536 return 3;
3637 }
3738 }
src/lstate.h+5−5
@@ -1,5 +1,5 @@
11 /*
2−** $Id: lstate.h,v 2.23 2005/07/09 13:22:34 roberto Exp $
2+** $Id: lstate.h,v 2.24 2006/02/06 18:27:59 roberto Exp $
33 ** Global State
44 ** See Copyright Notice in lua.h
55 */
@@ -49,8 +49,8 @@ typedef struct CallInfo { · 43 unmodified lines
4949 StkId base; /* base for this function */
5050 StkId func; /* function index in the stack */
5151 StkId top; /* top for this function */
52− int nresults; /* expected number of results from this function */
5352 const Instruction *savedpc;
53+ int nresults; /* expected number of results from this function */
5454 int tailcalls; /* number of tail calls lost under this entry */
5555 } CallInfo;
5656
@@ -71,9 +71,9 @@ typedef struct global_State { · 14 unmodified lines
7171 void *ud; /* auxiliary data to `frealloc' */
7272 lu_byte currentwhite;
7373 lu_byte gcstate; /* state of garbage collector */
74+ int sweepstrgc; /* position of sweep in `strt' */
7475 GCObject *rootgc; /* list of all collectable objects */
7576 GCObject **sweepgc; /* position of sweep in `rootgc' */
76− int sweepstrgc; /* position of sweep in `strt' */
7777 GCObject *gray; /* list of gray objects */
7878 GCObject *grayagain; /* list of objects to be traversed atomically */
7979 GCObject *weak; /* list of weak tables (to be cleared) */
@@ -99,6 +99,7 @@ typedef struct global_State { · 19 unmodified lines
9999 */
100100 struct lua_State {
101101 CommonHeader;
102+ lu_byte status;
102103 StkId top; /* first free slot in the stack */
103104 StkId base; /* base of current function */
104105 global_State *l_G;
@@ -106,14 +107,13 @@ struct lua_State { · 1 unmodified line
106107 const Instruction *savedpc; /* `savedpc' of current function */
107108 StkId stack_last; /* last free slot in the stack */
108109 StkId stack; /* stack base */
109− int stacksize;
110110 CallInfo *end_ci; /* points after end of ci array*/
111111 CallInfo *base_ci; /* array of CallInfo's */
112+ int stacksize;
112113 int size_ci; /* size of array `base_ci' */
113114 unsigned short nCcalls; /* number of nested C calls */
114115 lu_byte hookmask;
115116 lu_byte allowhook;
116− lu_byte status;
117117 int basehookcount;
118118 int hookcount;
119119 lua_Hook hook;
src/luaconf.h+2−2
@@ -1,5 +1,5 @@
11 /*
2−** $Id: luaconf.h,v 1.79 2006/01/23 19:51:43 roberto Exp $
2+** $Id: luaconf.h,v 1.80 2006/01/27 13:54:39 roberto Exp $
33 ** Configuration file for Lua
44 ** See Copyright Notice in lua.h
55 */
@@ -541,7 +541,7 @@ · 535 unmodified lines
541541 */
542542
543543 /* On a Pentium, resort to a trick */
544−#if !defined(LUA_ANSI) && !defined(__SSE2__) && \
544+#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__) && \
545545 (defined(__i386) || defined (_M_IX86) || defined(__i386__))
546546 union luai_Cast { double l_d; long l_l; };
547547 #define lua_number2int(i,d) \

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