mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Address some constParameter complaints from cppcheck
This commit is contained in:
parent
e9277e199a
commit
4fac8d72f4
@ -225,7 +225,7 @@ void chomp(std::string *str) {
|
||||
}
|
||||
|
||||
|
||||
unsigned char x2c(unsigned char *what) {
|
||||
unsigned char x2c(const unsigned char *what) {
|
||||
unsigned char digit;
|
||||
|
||||
digit = (what[0] >= 'A' ? ((what[0] & 0xdf) - 'A') + 10 : (what[0] - '0'));
|
||||
@ -239,7 +239,7 @@ unsigned char x2c(unsigned char *what) {
|
||||
/**
|
||||
* Converts a single hexadecimal digit into a decimal value.
|
||||
*/
|
||||
unsigned char xsingle2c(unsigned char *what) {
|
||||
unsigned char xsingle2c(const unsigned char *what) {
|
||||
unsigned char digit;
|
||||
|
||||
digit = (what[0] >= 'A' ? ((what[0] & 0xdf) - 'A') + 10 : (what[0] - '0'));
|
||||
|
@ -73,8 +73,8 @@ void replaceAll(std::string *str, const std::string& from,
|
||||
std::string removeWhiteSpacesIfNeeded(std::string a);
|
||||
std::string parserSanitizer(std::string a);
|
||||
|
||||
unsigned char x2c(unsigned char *what);
|
||||
unsigned char xsingle2c(unsigned char *what);
|
||||
unsigned char x2c(const unsigned char *what);
|
||||
unsigned char xsingle2c(const unsigned char *what);
|
||||
unsigned char *c2x(unsigned what, unsigned char *where);
|
||||
|
||||
} // namespace string
|
||||
|
@ -608,7 +608,7 @@ class Variables : public std::vector<Variable *> {
|
||||
public:
|
||||
bool contains(Variable *v) {
|
||||
return std::find_if(begin(), end(),
|
||||
[v](Variable *m) -> bool { return *v == *m; }) != end();
|
||||
[v](const Variable *m) -> bool { return *v == *m; }) != end();
|
||||
};
|
||||
bool contains(const VariableValue *v) {
|
||||
return std::find_if(begin(), end(),
|
||||
|
@ -80,8 +80,6 @@ missingInclude
|
||||
|
||||
purgedConfiguration
|
||||
|
||||
constParameter
|
||||
|
||||
nullPointerRedundantCheck
|
||||
knownConditionTrueFalse
|
||||
cstyleCast
|
||||
|
Loading…
x
Reference in New Issue
Block a user