diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugin.c | 32 | ||||
-rw-r--r-- | src/pluginuiinstance.c | 2 | ||||
-rw-r--r-- | src/port.c | 4 | ||||
-rw-r--r-- | src/world.c | 8 |
4 files changed, 19 insertions, 27 deletions
diff --git a/src/plugin.c b/src/plugin.c index 3ea7b9d..544a5eb 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -646,13 +646,12 @@ slv2_plugin_has_feature(SLV2Plugin p, SLV2Values slv2_plugin_get_supported_features(SLV2Plugin p) { - SLV2Values optional = slv2_plugin_get_optional_features(p); - SLV2Values required = slv2_plugin_get_required_features(p); - - SLV2Values result = slv2_values_new(); - unsigned n_optional = slv2_values_size(optional); - unsigned n_required = slv2_values_size(required); - unsigned i = 0; + SLV2Values optional = slv2_plugin_get_optional_features(p); + SLV2Values required = slv2_plugin_get_required_features(p); + SLV2Values result = slv2_values_new(); + unsigned n_optional = slv2_values_size(optional); + unsigned n_required = slv2_values_size(required); + unsigned i = 0; for ( ; i < n_optional; ++i) slv2_values_set_at(result, i, raptor_sequence_pop(optional)); for ( ; i < n_optional + n_required; ++i) @@ -772,6 +771,9 @@ slv2_plugin_get_uis(SLV2Plugin p) SLV2Node ui_ui = sord_get_uri( p->world->model, true, NS_UI "ui"); + SLV2Node ui_binary_node = sord_get_uri( + p->world->model, true, NS_UI "binary"); + SLV2UIs result = slv2_uis_new(); SLV2Matches uis = slv2_plugin_find_statements( p, @@ -780,18 +782,9 @@ slv2_plugin_get_uis(SLV2Plugin p) NULL); FOREACH_MATCH(uis) { - SLV2Node ui = slv2_match_object(uis); - - SLV2Value type = slv2_plugin_get_unique( - p, ui, p->world->rdf_a_node); - - SLV2Node ui_binary_node = sord_get_uri( - p->world->model, true, NS_UI "binary"); - - SLV2Value binary = slv2_plugin_get_unique( - p, ui, ui_binary_node); - - slv2_node_free(ui_binary_node); + SLV2Node ui = slv2_match_object(uis); + SLV2Value type = slv2_plugin_get_unique(p, ui, p->world->rdf_a_node); + SLV2Value binary = slv2_plugin_get_unique(p, ui, ui_binary_node); if (sord_node_get_type(ui) != SORD_URI || !slv2_value_is_uri(type) @@ -812,6 +805,7 @@ slv2_plugin_get_uis(SLV2Plugin p) } slv2_match_end(uis); + slv2_node_free(ui_binary_node); slv2_node_free(ui_ui); if (slv2_uis_size(result) > 0) { diff --git a/src/pluginuiinstance.c b/src/pluginuiinstance.c index 4103b4e..b677c94 100644 --- a/src/pluginuiinstance.c +++ b/src/pluginuiinstance.c @@ -46,7 +46,7 @@ slv2_ui_instantiate(SLV2Plugin plugin, ((LV2_Feature**)features)[0] = NULL; } - const char* const lib_uri = slv2_value_as_string(slv2_ui_get_binary_uri(ui)); + const char* const lib_uri = slv2_value_as_string(slv2_ui_get_binary_uri(ui)); const char* const lib_path = slv2_uri_to_path(lib_uri); if (!lib_path) @@ -296,8 +296,8 @@ SLV2ScalePoints slv2_port_get_scale_points(SLV2Plugin p, SLV2Port port) { - SLV2Node port_node = slv2_port_get_node(p, port); - SLV2Matches points = slv2_plugin_find_statements( + SLV2Node port_node = slv2_port_get_node(p, port); + SLV2Matches points = slv2_plugin_find_statements( p, port_node, sord_get_uri(p->world->model, true, SLV2_NS_LV2 "scalePoint"), diff --git a/src/world.c b/src/world.c index 10cf279..af9fe78 100644 --- a/src/world.c +++ b/src/world.c @@ -560,10 +560,8 @@ slv2_world_load_plugin_classes(SLV2World world) (const char*)sord_node_get_string(class_node)) < 0); } #endif - SLV2PluginClass pclass = slv2_plugin_class_new(world, - parent_node, - class_node, - (const char*)label); + SLV2PluginClass pclass = slv2_plugin_class_new( + world, parent_node, class_node, (const char*)label); if (pclass) { raptor_sequence_push(classes, pclass); @@ -587,7 +585,7 @@ slv2_world_load_all(SLV2World world) } else { char default_path[sizeof(SLV2_DEFAULT_LV2_PATH)]; memcpy(default_path, SLV2_DEFAULT_LV2_PATH, sizeof(SLV2_DEFAULT_LV2_PATH)); - char* dir = default_path; + char* dir = default_path; size_t lv2_path_len = 0; while (*dir != '\0') { char* colon = strchr(dir, ':'); |