summaryrefslogtreecommitdiffstats
path: root/src/sord.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-08-09 00:01:07 +0000
committerDavid Robillard <d@drobilla.net>2012-08-09 00:01:07 +0000
commita4be30c59cd6452ab595d221bc4e97bab00517a7 (patch)
tree1bd6d196e8236dca2dfa993dbc356869d718025b /src/sord.c
parentfcaa07ca53ae5a4e586117fa72bd92de903affef (diff)
downloadsord-a4be30c59cd6452ab595d221bc4e97bab00517a7.tar.gz
sord-a4be30c59cd6452ab595d221bc4e97bab00517a7.tar.bz2
sord-a4be30c59cd6452ab595d221bc4e97bab00517a7.zip
Fix warnings: -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes -Wmissing-prototypes.
git-svn-id: http://svn.drobilla.net/sord/trunk@244 3d64ff67-21c5-427c-a301-fe4f08042e5a
Diffstat (limited to 'src/sord.c')
-rw-r--r--src/sord.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/sord.c b/src/sord.c
index c1c480f..a0f76f2 100644
--- a/src/sord.c
+++ b/src/sord.c
@@ -727,23 +727,23 @@ sord_free(SordModel* sord)
SordIter* i = sord_begin(sord);
for (; !sord_iter_end(i); sord_iter_next(i)) {
sord_iter_get(i, tup);
- for (int i = 0; i < TUP_LEN; ++i) {
- sord_drop_quad_ref(sord, (SordNode*)tup[i], (SordQuadIndex)i);
+ for (int t = 0; t < TUP_LEN; ++t) {
+ sord_drop_quad_ref(sord, (SordNode*)tup[t], (SordQuadIndex)t);
}
}
sord_iter_free(i);
// Free quads
- for (ZixTreeIter* i = zix_tree_begin(sord->indices[DEFAULT_ORDER]);
- !zix_tree_iter_is_end(i);
- i = zix_tree_iter_next(i)) {
- free(zix_tree_get(i));
+ for (ZixTreeIter* t = zix_tree_begin(sord->indices[DEFAULT_ORDER]);
+ !zix_tree_iter_is_end(t);
+ t = zix_tree_iter_next(t)) {
+ free(zix_tree_get(t));
}
// Free indices
- for (unsigned i = 0; i < NUM_ORDERS; ++i)
- if (sord->indices[i])
- zix_tree_free(sord->indices[i]);
+ for (unsigned o = 0; o < NUM_ORDERS; ++o)
+ if (sord->indices[o])
+ zix_tree_free(sord->indices[o]);
free(sord);
}
@@ -899,7 +899,7 @@ sord_lookup_name(SordWorld* world, const uint8_t* str)
return (SordNode*)zix_hash_find(world->names, str);
}
-char*
+static char*
sord_strndup(const char* str, size_t len)
{
char* dup = (char*)malloc(len + 1);
@@ -1173,11 +1173,11 @@ sord_node_from_serd_node(SordWorld* world,
SerdURI abs_uri;
SerdNode abs_uri_node = serd_node_new_uri_from_node(
sn, &base_uri, &abs_uri);
- SordNode* ret = sord_new_uri_counted(world,
- abs_uri_node.buf,
- abs_uri_node.n_bytes,
- abs_uri_node.n_chars,
- true);
+ ret = sord_new_uri_counted(world,
+ abs_uri_node.buf,
+ abs_uri_node.n_bytes,
+ abs_uri_node.n_chars,
+ true);
serd_node_free(&abs_uri_node);
return ret;
}
@@ -1194,7 +1194,7 @@ sord_node_from_serd_node(SordWorld* world,
memcpy(buf, uri_prefix.buf, uri_prefix.len);
memcpy(buf + uri_prefix.len, uri_suffix.buf, uri_suffix.len);
buf[uri_len] = '\0';
- SordNode* ret = sord_new_uri_counted(
+ ret = sord_new_uri_counted(
world, buf, uri_prefix.len + uri_suffix.len,
uri_prefix.len + uri_suffix.len, false); // FIXME: UTF-8
return ret;