aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/reader.c4
-rw-r--r--src/writer.c5
2 files changed, 5 insertions, 4 deletions
diff --git a/src/reader.c b/src/reader.c
index 333aabde..7e9bb3d4 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -992,13 +992,13 @@ static bool
read_blank(SerdReader* reader, ReadContext ctx, bool subject, Ref* dest)
{
const SerdStatementFlags old_flags = *ctx.flags;
+ bool empty;
switch (peek_byte(reader)) {
case '_':
return (*dest = read_nodeID(reader));
case '[':
eat_byte_safe(reader, '[');
- const bool empty = peek_delim(reader, ']');
- if (empty) {
+ if ((empty = peek_delim(reader, ']'))) {
*ctx.flags |= (subject) ? SERD_EMPTY_S : SERD_EMPTY_O;
} else {
*ctx.flags |= (subject) ? SERD_ANON_S_BEGIN : SERD_ANON_O_BEGIN;
diff --git a/src/writer.c b/src/writer.c
index 849d4e7c..f538e486 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -243,7 +243,8 @@ write_text(SerdWriter* writer, TextContext ctx,
static size_t
uri_sink(const void* buf, size_t len, void* stream)
{
- return write_text((SerdWriter*)stream, WRITE_URI, buf, len);
+ return write_text((SerdWriter*)stream, WRITE_URI,
+ (const uint8_t*)buf, len);
}
static void
@@ -746,7 +747,7 @@ size_t
serd_chunk_sink(const void* buf, size_t len, void* stream)
{
SerdChunk* chunk = (SerdChunk*)stream;
- chunk->buf = realloc((uint8_t*)chunk->buf, chunk->len + len);
+ chunk->buf = (uint8_t*)realloc((uint8_t*)chunk->buf, chunk->len + len);
memcpy((uint8_t*)chunk->buf + chunk->len, buf, len);
chunk->len += len;
return len;