summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2025-07-23 19:15:24 +0200
committerSander Vrijders <sander@ouroboros.rocks>2025-07-25 16:24:46 +0200
commit408c977f7be09db3b8aa98224989aec731eb0b5a (patch)
treeec8781aae11e7b2ec459f541d36252020c2eff3a /include
parent1856a585ae4290e666314ee7907dc8cbbb08fe2d (diff)
downloadouroboros-408c977f7be09db3b8aa98224989aec731eb0b5a.tar.gz
ouroboros-408c977f7be09db3b8aa98224989aec731eb0b5a.zip
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 <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'include')
-rw-r--r--include/ouroboros/utils.h4
1 files changed, 2 insertions, 2 deletions
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;
/*