Module: check_mk
Branch: master
Commit: 8d66d704f41fb1fdd37e425a7532b6410b5f41f3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8d66d704f41fb1…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon Aug 8 15:36:43 2016 +0200
clang-tidy-3.9 cleanups.
---
Makefile | 2 +-
agents/windows/Configurable.h | 5 +++--
livestatus/src/OffsetStringMacroColumn.cc | 2 +-
livestatus/src/Store.cc | 5 +----
livestatus/src/Store.h | 2 +-
livestatus/src/TableServices.cc | 4 ++--
livestatus/src/TableServices.h | 4 ++--
livestatus/src/TableStateHistory.cc | 1 -
livestatus/src/logger.cc | 10 +++++-----
livestatus/src/module.cc | 12 ++++++------
livestatus/src/unixcat.cc | 12 ++++++------
11 files changed, 28 insertions(+), 31 deletions(-)
diff --git a/Makefile b/Makefile
index a34081b..a511880 100644
--- a/Makefile
+++ b/Makefile
@@ -34,7 +34,7 @@ TAROPTS := --owner=root --group=root --exclude=.svn
--exclude=*~ \
--exclude=.gitignore --exclude=*.swp --exclude=.f12
C_CXX_FLAGS := -g -O3 -Wall -Wextra
-CLANG_VERSION := 3.8
+CLANG_VERSION := 3.9
CLANG_FORMAT := clang-format-$(CLANG_VERSION)
CLANG_TIDY := clang-tidy-$(CLANG_VERSION)
SCAN_BUILD := scan-build-$(CLANG_VERSION)
diff --git a/agents/windows/Configurable.h b/agents/windows/Configurable.h
index f31cd87..0e84337 100644
--- a/agents/windows/Configurable.h
+++ b/agents/windows/Configurable.h
@@ -105,8 +105,9 @@ public: // only valid with a grouping adder. it's important to
understand that
// for template-instantiations where they aren't used so even though
// they wouldn't compile with non-grouping adders, this is not a
// problem. (google SFINAE)
- void setGroupFunction(typename AddMode::PriorityAppendGrouped<
- ContainerT>::GroupFunction function) {
+ void setGroupFunction(
+ typename AddMode::PriorityAppendGrouped<ContainerT>::GroupFunction
+ function) {
_add_mode.setGroupFunction(function);
}
diff --git a/livestatus/src/OffsetStringMacroColumn.cc
b/livestatus/src/OffsetStringMacroColumn.cc
index 92ce5e4..fe565fa 100644
--- a/livestatus/src/OffsetStringMacroColumn.cc
+++ b/livestatus/src/OffsetStringMacroColumn.cc
@@ -42,7 +42,7 @@ string OffsetStringMacroColumn::valueAsString(void *row,
service *svc = getService(row);
// search for macro names, beginning with $
- string result = "";
+ string result;
const char *scan = raw.c_str();
while (*scan != 0) {
diff --git a/livestatus/src/Store.cc b/livestatus/src/Store.cc
index 5e52130..b944181 100644
--- a/livestatus/src/Store.cc
+++ b/livestatus/src/Store.cc
@@ -45,11 +45,8 @@ using std::chrono::microseconds;
using std::chrono::system_clock;
using std::list;
using std::lock_guard;
-using std::make_pair;
using std::mutex;
-using std::pair;
using std::string;
-using std::to_string;
Store::Store()
: _log_cache(_commands_holder, g_max_cached_messages)
@@ -93,7 +90,7 @@ void Store::addTable(Table *table) {
_table_columns.addTable(table);
}
-Table *Store::findTable(string name) {
+Table *Store::findTable(const string &name) {
auto it = _tables.find(name);
if (it == _tables.end()) {
return nullptr;
diff --git a/livestatus/src/Store.h b/livestatus/src/Store.h
index fec255f..1d6f7d6 100644
--- a/livestatus/src/Store.h
+++ b/livestatus/src/Store.h
@@ -98,7 +98,7 @@ private:
std::mutex _command_mutex;
void addTable(Table *table);
- Table *findTable(std::string name);
+ Table *findTable(const std::string &name);
void answerGetRequest(const std::list<std::string> &lines, OutputBuffer *,
const char *);
void answerCommandRequest(const char *);
diff --git a/livestatus/src/TableServices.cc b/livestatus/src/TableServices.cc
index 3c514b1..4e4df23 100644
--- a/livestatus/src/TableServices.cc
+++ b/livestatus/src/TableServices.cc
@@ -62,8 +62,8 @@ string TableServices::name() const { return "services"; }
string TableServices::namePrefix() const { return "service_"; }
// static
-void TableServices::addColumns(Table *table, string prefix, int indirect_offset,
- bool add_hosts,
+void TableServices::addColumns(Table *table, const string &prefix,
+ int indirect_offset, bool add_hosts,
const DowntimesOrComments &downtimes_holder,
const DowntimesOrComments &comments_holder) {
// Es fehlen noch: double-Spalten, unsigned long spalten, etliche weniger
diff --git a/livestatus/src/TableServices.h b/livestatus/src/TableServices.h
index d0752f1..94db97b 100644
--- a/livestatus/src/TableServices.h
+++ b/livestatus/src/TableServices.h
@@ -51,8 +51,8 @@ public:
#else
TableServices(const DowntimesOrComments &downtimes_holder,
const DowntimesOrComments &comments_holder);
- static void addColumns(Table *, std::string prefix, int indirect_offset,
- bool add_hosts,
+ static void addColumns(Table *, const std::string &prefix,
+ int indirect_offset, bool add_hosts,
const DowntimesOrComments &downtimes_holder,
const DowntimesOrComments &comments_holder);
#endif
diff --git a/livestatus/src/TableStateHistory.cc b/livestatus/src/TableStateHistory.cc
index f44a4f1..03ed5f8 100644
--- a/livestatus/src/TableStateHistory.cc
+++ b/livestatus/src/TableStateHistory.cc
@@ -67,7 +67,6 @@ using std::lock_guard;
using std::make_pair;
using std::map;
using std::mutex;
-using std::recursive_mutex;
using std::set;
using std::string;
diff --git a/livestatus/src/logger.cc b/livestatus/src/logger.cc
index d987885..5e4f5be 100644
--- a/livestatus/src/logger.cc
+++ b/livestatus/src/logger.cc
@@ -26,12 +26,12 @@
#define _XOPEN_SOURCE 500
#include "logger.h"
-#include <errno.h>
#include <pthread.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
+#include <cerrno>
+#include <cstdarg>
+#include <cstdio>
+#include <cstring>
+#include <ctime>
#include "nagios.h"
extern char g_logfile_path[];
diff --git a/livestatus/src/module.cc b/livestatus/src/module.cc
index 7815747..3e2fd24 100644
--- a/livestatus/src/module.cc
+++ b/livestatus/src/module.cc
@@ -27,22 +27,22 @@
// IWYU pragma: no_include <bits/socket_type.h>
#include "config.h"
-#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h> // IWYU pragma: keep
#include <sys/un.h>
-#include <time.h>
#include <unistd.h>
+#include <cerrno>
+#include <cstddef>
#include <cstdint>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
#include "auth.h"
#include "data_encoding.h"
#include "global_counters.h"
diff --git a/livestatus/src/unixcat.cc b/livestatus/src/unixcat.cc
index f60842d..2ec7701 100644
--- a/livestatus/src/unixcat.cc
+++ b/livestatus/src/unixcat.cc
@@ -23,13 +23,7 @@
// Boston, MA 02110-1301 USA.
// IWYU pragma: no_include <bits/socket_type.h>
-#include <errno.h>
#include <pthread.h>
-#include <signal.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <sys/stat.h>
@@ -37,7 +31,13 @@
#include <sys/types.h> // IWYU pragma: keep
#include <sys/un.h>
#include <unistd.h>
+#include <cerrno>
#include <cinttypes>
+#include <csignal>
+#include <cstdint>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
int copy_data(int from, int to);
void *voidp;