aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-03-21 10:52:33 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-03-21 10:52:33 -0300
commitda4811238ab48446545621389cb07051982a8279 (patch)
tree56b1a056b383cb09295630e835ad12211036bd6d
parentf96872a534f1d10788d5607d634cc77e25a887ff (diff)
downloadlua-da4811238ab48446545621389cb07051982a8279.tar.gz
lua-da4811238ab48446545621389cb07051982a8279.tar.bz2
lua-da4811238ab48446545621389cb07051982a8279.zip
details (typos in comments)
-rw-r--r--lcode.c4
-rw-r--r--ldo.c4
-rw-r--r--lgc.c4
-rw-r--r--lobject.c4
-rw-r--r--lstrlib.c16
-rw-r--r--ltablib.c4
6 files changed, 18 insertions, 18 deletions
diff --git a/lcode.c b/lcode.c
index e6b2d98b..e2ffda4e 100644
--- a/lcode.c
+++ b/lcode.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lcode.c,v 2.83 2014/03/07 16:19:00 roberto Exp roberto $ 2** $Id: lcode.c,v 2.84 2014/03/09 19:21:34 roberto Exp roberto $
3** Code generator for Lua 3** Code generator for Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -308,7 +308,7 @@ static void freeexp (FuncState *fs, expdesc *e) {
308 308
309 309
310/* 310/*
311** Use scanner's table to cache position of constants in contant list 311** Use scanner's table to cache position of constants in constant list
312** and try to reuse constants 312** and try to reuse constants
313*/ 313*/
314static int addk (FuncState *fs, TValue *key, TValue *v) { 314static int addk (FuncState *fs, TValue *key, TValue *v) {
diff --git a/ldo.c b/ldo.c
index 22d1f0b3..267c8237 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 2.113 2014/02/15 13:12:01 roberto Exp roberto $ 2** $Id: ldo.c,v 2.114 2014/02/26 15:27:56 roberto Exp roberto $
3** Stack and Call structure of Lua 3** Stack and Call structure of Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -58,7 +58,7 @@
58 58
59#elif defined(LUA_USE_POSIX) /* }{ */ 59#elif defined(LUA_USE_POSIX) /* }{ */
60 60
61/* in Posix, try _longjmp/_setjmp (more efficient) */ 61/* in POSIX, try _longjmp/_setjmp (more efficient) */
62#define LUAI_THROW(L,c) _longjmp((c)->b, 1) 62#define LUAI_THROW(L,c) _longjmp((c)->b, 1)
63#define LUAI_TRY(L,c,a) if (_setjmp((c)->b) == 0) { a } 63#define LUAI_TRY(L,c,a) if (_setjmp((c)->b) == 0) { a }
64#define luai_jmpbuf jmp_buf 64#define luai_jmpbuf jmp_buf
diff --git a/lgc.c b/lgc.c
index 93e22f0f..537c38fe 100644
--- a/lgc.c
+++ b/lgc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.c,v 2.177 2014/02/18 13:46:26 roberto Exp roberto $ 2** $Id: lgc.c,v 2.178 2014/02/19 13:51:09 roberto Exp roberto $
3** Garbage Collector 3** Garbage Collector
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -169,7 +169,7 @@ void luaC_barrierback_ (lua_State *L, GCObject *o) {
169/* 169/*
170** barrier for assignments to closed upvalues. Because upvalues are 170** barrier for assignments to closed upvalues. Because upvalues are
171** shared among closures, it is impossible to know the color of all 171** shared among closures, it is impossible to know the color of all
172** closured pointing to it. So, we assume that the object being assigned 172** closures pointing to it. So, we assume that the object being assigned
173** must be marked. 173** must be marked.
174*/ 174*/
175LUAI_FUNC void luaC_upvalbarrier_ (lua_State *L, UpVal *uv) { 175LUAI_FUNC void luaC_upvalbarrier_ (lua_State *L, UpVal *uv) {
diff --git a/lobject.c b/lobject.c
index e80c8db7..02320e36 100644
--- a/lobject.c
+++ b/lobject.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.c,v 2.74 2014/02/26 15:27:56 roberto Exp roberto $ 2** $Id: lobject.c,v 2.75 2014/03/06 16:15:18 roberto Exp roberto $
3** Some generic functions over Lua objects 3** Some generic functions over Lua objects
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -140,7 +140,7 @@ void luaO_arith (lua_State *L, int op, const TValue *p1, const TValue *p2,
140 else break; /* go to the end */ 140 else break; /* go to the end */
141 } 141 }
142 } 142 }
143 /* could not perform raw operation; try metmethod */ 143 /* could not perform raw operation; try metamethod */
144 lua_assert(L != NULL); /* should not fail when folding (compile time) */ 144 lua_assert(L != NULL); /* should not fail when folding (compile time) */
145 luaT_trybinTM(L, p1, p2, res, cast(TMS, op - LUA_OPADD + TM_ADD)); 145 luaT_trybinTM(L, p1, p2, res, cast(TMS, op - LUA_OPADD + TM_ADD));
146} 146}
diff --git a/lstrlib.c b/lstrlib.c
index 46b06568..98cd20f7 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstrlib.c,v 1.186 2014/02/25 14:30:21 roberto Exp roberto $ 2** $Id: lstrlib.c,v 1.187 2014/03/12 18:09:06 roberto Exp roberto $
3** Standard library for string operations and pattern-matching 3** Standard library for string operations and pattern-matching
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -1005,7 +1005,7 @@ static int packint (char *buff, lua_Integer n, int littleendian, int size) {
1005 } 1005 }
1006 buff[i] = (n & MC); /* last byte */ 1006 buff[i] = (n & MC); /* last byte */
1007 /* test for overflow: OK if there are only zeros left in higher bytes, 1007 /* test for overflow: OK if there are only zeros left in higher bytes,
1008 or if there are only oneś left and packed number is negative (signal 1008 or if there are only ones left and packed number is negative (signal
1009 bit, the higher bit in last byte, is one) */ 1009 bit, the higher bit in last byte, is one) */
1010 return ((n & ~MC) == 0 || (n | SM) == ~(lua_Integer)0); 1010 return ((n & ~MC) == 0 || (n | SM) == ~(lua_Integer)0);
1011} 1011}
@@ -1027,7 +1027,7 @@ static int packint_l (lua_State *L) {
1027/* mask to check higher-order byte in a Lua integer */ 1027/* mask to check higher-order byte in a Lua integer */
1028#define HIGHERBYTE (MC << (NB * (SZINT - 1))) 1028#define HIGHERBYTE (MC << (NB * (SZINT - 1)))
1029 1029
1030/* mask to check higher-order byte + signal bit of next byte */ 1030/* mask to check higher-order byte + signal bit of next (lower) byte */
1031#define HIGHERBYTE1 (HIGHERBYTE | (HIGHERBYTE >> 1)) 1031#define HIGHERBYTE1 (HIGHERBYTE | (HIGHERBYTE >> 1))
1032 1032
1033static int unpackint (const char *buff, lua_Integer *res, 1033static int unpackint (const char *buff, lua_Integer *res,
@@ -1037,12 +1037,12 @@ static int unpackint (const char *buff, lua_Integer *res,
1037 for (i = 0; i < size; i++) { 1037 for (i = 0; i < size; i++) {
1038 if (i >= SZINT) { /* will throw away a byte? */ 1038 if (i >= SZINT) { /* will throw away a byte? */
1039 /* check for overflow: it is OK to throw away leading zeros for a 1039 /* check for overflow: it is OK to throw away leading zeros for a
1040 positive number; leading ones for a negative number; and one 1040 positive number, leading ones for a negative number, and a
1041 last leading zero to allow unsigned integers with a 1 in 1041 leading zero byte to allow unsigned integers with a 1 in
1042 its "signal bit" */ 1042 its "signal bit" */
1043 if (!((n & HIGHERBYTE1) == 0 || /* zeros for pos. number */ 1043 if (!((n & HIGHERBYTE1) == 0 || /* zeros for positive number */
1044 (n & HIGHERBYTE1) == HIGHERBYTE1 || /* ones for neg. number */ 1044 (n & HIGHERBYTE1) == HIGHERBYTE1 || /* ones for negative number */
1045 ((n & HIGHERBYTE) == 0 && i == size - 1))) /* last zero */ 1045 ((n & HIGHERBYTE) == 0 && i == size - 1))) /* leading zero */
1046 return 0; /* overflow */ 1046 return 0; /* overflow */
1047 } 1047 }
1048 n <<= NB; 1048 n <<= NB;
diff --git a/ltablib.c b/ltablib.c
index 50c506e3..09fe8491 100644
--- a/ltablib.c
+++ b/ltablib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltablib.c,v 1.64 2013/02/06 18:29:03 roberto Exp roberto $ 2** $Id: ltablib.c,v 1.65 2013/03/07 18:17:24 roberto Exp roberto $
3** Library for Table Manipulation 3** Library for Table Manipulation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -140,7 +140,7 @@ static int unpack (lua_State *L) {
140 e = luaL_opt(L, luaL_checkint, 3, luaL_len(L, 1)); 140 e = luaL_opt(L, luaL_checkint, 3, luaL_len(L, 1));
141 if (i > e) return 0; /* empty range */ 141 if (i > e) return 0; /* empty range */
142 n = e - i + 1; /* number of elements */ 142 n = e - i + 1; /* number of elements */
143 if (n <= 0 || !lua_checkstack(L, n)) /* n <= 0 means arith. overflow */ 143 if (n <= 0 || !lua_checkstack(L, n)) /* n <= 0 means arithmetic overflow */
144 return luaL_error(L, "too many results to unpack"); 144 return luaL_error(L, "too many results to unpack");
145 lua_rawgeti(L, 1, i); /* push arg[i] (avoiding overflow problems) */ 145 lua_rawgeti(L, 1, i); /* push arg[i] (avoiding overflow problems) */
146 while (i++ < e) /* push arg[i + 1...e] */ 146 while (i++ < e) /* push arg[i + 1...e] */