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'
|
||||
HeaderFilterRegex: '.*/(boost|fairlogger)/.*'
|
||||
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: '/(fairmq/|FairMQ)'
|
||||
|
|
|
@ -66,6 +66,8 @@ if(BUILD_FAIRMQ OR BUILD_SDK)
|
|||
target_link_libraries(${target}
|
||||
PRIVATE
|
||||
FairLogger::FairLogger
|
||||
PUBLIC
|
||||
Boost::boost
|
||||
)
|
||||
set_target_properties(${target} PROPERTIES
|
||||
VERSION ${PROJECT_GIT_VERSION}
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
using namespace std;
|
||||
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))
|
||||
, fConfig()
|
||||
, fDevice(nullptr)
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace mq {
|
|||
class DeviceRunner
|
||||
{
|
||||
public:
|
||||
DeviceRunner(int argc, char* const argv[], bool printLogo = true);
|
||||
DeviceRunner(int argc, char*const* argv, bool printLogo = true);
|
||||
|
||||
auto Run() -> int;
|
||||
auto RunWithExceptionHandlers() -> int;
|
||||
|
|
|
@ -53,8 +53,8 @@ enum class Transition : int
|
|||
ErrorFound
|
||||
};
|
||||
|
||||
std::string GetStateName(const State);
|
||||
std::string GetTransitionName(const Transition);
|
||||
std::string GetStateName(State);
|
||||
std::string GetTransitionName(Transition);
|
||||
State GetState(const std::string& state);
|
||||
Transition GetTransition(const std::string& transition);
|
||||
|
||||
|
|
|
@ -19,6 +19,10 @@ template<typename Tag, int Max>
|
|||
struct InstanceLimiter
|
||||
{
|
||||
InstanceLimiter() { Increment(); }
|
||||
explicit InstanceLimiter(const InstanceLimiter&) = delete;
|
||||
explicit InstanceLimiter(InstanceLimiter&&) = delete;
|
||||
InstanceLimiter& operator=(const InstanceLimiter&) = delete;
|
||||
InstanceLimiter& operator=(InstanceLimiter&&) = delete;
|
||||
~InstanceLimiter() { Decrement(); }
|
||||
auto GetCount() -> int { return fCount; }
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace asio
|
|||
{
|
||||
|
||||
class io_context;
|
||||
typedef class io_context io_service;
|
||||
using io_service = class io_context;
|
||||
|
||||
} // namespace asio
|
||||
} // namespace boost
|
||||
|
|
|
@ -48,7 +48,9 @@ public:
|
|||
* to 0 set the rate to 1 GHz (which is impossible to achieve, even with a
|
||||
* 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) {
|
||||
tw_req = std::chrono::nanoseconds(1);
|
||||
|
@ -133,4 +135,4 @@ private:
|
|||
} /* namespace mq */
|
||||
} /* namespace fair */
|
||||
|
||||
#endif // FAIR_MQ_TOOLS_RATELIMIT_H
|
||||
#endif // FAIR_MQ_TOOLS_RATELIMIT_H
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
#ifndef FAIR_MQ_TOOLS_STRINGS_H
|
||||
#define FAIR_MQ_TOOLS_STRINGS_H
|
||||
|
||||
#include <array>
|
||||
#include <boost/beast/core/span.hpp>
|
||||
#include <initializer_list>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
@ -33,15 +35,16 @@ auto ToString(T&&... t) -> std::string
|
|||
}
|
||||
|
||||
/// @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>{};
|
||||
boost::beast::span<char*const> argvView(argv, argc);
|
||||
if (dropProgramName)
|
||||
{
|
||||
res.assign(argv + 1, argv + argc);
|
||||
res.assign(argvView.begin() + 1, argvView.end());
|
||||
} else
|
||||
{
|
||||
res.assign(argv, argv + argc);
|
||||
res.assign(argvView.begin(), argvView.end());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user