Code cosmetics: reduce the amount of cppcheck warnings

This commit is contained in:
Felipe Zimmerle
2015-08-12 15:22:00 -03:00
parent 21400ba454
commit d5fe21ce3c
24 changed files with 49 additions and 56 deletions

View File

@@ -80,10 +80,9 @@ IpTree::~IpTree() {
bool IpTree::addFromBuffer(std::istream *ss, std::string *error) {
char *error_msg = NULL;
int res = 0;
for (std::string line; std::getline(*ss, line); ) {
res = ip_tree_from_param(line.c_str(), &m_tree, &error_msg);
int res = ip_tree_from_param(line.c_str(), &m_tree, &error_msg);
if (res != 0) {
if (error_msg != NULL) {
error->assign(error_msg);

View File

@@ -354,7 +354,7 @@ std::ostream& operator<<(std::ostream& out, MD5 md5)
//////////////////////////////
std::string md5(const std::string str)
std::string md5(const std::string& str)
{
MD5 md5 = MD5(str);

View File

@@ -88,6 +88,6 @@ private:
static inline void II(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac);
};
std::string md5(const std::string str);
std::string md5(const std::string& str);
#endif

View File

@@ -53,7 +53,6 @@ int regex_search(const std::string& s, SMatch *match,
}
int regex_search(const std::string& s, Regex regex) {
std::string match;
pcrecpp::RE re(regex.pattern);
return re.PartialMatch(s);
}