From f8050f47213c7beb18599a7ad44b5fd3d5d22aab Mon Sep 17 00:00:00 2001 From: Michel Machado Date: Tue, 16 Dec 2014 07:10:02 -0500 Subject: [PATCH] Address unused-parameter warning on Macs Function posix_fadvise(), only implemented on Macs, was issuing warnings because the code doesn't use parameters 'offset' and 'len'. --- utils.c | 2 ++ utils.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/utils.c b/utils.c index 03691c0..23ee768 100644 --- a/utils.c +++ b/utils.c @@ -238,6 +238,8 @@ static inline int fdatasync(int fd) /* This function is a _rough_ approximation of posix_fadvise(2). */ int posix_fadvise(int fd, off_t offset, off_t len, int advice) { + UNUSED(offset); + UNUSED(len); switch (advice) { case POSIX_FADV_SEQUENTIAL: return fcntl(fd, F_RDAHEAD, 1); diff --git a/utils.h b/utils.h index 8ce8e9a..6b7c92f 100644 --- a/utils.h +++ b/utils.h @@ -34,6 +34,8 @@ static inline uint64_t random_number(uint64_t prv_number) return prv_number * 4294967311ULL + 17; } +#define UNUSED(x) ((void)x) + #if __APPLE__ && __MACH__ #include /* For type off_t. */