cppcheck: make static analysis more pedantic

This commit is contained in:
Felipe Zimmerle
2020-01-17 11:41:05 -03:00
parent cd9b8aa93b
commit 4f13fecbaf
23 changed files with 58 additions and 42 deletions

View File

@@ -36,13 +36,13 @@ void CustomDebugLog::write(int level, const std::string &id,
m_log << msgf << std::endl;
}
bool CustomDebugLog::contains(const std::string& pattern) {
bool const CustomDebugLog::contains(const std::string& pattern) const {
modsecurity::Utils::Regex re(pattern);
std::string s = m_log.str();
return modsecurity::Utils::regex_search(s, re);
}
std::string CustomDebugLog::log_messages() {
std::string const CustomDebugLog::log_messages() const {
return m_log.str();
}

View File

@@ -31,8 +31,8 @@ class CustomDebugLog : public modsecurity::debug_log::DebugLog {
void write(int level, const std::string& message) override;
void write(int level, const std::string &id,
const std::string &uri, const std::string &msg) override;
bool contains(const std::string& pattern);
std::string log_messages();
bool const contains(const std::string& pattern) const;
std::string const log_messages() const;
std::string error_log_messages();
int getDebugLogLevel() override;

View File

@@ -23,7 +23,7 @@
namespace modsecurity_test {
std::string RegressionTest::print() {
const std::string RegressionTest::print() {
std::stringstream i;
#if 0

View File

@@ -33,7 +33,7 @@ class RegressionTest {
public:
static RegressionTest *from_yajl_node(const yajl_val &);
std::string print();
const std::string print();
std::string filename;
std::string name;
std::string title;