Prechádzať zdrojové kódy

Details (typos in comments)

Roberto Ierusalimschy 6 rokov pred
rodič
commit
e888976bc6
9 zmenil súbory, kde vykonal 19 pridanie a 19 odobranie
  1. 1 1
      lauxlib.c
  2. 1 1
      lgc.c
  3. 1 1
      liolib.c
  4. 1 1
      loadlib.c
  5. 3 3
      lopcodes.h
  6. 4 4
      lstate.h
  7. 1 1
      ltablib.c
  8. 6 6
      ltm.c
  9. 1 1
      luaconf.h

+ 1 - 1
lauxlib.c

@@ -62,7 +62,7 @@ static int findfield (lua_State *L, int objidx, int level) {
       else if (findfield(L, objidx, level - 1)) {  /* try recursively */
         /* stack: lib_name, lib_table, field_name (top) */
         lua_pushliteral(L, ".");  /* place '.' between the two names */
-        lua_replace(L, -3);  /* (in the slot ocupied by table) */
+        lua_replace(L, -3);  /* (in the slot occupied by table) */
         lua_concat(L, 3);  /* lib_name.field_name */
         return 1;
       }

+ 1 - 1
lgc.c

@@ -1250,7 +1250,7 @@ static void setminordebt (global_State *g) {
 /*
 ** Does a major collection after last collection was a "bad collection".
 **
-** When the program is building a big struture, it allocates lots of
+** When the program is building a big structure, it allocates lots of
 ** memory but generates very little garbage. In those scenarios,
 ** the generational mode just wastes time doing small collections, and
 ** major collections are frequently what we call a "bad collection", a

+ 1 - 1
liolib.c

@@ -338,7 +338,7 @@ static int io_readline (lua_State *L);
 #define MAXARGLINE	250
 
 /*
-** Auxiliar function to create the iteration function for 'lines'.
+** Auxiliary function to create the iteration function for 'lines'.
 ** The iteration function is a closure over 'io_readline', with
 ** the following upvalues:
 ** 1) The file being read (first value in the stack)

+ 1 - 1
loadlib.c

@@ -308,7 +308,7 @@ static void setpath (lua_State *L, const char *fieldname,
       luaL_addchar(&b, *LUA_PATH_SEP);
     }
     luaL_addstring(&b, dft);  /* add default */
-    if (dftmark < path + len - 2) {  /* is there a sufix after ';;'? */
+    if (dftmark < path + len - 2) {  /* is there a suffix after ';;'? */
       luaL_addchar(&b, *LUA_PATH_SEP);
       luaL_addlstring(&b, dftmark + 2, (path + len - 2) - dftmark);
     }

+ 3 - 3
lopcodes.h

@@ -286,9 +286,9 @@ OP_RETURN,/*	A B C	return R(A), ... ,R(A+B-2)	(see note)	*/
 OP_RETURN0,/*	  	return 						*/
 OP_RETURN1,/*	A 	return R(A)					*/
 
-OP_FORLOOP,/*	A Bx	R(A)+=R(A+2);
-			if R(A) <?= R(A+1) then { pc-=Bx; R(A+3)=R(A) }	*/
-OP_FORPREP,/*	A Bx	R(A)-=R(A+2); pc+=Bx				*/
+OP_FORLOOP,/*	A Bx	update counters; if loop continues then pc-=Bx; */
+OP_FORPREP,/*	A Bx	<check values and prepare counters>;
+                        if not to run then pc+=Bx+1;			*/
 
 OP_TFORPREP,/*	A Bx	create upvalue for R(A + 3); pc+=Bx		*/
 OP_TFORCALL,/*	A C	R(A+4), ... ,R(A+3+C) := R(A)(R(A+1), R(A+2));	*/

+ 4 - 4
lstate.h

@@ -74,7 +74,7 @@
 ** higher part counts the number of non-yieldable calls in the stack.
 ** (They are together so that we can change both with one instruction.)
 **
-** Because calls to external C functions can use of unkown amount
+** Because calls to external C functions can use an unknown amount
 ** of space (e.g., functions using an auxiliary buffer), calls
 ** to these functions add more than one to the count (see CSTACKCF).
 **
@@ -185,9 +185,9 @@ typedef struct CallInfo {
   union {
     int funcidx;  /* called-function index */
     int nyield;  /* number of values yielded */
-    struct {  /* info about transfered values (for call/return hooks) */
-      unsigned short ftransfer;  /* offset of first value transfered */
-      unsigned short ntransfer;  /* number of values transfered */
+    struct {  /* info about transferred values (for call/return hooks) */
+      unsigned short ftransfer;  /* offset of first value transferred */
+      unsigned short ntransfer;  /* number of values transferred */
     } transferinfo;
   } u2;
   short nresults;  /* expected number of results from this function */

+ 1 - 1
ltablib.c

@@ -338,7 +338,7 @@ static IdxT choosePivot (IdxT lo, IdxT up, unsigned int rnd) {
 
 
 /*
-** QuickSort algorithm (recursive function)
+** Quicksort algorithm (recursive function)
 */
 static void auxsort (lua_State *L, IdxT lo, IdxT up,
                                    unsigned int rnd) {

+ 6 - 6
ltm.c

@@ -168,8 +168,8 @@ void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2,
 
 
 void luaT_trybinassocTM (lua_State *L, const TValue *p1, const TValue *p2,
-                                       StkId res, int inv, TMS event) {
-  if (inv)
+                                       StkId res, int flip, TMS event) {
+  if (flip)
     luaT_trybinTM(L, p2, p1, res, event);
   else
     luaT_trybinTM(L, p1, p2, res, event);
@@ -177,10 +177,10 @@ void luaT_trybinassocTM (lua_State *L, const TValue *p1, const TValue *p2,
 
 
 void luaT_trybiniTM (lua_State *L, const TValue *p1, lua_Integer i2,
-                                   int inv, StkId res, TMS event) {
+                                   int flip, StkId res, TMS event) {
   TValue aux;
   setivalue(&aux, i2);
-  luaT_trybinassocTM(L, p1, &aux, res, inv, event);
+  luaT_trybinassocTM(L, p1, &aux, res, flip, event);
 }
 
 
@@ -205,14 +205,14 @@ int luaT_callorderTM (lua_State *L, const TValue *p1, const TValue *p2,
 
 
 int luaT_callorderiTM (lua_State *L, const TValue *p1, int v2,
-                       int inv, int isfloat, TMS event) {
+                       int flip, int isfloat, TMS event) {
   TValue aux; const TValue *p2;
   if (isfloat) {
     setfltvalue(&aux, cast_num(v2));
   }
   else
     setivalue(&aux, v2);
-  if (inv) {  /* arguments were exchanged? */
+  if (flip) {  /* arguments were exchanged? */
     p2 = p1; p1 = &aux;  /* correct them */
   }
   else

+ 1 - 1
luaconf.h

@@ -493,7 +493,7 @@
 @@ LUA_UNSIGNED is the unsigned version of LUA_INTEGER.
 **
 @@ LUAI_UACINT is the result of a 'default argument promotion'
-@@ over a lUA_INTEGER.
+@@ over a LUA_INTEGER.
 @@ LUA_INTEGER_FRMLEN is the length modifier for reading/writing integers.
 @@ LUA_INTEGER_FMT is the format for writing integers.
 @@ LUA_MAXINTEGER is the maximum value for a LUA_INTEGER.