aboutsummaryrefslogtreecommitdiffstats
path: root/lv2/lv2plug.in/ns/ext/atom
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-03-03 21:07:45 +0000
committerDavid Robillard <d@drobilla.net>2012-03-03 21:07:45 +0000
commit2a931ba3f49217dd1041fef9587421495041e6ce (patch)
tree31d591455608157b1a00f614cb74be2d02e638a6 /lv2/lv2plug.in/ns/ext/atom
parent6a848b53ef158648a4dc25274afeb668c530abd9 (diff)
downloadlv2-2a931ba3f49217dd1041fef9587421495041e6ce.tar.xz
Fix lv2_atom_forge_bool().
Use pointers for references when using an internal buffer rather than offsets, so 0 isn't a valid reference.
Diffstat (limited to 'lv2/lv2plug.in/ns/ext/atom')
-rw-r--r--lv2/lv2plug.in/ns/ext/atom/atom.ttl7
-rw-r--r--lv2/lv2plug.in/ns/ext/atom/forge.h6
2 files changed, 7 insertions, 6 deletions
diff --git a/lv2/lv2plug.in/ns/ext/atom/atom.ttl b/lv2/lv2plug.in/ns/ext/atom/atom.ttl
index 1b2ed1d..4d7c98e 100644
--- a/lv2/lv2plug.in/ns/ext/atom/atom.ttl
+++ b/lv2/lv2plug.in/ns/ext/atom/atom.ttl
@@ -237,9 +237,10 @@ atom:URI
rdfs:label "URI string" ;
lv2:documentation """
<p>A URI string. This is identical in format to atom:String, except the string
-is a URI. This is useful when a URI is needed but mapping is inappropriate.
-Since the ability to distinguish URIs from plain strings is often necessary,
-URIs MUST NOT be transmitted as atom:String.</p>
+is a URI. This is useful when a URI is needed but mapping is inappropriate,
+for example with temporary or relative URIs. Since the ability to distinguish
+URIs from plain strings is often necessary, URIs MUST NOT be transmitted as
+atom:String.</p>
<p>This is not strictly a URI, since UTF-8 is allowed. Escaping and related
issues issues are the host's responsibility.</p>
diff --git a/lv2/lv2plug.in/ns/ext/atom/forge.h b/lv2/lv2plug.in/ns/ext/atom/forge.h
index c1b6d31..82e80eb 100644
--- a/lv2/lv2plug.in/ns/ext/atom/forge.h
+++ b/lv2/lv2plug.in/ns/ext/atom/forge.h
@@ -201,7 +201,7 @@ static inline LV2_Atom*
lv2_atom_forge_deref(LV2_Atom_Forge* forge, LV2_Atom_Forge_Ref ref)
{
if (forge->buf) {
- return (LV2_Atom*)(forge->buf + ref);
+ return (LV2_Atom*)ref;
} else {
return forge->deref(forge->handle, ref);
}
@@ -219,7 +219,7 @@ lv2_atom_forge_raw(LV2_Atom_Forge* forge, const void* data, uint32_t size)
if (forge->sink) {
out = forge->sink(forge->handle, data, size);
} else {
- out = forge->offset;
+ out = (LV2_Atom_Forge_Ref)forge->buf + forge->offset;
uint8_t* mem = forge->buf + forge->offset;
if (forge->offset + size > forge->size) {
return 0;
@@ -316,7 +316,7 @@ lv2_atom_forge_double(LV2_Atom_Forge* forge, double val)
static inline LV2_Atom_Forge_Ref
lv2_atom_forge_bool(LV2_Atom_Forge* forge, bool val)
{
- const LV2_Atom_Bool a = { { sizeof(val), forge->Bool }, val };
+ const LV2_Atom_Bool a = { { sizeof(int32_t), forge->Bool }, val ? 1 : 0 };
return lv2_atom_forge_primitive(forge, &a.atom);
}