From b0d5a7b4a2c8fae72af553804a33bf11471c458a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 26 Jan 2011 01:08:50 +0000 Subject: Fix compilation in C++ (which won't implicitly cast 0 to an enum). git-svn-id: http://svn.drobilla.net/serd/trunk@82 490d8e77-9747-427b-9fa3-0b8f29cee8a0 --- serd/serd.h | 5 ++++- src/writer.c | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/serd/serd.h b/serd/serd.h index de2be28d..91dd7076 100644 --- a/serd/serd.h +++ b/serd/serd.h @@ -74,6 +74,9 @@ typedef enum { * @ref SERD_ANON equivalent to SERD_BLANK_ID. */ typedef enum { + /** The type of a NULL node. */ + SERD_NOTHING = 0, + /** Literal value. A literal optionally has either an associated language, * or an associated datatype (not both). */ @@ -171,7 +174,7 @@ typedef struct { const uint8_t* buf; ///< Buffer } SerdNode; -static const SerdNode SERD_NODE_NULL = { 0, 0, 0, 0 }; +static const SerdNode SERD_NODE_NULL = { SERD_NOTHING, 0, 0, 0 }; /** Make a deep copy of @a node. * @return a node that the caller must free with @ref serd_node_free. diff --git a/src/writer.c b/src/writer.c index 5f08df62..8010dba3 100644 --- a/src/writer.c +++ b/src/writer.c @@ -166,6 +166,8 @@ write_node(SerdWriter writer, SerdChunk uri_prefix; SerdChunk uri_suffix; switch (node->type) { + case SERD_NOTHING: + return false; case SERD_ANON_BEGIN: if (writer->syntax != SERD_NTRIPLES) { ++writer->indent; -- cgit v1.2.1