diff options
author | Finn Behrens <me@kloenk.de> | 2021-02-27 01:04:32 +0100 |
---|---|---|
committer | Finn Behrens <me@kloenk.de> | 2021-02-27 01:04:32 +0100 |
commit | a4ee0c62392998b710b941047ce6f324e4531457 (patch) | |
tree | 06f4acd47d6b332266cb5dccafc76c2b86a17e0e /protocol.h | |
parent | 03a59a6b035c26456784916793fa674b4b36b4c5 (diff) | |
download | mcc-a4ee0c62392998b710b941047ce6f324e4531457.tar.gz mcc-a4ee0c62392998b710b941047ce6f324e4531457.tar.xz mcc-a4ee0c62392998b710b941047ce6f324e4531457.zip |
send_package
Diffstat (limited to 'protocol.h')
-rw-r--r-- | protocol.h | 15 |
1 files changed, 4 insertions, 11 deletions
@@ -14,7 +14,7 @@ #include <stdio.h> #include <errno.h> -#define PROTOCOL_VERSION 0 +#define PROTOCOL_VERSION 9 // MARK: - Helpers #if defined(__APPLE__) @@ -46,15 +46,8 @@ if (func < 0) \ return func; \ x += func;*/ -#define check_add(func) check_addx(func, counter) - -int inline check_addx(int func, int *x) -{ - if (func < 0) - return func; - *x += func; - return 0; -} +#define check_add(func) check_addx(func, &counter) +int check_addx(int func, int *x); // MARK: - READ @@ -91,7 +84,7 @@ typedef struct { int read_position(position_t *dest, uint8_t *src); // string -int read_string_malloc(char *dest, uint8_t *src); +int read_string_malloc(char **dest, uint8_t *src); // MARK: - WRITE // MARK: VAR |