diff options
author | David Robillard <d@drobilla.net> | 2011-04-28 04:45:59 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-04-28 04:45:59 +0000 |
commit | 86e095df809f8d15b54ee62801f3deb829adfae9 (patch) | |
tree | a514dd90d72621c315d78ecda973ee7500989d85 /src/syntax.c | |
parent | 688537cf5ccb709c23359eb855946bedd5b65fcf (diff) | |
download | sord-86e095df809f8d15b54ee62801f3deb829adfae9.tar.gz sord-86e095df809f8d15b54ee62801f3deb829adfae9.tar.bz2 sord-86e095df809f8d15b54ee62801f3deb829adfae9.zip |
Const-correct node API.
git-svn-id: http://svn.drobilla.net/sord/trunk@98 3d64ff67-21c5-427c-a301-fe4f08042e5a
Diffstat (limited to 'src/syntax.c')
-rw-r--r-- | src/syntax.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/syntax.c b/src/syntax.c index daeec69..a0198c3 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -151,26 +151,28 @@ event_statement(void* handle, { ReadState* const state = (ReadState*)handle; - SordQuad tup; - tup[0] = sord_node_from_serd_node(state, subject, NULL, NULL); - tup[1] = sord_node_from_serd_node(state, predicate, NULL, NULL); - tup[2] = sord_node_from_serd_node(state, object, - object_datatype, object_lang); + SordNode* s = sord_node_from_serd_node(state, subject, NULL, NULL); + SordNode* p = sord_node_from_serd_node(state, predicate, NULL, NULL); + SordNode* o = sord_node_from_serd_node(state, object, + object_datatype, object_lang); + SordNode* g = NULL; if (state->graph_uri_node) { assert(graph->type == SERD_NOTHING); - tup[3] = sord_node_copy(state->graph_uri_node); + g = sord_node_copy(state->graph_uri_node); } else { - tup[3] = (graph && graph->buf) + g = (graph && graph->buf) ? sord_node_from_serd_node(state, graph, NULL, NULL) : NULL; } + const SordQuad tup = { s, p, o, g }; sord_add(state->sord, tup); - sord_node_free(state->world, tup[0]); - sord_node_free(state->world, tup[1]); - sord_node_free(state->world, tup[2]); - sord_node_free(state->world, tup[3]); + + sord_node_free(state->world, s); + sord_node_free(state->world, p); + sord_node_free(state->world, o); + sord_node_free(state->world, g); return true; } |