Commit 6c921adf authored by Dominik Charousset's avatar Dominik Charousset

Fix maybe-uninitialized warnings

parent b2f9a1c9
......@@ -198,7 +198,7 @@ public:
lhs = static_cast<underlying>(rhs);
}
} assign;
underlying tmp;
underlying tmp = 0;
return convert_apply(dref(), x, tmp, assign);
}
......@@ -221,7 +221,7 @@ public:
lhs = rhs ? 1 : 0;
}
} assign;
uint8_t tmp;
uint8_t tmp = 0;
return convert_apply(dref(), x, tmp, assign);
}
......@@ -288,7 +288,7 @@ public:
xs.clear();
auto insert_iter = std::inserter(xs, xs.end());
for (size_t i = 0; i < num_elements; ++i) {
typename std::remove_const<typename T::value_type>::type x;
typename std::remove_const<typename T::value_type>::type x = {};
auto err = apply(x);
if (err)
return err;
......@@ -445,7 +445,7 @@ public:
lhs = rhs.count();
}
} assign;
Rep tmp;
Rep tmp = 0;
return convert_apply(dref(), x, tmp, assign);
}
......
......@@ -237,7 +237,7 @@ struct binary_serialization_policy {
binary_serializer f{&context, buf};
f(x);
binary_deserializer g{&context, buf};
T y;
auto y = T{};
g(y);
CAF_CHECK_EQUAL(x, y);
return detail::safe_equal(x, y);
......@@ -252,5 +252,4 @@ CAF_TEST(binary_serialization_inspectors) {
scoped_execution_unit context;
binary_serialization_policy p{context};
test_impl(p);
}
......@@ -179,7 +179,7 @@ struct fixture {
// serializes `x` and then deserializes and returns the serialized value
template <class T>
T roundtrip(T x) {
T result;
auto result = T{};
deserialize(serialize(x), result);
return result;
}
......@@ -288,7 +288,7 @@ CAF_TEST(timestamp_values) {
CAF_TEST(enum_classes) {
auto buf = serialize(te);
test_enum x;
auto x = static_cast<test_enum>(0);
deserialize(buf, x);
CAF_CHECK_EQUAL(te, x);
}
......@@ -374,7 +374,7 @@ CAF_TEST(messages) {
CAF_TEST(multiple_messages) {
auto m = make_message(rs, te);
auto buf = serialize(te, m, msg);
test_enum t;
auto t = static_cast<test_enum>(0);
message m1;
message m2;
deserialize(buf, t, m1, m2);
......
......@@ -120,7 +120,7 @@ peer::behavior_type peer_fun(peer::broker_pointer self, connection_handle hdl,
},
[=](const new_data_msg& msg) {
CAF_MESSAGE("received new_data_msg");
atom_value x;
atom_value x = static_cast<atom_value>(0);
int y;
binary_deserializer source{self->system(), msg.buf};
auto e = source(x, y);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment