From 408c977f7be09db3b8aa98224989aec731eb0b5a Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Wed, 23 Jul 2025 19:15:24 +0200 Subject: lib: Swap len and data in the buffer_t This is how the ProtoBufCBinary data type is defined, so it will allow easier conversion until we get rid of it. But it makes sense, as the size_t will always be aligned. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- include/ouroboros/utils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/ouroboros/utils.h b/include/ouroboros/utils.h index 9c48b039..e1f0ca0e 100644 --- a/include/ouroboros/utils.h +++ b/include/ouroboros/utils.h @@ -33,11 +33,11 @@ #define ABS(a) ((a) > 0 ? (a) : -(a)) #define clrbuf(buf) do { memset(&(buf), 0, sizeof(buf)); } while (0); #define freebuf(buf) do { free((buf).data); clrbuf(buf); } while (0); -#define BUF_INIT { NULL, 0 } +#define BUF_INIT { 0, NULL } typedef struct { - uint8_t * data; size_t len; + uint8_t * data; } buffer_t; /* -- cgit v1.2.3