Skip to content

Commit 68161a4

Browse files
committed
Fix SonarCloud errors
1 parent 6637569 commit 68161a4

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

headers/modsecurity/rules_set_properties.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ using modsecurity::audit_log::AuditLog;
7171
/** @ingroup ModSecurity_CPP_API */
7272
class ConfigInt {
7373
public:
74-
ConfigInt() : m_set(false), m_value(0) { }
75-
bool m_set;
76-
int m_value;
74+
bool m_set = false;
75+
int m_value = 0;
76+
ConfigInt() = default;
7777

7878
void merge(const ConfigInt *from) {
7979
if (m_set == true || from->m_set == false) {
@@ -87,9 +87,9 @@ class ConfigInt {
8787

8888
class ConfigUnsignedInt {
8989
public:
90-
ConfigUnsignedInt() : m_set(false), m_value(0) { }
91-
bool m_set;
92-
unsigned int m_value;
90+
bool m_set = false;
91+
unsigned int m_value = 0;
92+
ConfigUnsignedInt() = default;
9393

9494
void merge(const ConfigUnsignedInt *from) {
9595
if (m_set == true || from->m_set == false) {
@@ -104,9 +104,9 @@ class ConfigUnsignedInt {
104104

105105
class ConfigDouble {
106106
public:
107-
ConfigDouble() : m_set(false), m_value(0) { }
108-
bool m_set;
109-
double m_value;
107+
bool m_set = false;
108+
double m_value = 0.0;
109+
ConfigDouble() = default;
110110

111111
void merge(const ConfigDouble *from) {
112112
if (m_set == true || from->m_set == false) {
@@ -121,9 +121,9 @@ class ConfigDouble {
121121

122122
class ConfigString {
123123
public:
124-
ConfigString() : m_set(false), m_value("") { }
125-
bool m_set;
126-
std::string m_value;
124+
bool m_set = false;
125+
std::string m_value = "";
126+
ConfigString() = default;
127127

128128
void merge(const ConfigString *from) {
129129
if (m_set == true || from->m_set == false) {
@@ -138,10 +138,10 @@ class ConfigString {
138138

139139
class ConfigSet {
140140
public:
141-
ConfigSet() : m_set(false), m_clear(false) { }
142-
bool m_set;
143-
bool m_clear;
141+
bool m_set = false;
142+
bool m_clear = false;
144143
std::set<std::string> m_value;
144+
ConfigSet() = default;
145145
};
146146

147147

src/utils/string.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ inline std::string toupper(std::string str) { // cppcheck-suppress passedByValue
278278
}
279279

280280
inline int parse_unsigned_int(const std::string &a, unsigned int *res) {
281-
char *endptr = NULL;
281+
char *endptr = nullptr;
282282
errno = 0;
283283

284284
unsigned long val = strtoul(a.c_str(), &endptr, 10);

0 commit comments

Comments
 (0)