From: Andreas Dilger Date: Mon, 16 Dec 2013 04:26:25 +0000 (-0500) Subject: ext2fs: quiet compiler warnings X-Git-Tag: v1.42.9~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=269da3b8068ecb0bdf8077b0f7b27f164203cb35;p=thirdparty%2Fe2fsprogs.git ext2fs: quiet compiler warnings Include ext2fsP.h in fileio.c for ext2fs_file_block_offset_too_big() declaration. Fix up the declaration to mark it extern in the header. Include header for strcasecmp() in tune2fs.c if available, as described in the strcasecmp(3) man page, instead of doing this indirectly by declaring _BSD_SOURCE and getting it from . If CONFIG_QUOTA is undefined, parse_quota_opts() is unused in tune2fs.c so #ifdef it out. Signed-off-by: Andreas Dilger Signed-off-by: "Theodore Ts'o" --- diff --git a/lib/ext2fs/ext2fsP.h b/lib/ext2fs/ext2fsP.h index 99c0c1ba8..a88db93e2 100644 --- a/lib/ext2fs/ext2fsP.h +++ b/lib/ext2fs/ext2fsP.h @@ -142,6 +142,6 @@ extern void ext2fs_warn_bitmap32(ext2fs_generic_bitmap bitmap,const char *func); extern int ext2fs_mem_is_zero(const char *mem, size_t len); -int ext2fs_file_block_offset_too_big(ext2_filsys fs, - struct ext2_inode *inode, - blk64_t offset); +extern int ext2fs_file_block_offset_too_big(ext2_filsys fs, + struct ext2_inode *inode, + blk64_t offset); diff --git a/lib/ext2fs/fileio.c b/lib/ext2fs/fileio.c index 582b306ab..77328042f 100644 --- a/lib/ext2fs/fileio.c +++ b/lib/ext2fs/fileio.c @@ -18,6 +18,7 @@ #include "ext2_fs.h" #include "ext2fs.h" +#include "ext2fsP.h" struct ext2_file { errcode_t magic; diff --git a/misc/tune2fs.c b/misc/tune2fs.c index 3730821a6..568fb30d9 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -26,7 +26,6 @@ */ #define _XOPEN_SOURCE 600 /* for inclusion of strptime() */ -#define _BSD_SOURCE /* for inclusion of strcasecmp() */ #include "config.h" #include #include @@ -41,6 +40,11 @@ extern int optind; #ifdef HAVE_STDLIB_H #include #endif +#ifdef HAVE_STRINGS_H +#include /* for strcasecmp() */ +#else +#define _BSD_SOURCE /* for inclusion of strcasecmp() via */ +#endif #include #include #include @@ -765,6 +769,7 @@ static void handle_quota_options(ext2_filsys fs) return; } +#ifdef CONFIG_QUOTA static void parse_quota_opts(const char *opts) { char *buf, *token, *next, *p; @@ -807,8 +812,7 @@ static void parse_quota_opts(const char *opts) } free(buf); } - - +#endif static void parse_e2label_options(int argc, char ** argv) {