aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-03-08 19:23:55 +0000
committerDavid Robillard <d@drobilla.net>2012-03-08 19:23:55 +0000
commit8c2b149cb21164028feefa1574238927aac1b0b9 (patch)
tree7c94401ed50fbeb9d7eb5ad076303844cacadc75 /src
parent44177f8c18af89540b90a1cfa38ddda84fc6f747 (diff)
downloadserd-8c2b149cb21164028feefa1574238927aac1b0b9.tar.gz
serd-8c2b149cb21164028feefa1574238927aac1b0b9.tar.bz2
serd-8c2b149cb21164028feefa1574238927aac1b0b9.zip
Fix compilation in VC++.
git-svn-id: http://svn.drobilla.net/serd/trunk@334 490d8e77-9747-427b-9fa3-0b8f29cee8a0
Diffstat (limited to 'src')
-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;