Showing the changes to src (6 of 17 files). Show all
Unified · Split
| @@ -107,6 +107,8 @@ posix: · 106 unmodified lines | ||
| 107 | 107 | solaris: |
| 108 | 108 | $(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-ldl" |
| 109 | 109 | |
| 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 | |
| 110 | 112 | |
| 111 | 113 | # DO NOT DELETE |
| 112 | 114 | |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | /* |
| 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 $ | |
| 3 | 3 | ** Standard I/O (and system) library |
| 4 | 4 | ** See Copyright Notice in lua.h |
| 5 | 5 | */ |
| @@ -283,7 +283,7 @@ static int read_line (lua_State *L, FILE *f) { · 277 unmodified lines | ||
| 283 | 283 | return (lua_strlen(L, -1) > 0); /* check whether read something */ |
| 284 | 284 | } |
| 285 | 285 | l = strlen(p); |
| 286 | − if (p[l-1] != '\n') | |
| 286 | + if (l == 0 || p[l-1] != '\n') | |
| 287 | 287 | luaL_addsize(&b, l); |
| 288 | 288 | else { |
| 289 | 289 | luaL_addsize(&b, l - 1); /* do not include `eol' */ |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | /* |
| 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 $ | |
| 3 | 3 | ** Lexical Analyzer |
| 4 | 4 | ** See Copyright Notice in lua.h |
| 5 | 5 | */ |
| @@ -166,7 +166,7 @@ static int check_next (LexState *ls, const char *set) { · 160 unmodified lines | ||
| 166 | 166 | |
| 167 | 167 | |
| 168 | 168 | static void buffreplace (LexState *ls, char from, char to) { |
| 169 | − int n = luaZ_bufflen(ls->buff); | |
| 169 | + size_t n = luaZ_bufflen(ls->buff); | |
| 170 | 170 | char *p = luaZ_buffer(ls->buff); |
| 171 | 171 | while (n--) |
| 172 | 172 | if (p[n] == from) p[n] = to; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | /* |
| 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 $ | |
| 3 | 3 | ** Standard Operating System library |
| 4 | 4 | ** See Copyright Notice in lua.h |
| 5 | 5 | */ |
| @@ -21,6 +21,7 @@ · 15 unmodified lines | ||
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | static int os_pushresult (lua_State *L, int i, const char *filename) { |
| 24 | + int en = errno; /* calls to Lua API may change this value */ | |
| 24 | 25 | if (i) { |
| 25 | 26 | lua_pushboolean(L, 1); |
| 26 | 27 | return 1; |
| @@ -28,10 +29,10 @@ static int os_pushresult (lua_State *L, int i, const char *filename) { · 1 unmodified line | ||
| 28 | 29 | else { |
| 29 | 30 | lua_pushnil(L); |
| 30 | 31 | if (filename) |
| 31 | − lua_pushfstring(L, "%s: %s", filename, strerror(errno)); | |
| 32 | + lua_pushfstring(L, "%s: %s", filename, strerror(en)); | |
| 32 | 33 | 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); | |
| 35 | 36 | return 3; |
| 36 | 37 | } |
| 37 | 38 | } |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | /* |
| 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 $ | |
| 3 | 3 | ** Global State |
| 4 | 4 | ** See Copyright Notice in lua.h |
| 5 | 5 | */ |
| @@ -49,8 +49,8 @@ typedef struct CallInfo { · 43 unmodified lines | ||
| 49 | 49 | StkId base; /* base for this function */ |
| 50 | 50 | StkId func; /* function index in the stack */ |
| 51 | 51 | StkId top; /* top for this function */ |
| 52 | − int nresults; /* expected number of results from this function */ | |
| 53 | 52 | const Instruction *savedpc; |
| 53 | + int nresults; /* expected number of results from this function */ | |
| 54 | 54 | int tailcalls; /* number of tail calls lost under this entry */ |
| 55 | 55 | } CallInfo; |
| 56 | 56 | |
| @@ -71,9 +71,9 @@ typedef struct global_State { · 14 unmodified lines | ||
| 71 | 71 | void *ud; /* auxiliary data to `frealloc' */ |
| 72 | 72 | lu_byte currentwhite; |
| 73 | 73 | lu_byte gcstate; /* state of garbage collector */ |
| 74 | + int sweepstrgc; /* position of sweep in `strt' */ | |
| 74 | 75 | GCObject *rootgc; /* list of all collectable objects */ |
| 75 | 76 | GCObject **sweepgc; /* position of sweep in `rootgc' */ |
| 76 | − int sweepstrgc; /* position of sweep in `strt' */ | |
| 77 | 77 | GCObject *gray; /* list of gray objects */ |
| 78 | 78 | GCObject *grayagain; /* list of objects to be traversed atomically */ |
| 79 | 79 | GCObject *weak; /* list of weak tables (to be cleared) */ |
| @@ -99,6 +99,7 @@ typedef struct global_State { · 19 unmodified lines | ||
| 99 | 99 | */ |
| 100 | 100 | struct lua_State { |
| 101 | 101 | CommonHeader; |
| 102 | + lu_byte status; | |
| 102 | 103 | StkId top; /* first free slot in the stack */ |
| 103 | 104 | StkId base; /* base of current function */ |
| 104 | 105 | global_State *l_G; |
| @@ -106,14 +107,13 @@ struct lua_State { · 1 unmodified line | ||
| 106 | 107 | const Instruction *savedpc; /* `savedpc' of current function */ |
| 107 | 108 | StkId stack_last; /* last free slot in the stack */ |
| 108 | 109 | StkId stack; /* stack base */ |
| 109 | − int stacksize; | |
| 110 | 110 | CallInfo *end_ci; /* points after end of ci array*/ |
| 111 | 111 | CallInfo *base_ci; /* array of CallInfo's */ |
| 112 | + int stacksize; | |
| 112 | 113 | int size_ci; /* size of array `base_ci' */ |
| 113 | 114 | unsigned short nCcalls; /* number of nested C calls */ |
| 114 | 115 | lu_byte hookmask; |
| 115 | 116 | lu_byte allowhook; |
| 116 | − lu_byte status; | |
| 117 | 117 | int basehookcount; |
| 118 | 118 | int hookcount; |
| 119 | 119 | lua_Hook hook; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | /* |
| 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 $ | |
| 3 | 3 | ** Configuration file for Lua |
| 4 | 4 | ** See Copyright Notice in lua.h |
| 5 | 5 | */ |
| @@ -541,7 +541,7 @@ · 535 unmodified lines | ||
| 541 | 541 | */ |
| 542 | 542 | |
| 543 | 543 | /* 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__) && \ | |
| 545 | 545 | (defined(__i386) || defined (_M_IX86) || defined(__i386__)) |
| 546 | 546 | union luai_Cast { double l_d; long l_l; }; |
| 547 | 547 | #define lua_number2int(i,d) \ |