فهرست منبع

Details

typo in comment + formatting + logical 'and' was written as a bitwise
operation (makes code more fragile)
Roberto I 1 ماه پیش
والد
کامیت
578ae5745c
3فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 1 1
      lapi.c
  2. 1 1
      lgc.c
  3. 1 1
      lstrlib.c

+ 1 - 1
lapi.c

@@ -366,7 +366,7 @@ LUA_API int lua_compare (lua_State *L, int index1, int index2, int op) {
 }
 }
 
 
 
 
-LUA_API unsigned (lua_numbertocstring) (lua_State *L, int idx, char *buff) {
+LUA_API unsigned lua_numbertocstring (lua_State *L, int idx, char *buff) {
   const TValue *o = index2value(L, idx);
   const TValue *o = index2value(L, idx);
   if (ttisnumber(o)) {
   if (ttisnumber(o)) {
     unsigned len = luaO_tostringbuff(o, buff);
     unsigned len = luaO_tostringbuff(o, buff);

+ 1 - 1
lgc.c

@@ -1672,7 +1672,7 @@ static l_mem singlestep (lua_State *L, int fast) {
         GCTM(L);  /* call one finalizer */
         GCTM(L);  /* call one finalizer */
         stepresult = CWUFIN;
         stepresult = CWUFIN;
       }
       }
-      else {  /* no more finalizers or emergency mode or no enough stack
+      else {  /* no more finalizers or emergency mode or not enough stack
                  to run finalizers */
                  to run finalizers */
         g->gcstate = GCSpause;  /* finish collection */
         g->gcstate = GCSpause;  /* finish collection */
         stepresult = step2pause;
         stepresult = step2pause;

+ 1 - 1
lstrlib.c

@@ -968,7 +968,7 @@ static int str_gsub (lua_State *L) {
     reprepstate(&ms);  /* (re)prepare state for new match */
     reprepstate(&ms);  /* (re)prepare state for new match */
     if ((e = match(&ms, src, p)) != NULL && e != lastmatch) {  /* match? */
     if ((e = match(&ms, src, p)) != NULL && e != lastmatch) {  /* match? */
       n++;
       n++;
-      changed = add_value(&ms, &b, src, e, tr) | changed;
+      changed = add_value(&ms, &b, src, e, tr) || changed;
       src = lastmatch = e;
       src = lastmatch = e;
     }
     }
     else if (src < ms.src_end)  /* otherwise, skip one character */
     else if (src < ms.src_end)  /* otherwise, skip one character */