]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Silence unused variable and parameter warnings
authorWolfgang Stöggl <c72578@yahoo.de>
Tue, 7 May 2019 14:41:17 +0000 (16:41 +0200)
committerTobias Oetiker <tobi@oetiker.ch>
Wed, 8 May 2019 05:46:57 +0000 (07:46 +0200)
- 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
src/rrd_open.c

index 8acb73882ba5828268ec3e24990e4042f083cc7c..433a284438d279e95f40d6542093af1cea255cc2 100644 (file)
@@ -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;
index 17edd37980336db7e0ceeb8ec4186a10c9a64415..7a30a79e50913962c296d171b8de13dcbd3e6cb4 100644 (file)
@@ -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 */
 }