From df831edaa3b3aa22e03bc5fd416a0553c5600a69 Mon Sep 17 00:00:00 2001 From: Phil Carmody Date: Wed, 7 May 2014 16:52:22 +0300 Subject: [PATCH] lib: a couple of trivial sparse cleanups The #include isn't needed on modern linux, as the macros are already defined The compiler seems to silently ignore redefinitions in system header files, so didn't throw a warning, but probably should have, as redefinitions can lead to insanity. The cast just makes it explicit that we're changing the prototype. --- src/lib/file-set-size.c | 3 ++- src/lib/istream.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/file-set-size.c b/src/lib/file-set-size.c index e153bc5cd3..14e09089cb 100644 --- a/src/lib/file-set-size.c +++ b/src/lib/file-set-size.c @@ -14,7 +14,8 @@ #include #include #include -#ifdef HAVE_LINUX_FALLOC_H +#if defined(HAVE_LINUX_FALLOC_H) && !defined(FALLOC_FL_KEEP_SIZE) +/* Legacy Linux does not have the FALLOC_FL_* flags under fcntl.h */ # include #endif diff --git a/src/lib/istream.c b/src/lib/istream.c index 3c3e181595..c4b2c698a6 100644 --- a/src/lib/istream.c +++ b/src/lib/istream.c @@ -77,7 +77,7 @@ void i_stream_remove_destroy_callback(struct istream *stream, dcs = array_get(&iostream->destroy_callbacks, &count); for (i = 0; i < count; i++) { - if (dcs[i].callback == callback) { + if (dcs[i].callback == (istream_callback_t *)callback) { array_delete(&iostream->destroy_callbacks, i, 1); return; } -- 2.47.3