detail (identation of switch)

This commit is contained in:
Roberto Ierusalimschy 2017-11-28 09:19:07 -02:00
parent 093c16b67b
commit dfd188ba12
2 changed files with 35 additions and 37 deletions

35
ldump.c
View File

@ -1,5 +1,5 @@
/*
** $Id: ldump.c,v 2.38 2017/06/27 11:35:31 roberto Exp roberto $
** $Id: ldump.c,v 2.39 2017/06/27 14:21:12 roberto Exp roberto $
** save precompiled Lua chunks
** See Copyright Notice in lua.h
*/
@ -113,23 +113,22 @@ static void DumpConstants (const Proto *f, DumpState *D) {
const TValue *o = &f->k[i];
DumpByte(ttype(o), D);
switch (ttype(o)) {
case LUA_TNIL:
break;
case LUA_TBOOLEAN:
DumpByte(bvalue(o), D);
break;
case LUA_TNUMFLT:
DumpNumber(fltvalue(o), D);
break;
case LUA_TNUMINT:
DumpInteger(ivalue(o), D);
break;
case LUA_TSHRSTR:
case LUA_TLNGSTR:
DumpString(tsvalue(o), D);
break;
default:
lua_assert(0);
case LUA_TNIL:
break;
case LUA_TBOOLEAN:
DumpByte(bvalue(o), D);
break;
case LUA_TNUMFLT:
DumpNumber(fltvalue(o), D);
break;
case LUA_TNUMINT:
DumpInteger(ivalue(o), D);
break;
case LUA_TSHRSTR:
case LUA_TLNGSTR:
DumpString(tsvalue(o), D);
break;
default: lua_assert(0);
}
}
}

View File

@ -1,5 +1,5 @@
/*
** $Id: lundump.c,v 2.46 2017/06/27 14:21:12 roberto Exp roberto $
** $Id: lundump.c,v 2.47 2017/06/29 15:06:44 roberto Exp roberto $
** load precompiled Lua chunks
** See Copyright Notice in lua.h
*/
@ -134,24 +134,23 @@ static void LoadConstants (LoadState *S, Proto *f) {
TValue *o = &f->k[i];
int t = LoadByte(S);
switch (t) {
case LUA_TNIL:
setnilvalue(o);
break;
case LUA_TBOOLEAN:
setbvalue(o, LoadByte(S));
break;
case LUA_TNUMFLT:
setfltvalue(o, LoadNumber(S));
break;
case LUA_TNUMINT:
setivalue(o, LoadInteger(S));
break;
case LUA_TSHRSTR:
case LUA_TLNGSTR:
setsvalue2n(S->L, o, LoadString(S));
break;
default:
lua_assert(0);
case LUA_TNIL:
setnilvalue(o);
break;
case LUA_TBOOLEAN:
setbvalue(o, LoadByte(S));
break;
case LUA_TNUMFLT:
setfltvalue(o, LoadNumber(S));
break;
case LUA_TNUMINT:
setivalue(o, LoadInteger(S));
break;
case LUA_TSHRSTR:
case LUA_TLNGSTR:
setsvalue2n(S->L, o, LoadString(S));
break;
default: lua_assert(0);
}
}
}