From: Phil Carmody Date: Wed, 7 May 2014 13:52:22 +0000 (+0300) Subject: lib: a couple of trivial sparse cleanups X-Git-Tag: 2.2.13.rc1~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df831edaa3b3aa22e03bc5fd416a0553c5600a69;p=thirdparty%2Fdovecot%2Fcore.git 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. --- 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; }