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

@@ -32,9 +32,10 @@ class Base64 {
static std::string decode(const std::string& data);
static std::string decode_forgiven(const std::string& data);
static void decode_forgiven_engine(unsigned char *output,
size_t output_size, size_t *aiming_size, const unsigned char *input,
size_t input_size);
static void decode_forgiven_engine(unsigned char *plain_text,
size_t plain_text_size, size_t *aiming_size,
const unsigned char *encoded,
size_t input_len);
};

View File

@@ -106,7 +106,7 @@ bool GeoLookup::setDataBase(const std::string& filePath,
bool GeoLookup::lookup(const std::string& target, Transaction *trans,
std::function<bool(int, std::string)> debug) {
std::function<bool(int, std::string)> debug) const {
if (m_version == NOT_LOADED) {
if (debug) {

View File

@@ -49,8 +49,8 @@ class GeoLookup {
bool setDataBase(const std::string& filePath, std::string *err);
void cleanUp();
bool lookup(const std::string& target, Transaction *t,
std::function<bool(int, std::string)> callback);
bool lookup(const std::string& target, Transaction *transaction,
std::function<bool(int, std::string)> debug) const;
private:
GeoLookup() :

View File

@@ -50,8 +50,8 @@ void HttpsClient::setKey(const std::string& key) {
m_key = "ModSec-key: " + key;
}
void HttpsClient::setRequestBody(const std::string& requestBody) {
m_requestBody = requestBody;
void HttpsClient::setRequestBody(const std::string& requestType) {
m_requestBody = requestType;
}
void HttpsClient::setRequestType(const std::string& requestType) {

View File

@@ -58,7 +58,7 @@ class Regex {
Regex& operator=(const Regex&) = delete;
std::list<SMatch> searchAll(const std::string& s) const;
int search(const std::string &s, SMatch *m) const;
int search(const std::string &s, SMatch *match) const;
int search(const std::string &s) const;
const std::string pattern;

View File

@@ -29,7 +29,7 @@ namespace utils {
double cpu_seconds(void);
std::string find_resource(const std::string& file, const std::string& param,
std::string find_resource(const std::string& file, const std::string& config,
std::string *err);
std::string get_path(const std::string& file);
std::list<std::string> expandEnv(const std::string& var, int flags);