From 2928e5f74983f5dd33bc65f192298af87996a037 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 14 Sep 2019 22:45:46 +0200 Subject: Less endian code --- include/bytecode/bytecode.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') 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) -- cgit v1.2.3