Skip to content

Commit beb1768

Browse files
authored
Merge pull request #54 from timohl/master
Added more void casts to prevent unused warnings.
2 parents f08f5aa + ffa6e76 commit beb1768

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/message/migfra/task.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ void Task_container::load(const YAML::Node &node)
176176
std::string type;
177177
try {
178178
fast::load(type, node["task"]);
179-
} catch (const std::exception /*&e*/) {
179+
} catch (const std::exception &/*e*/) {
180180
throw Task_container::no_task_exception("Cannot find key \"task\" to load Task from YAML.");
181181
}
182182
if (type == "start vm") {

src/mqtt_communicator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ std::string MQTT_communicator::get_message(const std::string &topic, const std::
328328
auto &subscription = subscriptions.at(topic);
329329
lock.unlock();
330330
return subscription->get_message(duration, actual_topic);
331-
} catch (const std::out_of_range /*&e*/) {
331+
} catch (const std::out_of_range &/*e*/) {
332332
throw std::out_of_range("Topic not found in subscriptions.");
333333
}
334334
}

test/optional_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ struct Task_tester :
5858
fructose_assert_eq(tag, p.get_tag());
5959
fructose_assert_exception(p.get(), std::runtime_error);
6060
fructose_assert_exception(*p, std::runtime_error);
61-
fructose_assert_exception(p->id, std::runtime_error);
61+
fructose_assert_exception((void) p->id, std::runtime_error);
6262
p = Person(1);
6363
fructose_assert(p);
6464
fructose_assert(p.is_valid());
6565
fructose_assert_no_exception(p.get());
6666
fructose_assert_no_exception(*p);
67-
fructose_assert_no_exception((*p).id);
68-
fructose_assert_no_exception(p.get().id);
69-
fructose_assert_no_exception(p->id);
67+
fructose_assert_no_exception((void) (*p).id);
68+
fructose_assert_no_exception((void) p.get().id);
69+
fructose_assert_no_exception((void) p->id);
7070
fructose_assert((*p).id == 1);
7171
fructose_assert(p.get().id == 1);
7272
fructose_assert(p->id == 1);

0 commit comments

Comments
 (0)