From e50d9192ef9680883443dad30f1860f17ea7403d Mon Sep 17 00:00:00 2001 From: Arkadiusz Szczepkowicz Date: Fri, 15 Mar 2024 14:50:07 +0100 Subject: [PATCH] #2063: Update void* to std::byte* in Holder struct --- src/vt/objgroup/holder/holder.h | 2 +- src/vt/objgroup/holder/holder_base.h | 4 ++-- src/vt/objgroup/holder/holder_basic.h | 2 +- src/vt/objgroup/manager.impl.h | 2 +- src/vt/objgroup/manager.static.h | 2 +- src/vt/objgroup/proxy/proxy_objgroup.impl.h | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/vt/objgroup/holder/holder.h b/src/vt/objgroup/holder/holder.h index 1ebfc6a91e..95d911c7f4 100644 --- a/src/vt/objgroup/holder/holder.h +++ b/src/vt/objgroup/holder/holder.h @@ -63,7 +63,7 @@ struct Holder final : HolderObjBase { public: ObjT* get() override { return obj_.get(); } bool exists() override { return obj_ != nullptr; } - void* getPtr() override { return obj_.get(); } + std::byte* getPtr() override { return reinterpret_cast(obj_.get()); } template void reset(Args&&... args) { diff --git a/src/vt/objgroup/holder/holder_base.h b/src/vt/objgroup/holder/holder_base.h index e1218e06e5..0cd9f6439b 100644 --- a/src/vt/objgroup/holder/holder_base.h +++ b/src/vt/objgroup/holder/holder_base.h @@ -57,7 +57,7 @@ struct HolderBase { virtual ~HolderBase() = default; virtual bool exists() = 0; - virtual void* getPtr() = 0; + virtual std::byte* getPtr() = 0; template void serialize(Serializer& s) { @@ -78,7 +78,7 @@ template struct HolderObjBase : HolderBase { virtual ~HolderObjBase() = default; virtual ObjT* get() = 0; - virtual void* getPtr() = 0; + virtual std::byte* getPtr() = 0; }; }}} /* end namespace vt::objgroup::holder */ diff --git a/src/vt/objgroup/holder/holder_basic.h b/src/vt/objgroup/holder/holder_basic.h index ca2f73c033..d752843e5b 100644 --- a/src/vt/objgroup/holder/holder_basic.h +++ b/src/vt/objgroup/holder/holder_basic.h @@ -61,7 +61,7 @@ struct HolderBasic final : HolderObjBase { public: ObjT* get() override { return obj_; } bool exists() override { return obj_ != nullptr; } - void* getPtr() override { return obj_; } + std::byte* getPtr() override { return reinterpret_cast(obj_); } template void reset(Args&&... args) { diff --git a/src/vt/objgroup/manager.impl.h b/src/vt/objgroup/manager.impl.h index d2792525ad..ebb11839ac 100644 --- a/src/vt/objgroup/manager.impl.h +++ b/src/vt/objgroup/manager.impl.h @@ -288,7 +288,7 @@ ObjT* ObjGroupManager::get(ProxyElmType proxy) { auto iter = objs_.find(proxy_bits); vtAssert(iter != objs_.end(), "Obj must exist on this node"); HolderBaseType* holder = iter->second.get(); - return static_cast(holder->getPtr()); + return reinterpret_cast(holder->getPtr()); } template diff --git a/src/vt/objgroup/manager.static.h b/src/vt/objgroup/manager.static.h index ac24a78aec..9f3b490697 100644 --- a/src/vt/objgroup/manager.static.h +++ b/src/vt/objgroup/manager.static.h @@ -96,7 +96,7 @@ decltype(auto) invoke( return runnable::makeRunnableVoid(false, han, this_node) .withObjGroup(elm) .withLBData(lb_data, elm_id) - .runLambda(f, static_cast(elm), msg.get()); + .runLambda(f, reinterpret_cast(elm), msg.get()); } template diff --git a/src/vt/objgroup/proxy/proxy_objgroup.impl.h b/src/vt/objgroup/proxy/proxy_objgroup.impl.h index 7a3448de28..f594ae6abe 100644 --- a/src/vt/objgroup/proxy/proxy_objgroup.impl.h +++ b/src/vt/objgroup/proxy/proxy_objgroup.impl.h @@ -279,7 +279,7 @@ typename Proxy::PendingSendType Proxy::reduce(MsgPtrT inmsg, ReduceS template ObjT* Proxy::get() const { auto proxy = Proxy(*this); - return theObjGroup()->get(proxy); + return reinterpret_cast(theObjGroup()->get(proxy)); } template