From 8123b3ff3aee3a161723c06a0d88141a0e8b7841 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 2 Aug 2020 12:19:54 +0200 Subject: Fix shadow warnings --- src/AtomReader.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/AtomReader.cpp') 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 subject_uri(atom_to_uri(subject)); - if (!subject_uri) { - _log.warn("Copy message has non-path subject\n"); - return false; - } boost::optional 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(seq)->body, + _iface(Response{reinterpret_cast(number)->body, static_cast( reinterpret_cast(body)->body), subject_uri ? subject_uri->c_str() : ""}); -- cgit v1.2.1