diff --git a/examples/01-simple-connection/main.cpp b/examples/01-simple-connection/main.cpp index 67b33d1..90e29e7 100644 --- a/examples/01-simple-connection/main.cpp +++ b/examples/01-simple-connection/main.cpp @@ -22,7 +22,7 @@ int main() Signal signal; // Connect a lambda - signal.connect([](std::string arg1, int arg2) { + (void)signal.connect([](std::string arg1, int arg2) { std::cout << arg1 << " " << arg2 << std::endl; }); diff --git a/examples/04-simple-property/main.cpp b/examples/04-simple-property/main.cpp index f9652ce..9e19182 100644 --- a/examples/04-simple-property/main.cpp +++ b/examples/04-simple-property/main.cpp @@ -35,7 +35,7 @@ int main() { Widget w("A cool widget"); - w.value.valueChanged().connect([](int newValue) { + (void)w.value.valueChanged().connect([](int newValue) { std::cout << "The new value is " << newValue << std::endl; }); diff --git a/examples/05-property-bindings/main.cpp b/examples/05-property-bindings/main.cpp index 38b1624..ebd1723 100644 --- a/examples/05-property-bindings/main.cpp +++ b/examples/05-property-bindings/main.cpp @@ -31,7 +31,7 @@ int main() Image img; std::cout << "The initial size of the image = " << img.byteSize.get() << " bytes" << std::endl; - img.byteSize.valueChanged().connect([](const int &newValue) { + (void)img.byteSize.valueChanged().connect([](const int &newValue) { std::cout << "The new size of the image = " << newValue << " bytes" << std::endl; }); diff --git a/examples/06-lazy-property-bindings/main.cpp b/examples/06-lazy-property-bindings/main.cpp index a22472e..a7a2978 100644 --- a/examples/06-lazy-property-bindings/main.cpp +++ b/examples/06-lazy-property-bindings/main.cpp @@ -33,7 +33,7 @@ int main() Image img; std::cout << "The initial size of the image = " << img.byteSize.get() << " bytes" << std::endl; - img.byteSize.valueChanged().connect([](const int &newValue) { + (void)img.byteSize.valueChanged().connect([](const int &newValue) { std::cout << "The new size of the image = " << newValue << " bytes" << std::endl; }); diff --git a/tests/binding/tst_binding.cpp b/tests/binding/tst_binding.cpp index beaf943..38c3801 100644 --- a/tests/binding/tst_binding.cpp +++ b/tests/binding/tst_binding.cpp @@ -185,7 +185,7 @@ TEST_CASE("Binding expression updates") Private::makeNode(input)), evaluator) }; - prop1.valueChanged().connect([&ordering](int) { ordering.emplace_back(1); }); + (void)prop1.valueChanged().connect([&ordering](int) { ordering.emplace_back(1); }); auto prop2 = Property{ std::make_unique>( @@ -193,7 +193,7 @@ TEST_CASE("Binding expression updates") Private::makeNode(input)), evaluator) }; - prop2.valueChanged().connect([&ordering](int) { ordering.emplace_back(2); }); + (void)prop2.valueChanged().connect([&ordering](int) { ordering.emplace_back(2); }); input = 8; evaluator.evaluateAll(); diff --git a/tests/property/tst_property.cpp b/tests/property/tst_property.cpp index 4db93d5..34cbeb1 100644 --- a/tests/property/tst_property.cpp +++ b/tests/property/tst_property.cpp @@ -79,7 +79,7 @@ class ClassWithProperty ClassWithProperty() { - property().valueChanged.connect( + (void)property().valueChanged.connect( [this]() { this->changed.emit(); }); @@ -92,7 +92,7 @@ TEST_CASE("An object with a Signal that is wrapped in a property can emit the Si auto handler = [&called]() { called = true; }; ClassWithProperty outer; - outer.changed.connect(handler); + (void)outer.changed.connect(handler); outer.property().emitSignal(); @@ -159,7 +159,7 @@ TEST_CASE("Signals") auto handler = [¬ified]() { notified = true; }; auto p = new Property{ 5 }; - p->destroyed().connect(handler); + (void)p->destroyed().connect(handler); delete p; REQUIRE(notified == true); @@ -254,7 +254,7 @@ TEST_CASE("Property Updaters") updatedValue = value; slotCalled = true; }; - property.valueChanged().connect(handler); + (void)property.valueChanged().connect(handler); updater->set(123); REQUIRE(property.get() == 123); @@ -299,7 +299,7 @@ TEST_CASE("Moving") auto property = Property>{ std::make_unique(42) }; property.valueChanged().connect(handlerVoid); - property.valueChanged().connect(handlerValue); + (void)property.valueChanged().connect(handlerValue); auto movedProperty{ std::move(property) }; movedProperty.set(std::make_unique(123)); diff --git a/tests/signal/tst_signal.cpp b/tests/signal/tst_signal.cpp index 71f5cbf..48cad8e 100644 --- a/tests/signal/tst_signal.cpp +++ b/tests/signal/tst_signal.cpp @@ -138,13 +138,13 @@ TEST_CASE("Signal connections") auto evaluator = std::make_shared(); std::thread thread1([&] { - signal1.connectDeferred(evaluator, [&val](int value) { + (void)signal1.connectDeferred(evaluator, [&val](int value) { val += value; }); }); std::thread thread2([&] { - signal2.connectDeferred(evaluator, [&val](int value) { + (void)signal2.connectDeferred(evaluator, [&val](int value) { val += value; }); }); @@ -169,11 +169,11 @@ TEST_CASE("Signal connections") int val2 = 4; auto evaluator = std::make_shared(); - signal1.connectDeferred(evaluator, [&val1](int value) { + (void)signal1.connectDeferred(evaluator, [&val1](int value) { val1 += value; }); - signal2.connectDeferred(evaluator, [&val2](int value) { + (void)signal2.connectDeferred(evaluator, [&val2](int value) { val2 += value; }); @@ -224,7 +224,7 @@ TEST_CASE("Signal connections") int val = 4; auto evaluator = std::make_shared(); - signal.connectDeferred(evaluator, [&val](int value) { + (void)signal.connectDeferred(evaluator, [&val](int value) { val += value; }); @@ -246,7 +246,7 @@ TEST_CASE("Signal connections") bool anotherCalled = false; auto handle = signal->connectDeferred(evaluator, [&called]() { called = true; }); - anotherSignal.connectDeferred(evaluator, [&anotherCalled]() { anotherCalled = true; }); + (void)anotherSignal.connectDeferred(evaluator, [&anotherCalled]() { anotherCalled = true; }); signal->emit(); anotherSignal.emit(); @@ -368,7 +368,7 @@ TEST_CASE("Signal connections") }); int lambdaCallCount2 = 0; - signal.connect([&]() { + (void)signal.connect([&]() { ++lambdaCallCount2; }); @@ -396,7 +396,7 @@ TEST_CASE("Signal connections") handle = &result; int lambdaCallCount2 = 0; - signal.connect([&]() { + (void)signal.connect([&]() { ++lambdaCallCount2; }); @@ -413,12 +413,12 @@ TEST_CASE("Signal connections") { Signal<> signal; int lambdaCallCount = 0; - signal.connect([&]() { + (void)signal.connect([&]() { ++lambdaCallCount; }); int lambdaCallCount2 = 0; - signal.connect([&]() { + (void)signal.connect([&]() { ++lambdaCallCount2; }); @@ -454,7 +454,7 @@ TEST_CASE("Moving") auto handler = [&count]() { ++count; }; Signal<> signal; - signal.connect(handler); + (void)signal.connect(handler); Signal<> movedSignal{ std::move(signal) }; movedSignal.emit(); @@ -467,7 +467,7 @@ TEST_CASE("Moving") auto handler = [&count]() { ++count; }; Signal<> signal; - signal.connect(handler); + (void)signal.connect(handler); Signal<> movedSignal = std::move(signal); movedSignal.emit();