diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-05-29 22:35:04 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-05-29 22:35:04 +0200 |
commit | 555e5d2c0ce77dd1e031690c98ec9a1366182347 (patch) | |
tree | 69a505a23ae6ca5d0951e8f832f9895fcbb88b83 /shared | |
parent | 87d8b0ceb349e101b693cf43336a98647f4b92dc (diff) |
`make format`
Diffstat (limited to 'shared')
-rw-r--r-- | shared/bin.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/shared/bin.h b/shared/bin.h index a849d53..4f7db81 100644 --- a/shared/bin.h +++ b/shared/bin.h @@ -13,13 +13,12 @@ extern uint8_t g_w2_endianness; -#define W2_CAST_BIN(type, in, out) type *out = (type*) &in->data; -#define W2_CREATE_MSG_BIN(type, normal, bin) \ - W2_CREATE_MSG_SIZE_BIN(type, sizeof(type), normal, bin) -#define W2_CREATE_MSG_SIZE_BIN(type, size, normal, bin) \ - w2_s_bin* bin = malloc(sizeof(w2_s_bin) + size); \ - bin->bytes = size; \ - type* normal = (type*) &bin->data; +#define W2_CAST_BIN(type, in, out) type *out = (type *)&in->data; +#define W2_CREATE_MSG_BIN(type, normal, bin) W2_CREATE_MSG_SIZE_BIN(type, sizeof(type), normal, bin) +#define W2_CREATE_MSG_SIZE_BIN(type, size, normal, bin) \ + w2_s_bin *bin = malloc(sizeof(w2_s_bin) + size); \ + bin->bytes = size; \ + type *normal = (type *)&bin->data; typedef struct { uint16_t bytes; |