From 0d2aa6cc54f436b10381187bb2c58dc6dd0d9f4e Mon Sep 17 00:00:00 2001 From: Enyby Date: Mon, 21 Oct 2019 23:25:30 +0300 Subject: [PATCH] Switch little-endian by default as original Lua does. --- src/core/org/luaj/vm2/compiler/DumpState.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/org/luaj/vm2/compiler/DumpState.java b/src/core/org/luaj/vm2/compiler/DumpState.java index cc213315..3f92ba63 100644 --- a/src/core/org/luaj/vm2/compiler/DumpState.java +++ b/src/core/org/luaj/vm2/compiler/DumpState.java @@ -28,14 +28,14 @@ import java.io.OutputStream; import org.luaj.vm2.Globals; import org.luaj.vm2.LoadState; import org.luaj.vm2.LocVars; -import org.luaj.vm2.Prototype; import org.luaj.vm2.LuaString; import org.luaj.vm2.LuaValue; +import org.luaj.vm2.Prototype; /** Class to dump a {@link Prototype} into an output stream, as part of compiling. *

- * Generally, this class is not used directly, but rather indirectly via a command + * Generally, this class is not used directly, but rather indirectly via a command * line interface tool such as {@link luac}. *

* A lua binary file is created via {@link DumpState#dump}: @@ -85,7 +85,7 @@ public class DumpState { public static final int NUMBER_FORMAT_DEFAULT = NUMBER_FORMAT_FLOATS_OR_DOUBLES; // header fields - private boolean IS_LITTLE_ENDIAN = false; + private boolean IS_LITTLE_ENDIAN = true; private int NUMBER_FORMAT = NUMBER_FORMAT_DEFAULT; private int SIZEOF_LUA_NUMBER = 8; private static final int SIZEOF_INT = 4; @@ -190,7 +190,7 @@ public class DumpState { dumpString((LuaString)o); break; default: - throw new IllegalArgumentException("bad type for " + o); + throw new IllegalArgumentException("bad type for " + o); } } n = f.p.length;