mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
Fix various clang-tidy warnings
This commit is contained in:
parent
a65f0e6777
commit
499ffcd300
|
@ -1,3 +1,3 @@
|
||||||
---
|
---
|
||||||
Checks: '*,-google-*,-fuchsia-*,-cert-*,-llvm-header-guard'
|
Checks: '*,-google-*,-fuchsia-*,-cert-*,-llvm-header-guard,-readability-named-parameter,-misc-non-private-member-variables-in-classes,-*-magic-numbers,-llvm-include-order,-hicpp-no-array-decay,-performance-unnecessary-value-param,-cppcoreguidelines-pro-bounds-array-to-pointer-decay'
|
||||||
HeaderFilterRegex: '.*/(boost|fairlogger)/.*'
|
HeaderFilterRegex: '/(fairmq/|FairMQ)'
|
||||||
|
|
|
@ -66,6 +66,8 @@ if(BUILD_FAIRMQ OR BUILD_SDK)
|
||||||
target_link_libraries(${target}
|
target_link_libraries(${target}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
FairLogger::FairLogger
|
FairLogger::FairLogger
|
||||||
|
PUBLIC
|
||||||
|
Boost::boost
|
||||||
)
|
)
|
||||||
set_target_properties(${target} PROPERTIES
|
set_target_properties(${target} PROPERTIES
|
||||||
VERSION ${PROJECT_GIT_VERSION}
|
VERSION ${PROJECT_GIT_VERSION}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace fair::mq;
|
using namespace fair::mq;
|
||||||
|
|
||||||
DeviceRunner::DeviceRunner(int argc, char* const argv[], bool printLogo)
|
DeviceRunner::DeviceRunner(int argc, char*const* argv, bool printLogo)
|
||||||
: fRawCmdLineArgs(tools::ToStrVector(argc, argv, false))
|
: fRawCmdLineArgs(tools::ToStrVector(argc, argv, false))
|
||||||
, fConfig()
|
, fConfig()
|
||||||
, fDevice(nullptr)
|
, fDevice(nullptr)
|
||||||
|
|
|
@ -51,7 +51,7 @@ namespace mq {
|
||||||
class DeviceRunner
|
class DeviceRunner
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DeviceRunner(int argc, char* const argv[], bool printLogo = true);
|
DeviceRunner(int argc, char*const* argv, bool printLogo = true);
|
||||||
|
|
||||||
auto Run() -> int;
|
auto Run() -> int;
|
||||||
auto RunWithExceptionHandlers() -> int;
|
auto RunWithExceptionHandlers() -> int;
|
||||||
|
|
|
@ -53,8 +53,8 @@ enum class Transition : int
|
||||||
ErrorFound
|
ErrorFound
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string GetStateName(const State);
|
std::string GetStateName(State);
|
||||||
std::string GetTransitionName(const Transition);
|
std::string GetTransitionName(Transition);
|
||||||
State GetState(const std::string& state);
|
State GetState(const std::string& state);
|
||||||
Transition GetTransition(const std::string& transition);
|
Transition GetTransition(const std::string& transition);
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,10 @@ template<typename Tag, int Max>
|
||||||
struct InstanceLimiter
|
struct InstanceLimiter
|
||||||
{
|
{
|
||||||
InstanceLimiter() { Increment(); }
|
InstanceLimiter() { Increment(); }
|
||||||
|
explicit InstanceLimiter(const InstanceLimiter&) = delete;
|
||||||
|
explicit InstanceLimiter(InstanceLimiter&&) = delete;
|
||||||
|
InstanceLimiter& operator=(const InstanceLimiter&) = delete;
|
||||||
|
InstanceLimiter& operator=(InstanceLimiter&&) = delete;
|
||||||
~InstanceLimiter() { Decrement(); }
|
~InstanceLimiter() { Decrement(); }
|
||||||
auto GetCount() -> int { return fCount; }
|
auto GetCount() -> int { return fCount; }
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace asio
|
||||||
{
|
{
|
||||||
|
|
||||||
class io_context;
|
class io_context;
|
||||||
typedef class io_context io_service;
|
using io_service = class io_context;
|
||||||
|
|
||||||
} // namespace asio
|
} // namespace asio
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
|
|
@ -48,7 +48,9 @@ public:
|
||||||
* to 0 set the rate to 1 GHz (which is impossible to achieve, even with a
|
* to 0 set the rate to 1 GHz (which is impossible to achieve, even with a
|
||||||
* loop that only calls RateLimiter::maybe_sleep).
|
* loop that only calls RateLimiter::maybe_sleep).
|
||||||
*/
|
*/
|
||||||
RateLimiter(float rate) : tw_req(std::chrono::seconds(1)), start_time(clock::now())
|
explicit RateLimiter(float rate)
|
||||||
|
: tw_req(std::chrono::seconds(1))
|
||||||
|
, start_time(clock::now())
|
||||||
{
|
{
|
||||||
if (rate <= 0) {
|
if (rate <= 0) {
|
||||||
tw_req = std::chrono::nanoseconds(1);
|
tw_req = std::chrono::nanoseconds(1);
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
#ifndef FAIR_MQ_TOOLS_STRINGS_H
|
#ifndef FAIR_MQ_TOOLS_STRINGS_H
|
||||||
#define FAIR_MQ_TOOLS_STRINGS_H
|
#define FAIR_MQ_TOOLS_STRINGS_H
|
||||||
|
|
||||||
|
#include <array>
|
||||||
|
#include <boost/beast/core/span.hpp>
|
||||||
#include <initializer_list>
|
#include <initializer_list>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -33,15 +35,16 @@ auto ToString(T&&... t) -> std::string
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief convert command line arguments from main function to vector of strings
|
/// @brief convert command line arguments from main function to vector of strings
|
||||||
inline auto ToStrVector(const int argc, char* const argv[], const bool dropProgramName = true) -> std::vector<std::string>
|
inline auto ToStrVector(const int argc, char*const* argv, const bool dropProgramName = true) -> std::vector<std::string>
|
||||||
{
|
{
|
||||||
auto res = std::vector<std::string>{};
|
auto res = std::vector<std::string>{};
|
||||||
|
boost::beast::span<char*const> argvView(argv, argc);
|
||||||
if (dropProgramName)
|
if (dropProgramName)
|
||||||
{
|
{
|
||||||
res.assign(argv + 1, argv + argc);
|
res.assign(argvView.begin() + 1, argvView.end());
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
res.assign(argv, argv + argc);
|
res.assign(argvView.begin(), argvView.end());
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user