summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugin.c17
-rw-r--r--src/world.c15
-rw-r--r--src/zix/common.h2
3 files changed, 16 insertions, 18 deletions
diff --git a/src/plugin.c b/src/plugin.c
index 58cee88..e46fed8 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -281,21 +281,23 @@ lilv_plugin_load_ports_if_necessary(const LilvPlugin* const_p)
LilvNode* symbol = lilv_plugin_get_unique(
p, port, p->world->uris.lv2_symbol);
- bool error = false;
if (!lilv_node_is_string(symbol) ||
!is_symbol((const char*)sord_node_get_string(symbol->node))) {
LILV_ERRORF("Plugin <%s> port symbol `%s' is invalid\n",
lilv_node_as_uri(p->plugin_uri),
lilv_node_as_string(symbol));
- error = true;
- goto done;
+ lilv_node_free(symbol);
+ lilv_plugin_free_ports(p);
+ break;
}
if (!lilv_node_is_int(index)) {
LILV_ERRORF("Plugin <%s> port index is not an integer\n",
lilv_node_as_uri(p->plugin_uri));
- error = true;
- goto done;
+ lilv_node_free(symbol);
+ lilv_node_free(index);
+ lilv_plugin_free_ports(p);
+ break;
}
uint32_t this_index = lilv_node_as_int(index);
@@ -334,13 +336,8 @@ lilv_plugin_load_ports_if_necessary(const LilvPlugin* const_p)
}
sord_iter_free(types);
- done:
lilv_node_free(symbol);
lilv_node_free(index);
- if (error) { // Invalid plugin
- lilv_plugin_free_ports(p);
- break;
- }
}
sord_iter_free(ports);
diff --git a/src/world.c b/src/world.c
index 7428354..1e51a2d 100644
--- a/src/world.c
+++ b/src/world.c
@@ -408,10 +408,11 @@ lilv_world_add_plugin(LilvWorld* world,
lilv_node_free(plugin_uri);
return;
}
- } else if ((z = lilv_collection_find_by_uri(world->zombies, plugin_uri))) {
+ } else if ((z = lilv_collection_find_by_uri((const ZixTree*)world->zombies,
+ plugin_uri))) {
// Plugin bundle has been re-loaded, move from zombies to plugins
- plugin = zix_tree_get(z);
- zix_tree_remove(world->zombies, z);
+ plugin = (LilvPlugin*)zix_tree_get(z);
+ zix_tree_remove((ZixTree*)world->zombies, z);
zix_tree_insert((ZixTree*)world->plugins, plugin, NULL);
lilv_node_free(plugin_uri);
lilv_plugin_clear(plugin, lilv_node_new_from_node(world, bundle));
@@ -868,14 +869,14 @@ lilv_world_unload_bundle(LilvWorld* world, const LilvNode* bundle_uri)
will not be in the list returned by lilv_world_get_all_plugins() but can
still be used.
*/
- ZixTreeIter* i = zix_tree_begin(world->plugins);
- while (i != zix_tree_end(world->plugins)) {
+ ZixTreeIter* i = zix_tree_begin((ZixTree*)world->plugins);
+ while (i != zix_tree_end((ZixTree*)world->plugins)) {
LilvPlugin* p = (LilvPlugin*)zix_tree_get(i);
ZixTreeIter* next = zix_tree_iter_next(i);
if (lilv_node_equals(lilv_plugin_get_bundle_uri(p), bundle_uri)) {
- zix_tree_remove(world->plugins, i);
- zix_tree_insert(world->zombies, p, NULL);
+ zix_tree_remove((ZixTree*)world->plugins, i);
+ zix_tree_insert((ZixTree*)world->zombies, p, NULL);
}
i = next;
diff --git a/src/zix/common.h b/src/zix/common.h
index f126cd1..e6b08e0 100644
--- a/src/zix/common.h
+++ b/src/zix/common.h
@@ -59,7 +59,7 @@ typedef enum {
ZIX_STATUS_NOT_FOUND,
ZIX_STATUS_EXISTS,
ZIX_STATUS_BAD_ARG,
- ZIX_STATUS_BAD_PERMS,
+ ZIX_STATUS_BAD_PERMS
} ZixStatus;
/**