From a5e2b23394fd30787857c9786b0f412486b1e106 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wolfgang=20St=C3=B6ggl?= Date: Tue, 7 May 2019 16:41:17 +0200 Subject: [PATCH] Silence unused variable and parameter warnings - Cast unused variables and parameters to void, do nothing - Fixes the following compiler warnings on Windows: rrd_open.c: 757:9: warning: unused parameter 'writelock' [-Wunused-parameter] int writelock) 810:24: warning: unused variable 'rrd_simple_file' [-Wunused-variable] rrd_simple_file_t *rrd_simple_file; 807:17: warning: unused parameter 'rrd_file' [-Wunused-parameter] rrd_file_t *rrd_file, 808:12: warning: unused parameter 'rrd' [-Wunused-parameter] rrd_t *rrd) rrd_client.c: 746:39: warning: unused parameter 'client' [-Wunused-parameter] static int connect_unix(rrd_client_t *client, const char *path) /* {{{ */ 746:59: warning: unused parameter 'path' [-Wunused-parameter] static int connect_unix(rrd_client_t *client, const char *path) /* {{{ */ --- src/rrd_client.c | 3 +++ src/rrd_open.c | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/src/rrd_client.c b/src/rrd_client.c index 8acb7388..433a2844 100644 --- a/src/rrd_client.c +++ b/src/rrd_client.c @@ -773,6 +773,9 @@ static int connect_unix( const char *path) { /* {{{ */ #ifdef _WIN32 + /* Silence unused parameter compiler warnings */ + (void) client; + (void) path; return (WSAEPROTONOSUPPORT); #else struct sockaddr_un sa; diff --git a/src/rrd_open.c b/src/rrd_open.c index 17edd379..7a30a79e 100644 --- a/src/rrd_open.c +++ b/src/rrd_open.c @@ -783,6 +783,8 @@ int rrd_rwlock( #ifdef USE_WINDOWS_LOCK /* _locking() does not support read locks; we always take a write lock */ rcstat = rrd_windows_lock(rrd_simple_file->fd); + /* Silence unused parameter compiler warning */ + (void) writelock; #else { struct flock lock; @@ -878,6 +880,11 @@ void rrd_dontneed( #if defined DEBUG && DEBUG > 1 mincore_print(rrd_file, "after"); #endif +#else /* #if defined USE_MADVISE || defined HAVE_POSIX_FADVISE */ + /* Silence compiler warnings about unused variables and parameters */ + (void) rrd_simple_file; + (void) rrd_file; + (void) rrd; #endif /* without madvise and posix_fadvise it does not make much sense todo anything */ } -- 2.47.2