Module: check_mk
Branch: master
Commit: d1d44607a063ad46a3c82c1121b54f456262f455
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d1d44607a063ad…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu May 11 16:27:22 2017 +0200
clang-tidy: performance-unnecessary-value-param fixes.
Change-Id: Ib40c7e2e0bd469be0bbc6f31738681253fb1135d
---
livestatus/src/CustomVarsColumn.cc | 4 ++--
livestatus/src/CustomVarsDictColumn.cc | 4 ++--
livestatus/src/CustomVarsDictFilter.cc | 2 +-
livestatus/src/CustomVarsDictFilter.h | 2 +-
livestatus/src/CustomVarsNamesColumn.cc | 4 ++--
livestatus/src/CustomVarsValuesColumn.cc | 4 ++--
livestatus/src/DynamicEventConsoleReplicationColumn.cc | 4 ++--
livestatus/src/HostFileColumn.cc | 4 ++--
livestatus/src/HostFileColumn.h | 2 +-
livestatus/src/Store.cc | 3 ++-
livestatus/src/TimeperiodColumn.cc | 7 ++++---
livestatus/src/TimeperiodColumn.h | 4 ++--
12 files changed, 23 insertions(+), 21 deletions(-)
diff --git a/livestatus/src/CustomVarsColumn.cc b/livestatus/src/CustomVarsColumn.cc
index 71f1196..fe4b4d1 100644
--- a/livestatus/src/CustomVarsColumn.cc
+++ b/livestatus/src/CustomVarsColumn.cc
@@ -38,8 +38,8 @@ using std::unordered_map;
CustomVarsColumn::CustomVarsColumn(string name, string description, int offset,
int indirect_offset, int extra_offset,
int extra_extra_offset)
- : Column(name, description, indirect_offset, extra_offset,
- extra_extra_offset)
+ : Column(std::move(name), std::move(description), indirect_offset,
+ extra_offset, extra_extra_offset)
, _offset(offset) {}
CustomVarsColumn::~CustomVarsColumn() = default;
diff --git a/livestatus/src/CustomVarsDictColumn.cc
b/livestatus/src/CustomVarsDictColumn.cc
index 41b8989..43121e3 100644
--- a/livestatus/src/CustomVarsDictColumn.cc
+++ b/livestatus/src/CustomVarsDictColumn.cc
@@ -37,8 +37,8 @@ CustomVarsDictColumn::CustomVarsDictColumn(string name, string
description,
int offset, int indirect_offset,
int extra_offset,
int extra_extra_offset)
- : CustomVarsColumn(name, description, offset, indirect_offset, extra_offset,
- extra_extra_offset) {}
+ : CustomVarsColumn(std::move(name), std::move(description), offset,
+ indirect_offset, extra_offset, extra_extra_offset) {}
ColumnType CustomVarsDictColumn::type() { return ColumnType::dict; }
diff --git a/livestatus/src/CustomVarsDictFilter.cc
b/livestatus/src/CustomVarsDictFilter.cc
index 85d3cfe..4c01446 100644
--- a/livestatus/src/CustomVarsDictFilter.cc
+++ b/livestatus/src/CustomVarsDictFilter.cc
@@ -38,7 +38,7 @@ using std::tie;
CustomVarsDictFilter::CustomVarsDictFilter(CustomVarsColumn *column,
RelationalOperator relOp,
- string value)
+ const string &value)
: _column(column), _relOp(relOp) {
// Filter for custom_variables:
// Filter: custom_variables = PATH /hirni.mk
diff --git a/livestatus/src/CustomVarsDictFilter.h
b/livestatus/src/CustomVarsDictFilter.h
index e4cf32f..6d2a827 100644
--- a/livestatus/src/CustomVarsDictFilter.h
+++ b/livestatus/src/CustomVarsDictFilter.h
@@ -37,7 +37,7 @@ class Row;
class CustomVarsDictFilter : public ColumnFilter {
public:
CustomVarsDictFilter(CustomVarsColumn *column, RelationalOperator relOp,
- std::string value);
+ const std::string &value);
bool accepts(Row row, contact *auth_user, int timezone_offset) override;
CustomVarsColumn *column() const override;
diff --git a/livestatus/src/CustomVarsNamesColumn.cc
b/livestatus/src/CustomVarsNamesColumn.cc
index c4b18c5..f86ab70 100644
--- a/livestatus/src/CustomVarsNamesColumn.cc
+++ b/livestatus/src/CustomVarsNamesColumn.cc
@@ -38,8 +38,8 @@ CustomVarsNamesColumn::CustomVarsNamesColumn(string name, string
description,
int offset, int indirect_offset,
int extra_offset,
int extra_extra_offset)
- : CustomVarsColumn(name, description, offset, indirect_offset, extra_offset,
- extra_extra_offset) {}
+ : CustomVarsColumn(std::move(name), std::move(description), offset,
+ indirect_offset, extra_offset, extra_extra_offset) {}
ColumnType CustomVarsNamesColumn::type() { return ColumnType::list; }
diff --git a/livestatus/src/CustomVarsValuesColumn.cc
b/livestatus/src/CustomVarsValuesColumn.cc
index 206ce80..d877b73 100644
--- a/livestatus/src/CustomVarsValuesColumn.cc
+++ b/livestatus/src/CustomVarsValuesColumn.cc
@@ -37,8 +37,8 @@ CustomVarsValuesColumn::CustomVarsValuesColumn(string name, string
description,
int offset, int indirect_offset,
int extra_offset,
int extra_extra_offset)
- : CustomVarsColumn(name, description, offset, indirect_offset, extra_offset,
- extra_extra_offset) {}
+ : CustomVarsColumn(std::move(name), std::move(description), offset,
+ indirect_offset, extra_offset, extra_extra_offset) {}
ColumnType CustomVarsValuesColumn::type() { return ColumnType::list; }
diff --git a/livestatus/src/DynamicEventConsoleReplicationColumn.cc
b/livestatus/src/DynamicEventConsoleReplicationColumn.cc
index 91ac299..edf9fdd 100644
--- a/livestatus/src/DynamicEventConsoleReplicationColumn.cc
+++ b/livestatus/src/DynamicEventConsoleReplicationColumn.cc
@@ -59,8 +59,8 @@ private:
class ReplicationColumn : public BlobColumn {
public:
- ReplicationColumn(string name, string description, string blob,
- int indirect_offset, int extra_offset,
+ ReplicationColumn(const string &name, const string &description,
+ string blob, int indirect_offset, int extra_offset,
int extra_extra_offset)
: BlobColumn(name, description, indirect_offset, extra_offset,
extra_extra_offset)
diff --git a/livestatus/src/HostFileColumn.cc b/livestatus/src/HostFileColumn.cc
index 5a01d25..967ff89 100644
--- a/livestatus/src/HostFileColumn.cc
+++ b/livestatus/src/HostFileColumn.cc
@@ -44,7 +44,7 @@ using std::string;
using std::unique_ptr;
using std::vector;
-HostFileColumn::HostFileColumn(string name, string description,
+HostFileColumn::HostFileColumn(const string& name, const string& description,
std::string base_dir, std::string suffix,
int indirect_offset, int extra_offset,
int extra_extra_offset)
@@ -96,7 +96,7 @@ unique_ptr<vector<char>> HostFileColumn::getBlob(Row row) {
size_t bytes_to_read = st.st_size;
unique_ptr<vector<char>> result =
make_unique<vector<char>>(bytes_to_read);
- char *buffer = &(*result)[0];
+ char* buffer = &(*result)[0];
while (bytes_to_read > 0) {
ssize_t bytes_read = read(fd, buffer, bytes_to_read);
if (bytes_read == -1) {
diff --git a/livestatus/src/HostFileColumn.h b/livestatus/src/HostFileColumn.h
index 89788c8..f9bb231 100644
--- a/livestatus/src/HostFileColumn.h
+++ b/livestatus/src/HostFileColumn.h
@@ -34,7 +34,7 @@ class Row;
class HostFileColumn : public BlobColumn {
public:
- HostFileColumn(std::string name, std::string description,
+ HostFileColumn(const std::string& name, const std::string& description,
std::string base_dir, std::string suffix,
int indirect_offset, int extra_offset,
int extra_extra_offset);
diff --git a/livestatus/src/Store.cc b/livestatus/src/Store.cc
index d30b08e..beefe77 100644
--- a/livestatus/src/Store.cc
+++ b/livestatus/src/Store.cc
@@ -219,7 +219,8 @@ namespace {
class ECTableConnection : public EventConsoleConnection {
public:
ECTableConnection(Logger *logger, string path, string command)
- : EventConsoleConnection(logger, path), _command(move(command)) {}
+ : EventConsoleConnection(logger, std::move(path))
+ , _command(move(command)) {}
private:
void sendRequest(std::ostream &os) override { os << _command; }
diff --git a/livestatus/src/TimeperiodColumn.cc b/livestatus/src/TimeperiodColumn.cc
index 2a5ef85..c198c78 100644
--- a/livestatus/src/TimeperiodColumn.cc
+++ b/livestatus/src/TimeperiodColumn.cc
@@ -29,15 +29,16 @@
using std::string;
-extern TimeperiodsCache *g_timeperiods_cache;
+extern TimeperiodsCache* g_timeperiods_cache;
-TimeperiodColumn::TimeperiodColumn(string name, string description,
+TimeperiodColumn::TimeperiodColumn(const string& name,
+ const string& description,
int indirect_offset, int extra_offset,
int extra_extra_offset)
: IntColumn(name, description, indirect_offset, extra_offset,
extra_extra_offset) {}
-int32_t TimeperiodColumn::getValue(Row row, contact * /* auth_user */) {
+int32_t TimeperiodColumn::getValue(Row row, contact* /* auth_user */) {
if (auto tp = columnData<timeperiod>(row)) {
// no timeperiod set -> Nagios assumes 7x24
return (tp == nullptr || g_timeperiods_cache->inTimeperiod(tp)) ? 1 : 0;
diff --git a/livestatus/src/TimeperiodColumn.h b/livestatus/src/TimeperiodColumn.h
index 486def0..e745677 100644
--- a/livestatus/src/TimeperiodColumn.h
+++ b/livestatus/src/TimeperiodColumn.h
@@ -34,10 +34,10 @@ class Row;
class TimeperiodColumn : public IntColumn {
public:
- TimeperiodColumn(std::string name, std::string description,
+ TimeperiodColumn(const std::string& name, const std::string& description,
int indirect_offset, int extra_offset,
int extra_extra_offset);
- int32_t getValue(Row row, contact *auth_user) override;
+ int32_t getValue(Row row, contact* auth_user) override;
};
#endif // TimeperiodColumn_h