aboutsummaryrefslogtreecommitdiffstats
path: root/src/statement.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-10-02 14:47:14 -0400
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:07 -0500
commitaa6b5ec5b9344bce0ea38d294aef0782c3745548 (patch)
tree0481c7a3b690a35728b0649d281e0ba3e321a428 /src/statement.c
parent6076b31090176be685c30aa198edd3cebfd4fd7a (diff)
downloadserd-aa6b5ec5b9344bce0ea38d294aef0782c3745548.tar.gz
serd-aa6b5ec5b9344bce0ea38d294aef0782c3745548.tar.bz2
serd-aa6b5ec5b9344bce0ea38d294aef0782c3745548.zip
Add assertions for all non-null pointers in the public API
Diffstat (limited to 'src/statement.c')
-rw-r--r--src/statement.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/statement.c b/src/statement.c
index 430194b7..434d41d4 100644
--- a/src/statement.c
+++ b/src/statement.c
@@ -85,36 +85,42 @@ serd_statement_free(SerdStatement* const statement)
const SerdNode*
serd_statement_node(const SerdStatement* const statement, const SerdField field)
{
+ assert(statement);
return statement->nodes[field];
}
const SerdNode*
serd_statement_subject(const SerdStatement* const statement)
{
+ assert(statement);
return statement->nodes[SERD_SUBJECT];
}
const SerdNode*
serd_statement_predicate(const SerdStatement* const statement)
{
+ assert(statement);
return statement->nodes[SERD_PREDICATE];
}
const SerdNode*
serd_statement_object(const SerdStatement* const statement)
{
+ assert(statement);
return statement->nodes[SERD_OBJECT];
}
const SerdNode*
serd_statement_graph(const SerdStatement* const statement)
{
+ assert(statement);
return statement->nodes[SERD_GRAPH];
}
const SerdCaret*
serd_statement_caret(const SerdStatement* const statement)
{
+ assert(statement);
return statement->caret;
}
@@ -135,6 +141,8 @@ serd_statement_matches(const SerdStatement* const statement,
const SerdNode* const object,
const SerdNode* const graph)
{
+ assert(statement);
+
return (serd_node_pattern_match(statement->nodes[0], subject) &&
serd_node_pattern_match(statement->nodes[1], predicate) &&
serd_node_pattern_match(statement->nodes[2], object) &&