diff options
author | 2015-08-20 10:00:28 -0400 | |
---|---|---|
committer | 2015-08-20 10:00:28 -0400 | |
commit | 5c0edb3435a07372bf89ef19e9730066aecc6b8c (patch) | |
tree | 062b9bc20a9d8f9ee9be39ce30638ca0f0266cf0 /src/lib/pid.c | |
parent | testing (diff) | |
parent | Compile with -W -Wall -Werror (diff) | |
download | firejail-5c0edb3435a07372bf89ef19e9730066aecc6b8c.tar.gz firejail-5c0edb3435a07372bf89ef19e9730066aecc6b8c.tar.zst firejail-5c0edb3435a07372bf89ef19e9730066aecc6b8c.zip |
Merge pull request #35 from pmillerchip/warnings-cleanup
Compile with -W -Wall -Werror
Diffstat (limited to 'src/lib/pid.c')
-rw-r--r-- | src/lib/pid.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/lib/pid.c b/src/lib/pid.c index a0261ead2..1a1797ce2 100644 --- a/src/lib/pid.c +++ b/src/lib/pid.c | |||
@@ -222,15 +222,18 @@ static void print_elem(unsigned index, int nowrap) { | |||
222 | // recursivity!!! | 222 | // recursivity!!! |
223 | void pid_print_tree(unsigned index, unsigned parent, int nowrap) { | 223 | void pid_print_tree(unsigned index, unsigned parent, int nowrap) { |
224 | print_elem(index, nowrap); | 224 | print_elem(index, nowrap); |
225 | |||
226 | // Remove unused parameter warning | ||
227 | (void)parent; | ||
225 | 228 | ||
226 | int i; | 229 | unsigned i; |
227 | for (i = index + 1; i < max_pids; i++) { | 230 | for (i = index + 1; i < (unsigned)max_pids; i++) { |
228 | if (pids[i].parent == index) | 231 | if (pids[i].parent == (pid_t)index) |
229 | pid_print_tree(i, index, nowrap); | 232 | pid_print_tree(i, index, nowrap); |
230 | } | 233 | } |
231 | 234 | ||
232 | for (i = 0; i < index; i++) { | 235 | for (i = 0; i < index; i++) { |
233 | if (pids[i].parent == index) | 236 | if (pids[i].parent == (pid_t)index) |
234 | pid_print_tree(i, index, nowrap); | 237 | pid_print_tree(i, index, nowrap); |
235 | } | 238 | } |
236 | } | 239 | } |
@@ -245,6 +248,9 @@ void pid_store_cpu(unsigned index, unsigned parent, unsigned *utime, unsigned *s | |||
245 | *utime = 0; | 248 | *utime = 0; |
246 | *stime = 0; | 249 | *stime = 0; |
247 | } | 250 | } |
251 | |||
252 | // Remove unused parameter warning | ||
253 | (void)parent; | ||
248 | 254 | ||
249 | unsigned utmp = 0; | 255 | unsigned utmp = 0; |
250 | unsigned stmp = 0; | 256 | unsigned stmp = 0; |
@@ -252,9 +258,9 @@ void pid_store_cpu(unsigned index, unsigned parent, unsigned *utime, unsigned *s | |||
252 | *utime += utmp; | 258 | *utime += utmp; |
253 | *stime += stmp; | 259 | *stime += stmp; |
254 | 260 | ||
255 | int i; | 261 | unsigned i; |
256 | for (i = index + 1; i < max_pids; i++) { | 262 | for (i = index + 1; i < (unsigned)max_pids; i++) { |
257 | if (pids[i].parent == index) | 263 | if (pids[i].parent == (pid_t)index) |
258 | pid_store_cpu(i, index, utime, stime); | 264 | pid_store_cpu(i, index, utime, stime); |
259 | } | 265 | } |
260 | 266 | ||