From d4aafb057f9ddd9234d112ea2a2d711b20f28711 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sun, 13 Jun 2021 09:30:15 -0400 Subject: Changed the order of the struct definitions in `network.h`. It wouldn't compile due to them not being defined eariler, and I don't want to do prototyping. --- network.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/network.h b/network.h index c2d8d13..2387c8b 100644 --- a/network.h +++ b/network.h @@ -15,9 +15,10 @@ typedef struct packet packet; typedef struct cmd cmd; typedef struct cmd_header cmd_header; -struct packet { - uint32_t size; /* Size of packet, in bytes. */ - cmd cmd; /* Command. */ +struct cmd_header { + uint32_t size; /* Size of command, in bytes, including command header. */ + uint16_t magic; /* Magic Number. Must always be 0x1488. */ + uint16_t id; /* Command ID. */ }; struct cmd { @@ -25,10 +26,9 @@ struct cmd { uint8_t *data; /* Command data. */ }; -struct cmd_header { - uint32_t size; /* Size of command, in bytes, including command header. */ - uint16_t magic; /* Magic Number. Must always be 0x1488. */ - uint16_t id; /* Command ID. */ +struct packet { + uint32_t size; /* Size of packet, in bytes. */ + cmd cmd; /* Command. */ }; #endif -- cgit v1.2.3-13-gbd6f