-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sync-with-eclipse-ecal-2024-05-16-2 #69
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There were too many comments to post at once. Showing the first 20 out of 39. Check the log or trigger a new build to see more.
{ | ||
class CDynamicSubscriber | ||
class CapnprotoDynamicDeserializer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: m_msg_builder, m_schema_map, m_loader [cppcoreguidelines-pro-type-member-init]
ecal/core/include/ecal/msg/capnproto/dynamic.h:77:
- capnp::MallocMessageBuilder m_msg_builder;
- std::map<SDataTypeInformation, capnp::Schema> m_schema_map;
- capnp::SchemaLoader m_loader;
+ capnp::MallocMessageBuilder m_msg_builder{};
+ std::map<SDataTypeInformation, capnp::Schema> m_schema_map{};
+ capnp::SchemaLoader m_loader{};
// This function is NOT threadsafe!!! | ||
// what about the lifetime of the objects? | ||
// It's totally unclear to me :/ | ||
capnp::DynamicStruct::Reader Deserialize(const void* buffer_, size_t size_, const SDataTypeInformation& datatype_info_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: parameter 'buffer_' is unused [misc-unused-parameters]
capnp::DynamicStruct::Reader Deserialize(const void* buffer_, size_t size_, const SDataTypeInformation& datatype_info_) | |
capnp::DynamicStruct::Reader Deserialize(const void* /*buffer_*/, size_t size_, const SDataTypeInformation& datatype_info_) |
void OnReceive(const char* topic_name_, const capnp::MallocMessageBuilder& msg_, long long time_, long long clock_, long long id_) | ||
{ | ||
if (!initialized) | ||
capnp::Schema schema = GetSchema(datatype_info_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'schema' is not initialized [cppcoreguidelines-init-variables]
capnp::Schema schema = GetSchema(datatype_info_); | |
capnp::Schema schema = 0 = GetSchema(datatype_info_); |
{ | ||
if (!initialized) | ||
capnp::Schema schema = GetSchema(datatype_info_); | ||
capnp::DynamicStruct::Builder root_builder = m_msg_builder.getRoot<capnp::DynamicStruct>(schema.asStruct()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'root_builder' is not initialized [cppcoreguidelines-init-variables]
capnp::DynamicStruct::Builder root_builder = m_msg_builder.getRoot<capnp::DynamicStruct>(schema.asStruct()); | |
capnp::DynamicStruct::Builder root_builder = 0 = m_msg_builder.getRoot<capnp::DynamicStruct>(schema.asStruct()); |
**/ | ||
class CBuilderSubscriber : public CMsgSubscriber<capnp::MallocMessageBuilder> | ||
template <typename T> | ||
class CapnprotoDeserializer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: constructor does not initialize these fields: m_msg_builder [cppcoreguidelines-pro-type-member-init]
ecal/core/include/ecal/msg/capnproto/subscriber.h:69:
- capnp::MallocMessageBuilder m_msg_builder;
+ capnp::MallocMessageBuilder m_msg_builder{};
// the callback bound to the CSubscriber belongs to rhs, bind to this callback instead | ||
CSubscriber::RemReceiveCallback(); | ||
auto callback = std::bind(&CDynamicMessageSubscriber::ReceiveCallback, this, std::placeholders::_1, std::placeholders::_2); | ||
CSubscriber::AddReceiveCallback(callback); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'callback' is not initialized [cppcoreguidelines-init-variables]
CSubscriber::AddReceiveCallback(callback); | |
CSubscriber::AddReceiveCallback(callback = 0); |
// Do we want to call error callbacks on receive? Probably not! std::expected wouuld be a good thing to return the reason why things went wrong. | ||
std::optional<T> Receive(long long* time_ = nullptr, int rcv_timeout_ = 0) | ||
{ | ||
std::string rec_buf; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'rec_buf' of type 'std::string' (aka 'basic_string') can be declared 'const' [misc-const-correctness]
std::string rec_buf; | |
std::string const rec_buf; |
std::optional<T> Receive(long long* time_ = nullptr, int rcv_timeout_ = 0) | ||
{ | ||
std::string rec_buf; | ||
bool success = CSubscriber::ReceiveBuffer(rec_buf, time_, rcv_timeout_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'success' is not initialized [cppcoreguidelines-init-variables]
bool success = CSubscriber::ReceiveBuffer(rec_buf, time_, rcv_timeout_); | |
bool success = false = CSubscriber::ReceiveBuffer(rec_buf, time_, rcv_timeout_); |
**/ | ||
bool RemReceiveCallback() | ||
{ | ||
bool ret = CSubscriber::RemReceiveCallback(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ret' is not initialized [cppcoreguidelines-init-variables]
bool ret = CSubscriber::RemReceiveCallback(); | |
bool ret = false = CSubscriber::RemReceiveCallback(); |
private: | ||
void ReceiveCallback(const char* topic_name_, const struct eCAL::SReceiveCallbackData* data_) | ||
{ | ||
MsgReceiveCallbackT fn_callback = nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'fn_callback' is not initialized [cppcoreguidelines-init-variables]
MsgReceiveCallbackT fn_callback = nullptr; | |
MsgReceiveCallbackT fn_callback = 0 = nullptr; |
sync-with-eclipse-ecal-2024-05-16-2