From 4e97a27ba8d706af7f54be70502ba3bfeb957565 Mon Sep 17 00:00:00 2001 From: William F Godoy <williamfgc@yahoo.com> Date: Mon, 20 Nov 2017 13:02:16 -0500 Subject: [PATCH] Removed warning for void parameter and checking on --- .../toolkit/transportman/dataman/DataMan.cpp | 14 ++++++++------ .../adios2/toolkit/transportman/dataman/DataMan.h | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/source/adios2/toolkit/transportman/dataman/DataMan.cpp b/source/adios2/toolkit/transportman/dataman/DataMan.cpp index ca65bbd47..516b1a289 100644 --- a/source/adios2/toolkit/transportman/dataman/DataMan.cpp +++ b/source/adios2/toolkit/transportman/dataman/DataMan.cpp @@ -38,6 +38,7 @@ DataMan::~DataMan() void DataMan::OpenWANTransports(const std::string &name, const Mode mode, const std::vector<Params> ¶metersVector, const bool profile) + { #ifdef ADIOS2_HAVE_ZEROMQ size_t counter = 0; // remove MACRO when more libraries are added @@ -134,13 +135,14 @@ void DataMan::WriteWAN(const void *buffer, nlohmann::json jmsg) { m_ControlTransports[m_CurrentTransport]->Write(jmsg.dump().c_str(), jmsg.dump().size()); - m_Transports[m_CurrentTransport]->Write(static_cast<const char *>(buffer), - jmsg["bytes"].get<size_t>()); + m_Transports[m_CurrentTransport]->Write( + reinterpret_cast<const char *>(buffer), jmsg["bytes"].get<size_t>()); } -void DataMan::WriteWAN(const char *buffer, size_t size) +void DataMan::WriteWAN(const void *buffer, size_t size) { - m_Transports[m_CurrentTransport]->Write(buffer, size); + m_Transports[m_CurrentTransport]->Write( + reinterpret_cast<const char *>(buffer), size); } void DataMan::ReadWAN(void *buffer, nlohmann::json jmsg) {} @@ -205,11 +207,11 @@ void DataMan::ReadThread(std::shared_ptr<Transport> trans, if (bufferSize > 0) { - size_t size = static_cast<size_t>(bufferSize); + const size_t size = static_cast<size_t>(bufferSize) + 8; m_BP3Deserializer->m_Data.Resize( size, "in DataMan Streaming Listener"); - trans->Read(m_BP3Deserializer->m_Data.m_Buffer.data(), size); + trans->Read(m_BP3Deserializer->m_Data.m_Buffer.data(), size, 0); m_BP3Deserializer->ParseMetadata(*m_IO); const auto variablesInfo = m_IO->GetAvailableVariables(); diff --git a/source/adios2/toolkit/transportman/dataman/DataMan.h b/source/adios2/toolkit/transportman/dataman/DataMan.h index ed3fd40af..4dc134e35 100644 --- a/source/adios2/toolkit/transportman/dataman/DataMan.h +++ b/source/adios2/toolkit/transportman/dataman/DataMan.h @@ -44,7 +44,7 @@ public: * @param buffer * @param size can't use const due to C libraries... */ - void WriteWAN(const char *buffer, size_t size); + void WriteWAN(const void *buffer, size_t size); void ReadWAN(void *buffer, nlohmann::json jmsg); -- GitLab