Small changes in the header of binary files

- LUAC_VERSION is equal to LUA_VERSION_NUM, and it is stored
as an int.

- 'sizeof(int)' and 'sizeof(size_t)' removed from the header, as
the binary format does not depend on these sizes. (It uses its
own serialization for unsigned integer values.)
This commit is contained in:
Roberto Ierusalimschy
2019-03-19 15:31:08 -03:00
parent 39bb3cf242
commit f53eabeed8
4 changed files with 34 additions and 31 deletions

View File

@@ -198,11 +198,9 @@ static void DumpFunction (const Proto *f, TString *psource, DumpState *D) {
static void DumpHeader (DumpState *D) {
DumpLiteral(LUA_SIGNATURE, D);
DumpByte(LUAC_VERSION, D);
DumpInt(LUAC_VERSION, D);
DumpByte(LUAC_FORMAT, D);
DumpLiteral(LUAC_DATA, D);
DumpByte(sizeof(int), D);
DumpByte(sizeof(size_t), D);
DumpByte(sizeof(Instruction), D);
DumpByte(sizeof(lua_Integer), D);
DumpByte(sizeof(lua_Number), D);