diff options
author | David Robillard <d@drobilla.net> | 2011-01-30 05:28:32 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-01-30 05:28:32 +0000 |
commit | c5f3bb2fa81d443c3475c0df2b9e6f14d02f2cc8 (patch) | |
tree | 2c26bc1218d852b8b5196116d40c17e8fbd5d3a5 /src/port.c | |
parent | 73d4c34f7756a36c078a11c639328a7eef474ecb (diff) | |
download | lilv-c5f3bb2fa81d443c3475c0df2b9e6f14d02f2cc8.tar.gz lilv-c5f3bb2fa81d443c3475c0df2b9e6f14d02f2cc8.tar.bz2 lilv-c5f3bb2fa81d443c3475c0df2b9e6f14d02f2cc8.zip |
Wrap stream iteration in macros.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@2869 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/port.c')
-rw-r--r-- | src/port.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -75,7 +75,7 @@ slv2_port_get_node(SLV2Plugin p, librdf_new_node_from_node(p->world->lv2_port_node), NULL); librdf_node* ret = NULL; - for (; !librdf_stream_end(ports); librdf_stream_next(ports)) { + FOREACH_MATCH(ports) { librdf_statement* s = librdf_stream_get_object(ports); librdf_node* node = librdf_statement_get_object(s); @@ -89,6 +89,7 @@ slv2_port_get_node(SLV2Plugin p, break; } } + END_MATCH(ports); assert(ret); return ret; } @@ -142,7 +143,7 @@ slv2_values_from_stream_objects(SLV2Plugin p, librdf_stream* stream) } SLV2Values values = slv2_values_new(); - for (; !librdf_stream_end(stream); librdf_stream_next(stream)) { + FOREACH_MATCH(stream) { raptor_sequence_push( values, slv2_value_new_librdf_node( @@ -150,7 +151,7 @@ slv2_values_from_stream_objects(SLV2Plugin p, librdf_stream* stream) librdf_statement_get_object( librdf_stream_get_object(stream)))); } - librdf_free_stream(stream); + END_MATCH(stream); return values; } @@ -320,7 +321,7 @@ slv2_port_get_scale_points(SLV2Plugin p, if (!librdf_stream_end(points)) ret = slv2_scale_points_new(); - for (; !librdf_stream_end(points); librdf_stream_next(points)) { + FOREACH_MATCH(points) { librdf_statement* s = librdf_stream_get_object(points); librdf_node* point = librdf_statement_get_object(s); @@ -338,7 +339,7 @@ slv2_port_get_scale_points(SLV2Plugin p, raptor_sequence_push(ret, slv2_scale_point_new(value, label)); } } - librdf_free_stream(points); + END_MATCH(points); assert(!ret || slv2_values_size(ret) > 0); return ret; |