Module: check_mk
Branch: master
Commit: b74bedab298aea2c61ebde48cdeb20f161807556
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b74bedab298aea…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Feb 4 10:01:11 2016 +0100
More casting fixes.
---
.clang-tidy | 3 +--
livestatus/src/ContactsColumn.cc | 4 +---
livestatus/src/DownCommColumn.cc | 2 +-
livestatus/src/TableStatus.cc | 2 +-
4 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/.clang-tidy b/.clang-tidy
index da51e8a..29f3168 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -20,11 +20,10 @@
# * cppcoreguidelines-pro-type-const-cast ("do not use const_cast")
#
# * desirable checks, but not yet fixed:
-# * cppcoreguidelines-pro-type-cstyle-cast ("do not use C-style cast to
convert between unrelated types")
# * cppcoreguidelines-pro-type-reinterpret-cast ("do not use
reinterpret_cast")
# * readability-else-after-return ("don't use else after return")
#
-Checks:
'*,-cert-dcl50-cpp,-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-cstyle-cast,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-type-vararg,-google-runtime-int,-llvm-include-order,-readability-else-after-return'
+Checks:
'*,-cert-dcl50-cpp,-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-reinterpret-cast,-cppcoreguidelines-pro-type-static-cast-downcast,-cppcoreguidelines-pro-type-vararg,-google-runtime-int,-llvm-include-order,-readability-else-after-return'
CheckOptions:
- key: google-readability-namespace-comments.SpacesBeforeComments
value: '1'
diff --git a/livestatus/src/ContactsColumn.cc b/livestatus/src/ContactsColumn.cc
index e0e2089..930aa69 100644
--- a/livestatus/src/ContactsColumn.cc
+++ b/livestatus/src/ContactsColumn.cc
@@ -28,9 +28,7 @@
extern contact *contact_list;
-void *ContactsColumn::getNagiosObject(char *name) {
- return (void *)find_contact(name);
-}
+void *ContactsColumn::getNagiosObject(char *name) { return find_contact(name); }
void ContactsColumn::output(void *data, Query *query) {
query->outputBeginList();
diff --git a/livestatus/src/DownCommColumn.cc b/livestatus/src/DownCommColumn.cc
index 71b52fe..db0e19c 100644
--- a/livestatus/src/DownCommColumn.cc
+++ b/livestatus/src/DownCommColumn.cc
@@ -118,7 +118,7 @@ bool DownCommColumn::isEmpty(void *data) {
for (auto it = table->entriesIteratorBegin();
it != table->entriesIteratorEnd(); ++it) {
DowntimeOrComment *dt = it->second;
- if ((void *)dt->_service == data ||
+ if (dt->_service == data ||
(dt->_service == nullptr && dt->_host == data)) {
return false;
}
diff --git a/livestatus/src/TableStatus.cc b/livestatus/src/TableStatus.cc
index cd9ca9d..097e124 100644
--- a/livestatus/src/TableStatus.cc
+++ b/livestatus/src/TableStatus.cc
@@ -281,7 +281,7 @@ TableStatus::TableStatus() {
&num_cached_log_messages));
addColumn(new StringPointerColumn("livestatus_version",
"The version of the MK Livestatus
module",
- (char *)VERSION));
+ VERSION));
addColumn(new IntPointerColumn(
"livestatus_active_connections",
"The current number of active connections to MK Livestatus",