diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-09-14 22:45:46 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-25 14:36:46 +0200 |
commit | 2928e5f74983f5dd33bc65f192298af87996a037 (patch) | |
tree | f222f81438e39731a3885e2667b01e3bb81ca66a /include/bytecode | |
parent | 35200031e88c65da6a0bde563f20d95c1dd4f464 (diff) |
Less endian code
Diffstat (limited to 'include/bytecode')
-rw-r--r-- | include/bytecode/bytecode.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/bytecode/bytecode.h b/include/bytecode/bytecode.h index 83d62b9..346455c 100644 --- a/include/bytecode/bytecode.h +++ b/include/bytecode/bytecode.h @@ -64,7 +64,8 @@ typedef enum { AMAL_OP_LABEL /* label - Label. This is the target of a jump instruction. Jump instructions only jump to labels in the same function scope */ } AmalOpcode; -#define AMAL_BYTECODE_MAGIC_NUMBER (u32)0xdec05eba +#define AMAL_BYTECODE_MAGIC_NUMBER "\xde\xc0\x5e\xba" +#define AMAL_BYTECODE_MAGIC_NUMBER_SIZE 4 #define AMAL_BYTECODE_MAJOR_VERSION 1 #define AMAL_BYTECODE_MINOR_VERSION 0 #define AMAL_BYTECODE_PATCH_VERSION 0 @@ -83,11 +84,10 @@ typedef u8 AmalOpcodeType; /* TODO: Make sure this pragma pack works on all platforms */ #pragma pack(push, 1) typedef struct { - u32 magic_number; /* AMAL_BYTECODE_MAGIC_NUMBER */ + u8 magic_number[AMAL_BYTECODE_MAGIC_NUMBER_SIZE]; /* @AMAL_BYTECODE_MAGIC_NUMBER */ u8 major_version; u8 minor_version; u8 patch_version; - u8 endian; /* 0 = little endian, 1 = big endian */ } BytecodeHeader; #pragma pack(pop) |