From 1172f40724d2774be6c9f089c46ef377f2325957 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 14 Aug 2020 15:51:19 +0200 Subject: Make serd_stack_push() return a void pointer This avoids some unnecessary type punning. --- src/reader.h | 2 +- src/stack.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/reader.h b/src/reader.h index 1b0a80c2..3ed4ecc8 100644 --- a/src/reader.h +++ b/src/reader.h @@ -169,7 +169,7 @@ push_byte(SerdReader* reader, Ref ref, const int c) assert(c != EOF); SERD_STACK_ASSERT_TOP(reader, ref); - uint8_t* const s = serd_stack_push(&reader->stack, 1); + uint8_t* const s = (uint8_t*)serd_stack_push(&reader->stack, 1); SerdNode* const node = (SerdNode*)(reader->stack.buf + ref); ++node->n_bytes; if (!(c & 0x80)) { // Starts with 0 bit, start of new character diff --git a/src/stack.h b/src/stack.h index e95c5770..9c1d075a 100644 --- a/src/stack.h +++ b/src/stack.h @@ -61,7 +61,7 @@ serd_stack_free(SerdStack* stack) stack->size = 0; } -static inline uint8_t* +static inline void* serd_stack_push(SerdStack* stack, size_t n_bytes) { const size_t new_size = stack->size + n_bytes; -- cgit v1.2.1