From: cgzones Date: Thu, 20 Apr 2017 22:35:40 +0000 (+0200) Subject: fix compile warnings X-Git-Tag: v1.18~30^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d62ab7625e11e5d309e8f8f3cce396b00eb4007;p=vnstat fix compile warnings src/daemon.c:176:13: warning: use of non-standard escape character '\%' [-Wpedantic] src/dbcache.c:333:33: warning: declaration shadows a variable in the global scope [-Wshadow] --- diff --git a/src/daemon.c b/src/daemon.c index 811dfef..7b9d52b 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -173,7 +173,7 @@ int addinterfaces(const char *dirname, const int running) } } else { if (debug) - printf("\%s\" added with %"PRIu32" Mbit bandwidth limit to cache.\n", interface, bwlimit); + printf("\"%s\" added with %"PRIu32" Mbit bandwidth limit to cache.\n", interface, bwlimit); cacheadd(interface, 1); } } diff --git a/src/dbcache.c b/src/dbcache.c index a3b717f..a4329d6 100644 --- a/src/dbcache.c +++ b/src/dbcache.c @@ -330,19 +330,19 @@ uint32_t dbcheck(uint32_t dbhash, int *forcesave) return newhash; } -uint32_t simplehash(const char *data, int len) +uint32_t simplehash(const char *input, int len) { uint32_t hash = len; - if (len <= 0 || data == NULL) { + if (len <= 0 || input == NULL) { return 0; } for (len--; len >= 0; len--) { if (len > 0) { - hash += (int)data[len] * len; + hash += (int)input[len] * len; } else { - hash += (int)data[len]; + hash += (int)input[len]; } } diff --git a/src/dbcache.h b/src/dbcache.h index 928e426..ad2e84c 100644 --- a/src/dbcache.h +++ b/src/dbcache.h @@ -18,7 +18,7 @@ void cacheflush(const char *dirname); int cachecount(void); int cacheactivecount(void); uint32_t dbcheck(uint32_t dbhash, int *forcesave); -uint32_t simplehash(const char *data, int len); +uint32_t simplehash(const char *input, int len); /* global variables */ datanode *dataptr;