From fe43ff5fe29d5bbe59ead086782131144e451dc6 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 28 Sep 2011 14:26:47 +0000 Subject: Remove use of GSList. git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@3500 a436a847-0d15-0410-975c-d299462d15a1 --- src/lilv_internal.h | 9 +++++---- src/node.c | 2 -- src/world.c | 14 +++++++------- 3 files changed, 12 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/lilv_internal.h b/src/lilv_internal.h index 9698fe9..770f144 100644 --- a/src/lilv_internal.h +++ b/src/lilv_internal.h @@ -67,9 +67,10 @@ struct LilvPortImpl { struct LilvSpecImpl { - SordNode* spec; - SordNode* bundle; - LilvNodes* data_uris; + SordNode* spec; + SordNode* bundle; + LilvNodes* data_uris; + struct LilvSpecImpl* next; }; /** @@ -115,7 +116,7 @@ struct LilvWorldImpl { unsigned n_read_files; LilvPluginClass* lv2_plugin_class; LilvPluginClasses* plugin_classes; - GSList* specs; + LilvSpec* specs; LilvPlugins* plugins; SordNode* dc_replaces_node; SordNode* dyn_manifest_node; diff --git a/src/node.c b/src/node.c index 918bdd0..ccccf88 100644 --- a/src/node.c +++ b/src/node.c @@ -21,8 +21,6 @@ #include #include -#include - #include "lilv_internal.h" static void diff --git a/src/world.c b/src/world.c index 14f1fe9..9cb00ac 100644 --- a/src/world.c +++ b/src/world.c @@ -135,14 +135,14 @@ lilv_world_free(LilvWorld* world) lilv_node_free(world->lv2_optionalFeature_val); lilv_node_free(world->lv2_requiredFeature_val); - for (GSList* l = world->specs; l; l = l->next) { - LilvSpec* spec = (LilvSpec*)l->data; + for (LilvSpec* spec = world->specs; spec;) { + LilvSpec* next = spec->next; sord_node_free(world->world, spec->spec); sord_node_free(world->world, spec->bundle); lilv_nodes_free(spec->data_uris); free(spec); + spec = next; } - g_slist_free(world->specs); world->specs = NULL; LILV_FOREACH(plugins, i, world->plugins) { @@ -333,8 +333,9 @@ lilv_world_add_spec(LilvWorld* world, } lilv_match_end(files); - // Add specification to world specification sequence - world->specs = g_slist_prepend(world->specs, spec); + // Add specification to world specification list + spec->next = world->specs; + world->specs = spec; } static void @@ -681,8 +682,7 @@ lilv_world_load_path(LilvWorld* world, static void lilv_world_load_specifications(LilvWorld* world) { - for (GSList* l = world->specs; l; l = l->next) { - LilvSpec* spec = (LilvSpec*)l->data; + for (LilvSpec* spec = world->specs; spec; spec = spec->next) { LILV_FOREACH(nodes, f, spec->data_uris) { LilvNode* file = lilv_collection_get(spec->data_uris, f); const uint8_t* file_uri = (const uint8_t*)lilv_node_as_uri(file); -- cgit v1.2.1