Use static_cast instead of reinterpret_cast.
GitOrigin-RevId: a41264fd2afb5d20bae5846819bc457c79605a26
This commit is contained in:
parent
666faca521
commit
8e14bd16b2
@ -29,7 +29,7 @@ TEST(MultiTimeout, bug) {
|
|||||||
multi_timeout = std::make_unique<MultiTimeout>();
|
multi_timeout = std::make_unique<MultiTimeout>();
|
||||||
data.multi_timeout = multi_timeout.get();
|
data.multi_timeout = multi_timeout.get();
|
||||||
multi_timeout->set_callback([](void *void_data, int64 key) {
|
multi_timeout->set_callback([](void *void_data, int64 key) {
|
||||||
auto &data = *reinterpret_cast<Data *>(void_data);
|
auto &data = *static_cast<Data *>(void_data);
|
||||||
if (key == 1) {
|
if (key == 1) {
|
||||||
data.multi_timeout->cancel_timeout(key + 1);
|
data.multi_timeout->cancel_timeout(key + 1);
|
||||||
data.multi_timeout->set_timeout_in(key + 2, 1);
|
data.multi_timeout->set_timeout_in(key + 2, 1);
|
||||||
|
Reference in New Issue
Block a user