diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/reader.c | 2 | ||||
-rw-r--r-- | src/reader.h | 2 | ||||
-rw-r--r-- | src/serd_internal.h | 2 | ||||
-rw-r--r-- | src/string.c | 6 |
4 files changed, 6 insertions, 6 deletions
diff --git a/src/reader.c b/src/reader.c index a0bf2ea2..f063358b 100644 --- a/src/reader.c +++ b/src/reader.c @@ -80,7 +80,7 @@ Ref push_node_padded(SerdReader* reader, size_t maxlen, SerdType type, const char* str, size_t n_bytes) { - char* mem = (char*)serd_stack_push_aligned( + void* mem = serd_stack_push_aligned( &reader->stack, sizeof(SerdNode) + maxlen + 1, sizeof(SerdNode)); SerdNode* const node = (SerdNode*)mem; diff --git a/src/reader.h b/src/reader.h index 88603faa..4b8441b1 100644 --- a/src/reader.h +++ b/src/reader.h @@ -75,7 +75,7 @@ push_byte(SerdReader* reader, Ref ref, const int c) assert(c != EOF); SERD_STACK_ASSERT_TOP(reader, ref); - char* const s = serd_stack_push(&reader->stack, 1); + char* const s = (char*)serd_stack_push(&reader->stack, 1); SerdNode* const node = (SerdNode*)(reader->stack.buf + ref); ++node->n_bytes; *(s - 1) = (uint8_t)c; diff --git a/src/serd_internal.h b/src/serd_internal.h index 165aefd1..211d260e 100644 --- a/src/serd_internal.h +++ b/src/serd_internal.h @@ -208,7 +208,7 @@ serd_stack_free(SerdStack* stack) stack->size = 0; } -static inline char* +static inline void* serd_stack_push(SerdStack* stack, size_t n_bytes) { const size_t new_size = stack->size + n_bytes; diff --git a/src/string.c b/src/string.c index b564a874..7229d6b2 100644 --- a/src/string.c +++ b/src/string.c @@ -101,7 +101,7 @@ read_sign(const char** sptr) } double -serd_strtod(const char* str, char** endptr) +serd_strtod(const char* str, size_t* end) { double result = 0.0; @@ -137,8 +137,8 @@ serd_strtod(const char* str, char** endptr) result *= pow(10, expt * expt_sign); } - if (endptr) { - *endptr = (char*)s; + if (end) { + *end = s - str; } return result * sign; |