aboutsummaryrefslogtreecommitdiffstats
path: root/src/writer.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-01-16 18:21:53 +0000
committerDavid Robillard <d@drobilla.net>2012-01-16 18:21:53 +0000
commit2d724f0e199f74201307cc161031afbd8dba4eb5 (patch)
treeb6db75dbfa6e3d29823d64b9207232e61cfcc070 /src/writer.c
parent80a8bad6790dd510577d0922287b8a3f60d89252 (diff)
downloadserd-2d724f0e199f74201307cc161031afbd8dba4eb5.tar.gz
serd-2d724f0e199f74201307cc161031afbd8dba4eb5.tar.bz2
serd-2d724f0e199f74201307cc161031afbd8dba4eb5.zip
Support compilation as C++ under MSVC++
git-svn-id: http://svn.drobilla.net/serd/trunk@291 490d8e77-9747-427b-9fa3-0b8f29cee8a0
Diffstat (limited to 'src/writer.c')
-rw-r--r--src/writer.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/writer.c b/src/writer.c
index 60345463..26b06690 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -31,7 +31,7 @@ typedef struct {
} WriteContext;
static const WriteContext WRITE_CONTEXT_NULL = {
- {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}
+ SERD_NODE_NULL, SERD_NODE_NULL, SERD_NODE_NULL
};
struct SerdWriterImpl {
@@ -72,7 +72,7 @@ copy_node(SerdNode* dst, const SerdNode* src)
return;
}
if (!dst->buf || dst->n_bytes < src->n_bytes) {
- dst->buf = realloc((char*)dst->buf, src->n_bytes + 1);
+ dst->buf = (uint8_t*)realloc((char*)dst->buf, src->n_bytes + 1);
}
dst->n_bytes = src->n_bytes;
dst->n_chars = src->n_chars;
@@ -217,9 +217,9 @@ serd_writer_write_delim(SerdWriter* writer, const uint8_t delim)
}
static void
-reset_context(SerdWriter* writer, bool delete)
+reset_context(SerdWriter* writer, bool del)
{
- if (delete) {
+ if (del) {
serd_node_free(&writer->context.graph);
serd_node_free(&writer->context.subject);
serd_node_free(&writer->context.predicate);
@@ -525,7 +525,7 @@ serd_writer_new(SerdSyntax syntax,
void* stream)
{
const WriteContext context = WRITE_CONTEXT_NULL;
- SerdWriter* writer = malloc(sizeof(struct SerdWriterImpl));
+ SerdWriter* writer = (SerdWriter*)malloc(sizeof(SerdWriter));
writer->syntax = syntax;
writer->style = style;
writer->env = env;
@@ -554,7 +554,7 @@ serd_writer_chop_blank_prefix(SerdWriter* writer,
writer->bprefix = NULL;
if (prefix) {
writer->bprefix_len = strlen((const char*)prefix);
- writer->bprefix = malloc(writer->bprefix_len + 1);
+ writer->bprefix = (uint8_t*)malloc(writer->bprefix_len + 1);
memcpy(writer->bprefix, prefix, writer->bprefix_len + 1);
}
}