From: Simon Ruderich Date: Mon, 10 Jun 2013 02:53:30 +0000 (+0200) Subject: handle_*_pre(),handle_*_post(): Remove unused action parameter. X-Git-Tag: 0.1~95 X-Git-Url: https://ruderich.org/simon/gitweb/?p=coloredstderr%2Fcoloredstderr.git;a=commitdiff_plain;h=fe3f7d4c635b265c58efd5bc420d32135ec7903e handle_*_pre(),handle_*_post(): Remove unused action parameter. --- diff --git a/src/coloredstderr.c b/src/coloredstderr.c index 94a597e..c36c2f7 100644 --- a/src/coloredstderr.c +++ b/src/coloredstderr.c @@ -140,9 +140,7 @@ inline static void init_pre_post_string(void) { post_string_size = strlen(post_string); } -static void handle_fd_pre(int fd, int action) { - (void)action; - +static void handle_fd_pre(int fd) { if (!pre_string || !post_string) { init_pre_post_string(); } @@ -150,16 +148,12 @@ static void handle_fd_pre(int fd, int action) { DLSYM_FUNCTION(real_write, "write"); real_write(fd, pre_string, pre_string_size); } -static void handle_fd_post(int fd, int action) { - (void)action; - +static void handle_fd_post(int fd) { /* write() already loaded above in handle_fd_pre(). */ real_write(fd, post_string, post_string_size); } -static void handle_file_pre(FILE *stream, int action) { - (void)action; - +static void handle_file_pre(FILE *stream) { if (!pre_string || !post_string) { init_pre_post_string(); } @@ -167,9 +161,7 @@ static void handle_file_pre(FILE *stream, int action) { DLSYM_FUNCTION(real_fwrite, "fwrite"); real_fwrite(pre_string, pre_string_size, 1, stream); } -static void handle_file_post(FILE *stream, int action) { - (void)action; - +static void handle_file_post(FILE *stream) { /* fwrite() already loaded above in handle_file_pre(). */ real_fwrite(post_string, post_string_size, 1, stream); } diff --git a/src/hookmacros.h b/src/hookmacros.h index 6f65d1e..4698869 100644 --- a/src/hookmacros.h +++ b/src/hookmacros.h @@ -35,7 +35,7 @@ _HOOK_PRE(type, name) \ handle = check_handle_fd(fd); \ if (handle) { \ - handle_fd_pre(fd, handle); \ + handle_fd_pre(fd); \ } \ errno = saved_errno; #define _HOOK_PRE_FILE(type, name, file) \ @@ -43,7 +43,7 @@ _HOOK_PRE(type, name) \ handle = check_handle_fd(fileno(file)); \ if (handle) { \ - handle_file_pre(file, handle); \ + handle_file_pre(file); \ } \ errno = saved_errno; /* Save and restore the errno to make sure we return the errno of the original @@ -51,7 +51,7 @@ #define _HOOK_POST_FD_(fd) \ if (handle) { \ saved_errno = errno; \ - handle_fd_post(fd, handle); \ + handle_fd_post(fd); \ errno = saved_errno; \ } #define _HOOK_POST_FD(fd) \ @@ -60,7 +60,7 @@ #define _HOOK_POST_FILE(file) \ if (handle) { \ saved_errno = errno; \ - handle_file_post(file, handle); \ + handle_file_post(file); \ errno = saved_errno; \ } \ return result;