From 8c2b149cb21164028feefa1574238927aac1b0b9 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 8 Mar 2012 19:23:55 +0000 Subject: Fix compilation in VC++. git-svn-id: http://svn.drobilla.net/serd/trunk@334 490d8e77-9747-427b-9fa3-0b8f29cee8a0 --- src/reader.c | 4 ++-- src/writer.c | 5 +++-- 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; -- cgit v1.2.1