From: Wolfgang Stöggl Date: Tue, 7 May 2019 14:41:17 +0000 (+0200) Subject: Silence unused variable and parameter warnings X-Git-Tag: v1.7.2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5e2b23394fd30787857c9786b0f412486b1e106;p=thirdparty%2Frrdtool-1.x.git 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) /* {{{ */ --- 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 */ }