aboutsummaryrefslogtreecommitdiffstats
path: root/lv2/lv2plug.in/ns/ext
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-01-31 15:52:16 +0000
committerDavid Robillard <d@drobilla.net>2014-01-31 15:52:16 +0000
commite2ac3f3bb6c26f5a5e93c0df767d66de0d47222b (patch)
tree33c831cf9aef999663a122fce149cfb29e6031bb /lv2/lv2plug.in/ns/ext
parent8c5569c7fba0ced49c4289855a71737ba278d6c4 (diff)
downloadlv2-e2ac3f3bb6c26f5a5e93c0df767d66de0d47222b.tar.xz
Simplify sizes and remove implicit type conversions.
Diffstat (limited to 'lv2/lv2plug.in/ns/ext')
-rw-r--r--lv2/lv2plug.in/ns/ext/atom/forge.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/lv2/lv2plug.in/ns/ext/atom/forge.h b/lv2/lv2plug.in/ns/ext/atom/forge.h
index 7da3d65..cdf5ec7 100644
--- a/lv2/lv2plug.in/ns/ext/atom/forge.h
+++ b/lv2/lv2plug.in/ns/ext/atom/forge.h
@@ -230,8 +230,7 @@ lv2_atom_forge_is_blank(const LV2_Atom_Forge* forge,
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
return (type == forge->Blank ||
- (type == forge->Object &&
- ((LV2_Atom_Object_Body*)body)->id == 0));
+ (type == forge->Object && body->id == 0));
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
# pragma GCC diagnostic pop
#endif
@@ -583,7 +582,7 @@ lv2_atom_forge_object(LV2_Atom_Forge* forge,
LV2_URID otype)
{
const LV2_Atom_Object a = {
- { sizeof(LV2_Atom_Object) - sizeof(LV2_Atom), forge->Object },
+ { (uint32_t)sizeof(LV2_Atom_Object_Body), forge->Object },
{ id, otype }
};
return lv2_atom_forge_push(
@@ -608,7 +607,7 @@ lv2_atom_forge_resource(LV2_Atom_Forge* forge,
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
const LV2_Atom_Object a = {
- { sizeof(LV2_Atom_Object) - sizeof(LV2_Atom), forge->Resource },
+ { (uint32_t)sizeof(LV2_Atom_Object_Body), forge->Resource },
{ id, otype }
};
return lv2_atom_forge_push(
@@ -636,7 +635,7 @@ lv2_atom_forge_blank(LV2_Atom_Forge* forge,
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
const LV2_Atom_Object a = {
- { sizeof(LV2_Atom_Object) - sizeof(LV2_Atom), forge->Blank },
+ { (uint32_t)sizeof(LV2_Atom_Object_Body), forge->Blank },
{ id, otype }
};
return lv2_atom_forge_push(
@@ -656,7 +655,7 @@ lv2_atom_forge_key(LV2_Atom_Forge* forge,
LV2_URID key)
{
const LV2_Atom_Property_Body a = { key, 0, { 0, 0 } };
- return lv2_atom_forge_write(forge, &a, 2 * sizeof(uint32_t));
+ return lv2_atom_forge_write(forge, &a, 2 * (uint32_t)sizeof(uint32_t));
}
/**
@@ -671,7 +670,7 @@ lv2_atom_forge_property_head(LV2_Atom_Forge* forge,
LV2_URID context)
{
const LV2_Atom_Property_Body a = { key, context, { 0, 0 } };
- return lv2_atom_forge_write(forge, &a, 2 * sizeof(uint32_t));
+ return lv2_atom_forge_write(forge, &a, 2 * (uint32_t)sizeof(uint32_t));
}
/**
@@ -683,7 +682,7 @@ lv2_atom_forge_sequence_head(LV2_Atom_Forge* forge,
uint32_t unit)
{
const LV2_Atom_Sequence a = {
- { sizeof(LV2_Atom_Sequence) - sizeof(LV2_Atom), forge->Sequence },
+ { (uint32_t)sizeof(LV2_Atom_Sequence_Body), forge->Sequence },
{ unit, 0 }
};
return lv2_atom_forge_push(