diff options
author | David Robillard <d@drobilla.net> | 2012-08-09 01:50:07 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-08-09 01:50:07 +0000 |
commit | 1ac0d686b1a540f3ffe5a948f07f53b9a9cdbe5b (patch) | |
tree | 3cc280aae8daa7bf8d64868d1a41976eb845418c /src | |
parent | 2fdda7eb1b6b5f5582e05c94591a1db44947af18 (diff) | |
download | lilv-1ac0d686b1a540f3ffe5a948f07f53b9a9cdbe5b.tar.gz lilv-1ac0d686b1a540f3ffe5a948f07f53b9a9cdbe5b.tar.bz2 lilv-1ac0d686b1a540f3ffe5a948f07f53b9a9cdbe5b.zip |
Fix warnings: -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes -Wmissing-prototypes.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@4631 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/collections.c | 13 | ||||
-rw-r--r-- | src/instance.c | 2 | ||||
-rw-r--r-- | src/plugin.c | 8 | ||||
-rw-r--r-- | src/query.c | 2 | ||||
-rw-r--r-- | src/state.c | 20 | ||||
-rw-r--r-- | src/util.c | 4 | ||||
-rw-r--r-- | src/world.c | 6 | ||||
-rw-r--r-- | src/zix/tree.c | 2 | ||||
-rw-r--r-- | src/zix/tree.h | 2 |
9 files changed, 29 insertions, 30 deletions
diff --git a/src/collections.c b/src/collections.c index ebb5633..dd676e6 100644 --- a/src/collections.c +++ b/src/collections.c @@ -25,8 +25,8 @@ lilv_ptr_cmp(const void* a, const void* b, void* user_data) int lilv_resource_node_cmp(const void* a, const void* b, void* user_data) { - const SordNode* an = ((LilvNode*)a)->val.uri_val; - const SordNode* bn = ((LilvNode*)b)->val.uri_val; + const SordNode* an = ((const LilvNode*)a)->val.uri_val; + const SordNode* bn = ((const LilvNode*)b)->val.uri_val; return (intptr_t)an - (intptr_t)bn; } @@ -48,7 +48,7 @@ lilv_collection_free(LilvCollection* coll) unsigned lilv_collection_size(const LilvCollection* coll) { - return (coll ? zix_tree_size((ZixTree*)coll) : 0); + return (coll ? zix_tree_size((const ZixTree*)coll) : 0); } LilvIter* @@ -104,14 +104,15 @@ const LilvPluginClass* lilv_plugin_classes_get_by_uri(const LilvPluginClasses* coll, const LilvNode* uri) { - return (LilvPluginClass*)lilv_collection_get_by_uri((ZixTree*)coll, uri); + return (LilvPluginClass*)lilv_collection_get_by_uri( + (const ZixTree*)coll, uri); } LILV_API const LilvUI* lilv_uis_get_by_uri(const LilvUIs* coll, const LilvNode* uri) { - return (LilvUI*)lilv_collection_get_by_uri((ZixTree*)coll, uri); + return (LilvUI*)lilv_collection_get_by_uri((const ZixTree*)coll, uri); } /* Plugins */ @@ -126,7 +127,7 @@ LILV_API const LilvPlugin* lilv_plugins_get_by_uri(const LilvPlugins* list, const LilvNode* uri) { - return (LilvPlugin*)lilv_collection_get_by_uri((ZixTree*)list, uri); + return (LilvPlugin*)lilv_collection_get_by_uri((const ZixTree*)list, uri); } /* Nodes */ diff --git a/src/instance.c b/src/instance.c index 0d4457d..5fa47fa 100644 --- a/src/instance.c +++ b/src/instance.c @@ -83,7 +83,7 @@ lilv_plugin_instantiate(const LilvPlugin* plugin, result = (LilvInstance*)malloc(sizeof(LilvInstance)); result->lv2_descriptor = ld; result->lv2_handle = ld->instantiate( - ld, sample_rate, (char*)bundle_path, + ld, sample_rate, bundle_path, (features) ? features : local_features); result->pimpl = lib; serd_node_free(&abs_uri_node); diff --git a/src/plugin.c b/src/plugin.c index e085abb..c32c2fe 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -1016,16 +1016,16 @@ lilv_plugin_write_description(LilvWorld* world, maybe_write_prefixes(writer, env, plugin_file); // Write plugin description - SordIter* iter = lilv_world_query_internal( + SordIter* plug_iter = lilv_world_query_internal( world, subject->val.uri_val, NULL, NULL); - sord_write_iter(iter, writer); + sord_write_iter(plug_iter, writer); // Write port descriptions for (uint32_t i = 0; i < num_ports; ++i) { const LilvPort* port = plugin->ports[i]; - SordIter* iter = lilv_world_query_internal( + SordIter* port_iter = lilv_world_query_internal( world, port->node, NULL, NULL); - sord_write_iter(iter, writer); + sord_write_iter(port_iter, writer); } serd_writer_free(writer); diff --git a/src/query.c b/src/query.c index 7f2a7de..09fa6f2 100644 --- a/src/query.c +++ b/src/query.c @@ -46,7 +46,7 @@ lilv_lang_matches(const char* a, const char* b) return LILV_LANG_MATCH_NONE; } -LilvNodes* +static LilvNodes* lilv_nodes_from_stream_objects_i18n(LilvWorld* world, SordIter* stream, SordQuadIndex field) diff --git a/src/state.c b/src/state.c index c058f8d..6a6d339 100644 --- a/src/state.c +++ b/src/state.c @@ -200,16 +200,16 @@ make_path(LV2_State_Make_Path_Handle handle, const char* path) static char* abstract_path(LV2_State_Map_Path_Handle handle, - const char* absolute_path) + const char* abs_path) { LilvState* state = (LilvState*)handle; char* path = NULL; - char* real_path = lilv_realpath(absolute_path); + char* real_path = lilv_realpath(abs_path); const PathMap key = { (char*)real_path, NULL }; ZixTreeIter* iter = NULL; - if (absolute_path[0] == '\0') { - return lilv_strdup(absolute_path); + if (abs_path[0] == '\0') { + return lilv_strdup(abs_path); } else if (!zix_tree_find(state->abs2rel, &key, &iter)) { // Already mapped path in a previous call PathMap* pm = (PathMap*)zix_tree_get(iter); @@ -259,26 +259,26 @@ abstract_path(LV2_State_Map_Path_Handle handle, static char* absolute_path(LV2_State_Map_Path_Handle handle, - const char* abstract_path) + const char* state_path) { LilvState* state = (LilvState*)handle; char* path = NULL; - if (lilv_path_is_absolute(abstract_path)) { + if (lilv_path_is_absolute(state_path)) { // Absolute path, return identical path - path = lilv_strdup(abstract_path); + path = lilv_strdup(state_path); } else if (state->dir) { // Relative path inside state directory - path = lilv_path_join(state->dir, abstract_path); + path = lilv_path_join(state->dir, state_path); } else { // State has not been saved, unmap - path = lilv_strdup(lilv_state_rel2abs(state, abstract_path)); + path = lilv_strdup(lilv_state_rel2abs(state, state_path)); } return path; } /** Return a new features array which is @c feature added to @c features. */ -const LV2_Feature** +static const LV2_Feature** add_features(const LV2_Feature *const * features, const LV2_Feature* map, const LV2_Feature* make) { @@ -138,7 +138,7 @@ lilv_get_lang(void) } /** Append suffix to dst, update dst_len, and return the realloc'd result. */ -char* +static char* strappend(char* dst, size_t* dst_len, const char* suffix, size_t suffix_len) { dst = (char*)realloc(dst, *dst_len + suffix_len + 1); @@ -148,7 +148,7 @@ strappend(char* dst, size_t* dst_len, const char* suffix, size_t suffix_len) } /** Append the value of the environment variable var to dst. */ -char* +static char* append_var(char* dst, size_t* dst_len, const char* var) { // Get value from environment diff --git a/src/world.c b/src/world.c index 9ebdaac..96cb247 100644 --- a/src/world.c +++ b/src/world.c @@ -702,12 +702,10 @@ lilv_world_load_plugin_classes(LilvWorld* world) const uint8_t* label = sord_node_get_string(label_node); sord_iter_free(labels); - LilvPluginClasses* classes = world->plugin_classes; - LilvPluginClass* pclass = lilv_plugin_class_new( + LilvPluginClass* pclass = lilv_plugin_class_new( world, parent_node, class_node, (const char*)label); - if (pclass) { - zix_tree_insert((ZixTree*)classes, pclass, NULL); + zix_tree_insert(world->plugin_classes, pclass, NULL); } } sord_iter_free(classes); diff --git a/src/zix/tree.c b/src/zix/tree.c index c8a5bb4..dd6be5d 100644 --- a/src/zix/tree.c +++ b/src/zix/tree.c @@ -107,7 +107,7 @@ zix_tree_free(ZixTree* t) } size_t -zix_tree_size(ZixTree* t) +zix_tree_size(const ZixTree* t) { return t->size; } diff --git a/src/zix/tree.h b/src/zix/tree.h index 5a74fd7..cb8c60d 100644 --- a/src/zix/tree.h +++ b/src/zix/tree.h @@ -61,7 +61,7 @@ zix_tree_free(ZixTree* t); Return the number of elements in @a t. */ size_t -zix_tree_size(ZixTree* t); +zix_tree_size(const ZixTree* t); /** Insert the element @a e into @a t and point @a ti at the new element. |