Module: check_mk
Branch: master
Commit: 8d7324774e8bc243af422e95deeb8325bd659227
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8d7324774e8bc2…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Dec 7 09:31:30 2017 +0100
A few mechanical clang-tidy fixes.
Change-Id: I8d22f7d87904eccd89c029dfd6c42c1fb3c955c2
---
.clang-tidy | 3 ++-
livestatus/src/HostListStateColumn.cc | 2 +-
livestatus/src/OffsetTimeColumn.cc | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/.clang-tidy b/.clang-tidy
index 6aa4984..ec71d61 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -11,6 +11,7 @@
# * undesirable checks:
# * cppcoreguidelines-pro-type-static-cast-downcast ("do not use static_cast
to downcast from a base to a derived class; use dynamic_cast instead")
# * google-runtime-references ("non-const reference parameter 'foo',
make it const or use a pointer")
+# * hicpp-no-assembler ("do not use inline assembler in safety-critical
code") triggered by ntohs/htons
# * llvm-include-order ("#includes are not sorted properly")
#
# * desirable checks, but hard to fix currently:
@@ -26,7 +27,7 @@
# * cppcoreguidelines-pro-type-union-access ("do not access members of unions;
use (boost::)variant instead")
# * modernize-use-bool-literals ("converting integer literal to bool, use bool
literal instead") Incorrectly triggered by e.g. FD_ZERO
#
-Checks:
'*,-cert-env33-c,-cert-err34-c,-cert-err58-cpp,-clang-analyzer-alpha*,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-const-cast,-cppcoreguidelines-pro-type-member-init,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-type-union-access,-cppcoreguidelines-pro-type-vararg,-google-runtime-int,-google-runtime-references,-hicpp-member-init,-llvm-include-order,-modernize-use-bool-literals'
+Checks:
'*,-cert-env33-c,-cert-err34-c,-cert-err58-cpp,-clang-analyzer-alpha*,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-const-cast,-cppcoreguidelines-pro-type-member-init,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-type-union-access,-cppcoreguidelines-pro-type-vararg,-google-runtime-int,-google-runtime-references,-hicpp-member-init,-hicpp-no-assembler,-llvm-include-order,-modernize-use-bool-literals'
CheckOptions:
- key: google-readability-namespace-comments.SpacesBeforeComments
value: '1'
diff --git a/livestatus/src/HostListStateColumn.cc
b/livestatus/src/HostListStateColumn.cc
index 1f377da..a8a95ba 100644
--- a/livestatus/src/HostListStateColumn.cc
+++ b/livestatus/src/HostListStateColumn.cc
@@ -63,7 +63,7 @@ void HostListStateColumn::update(host *hst, const contact *auth_user,
#ifdef CMC
ServiceListStateColumn::service_list services = &hst->_services;
bool has_been_checked = hst->state()->_has_been_checked;
- int current_state = static_cast<int>(hst->state()->_current_state);
+ auto current_state = static_cast<int>(hst->state()->_current_state);
#else
ServiceListStateColumn::service_list services = hst->services;
bool has_been_checked = hst->has_been_checked != 0;
diff --git a/livestatus/src/OffsetTimeColumn.cc b/livestatus/src/OffsetTimeColumn.cc
index e3d0a87..22c39e6 100644
--- a/livestatus/src/OffsetTimeColumn.cc
+++ b/livestatus/src/OffsetTimeColumn.cc
@@ -31,5 +31,5 @@ std::chrono::system_clock::time_point OffsetTimeColumn::getRawValue(
if (auto p = columnData<time_t>(row)) {
return std::chrono::system_clock::from_time_t(*p);
}
- return std::chrono::system_clock::time_point();
+ return {};
}