diff --git a/ecal/core/src/custom_tclap/advanced_tclap_output.h b/ecal/core/src/custom_tclap/advanced_tclap_output.h index 5415eb4fa0..521c13f208 100644 --- a/ecal/core/src/custom_tclap/advanced_tclap_output.h +++ b/ecal/core/src/custom_tclap/advanced_tclap_output.h @@ -69,9 +69,9 @@ namespace CustomTclap */ AdvancedTclapOutput(std::ostream* output_stream, int max_width); - virtual void version(TCLAP::CmdLineInterface &cmd) override; - virtual void usage(TCLAP::CmdLineInterface &cmd) override; - virtual void failure(TCLAP::CmdLineInterface &cmd, TCLAP::ArgException &e) override; + void version(TCLAP::CmdLineInterface &cmd) override; + void usage(TCLAP::CmdLineInterface &cmd) override; + void failure(TCLAP::CmdLineInterface &cmd, TCLAP::ArgException &e) override; /** * @brief Hides / un-hides an argument diff --git a/ecal/core/src/io/ecal_memfile_broadcast_reader.h b/ecal/core/src/io/ecal_memfile_broadcast_reader.h index 8dda745bd2..7b031b39bd 100644 --- a/ecal/core/src/io/ecal_memfile_broadcast_reader.h +++ b/ecal/core/src/io/ecal_memfile_broadcast_reader.h @@ -39,7 +39,7 @@ namespace eCAL std::int64_t timestamp; }; - typedef std::vector MemfileBroadcastMessageListT; + using MemfileBroadcastMessageListT = std::vector; class CMemoryFileBroadcastReader { diff --git a/ecal/core/src/io/ecal_memfile_db.cpp b/ecal/core/src/io/ecal_memfile_db.cpp index f60abfeff2..36e1a94428 100644 --- a/ecal/core/src/io/ecal_memfile_db.cpp +++ b/ecal/core/src/io/ecal_memfile_db.cpp @@ -164,19 +164,19 @@ namespace eCAL { bool AddFile(const std::string& name_, const bool create_, const size_t len_, SMemFileInfo& mem_file_info_) { - if (!g_memfile_map()) return false; + if (g_memfile_map() == nullptr) return false; return g_memfile_map()->AddFile(name_, create_, len_, mem_file_info_); } bool RemoveFile(const std::string& name_, const bool remove_) { - if (!g_memfile_map()) return false; + if (g_memfile_map() == nullptr) return false; return g_memfile_map()->RemoveFile(name_, remove_); } bool CheckFileSize(const std::string& name_, const size_t len_, SMemFileInfo& mem_file_info_) { - if (!g_memfile_map()) return false; + if (g_memfile_map() == nullptr) return false; return g_memfile_map()->CheckFileSize(name_, len_, mem_file_info_); } } diff --git a/ecal/core/src/io/ecal_memfile_db.h b/ecal/core/src/io/ecal_memfile_db.h index a716bd5e16..a60224bf30 100644 --- a/ecal/core/src/io/ecal_memfile_db.h +++ b/ecal/core/src/io/ecal_memfile_db.h @@ -44,7 +44,7 @@ namespace eCAL bool CheckFileSize(const std::string& name_, const size_t len_, SMemFileInfo& mem_file_info_); protected: - typedef std::unordered_map MemFileMapT; + using MemFileMapT = std::unordered_map; std::mutex m_memfile_map_mtx; MemFileMapT m_memfile_map; }; diff --git a/ecal/core/src/io/ecal_memfile_header.h b/ecal/core/src/io/ecal_memfile_header.h index 96e76e483b..a016179f59 100644 --- a/ecal/core/src/io/ecal_memfile_header.h +++ b/ecal/core/src/io/ecal_memfile_header.h @@ -23,7 +23,7 @@ #pragma once -#include +#include namespace eCAL { diff --git a/ecal/core/src/io/ecal_memfile_info.h b/ecal/core/src/io/ecal_memfile_info.h index 14344009a3..dc37723d23 100644 --- a/ecal/core/src/io/ecal_memfile_info.h +++ b/ecal/core/src/io/ecal_memfile_info.h @@ -32,8 +32,8 @@ #include "ecal_win_main.h" -typedef HANDLE MemFileT; -typedef HANDLE MapRegionT; +using MemFileT = HANDLE; +using MapRegionT = HANDLE; #endif /* ECAL_OS_WINDOWS */ @@ -48,23 +48,13 @@ namespace eCAL { struct SMemFileInfo { - SMemFileInfo() - { - refcnt = 0; - remove = false; - memfile = 0; - map_region = 0; - mem_address = 0; - size = 0; - exists = false; - } - int refcnt; - bool remove; - MemFileT memfile; - MapRegionT map_region; - void* mem_address; + int refcnt = 0; + bool remove = false; + MemFileT memfile = 0; + MapRegionT map_region = 0; + void* mem_address = 0; std::string name; - size_t size; - bool exists; + size_t size = 0; + bool exists = false; }; } diff --git a/ecal/core/src/io/ecal_memfile_pool.h b/ecal/core/src/io/ecal_memfile_pool.h index c09c7f6b7e..7357055eaf 100644 --- a/ecal/core/src/io/ecal_memfile_pool.h +++ b/ecal/core/src/io/ecal_memfile_pool.h @@ -39,7 +39,7 @@ namespace eCAL { - typedef std::function MemFileDataCallbackT; + using MemFileDataCallbackT = std::function; //////////////////////////////////////// // CMemFileObserver diff --git a/ecal/core/src/io/ecal_memfile_sync.h b/ecal/core/src/io/ecal_memfile_sync.h index a6756116d0..ca0e972d1f 100644 --- a/ecal/core/src/io/ecal_memfile_sync.h +++ b/ecal/core/src/io/ecal_memfile_sync.h @@ -79,7 +79,7 @@ namespace eCAL EventHandleT event_ack; bool event_ack_is_invalid = false; //!< The ack event has timeouted. Thus, we don't wait for it anymore, until the subscriber notifies us via registration layer that it is still alive. }; - typedef std::unordered_map EventHandleMapT; + using EventHandleMapT = std::unordered_map; std::mutex m_event_handle_map_sync; EventHandleMapT m_event_handle_map; }; diff --git a/ecal/core/src/io/ecal_named_mutex_base.h b/ecal/core/src/io/ecal_named_mutex_base.h index b2bb25a3c0..dfd186f1d0 100644 --- a/ecal/core/src/io/ecal_named_mutex_base.h +++ b/ecal/core/src/io/ecal_named_mutex_base.h @@ -31,7 +31,7 @@ namespace eCAL class CNamedMutexImplBase { public: - virtual ~CNamedMutexImplBase(){} + virtual ~CNamedMutexImplBase()= default; virtual bool IsCreated() const = 0; virtual bool IsRecoverable() const = 0; diff --git a/ecal/core/src/io/rcv_sample.h b/ecal/core/src/io/rcv_sample.h index 447f92acc4..511003b7f3 100644 --- a/ecal/core/src/io/rcv_sample.h +++ b/ecal/core/src/io/rcv_sample.h @@ -107,7 +107,7 @@ class CSampleReceiver int Process(const char* sample_buffer_, size_t sample_buffer_len_); protected: - typedef std::unordered_map> ReceiveSlotMapT; + using ReceiveSlotMapT = std::unordered_map>; ReceiveSlotMapT m_receive_slot_map; std::vector m_msg_buffer; eCAL::pb::Sample m_ecal_sample; diff --git a/ecal/core/src/io/snd_raw_buffer.cpp b/ecal/core/src/io/snd_raw_buffer.cpp index cadbe11f28..4208fc1eb6 100644 --- a/ecal/core/src/io/snd_raw_buffer.cpp +++ b/ecal/core/src/io/snd_raw_buffer.cpp @@ -79,7 +79,7 @@ namespace eCAL size_t SendSampleBuffer(char* buf_, size_t buf_len_, long bandwidth_, TransmitCallbackT transmit_cb_) { - if (!buf_) return(0); + if (buf_ == nullptr) return(0); size_t sent(0); size_t sent_sum(0); @@ -168,7 +168,7 @@ namespace eCAL // send data package sent = transmit_cb_(buf_ + static_cast(current_packet_num)*MSG_PAYLOAD_SIZE, sizeof(struct SUDPMessageHead) + current_snd_len); if (sent == 0) return(sent); - if (send_sleep_us) + if (send_sleep_us != 0) eCAL::Process::SleepFor(std::chrono::microseconds(send_sleep_us)); #ifndef NDEBUG diff --git a/ecal/core/src/io/snd_raw_buffer.h b/ecal/core/src/io/snd_raw_buffer.h index bfcdf1635e..4cc864f1ac 100644 --- a/ecal/core/src/io/snd_raw_buffer.h +++ b/ecal/core/src/io/snd_raw_buffer.h @@ -36,6 +36,6 @@ namespace eCAL { size_t CreateSampleBuffer(const std::string& sample_name_, const eCAL::pb::Sample& ecal_sample_, std::vector& payload_); - typedef std::function TransmitCallbackT; + using TransmitCallbackT = std::function; size_t SendSampleBuffer(char* buf_, size_t buf_len_, long bandwidth_, TransmitCallbackT transmit_cb_); } diff --git a/ecal/core/src/io/udp_init.cpp b/ecal/core/src/io/udp_init.cpp index a39a75f86f..1636cd86b2 100644 --- a/ecal/core/src/io/udp_init.cpp +++ b/ecal/core/src/io/udp_init.cpp @@ -23,7 +23,7 @@ #include -#include +#include #include #ifdef ECAL_OS_WINDOWS diff --git a/ecal/core/src/io/udp_receiver_asio.cpp b/ecal/core/src/io/udp_receiver_asio.cpp index 3f1f572838..86c01f5408 100644 --- a/ecal/core/src/io/udp_receiver_asio.cpp +++ b/ecal/core/src/io/udp_receiver_asio.cpp @@ -189,7 +189,7 @@ namespace eCAL RunIOContext(asio::chrono::milliseconds(timeout_)); // retrieve underlaying raw socket informations - if (address_) + if (address_ != nullptr) { if (m_sender_endpoint.address().is_v4()) {