]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Add UNUSED macro that expands to a parameter attribute annotation on
authorMartin Pool <mbp@samba.org>
Sat, 23 Feb 2002 00:17:50 +0000 (00:17 +0000)
committerMartin Pool <mbp@samba.org>
Sat, 23 Feb 2002 00:17:50 +0000 (00:17 +0000)
gcc, to quieten its worries about parameters that must always be
unused.

main.c
rsync.h

diff --git a/main.c b/main.c
index be8d0c2a5dad9e76e6d5ebcddc2e9474d83a6a82..74d205f0e8738c08d0b650e1cfa477d2d7b8c531 100644 (file)
--- a/main.c
+++ b/main.c
@@ -786,17 +786,17 @@ static int start_client(int argc, char *argv[])
 }
 
 
-static RETSIGTYPE sigusr1_handler(int val) {
+static RETSIGTYPE sigusr1_handler(int UNUSED(val)) {
        exit_cleanup(RERR_SIGNAL);
 }
 
-static RETSIGTYPE sigusr2_handler(int val) {
+static RETSIGTYPE sigusr2_handler(int UNUSED(val)) {
        extern int log_got_error;
        if (log_got_error) _exit(RERR_PARTIAL);
        _exit(0);
 }
 
-static RETSIGTYPE sigchld_handler(int val) {
+static RETSIGTYPE sigchld_handler(int UNUSED(val)) {
 #ifdef WNOHANG
        while (waitpid(-1, NULL, WNOHANG) > 0) ;
 #endif
diff --git a/rsync.h b/rsync.h
index 2bfe25063fb41890c162368e73369afa9346af94..449ce094cad03a9953c335691bd0a4e5a6f85c5c 100644 (file)
--- a/rsync.h
+++ b/rsync.h
@@ -609,3 +609,9 @@ inet_ntop(int af, const void *src, char *dst, size_t size);
 #ifndef HAVE_INET_PTON
 int isc_net_pton(int af, const char *src, void *dst);
 #endif
+
+#ifdef __GNUC__
+#  define UNUSED(x) x __attribute__((__unused__))
+#else
+#  define UNUSED(x) x
+#endif /* ndef __GNUC__ */