Module: check_mk
Branch: master
Commit: ffeee72739024d8767b6d8030c3a7b4eaf73ea9e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ffeee72739024d…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Nov 23 11:45:25 2017 +0100
Bumped clang version to 5.0.
Change-Id: I59d1b3da1254decea579c4d173c8a321e5a430c0
---
Makefile | 2 +-
agents/windows/Environment.cc | 6 +++---
agents/windows/EventLogVista.cc | 17 +++++++----------
agents/windows/dynamic_func.h | 18 ++++++++----------
agents/windows/win_error.cc | 10 +++++-----
agents/windows/wmiHelper.cc | 9 +++------
livestatus/src/HostListStateColumn.cc | 5 ++---
7 files changed, 29 insertions(+), 38 deletions(-)
diff --git a/Makefile b/Makefile
index fbb3477..0be7d0b 100644
--- a/Makefile
+++ b/Makefile
@@ -67,7 +67,7 @@ CXX_FLAGS := -g -O3 -Wall -Wextra
# should be removed when the compiler defaults are in sync again.
CXX_FLAGS += -std=c++14
-CLANG_VERSION := 4.0
+CLANG_VERSION := 5.0
CLANG_FORMAT := clang-format-$(CLANG_VERSION)
CLANG_TIDY := clang-tidy-$(CLANG_VERSION)
SCAN_BUILD := scan-build-$(CLANG_VERSION)
diff --git a/agents/windows/Environment.cc b/agents/windows/Environment.cc
index b9075b2..a9dde99 100644
--- a/agents/windows/Environment.cc
+++ b/agents/windows/Environment.cc
@@ -116,9 +116,9 @@ string Environment::determineAgentDirectory(bool use_cwd) const {
vector<unsigned char> buffer(MAX_PATH_UNICODE, '\0');
DWORD dsize = MAX_PATH_UNICODE;
- if (ERROR_SUCCESS ==
- _winapi.RegQueryValueEx(key, "ImagePath", NULL, NULL,
buffer.data(),
- &dsize)) {
+ if (ERROR_SUCCESS == _winapi.RegQueryValueEx(key, "ImagePath", NULL,
+ NULL, buffer.data(),
+ &dsize)) {
buffer.resize(dsize);
string directory{buffer.begin(), buffer.end()};
// search backwards for backslash
diff --git a/agents/windows/EventLogVista.cc b/agents/windows/EventLogVista.cc
index b93bada..6e5113d 100644
--- a/agents/windows/EventLogVista.cc
+++ b/agents/windows/EventLogVista.cc
@@ -197,9 +197,8 @@ public:
std::wstring result;
result.resize(128);
auto publisher_meta = std::make_unique<ManagedEventHandle>(
- *_evt,
- _evt->openPublisherMetadata(nullptr, source().c_str(), nullptr, 0,
- 0));
+ *_evt, _evt->openPublisherMetadata(nullptr, source().c_str(),
+ nullptr, 0, 0));
if (publisher_meta->get_handle() != nullptr) {
for (;;) {
DWORD required;
@@ -401,10 +400,9 @@ void EventLogVista::seek(uint64_t record_id) {
*_evt, evt().createBookmark(bookmarkXml.c_str()));
_handle = std::make_unique<ManagedEventHandle>(
- *_evt,
- evt().subscribe(nullptr, _signal->get_handle(), _path.c_str(),
L"*",
- bookmark->get_handle(), nullptr, nullptr,
- EvtSubscribeStartAfterBookmark));
+ *_evt, evt().subscribe(nullptr, _signal->get_handle(), _path.c_str(),
+ L"*", bookmark->get_handle(), nullptr,
nullptr,
+ EvtSubscribeStartAfterBookmark));
if (_handle->get_handle() == nullptr) {
throw win_exception(
@@ -429,9 +427,8 @@ uint64_t EventLogVista::getLastRecordId() {
EVT_HANDLE event_handle = nullptr;
DWORD num_events = 0;
- if (evt().next &&
- evt().next(log->get_handle(), 1, &event_handle, INFINITE, 0,
- &num_events)) {
+ if (evt().next && evt().next(log->get_handle(), 1, &event_handle,
INFINITE,
+ 0, &num_events)) {
auto event = std::make_unique<ManagedEventHandle>(*_evt, event_handle);
return EventLogRecordVista(event->get_handle(), _evt.get(),
diff --git a/agents/windows/dynamic_func.h b/agents/windows/dynamic_func.h
index c824070..2915999 100644
--- a/agents/windows/dynamic_func.h
+++ b/agents/windows/dynamic_func.h
@@ -42,16 +42,14 @@ FuncT dynamic_func(LPCWSTR dllName, LPCSTR funcName,
return nullptr;
}
-// there are two macros to declare a dynamic function. The first requires the
-// caller to provide the function signature as OriginalFunctionName_type
-// the second variant uses c++11 decltype to deduce the type automatically.
-//
-// The latter is obviously neater at the call site but in case of windows apis
-// it
-// requires us to include the header with macros set up such that the function
-// get declared. In this case the developers have to take care they don't use
-// the
-// functions directly
+ // There are two macros to declare a dynamic function. The first requires
+ // the caller to provide the function signature as OriginalFunctionName_type
+ // the second variant uses c++11 decltype to deduce the type automatically.
+ //
+ // The latter is obviously neater at the call site but in case of windows
+ // apis it requires us to include the header with macros set up such that
+ // the function get declared. In this case the developers have to take care
+ // they don't use the functions directly
#define DYNAMIC_FUNC(funcName, dllName, winapi) \
dynamic_func<funcName_type>(dllName, funcName, winapi)
diff --git a/agents/windows/win_error.cc b/agents/windows/win_error.cc
index 7b05ebd..24b78cf 100644
--- a/agents/windows/win_error.cc
+++ b/agents/windows/win_error.cc
@@ -49,8 +49,8 @@ std::string get_win_error_as_string(const WinApiAdaptor &winapi,
win_exception::win_exception(const WinApiAdaptor &winapi,
const std::string &msg,
DWORD error_code /* = GET_LAST_ERROR */)
- : std::runtime_error(msg + "; " +
- get_win_error_as_string(winapi,
- error_code == GET_LAST_ERROR
- ? winapi.GetLastError()
- : error_code)) {}
+ : std::runtime_error(
+ msg + "; " +
+ get_win_error_as_string(winapi, error_code == GET_LAST_ERROR
+ ? winapi.GetLastError()
+ : error_code)) {}
diff --git a/agents/windows/wmiHelper.cc b/agents/windows/wmiHelper.cc
index a27400b..1d21c2b 100644
--- a/agents/windows/wmiHelper.cc
+++ b/agents/windows/wmiHelper.cc
@@ -390,8 +390,7 @@ private:
RPC_C_IMP_LEVEL_IMPERSONATE, // impersonation level
nullptr, // authentication info
EOAC_NONE, // additional capabilities
- nullptr // reserved
- );
+ nullptr); // reserved
if (FAILED(res)) {
throw ComException("Failed to initialize COM security", res,
_winapi);
@@ -443,8 +442,7 @@ IWbemServices *Helper::connectServer(IWbemLocator *locator) {
0, // security flags
0, // authority
0, // context object
- &services // services proxy
- );
+ &services); // services proxy
if (FAILED(res)) {
throw ComException("Failed to connect", res, _winapi);
@@ -461,8 +459,7 @@ void Helper::setProxyBlanket(IWbemServices *services) {
RPC_C_AUTHN_LEVEL_CALL, // authentication level
RPC_C_IMP_LEVEL_IMPERSONATE, // impersonation level
nullptr, // client identity
- EOAC_NONE // proxy capabilities
- );
+ EOAC_NONE); // proxy capabilities
if (FAILED(res)) {
throw ComException("Failed to set proxy blanket", res, _winapi);
diff --git a/livestatus/src/HostListStateColumn.cc
b/livestatus/src/HostListStateColumn.cc
index f7a63cc..1f377da 100644
--- a/livestatus/src/HostListStateColumn.cc
+++ b/livestatus/src/HostListStateColumn.cc
@@ -96,9 +96,8 @@ void HostListStateColumn::update(host *hst, const contact *auth_user,
case Type::num_hst_down:
case Type::num_hst_unreach:
if (has_been_checked &&
- current_state ==
- static_cast<int>(_logictype) -
- static_cast<int>(Type::num_hst_up)) {
+ current_state == static_cast<int>(_logictype) -
+ static_cast<int>(Type::num_hst_up)) {
result++;
}
break;