From: Marcin Siodelski Date: Wed, 4 Mar 2015 14:02:04 +0000 (+0100) Subject: [3673] Fixed cppcheck errors in the MySQL and PgSQL backends. X-Git-Tag: trac3764_base~16^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ec05369176c1ec91dad0dbcfe1a07be7b75a6b6;p=thirdparty%2Fkea.git [3673] Fixed cppcheck errors in the MySQL and PgSQL backends. This is about making some functions static or const. --- diff --git a/src/lib/dhcpsrv/mysql_lease_mgr.cc b/src/lib/dhcpsrv/mysql_lease_mgr.cc index 4cce4a6e02..b43d74400d 100644 --- a/src/lib/dhcpsrv/mysql_lease_mgr.cc +++ b/src/lib/dhcpsrv/mysql_lease_mgr.cc @@ -240,7 +240,8 @@ public: /// data associated with one of the "bind" elements, the /// corresponding element in the error array is set to MLM_TRUE. /// @param count Size of each of the arrays. - void setErrorIndicators(MYSQL_BIND* bind, my_bool* error, size_t count) { + static void setErrorIndicators(MYSQL_BIND* bind, my_bool* error, + size_t count) { for (size_t i = 0; i < count; ++i) { error[i] = MLM_FALSE; bind[i].error = reinterpret_cast(&error[i]); @@ -260,8 +261,8 @@ public: /// the error. /// @param names Array of column names, the same size as the error array. /// @param count Size of each of the arrays. - std::string getColumnsInError(my_bool* error, std::string* names, - size_t count) { + static std::string getColumnsInError(my_bool* error, std::string* names, + size_t count) { std::string result = ""; // Accumulate list of column names diff --git a/src/lib/dhcpsrv/pgsql_lease_mgr.cc b/src/lib/dhcpsrv/pgsql_lease_mgr.cc index ac2a1c54a9..76529145a3 100644 --- a/src/lib/dhcpsrv/pgsql_lease_mgr.cc +++ b/src/lib/dhcpsrv/pgsql_lease_mgr.cc @@ -508,7 +508,7 @@ public: } /// @brief Returns column label given a column number - std::string getColumnLabel(const size_t column) { + std::string getColumnLabel(const size_t column) const { if (column > columnLabels_.size()) { ostringstream os; os << "Unknown column:" << column;