Skip to content

Commit

Permalink
[core] common warning fixes (#1837)
Browse files Browse the repository at this point in the history
* eCAL_Finalize(eCAL_Init_All) -> eCAL_Finalize()
* class WriterImpl -> struct WriterImpl
* minor sample warning fixes
* JsonOptions (deprecated) -> JsonPrintOptions
* some more warning fixes
  • Loading branch information
rex-schilasky authored Dec 5, 2024
1 parent b6b66b2 commit e1ceb9f
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 24 deletions.
4 changes: 2 additions & 2 deletions app/meas_cutter/src/config_file_parser.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2019 Continental Corporation
* Copyright (C) 2016 - 2024 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,7 +21,7 @@
#include <iostream>
#include <ecal_utils/filesystem.h>

#define YAML_CPP_STATIC_DEFINE
//#define YAML_CPP_STATIC_DEFINE // set by CMake
#include <yaml-cpp/yaml.h>

#include "utils.h"
Expand Down
4 changes: 2 additions & 2 deletions app/meas_cutter/src/utils.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2019 Continental Corporation
* Copyright (C) 2016 - 2024 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,7 +26,7 @@
#include <fstream>
#include <algorithm>

#define YAML_CPP_STATIC_DEFINE
//#define YAML_CPP_STATIC_DEFINE // set by CMake
#include "yaml-cpp/yaml.h"

#include <ecal_utils/str_convert.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace eCAL
{
namespace hdf5
{
class WriterImpl;
struct WriterImpl;

/**
* @brief Hdf5 based Writer implementation
Expand Down
13 changes: 11 additions & 2 deletions ecal/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -502,11 +502,19 @@ endif()
# public header
######################################
set(ecal_header_cmn
include/ecal/types/logging.h
include/ecal/types/monitoring.h
include/ecal/config/application.h
include/ecal/config/configuration.h
include/ecal/config/logging.h
include/ecal/config/monitoring.h
include/ecal/config/publisher.h
include/ecal/config/registration.h
include/ecal/config/service.h
include/ecal/config/subscriber.h
include/ecal/config/time.h
include/ecal/config/transport_layer.h
include/ecal/config/user_arguments.h
include/ecal/types/logging.h
include/ecal/types/monitoring.h
include/ecal/ecal.h
include/ecal/ecal_callback.h
include/ecal/ecal_config.h
Expand Down Expand Up @@ -555,6 +563,7 @@ set(ecal_header_cimpl

set(ecal_header_msg
include/ecal/msg/protobuf/client.h
include/ecal/msg/protobuf/dynamic_json_subscriber.h
include/ecal/msg/protobuf/dynamic_publisher.h
include/ecal/msg/protobuf/dynamic_subscriber.h
include/ecal/msg/protobuf/publisher.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace eCAL
public:
std::string Deserialize(const void* buffer_, size_t size_, const SDataTypeInformation& datatype_info_)
{
google::protobuf::util::JsonOptions options;
google::protobuf::util::JsonPrintOptions options;
#if GOOGLE_PROTOBUF_VERSION >= 5026000
options.always_print_fields_with_no_presence = true;
#else
Expand Down
4 changes: 2 additions & 2 deletions ecal/samples/c/pubsub/string/minimal_rec/src/minimal_rec.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2019 Continental Corporation
* Copyright (C) 2016 - 2024 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -54,7 +54,7 @@ int main(int argc, char **argv)
eCAL_Sub_Destroy(sub);

// finalize eCAL API
eCAL_Finalize(eCAL_Init_All);
eCAL_Finalize();

return(0);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2019 Continental Corporation
* Copyright (C) 2016 - 2024 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -53,7 +53,7 @@ int main(int argc, char **argv)
eCAL_Sub_Destroy(sub);

// finalize eCAL API
eCAL_Finalize(eCAL_Init_All);
eCAL_Finalize();

return(0);
}
4 changes: 2 additions & 2 deletions ecal/samples/c/pubsub/string/minimal_snd/src/minimal_snd.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2019 Continental Corporation
* Copyright (C) 2016 - 2024 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -47,7 +47,7 @@ int main(int argc, char **argv)
}

// finalize eCAL API
eCAL_Finalize(eCAL_Init_All);
eCAL_Finalize();

return(0);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2019 Continental Corporation
* Copyright (C) 2016 - 2024 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -71,7 +71,7 @@ int main(int argc, char **argv)
eCAL_Client_Destroy(hclient);

// finalize eCAL API
eCAL_Finalize(eCAL_Init_All);
eCAL_Finalize();

return(0);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ========================= eCAL LICENSE =================================
*
* Copyright (C) 2016 - 2019 Continental Corporation
* Copyright (C) 2016 - 2024 Continental Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -71,7 +71,7 @@ int main(int argc, char **argv)
eCAL_Server_Destroy(hserver);

// finalize eCAL API
eCAL_Finalize(eCAL_Init_All);
eCAL_Finalize();

return(0);
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ std::string GenerateSizedString(const std::string& name, size_t totalSize)
return result;
}

int main(int argc, char** argv)
int main(int /*argc*/, char** /*argv*/)
{
// set eCAL configuration
eCAL::Configuration configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ void throughput_test(int snd_size, int snd_loops, eCAL::TLayer::eTransportLayer
case eCAL::TLayer::tlayer_tcp:
pub_config.layer.tcp.enable = true;
break;
default:
break;
}

// enable zero copy mode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ int main(int argc, char **argv)
pb::People::Person person;

eCAL::protobuf::CSubscriber<pb::People::Person> sub("person");
auto receive_lambda = [&sub](const char* /*topic_name_*/, const pb::People::Person& person_, const long long /*time_*/, const long long /*clock_*/, const long long /*id_*/){
auto receive_lambda = [](const char* /*topic_name_*/, const pb::People::Person& person_, const long long /*time_*/, const long long /*clock_*/, const long long /*id_*/){
std::cout << "------------------------------------------" << std::endl;
std::cout << " RECEIVED " << std::endl;
std::cout << "------------------------------------------" << std::endl;
Expand Down
2 changes: 0 additions & 2 deletions ecal/tests/cpp/pubsub_test/src/pubsub_connection_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ TEST(core_cpp_pubsub, TestSubscriberIsPublishedTiming)
std::string first_received_sample;
auto subscriber_function = [&do_start_publication, &publication_finished, &publisher_seen_at_subscription_start, &first_received_sample]() {
eCAL::CSubscriber sub("blob");
bool received(false);
const auto max_sub_count(10);
auto sub_count(0);
auto receive_lambda = [&max_sub_count, &sub_count, &publisher_seen_at_subscription_start, &first_received_sample, &sub](const char* /*topic_name_*/, const struct eCAL::SReceiveCallbackData* data_) {
Expand Down Expand Up @@ -171,7 +170,6 @@ TEST(core_cpp_pubsub, TestPublisherIsSubscribedTiming)
std::string first_received_sample;
auto subscriber_function = [&publication_finished, &publisher_seen_at_subscription_start, &first_received_sample]() {
eCAL::CSubscriber sub("blob");
bool received(false);
const auto max_sub_count(10);
auto sub_count(0);
auto receive_lambda = [&max_sub_count, &sub_count, &publisher_seen_at_subscription_start, &first_received_sample, &sub](const char* /*topic_name_*/, const struct eCAL::SReceiveCallbackData* data_) {
Expand Down
4 changes: 2 additions & 2 deletions ecal/tests/cpp/pubsub_test/src/pubsub_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ TEST(core_cpp_pubsub, SubscriberReconnection)
size_t callback_received_count(0);

eCAL::string::CSubscriber<std::string> sub_foo("foo");
auto receive_lambda = [&sub_foo, &callback_received_count](const char* /*topic_*/, const std::string& /*msg*/, long long /*time_*/, long long /*clock_*/, long long /*id_*/) {
auto receive_lambda = [&callback_received_count](const char* /*topic_*/, const std::string& /*msg*/, long long /*time_*/, long long /*clock_*/, long long /*id_*/) {
std::cout << "Receiving in scope 1" << std::endl;
callback_received_count++;
};
Expand All @@ -605,7 +605,7 @@ TEST(core_cpp_pubsub, SubscriberReconnection)
size_t callback_received_count(0);

eCAL::string::CSubscriber<std::string> sub_foo("foo");
auto receive_lambda = [&sub_foo, &callback_received_count](const char* /*topic_*/, const std::string& /*msg*/, long long /*time_*/, long long /*clock_*/, long long /*id_*/) {
auto receive_lambda = [&callback_received_count](const char* /*topic_*/, const std::string& /*msg*/, long long /*time_*/, long long /*clock_*/, long long /*id_*/) {
std::cout << "Receiving in scope 2" << std::endl;
callback_received_count++;
};
Expand Down

0 comments on commit e1ceb9f

Please sign in to comment.