mirror of
https://github.com/lua/lua.git
synced 2026-01-26 15:39:12 +00:00
Details
typo in comment + formatting + logical 'and' was written as a bitwise operation (makes code more fragile)
This commit is contained in:
parent
a5522f06d2
commit
578ae5745c
2
lapi.c
2
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);
|
||||
if (ttisnumber(o)) {
|
||||
unsigned len = luaO_tostringbuff(o, buff);
|
||||
|
||||
2
lgc.c
2
lgc.c
@ -1672,7 +1672,7 @@ static l_mem singlestep (lua_State *L, int fast) {
|
||||
GCTM(L); /* call one finalizer */
|
||||
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 */
|
||||
g->gcstate = GCSpause; /* finish collection */
|
||||
stepresult = step2pause;
|
||||
|
||||
@ -968,7 +968,7 @@ static int str_gsub (lua_State *L) {
|
||||
reprepstate(&ms); /* (re)prepare state for new match */
|
||||
if ((e = match(&ms, src, p)) != NULL && e != lastmatch) { /* match? */
|
||||
n++;
|
||||
changed = add_value(&ms, &b, src, e, tr) | changed;
|
||||
changed = add_value(&ms, &b, src, e, tr) || changed;
|
||||
src = lastmatch = e;
|
||||
}
|
||||
else if (src < ms.src_end) /* otherwise, skip one character */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user