mirror of
https://github.com/AltraMayor/f3.git
synced 2025-09-07 22:28:39 -04:00
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'.
This commit is contained in:
parent
e8509a05e9
commit
f8050f4721
2
utils.c
2
utils.c
@ -238,6 +238,8 @@ static inline int fdatasync(int fd)
|
|||||||
/* This function is a _rough_ approximation of posix_fadvise(2). */
|
/* This function is a _rough_ approximation of posix_fadvise(2). */
|
||||||
int posix_fadvise(int fd, off_t offset, off_t len, int advice)
|
int posix_fadvise(int fd, off_t offset, off_t len, int advice)
|
||||||
{
|
{
|
||||||
|
UNUSED(offset);
|
||||||
|
UNUSED(len);
|
||||||
switch (advice) {
|
switch (advice) {
|
||||||
case POSIX_FADV_SEQUENTIAL:
|
case POSIX_FADV_SEQUENTIAL:
|
||||||
return fcntl(fd, F_RDAHEAD, 1);
|
return fcntl(fd, F_RDAHEAD, 1);
|
||||||
|
2
utils.h
2
utils.h
@ -34,6 +34,8 @@ static inline uint64_t random_number(uint64_t prv_number)
|
|||||||
return prv_number * 4294967311ULL + 17;
|
return prv_number * 4294967311ULL + 17;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define UNUSED(x) ((void)x)
|
||||||
|
|
||||||
#if __APPLE__ && __MACH__
|
#if __APPLE__ && __MACH__
|
||||||
|
|
||||||
#include <unistd.h> /* For type off_t. */
|
#include <unistd.h> /* For type off_t. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user