Skip to content

Commit 808bbb2

Browse files
Mefiresup2r3
authored andcommitted
Remove BlockChange from packed structs
pragma pack (push, 1) forces alignment to 1-byte. While reordering the fields does help with memory accesses, it only works if the compiler can ensure 2-byte alignments for this struct.
1 parent ba03d92 commit 808bbb2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

include/globals.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,15 @@ extern uint8_t motd_len;
172172

173173
extern uint16_t client_count;
174174

175-
#pragma pack(push, 1)
176-
177175
typedef struct {
178176
short x;
179177
short z;
180178
uint8_t y;
181179
uint8_t block;
182180
} BlockChange;
183181

182+
#pragma pack(push, 1)
183+
184184
typedef struct {
185185
uint8_t uuid[16];
186186
char name[16];

0 commit comments

Comments
 (0)