aboutsummaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-01-08 04:38:25 +0000
committerDavid Robillard <d@drobilla.net>2011-01-08 04:38:25 +0000
commit7c13fe77eba94b1d9ac55a29acc2f5ab66cd984a (patch)
tree4093909f8c54438c658bb59f329abd65c2b8b975 /ext
parentd30c5821957c45e048d7e8fb9b2e02b05b8ac2d4 (diff)
downloadlv2-7c13fe77eba94b1d9ac55a29acc2f5ab66cd984a.tar.xz
Const correct object iterator (not really useful for writing).
Diffstat (limited to 'ext')
-rw-r--r--ext/atom.lv2/atom-helpers.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/atom.lv2/atom-helpers.h b/ext/atom.lv2/atom-helpers.h
index 6eac4b5..0430230 100644
--- a/ext/atom.lv2/atom-helpers.h
+++ b/ext/atom.lv2/atom-helpers.h
@@ -49,9 +49,9 @@ typedef LV2_Atom_Property* LV2_Object_Iter;
/** Get an iterator pointing to @a prop in some LV2_Object */
static inline LV2_Object_Iter
-lv2_object_begin(LV2_Atom* obj)
+lv2_object_begin(const LV2_Atom* obj)
{
- return (LV2_Object_Iter)(((LV2_Object*)obj->body)->properties);
+ return (LV2_Object_Iter)(((const LV2_Object*)obj->body)->properties);
}
/** Return true iff @a iter has reached the end of @a object */
@@ -169,8 +169,8 @@ lv2_atom_is_a(LV2_Atom* object,
/** A single entry in an Object query. */
typedef struct {
- uint32_t key; ///< Set by the user to the desired key to query.
- LV2_Atom* value; ///< Possibly set by query function to the found value
+ uint32_t key; ///< Set by the user to the desired key to query.
+ const LV2_Atom* value; ///< Possibly set by query function to the found value
} LV2_Object_Query;
/** "Query" an object, getting a pointer to the values for various keys.
@@ -181,7 +181,7 @@ typedef struct {
* quickly without allocating any memory. This function is realtime safe.
*/
static inline int
-lv2_object_query(LV2_Atom* object, LV2_Object_Query* query)
+lv2_object_query(const LV2_Atom* object, LV2_Object_Query* query)
{
int matches = 0;
int n_queries = 0;
@@ -191,7 +191,7 @@ lv2_object_query(LV2_Atom* object, LV2_Object_Query* query)
++n_queries;
LV2_OBJECT_FOREACH(object, o) {
- LV2_Atom_Property* prop = lv2_object_iter_get(o);
+ const LV2_Atom_Property* prop = lv2_object_iter_get(o);
for (LV2_Object_Query* q = query; q->key; ++q) {
if (q->key == prop->key && !q->value) {
q->value = &prop->value;