summaryrefslogtreecommitdiffstats
path: root/src/AtomReader.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-02 12:19:54 +0200
committerDavid Robillard <d@drobilla.net>2020-08-02 12:51:11 +0200
commit8123b3ff3aee3a161723c06a0d88141a0e8b7841 (patch)
tree82401219c53b678fcb3eab92904428e7b570a691 /src/AtomReader.cpp
parent8e0ab708ccb604c3224da2386dde609cb30de2b7 (diff)
downloadingen-8123b3ff3aee3a161723c06a0d88141a0e8b7841.tar.gz
ingen-8123b3ff3aee3a161723c06a0d88141a0e8b7841.tar.bz2
ingen-8123b3ff3aee3a161723c06a0d88141a0e8b7841.zip
Fix shadow warnings
Diffstat (limited to 'src/AtomReader.cpp')
-rw-r--r--src/AtomReader.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/AtomReader.cpp b/src/AtomReader.cpp
index a7f0386e..77b4740d 100644
--- a/src/AtomReader.cpp
+++ b/src/AtomReader.cpp
@@ -324,6 +324,11 @@ AtomReader::write(const LV2_Atom* msg, int32_t default_id)
return false;
}
+ if (!subject_uri) {
+ _log.warn("Copy message has non-path subject\n");
+ return false;
+ }
+
const LV2_Atom* dest = nullptr;
lv2_atom_object_get(obj, _uris.patch_destination.urid(), &dest, 0);
if (!dest) {
@@ -331,11 +336,6 @@ AtomReader::write(const LV2_Atom* msg, int32_t default_id)
return false;
}
- boost::optional<URI> subject_uri(atom_to_uri(subject));
- if (!subject_uri) {
- _log.warn("Copy message has non-path subject\n");
- return false;
- }
boost::optional<URI> dest_uri(atom_to_uri(dest));
if (!dest_uri) {
@@ -371,20 +371,18 @@ AtomReader::write(const LV2_Atom* msg, int32_t default_id)
_iface(Move{seq, *subject_path, *dest_path});
} else if (obj->body.otype == _uris.patch_Response) {
- const LV2_Atom* seq = nullptr;
const LV2_Atom* body = nullptr;
lv2_atom_object_get(obj,
- _uris.patch_sequenceNumber.urid(), &seq,
- _uris.patch_body.urid(), &body,
+ _uris.patch_body.urid(), &body,
0);
- if (!seq || seq->type != _uris.atom_Int) {
+ if (!number || number->type != _uris.atom_Int) {
_log.warn("Response message has no sequence number\n");
return false;
} else if (!body || body->type != _uris.atom_Int) {
_log.warn("Response message body is not integer\n");
return false;
}
- _iface(Response{reinterpret_cast<const LV2_Atom_Int*>(seq)->body,
+ _iface(Response{reinterpret_cast<const LV2_Atom_Int*>(number)->body,
static_cast<ingen::Status>(
reinterpret_cast<const LV2_Atom_Int*>(body)->body),
subject_uri ? subject_uri->c_str() : ""});