diff --git a/src/libintstructs/hash-table.h b/src/libintstructs/hash-table.h index 5fd2c2e4e..3c93a4e29 100644 --- a/src/libintstructs/hash-table.h +++ b/src/libintstructs/hash-table.h @@ -34,17 +34,16 @@ typedef struct \ KEY_TYPE key; \ VALUE_TYPE value; \ } \ -__packed \ NAME##_backet; TODO (/*Rewrite to NAME##_backet **backets when neccesary*/) #define DEFINE_HASH_TYPE(NAME, KEY_TYPE, VALUE_TYPE) \ typedef struct \ { \ + NAME##_backet *backets; \ + uint8_t *lens; \ uint8_t size; \ uint8_t max_lens; \ - uint8_t *lens; \ - NAME##_backet *backets; \ } \ __packed \ NAME##_hash_table; diff --git a/src/libintstructs/linked-list.h b/src/libintstructs/linked-list.h index 8714120a1..393c02679 100644 --- a/src/libintstructs/linked-list.h +++ b/src/libintstructs/linked-list.h @@ -22,11 +22,11 @@ typedef struct linked_list_header { + struct linked_list_header *next; + struct linked_list_header *prev; uint8_t magic; uint8_t block_size; uint8_t used_size; - struct linked_list_header *next; - struct linked_list_header *prev; } __packed linked_list_header; diff --git a/src/libintstructs/lp-string.h b/src/libintstructs/lp-string.h index 2f7d5593c..2073e4813 100644 --- a/src/libintstructs/lp-string.h +++ b/src/libintstructs/lp-string.h @@ -21,8 +21,8 @@ /* Length-prefixed or "pascal" string. */ typedef struct { - ecma_length_t length; ecma_char_t *str; + ecma_length_t length; } __packed lp_string; diff --git a/src/libintstructs/stack.h b/src/libintstructs/stack.h index a88edb66e..cc9990329 100644 --- a/src/libintstructs/stack.h +++ b/src/libintstructs/stack.h @@ -73,10 +73,10 @@ typedef TYPE NAME##_stack_value_type; \ typedef DATA_TYPE NAME##_stack_data_type; \ typedef struct \ { \ + linked_list blocks; \ DATA_TYPE length; \ DATA_TYPE current; \ DATA_TYPE block_len; \ - linked_list blocks; \ } \ __packed \ NAME##_stack; diff --git a/src/libintstructs/tree.h b/src/libintstructs/tree.h index 4646b5467..4c3a10c21 100644 --- a/src/libintstructs/tree.h +++ b/src/libintstructs/tree.h @@ -22,10 +22,11 @@ typedef struct tree_header { - uint8_t magic; - uint8_t children_num; struct tree_header *parent; linked_list children; + uint8_t magic; + uint8_t children_num; + uint16_t reserved; } __packed tree_header; diff --git a/src/libjsparser/lexer.h b/src/libjsparser/lexer.h index d002e49de..63bb62a8b 100644 --- a/src/libjsparser/lexer.h +++ b/src/libjsparser/lexer.h @@ -139,9 +139,9 @@ typedef size_t locus; /* Represents the contents of a token. */ typedef struct { + locus loc; token_type type; uint8_t uid; - locus loc; } __packed token; diff --git a/src/libjsparser/scopes-tree.h b/src/libjsparser/scopes-tree.h index bab7a8d3d..5faa8646a 100644 --- a/src/libjsparser/scopes-tree.h +++ b/src/libjsparser/scopes-tree.h @@ -22,10 +22,10 @@ typedef struct { - tree_header t; - unsigned strict_mode:1; - opcode_counter_t opcodes_num; linked_list opcodes; + tree_header t; + opcode_counter_t opcodes_num; + unsigned strict_mode:1; } __packed scopes_tree_int; diff --git a/src/liboptimizer/bytecode-data.h b/src/liboptimizer/bytecode-data.h index b06514e49..37a490590 100644 --- a/src/liboptimizer/bytecode-data.h +++ b/src/liboptimizer/bytecode-data.h @@ -35,13 +35,12 @@ } */ struct { - uint8_t strs_count; - uint8_t nums_count; - opcode_counter_t opcodes_count; - const lp_string *strings; const ecma_number_t *nums; const opcode_t *opcodes; + uint8_t strs_count; + uint8_t nums_count; + opcode_counter_t opcodes_count; } __packed bytecode_data;