diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2019-03-30 12:35:28 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2019-03-30 12:35:28 +0000 |
commit | d61d2f00a863905c1cf5990492d36d9235760c15 (patch) | |
tree | 3fb78a1a11499ffa84fd7e597ddc7bd34e7cea7d | |
parent | Enable clang tidy modernize and fixes (diff) | |
download | icetray-d61d2f00a863905c1cf5990492d36d9235760c15.tar.bz2 icetray-d61d2f00a863905c1cf5990492d36d9235760c15.tar.xz icetray-d61d2f00a863905c1cf5990492d36d9235760c15.zip |
Tidy fixes for latest clangicetray-0.3.1
-rw-r--r-- | icetray/icetray/logWriterConsole.cpp | 7 | ||||
-rw-r--r-- | icetray/icetray/logger.cpp | 1 | ||||
-rw-r--r-- | icetray/tool/icetraySql.cpp | 1 | ||||
-rw-r--r-- | icetray/unittests/Jamfile.jam | 5 | ||||
-rw-r--r-- | icetray/unittests/testIceTrayServiceI.cpp | 2 |
5 files changed, 12 insertions, 4 deletions
diff --git a/icetray/icetray/logWriterConsole.cpp b/icetray/icetray/logWriterConsole.cpp index 23c1279..11d9a16 100644 --- a/icetray/icetray/logWriterConsole.cpp +++ b/icetray/icetray/logWriterConsole.cpp @@ -7,7 +7,7 @@ namespace AdHoc { AdHocFormatter(DomainFmt, ".%?"); StreamWriterT('d') { template<typename ... Pn> - static void write(stream & s, int width, const IceTray::Logging::Domain & domain, const Pn & ... pn) + static void write(stream & s, ssize_t width, const IceTray::Logging::Domain & domain, const Pn & ... pn) { auto di = domain.begin(); if (di == domain.end()) { @@ -21,9 +21,9 @@ namespace AdHoc { } } else { - int target = width; + auto target = width; while (di != domain.end()) { - int total = di == domain.begin() ? -1 : 0; + auto total = di == domain.begin() ? -1 : 0; for (auto dic = di; dic != domain.end(); dic++) { total += 1 + dic->length(); } @@ -55,6 +55,7 @@ namespace AdHoc { }; } +// NOLINTNEXTLINE(modernize-concat-nested-namespaces) namespace IceTray { namespace Logging { AdHocFormatter(LogMsg, "%?: %d: %?\n"); diff --git a/icetray/icetray/logger.cpp b/icetray/icetray/logger.cpp index 9f699e3..6ceff96 100644 --- a/icetray/icetray/logger.cpp +++ b/icetray/icetray/logger.cpp @@ -12,6 +12,7 @@ INSTANTIATEFACTORY(IceTray::Logging::LogWriter, const Ice::PropertiesPtr &); template class ::AdHoc::GlobalStatic<::IceTray::Logging::LogManager>; +// NOLINTNEXTLINE(modernize-concat-nested-namespaces) namespace IceTray { namespace Logging { LoggerBase::LoggerBase(Domain domain) : diff --git a/icetray/tool/icetraySql.cpp b/icetray/tool/icetraySql.cpp index 2b9a5ff..bc87f58 100644 --- a/icetray/tool/icetraySql.cpp +++ b/icetray/tool/icetraySql.cpp @@ -67,6 +67,7 @@ main(int argc, char ** argv) po::notify(vm); std::vector<std::string> sqlnsparts; + // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks) boost::algorithm::split(sqlnsparts, sqlns, boost::algorithm::is_any_of(":"), boost::algorithm::token_compress_on); auto r = fs::canonical(sql).lexically_relative(fs::canonical(base)).parent_path(); if (!r.empty()) { diff --git a/icetray/unittests/Jamfile.jam b/icetray/unittests/Jamfile.jam index 67ffc0a..7486d04 100644 --- a/icetray/unittests/Jamfile.jam +++ b/icetray/unittests/Jamfile.jam @@ -10,6 +10,11 @@ lib dbpp-postgresql : : : : <include>/usr/include/dbpp-postgresql ; path-constant me : . ; +project + : requirements + <toolset>tidy:<xcheckxx>misc-non-private-member-variables-in-classes + ; + alias testCommon : : : : <define>ROOT=\"$(me)\" <library>..//adhocutil diff --git a/icetray/unittests/testIceTrayServiceI.cpp b/icetray/unittests/testIceTrayServiceI.cpp index c4b8331..09c2ac6 100644 --- a/icetray/unittests/testIceTrayServiceI.cpp +++ b/icetray/unittests/testIceTrayServiceI.cpp @@ -44,7 +44,7 @@ namespace TestIceTray { fetchTest<Ice::Short>(1); fetchTest<Ice::Int>(100000); fetchTest<Ice::Long>(10000000); - fetchTest<Ice::Float>(0.1f); + fetchTest<Ice::Float>(0.1F); fetchTest<Ice::Double>(3.14); fetchTest<std::string>("some string"); fetchTest<unsigned long>(20000000); |