Skip to content

Commit f55a954

Browse files
committed
fix: cppcheck warning in standalone/server.c; add suppression to whole header's dir
1 parent 7db0379 commit f55a954

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

Makefile.am

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ cppcheck:
4444
--library=gnu \
4545
--library=posix \
4646
--std=c++17 \
47-
-I ./apache2 \
47+
-I ./apache2 \
4848
-I /usr/include/libxml2 \
49-
-I @APXS_INCLUDEDIR@ \
49+
-I @APXS_INCLUDEDIR@ \
5050
-I @APR_INCLUDEDIR@ \
5151
-I @APU_INCLUDEDIR@ \
5252
--suppressions-list=./tests/cppcheck_suppressions.txt \
53+
--suppress=syntaxError:/usr/include/apr-1.0/* \
5354
--inline-suppr \
5455
--inconclusive \
5556
--template="warning: {file},{line},{severity},{id},{message}" \

standalone/server.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,15 @@ AP_DECLARE(int) ap_index_of_response(int status)
139139
{
140140
static const int shortcut[6] = {0, LEVEL_200, LEVEL_300, LEVEL_400,
141141
LEVEL_500, RESPONSE_CODES};
142-
int i, pos;
143142

144143
if (status < 100) { /* Below 100 is illegal for HTTP status */
145144
return LEVEL_500;
146145
}
147146

148-
for (i = 0; i < 5; i++) {
147+
for (int i = 0; i < 5; i++) {
149148
status -= 100;
150149
if (status < 100) {
151-
pos = (status + shortcut[i]);
150+
int pos = (status + shortcut[i]);
152151
if (pos < shortcut[i + 1]) {
153152
return pos;
154153
}

0 commit comments

Comments
 (0)