Browse Source

* suppress compiler warnings

master
Alex 'AdUser' Z 8 years ago
parent
commit
e6b34fb738
  1. 4
      src/backends/redis.c
  2. 4
      src/client.c
  3. 5
      src/sources/files.c
  4. 2
      t/t_cmd.c
  5. 1
      t/t_statefile.c

4
src/backends/redis.c

@ -222,7 +222,9 @@ bool
unban(cfg_t *cfg, const char *ip) {
assert(cfg != NULL);
(void)(cfg); /* suppress warning for unused variable 'ip' */
(void)(ip); /* suppress warning for unused variable 'ip' */
return true;
}
@ -230,7 +232,9 @@ bool
check(cfg_t *cfg, const char *ip) {
assert(cfg != NULL);
(void)(cfg); /* suppress warning for unused variable 'ip' */
(void)(ip); /* suppress warning for unused variable 'ip' */
return false;
}

4
src/client.c

@ -117,7 +117,9 @@ int main(int argc, char *argv[]) {
SA_REGISTER(SIGINT, &signal_handler);
/* prepare client side of socket */
mkstemp(opts.csocket_cpath);
ret = mkstemp(opts.csocket_cpath);
if (ret >= 0)
close(ret); /* suppress compiler warning */
unlink(opts.csocket_cpath); /* remove regular file created by mkstemp() */
if ((opts.csocket = f2b_csocket_connect(opts.csocket_spath, opts.csocket_cpath)) <= 0)

5
src/sources/files.c

@ -126,7 +126,12 @@ config(cfg_t *cfg, const char *key, const char *value) {
assert(cfg != NULL);
assert(key != NULL);
assert(value != NULL);
/* no options */
(void)(cfg); /* suppress warning for unused variable 'ip' */
(void)(key); /* suppress warning for unused variable 'ip' */
(void)(value); /* suppress warning for unused variable 'ip' */
return false;
}

2
t/t_cmd.c

@ -5,6 +5,8 @@ int main() {
char buf[1024];
const char *line;
UNUSED(line);
buf[0] = '\0';
f2b_cmd_append_arg(buf, sizeof(buf), "42");
assert(strcmp(buf, "42\n") == 0);

1
t/t_statefile.c

@ -11,6 +11,7 @@ int main() {
struct stat st;
time_t banned_at = 0, release_at = 0;
UNUSED(res);
UNUSED(list);
snprintf(jailname, sizeof(jailname), "%lu", time(NULL)); /* gen unique jailname */

Loading…
Cancel
Save