diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | MCONFIG.in | 6 | ||||
-rw-r--r-- | debugfs/ChangeLog | 4 | ||||
-rw-r--r-- | debugfs/debugfs.c | 4 | ||||
-rw-r--r-- | e2fsck/ChangeLog | 6 | ||||
-rw-r--r-- | e2fsck/dict.c | 12 | ||||
-rw-r--r-- | e2fsck/dict.h | 18 | ||||
-rw-r--r-- | e2fsck/pass2.c | 2 | ||||
-rw-r--r-- | lib/blkid/ChangeLog | 8 | ||||
-rw-r--r-- | lib/blkid/blkid_types.h.in | 28 | ||||
-rw-r--r-- | lib/blkid/cache.c | 1 | ||||
-rw-r--r-- | lib/blkid/probe.c | 10 | ||||
-rw-r--r-- | lib/e2p/ChangeLog | 4 | ||||
-rw-r--r-- | lib/e2p/iod.c | 1 | ||||
-rw-r--r-- | lib/ext2fs/ChangeLog | 17 | ||||
-rw-r--r-- | lib/ext2fs/ext2_fs.h | 8 | ||||
-rw-r--r-- | lib/ext2fs/ext2_types.h.in | 28 | ||||
-rw-r--r-- | lib/ext2fs/flushb.c | 12 | ||||
-rw-r--r-- | lib/ext2fs/initialize.c | 18 | ||||
-rw-r--r-- | lib/ext2fs/ismounted.c | 14 | ||||
-rw-r--r-- | lib/ext2fs/kernel-jbd.h | 2 | ||||
-rw-r--r-- | lib/ext2fs/llseek.c | 4 | ||||
-rw-r--r-- | lib/ext2fs/lookup.c | 2 | ||||
-rw-r--r-- | lib/ext2fs/read_bb.c | 2 | ||||
-rw-r--r-- | lib/ext2fs/test_io.c | 4 | ||||
-rw-r--r-- | misc/ChangeLog | 6 | ||||
-rw-r--r-- | misc/badblocks.c | 22 | ||||
-rw-r--r-- | misc/blkid.c | 1 |
28 files changed, 176 insertions, 79 deletions
@@ -1,3 +1,14 @@ +2003-07-06 Theodore Ts'o <tytso@mit.edu> + + * MCONFIG.in (WFLAGS): Add additional warning checks. Remove + --traditional since newer versions of gcc are overly annoying. + +2003-07-05 Theodore Ts'o <tytso@mit.edu> + + * Add workaround for Libintl / Darwin incompatibility. Apparently + Darwin's gcc doesn't like the __asm__ statements used by + libintl to redirect the system-provided gettext calls. + 2003-06-08 Theodore Ts'o <tytso@mit.edu> * configure.in: Adjust defaults for FreeBSD to no longer build the @@ -120,10 +120,12 @@ $(top_builddir)/util/subst: # Run make gcc-wall to do a build with warning messages. # # -WFLAGS= -ansi -D_POSIX_SOURCE -pedantic \ +WFLAGS= -ansi -D_POSIX_SOURCE -pedantic $(WFLAGS_EXTRA) \ -Wall -Wwrite-strings -Wpointer-arith \ - -Wcast-qual -Wcast-align -Wtraditional \ + -Wcast-qual -Wcast-align \ -Wstrict-prototypes -Wmissing-prototypes \ + -Wformat-security -Wformat-nonliteral \ + -Wmissing-format-attribute \ -Wnested-externs -Winline -DNO_INLINE_FUNCS -Wshadow gcc-wall-new: diff --git a/debugfs/ChangeLog b/debugfs/ChangeLog index 33eb3953..1531d08e 100644 --- a/debugfs/ChangeLog +++ b/debugfs/ChangeLog @@ -1,3 +1,7 @@ +2003-07-06 Theodore Ts'o <tytso@mit.edu> + + * debugfs.c (do_imap): Fix gcc -Wall nitpicks (printf format types). + 2003-05-21 Theodore Ts'o <tytso@mit.edu> * unused.c (do_dump_unused): Add new command which dumps the diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c index 33e20518..1fcb9d37 100644 --- a/debugfs/debugfs.c +++ b/debugfs/debugfs.c @@ -1492,8 +1492,8 @@ void do_imap(int argc, char *argv[]) block; offset &= (EXT2_BLOCK_SIZE(current_fs->super) - 1); - printf("Inode %d is part of block group %d\n" - "\tlocated at block %d, offset 0x%04x\n", ino, group, + printf("Inode %d is part of block group %lu\n" + "\tlocated at block %lu, offset 0x%04lx\n", ino, group, block_nr, offset); } diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index ab005b1a..2d85bb2a 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,9 @@ +2003-07-06 Theodore Ts'o <tytso@mit.edu> + + * pass2.c: Fix gcc -Wall nitpicks (missing #include <string.h>) + + * dict.c, dict.h: Fix gcc -Wall nitpicks (indented cpp directives) + 2003-06-8 Theodore Ts'o <tytso@mit.edu> * problem.c: Fix spelling error. diff --git a/e2fsck/dict.c b/e2fsck/dict.c index 27652541..350ce752 100644 --- a/e2fsck/dict.c +++ b/e2fsck/dict.c @@ -1056,14 +1056,14 @@ void dict_load_next(dict_load_t *load, dnode_t *newnode, const void *key) assert (!dnode_is_in_a_dict(newnode)); assert (dict->nodecount < dict->maxcount); - #ifndef NDEBUG +#ifndef NDEBUG if (dict->nodecount > 0) { if (dict->dupes) assert (dict->compare(nil->left->key, key) <= 0); else assert (dict->compare(nil->left->key, key) < 0); } - #endif +#endif newnode->key = key; nil->right->left = newnode; @@ -1184,9 +1184,9 @@ void dict_merge(dict_t *dest, dict_t *source) copyleft: { dnode_t *next = dict_next(dest, leftnode); - #ifndef NDEBUG +#ifndef NDEBUG leftnode->left = NULL; /* suppress assertion in dict_load_next */ - #endif +#endif dict_load_next(&load, leftnode, leftnode->key); leftnode = next; continue; @@ -1195,9 +1195,9 @@ void dict_merge(dict_t *dest, dict_t *source) copyright: { dnode_t *next = dict_next(source, rightnode); - #ifndef NDEBUG +#ifndef NDEBUG rightnode->left = NULL; - #endif +#endif dict_load_next(&load, rightnode, rightnode->key); rightnode = next; continue; diff --git a/e2fsck/dict.h b/e2fsck/dict.h index 85c9f1de..838079d6 100644 --- a/e2fsck/dict.h +++ b/e2fsck/dict.h @@ -44,16 +44,16 @@ typedef unsigned long dictcount_t; typedef enum { dnode_red, dnode_black } dnode_color_t; typedef struct dnode_t { - #if defined(DICT_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG) +#if defined(DICT_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG) struct dnode_t *dict_left; struct dnode_t *dict_right; struct dnode_t *dict_parent; dnode_color_t dict_color; const void *dict_key; void *dict_data; - #else +#else int dict_dummy; - #endif +#endif } dnode_t; typedef int (*dict_comp_t)(const void *, const void *); @@ -61,7 +61,7 @@ typedef dnode_t *(*dnode_alloc_t)(void *); typedef void (*dnode_free_t)(dnode_t *, void *); typedef struct dict_t { - #if defined(DICT_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG) +#if defined(DICT_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG) dnode_t dict_nilnode; dictcount_t dict_nodecount; dictcount_t dict_maxcount; @@ -70,20 +70,20 @@ typedef struct dict_t { dnode_free_t dict_freenode; void *dict_context; int dict_dupes; - #else +#else int dict_dummmy; - #endif +#endif } dict_t; typedef void (*dnode_process_t)(dict_t *, dnode_t *, void *); typedef struct dict_load_t { - #if defined(DICT_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG) +#if defined(DICT_IMPLEMENTATION) || !defined(KAZLIB_OPAQUE_DEBUG) dict_t *dict_dictptr; dnode_t dict_nilnode; - #else +#else int dict_dummmy; - #endif +#endif } dict_load_t; extern dict_t *dict_create(dictcount_t, dict_comp_t); diff --git a/e2fsck/pass2.c b/e2fsck/pass2.c index 516e058d..0385c761 100644 --- a/e2fsck/pass2.c +++ b/e2fsck/pass2.c @@ -41,6 +41,8 @@ * - The inode_reg_map bitmap */ +#include <string.h> + #include "e2fsck.h" #include "problem.h" #include "dict.h" diff --git a/lib/blkid/ChangeLog b/lib/blkid/ChangeLog index bdf1849d..45b75f81 100644 --- a/lib/blkid/ChangeLog +++ b/lib/blkid/ChangeLog @@ -1,3 +1,11 @@ +2003-07-06 Theodore Ts'o <tytso@mit.edu> + + * blkid_types.h.in: Fix gcc -Wall nitpicks (don't use #elsif) + + * cache.c: Fix gcc -Wall nitpicks (missing #include <string.h>) + + * probe.h: Fix gcc -Wall nitpicks (missing casts) + 2003-05-21 Theodore Ts'o <tytso@mit.edu> * Makefile.in (ELF_OTHER_LIBS): The blkid library depends on the diff --git a/lib/blkid/blkid_types.h.in b/lib/blkid/blkid_types.h.in index 9de6804e..15284070 100644 --- a/lib/blkid/blkid_types.h.in +++ b/lib/blkid/blkid_types.h.in @@ -13,39 +13,49 @@ typedef signed char __s8; #if (@SIZEOF_INT@ == 8) typedef int __s64; typedef unsigned int __u64; -#elif (@SIZEOF_LONG@ == 8) +#else +#if (@SIZEOF_LONG@ == 8) typedef long __s64; typedef unsigned long __u64; -#elif (@SIZEOF_LONG_LONG@ == 8) +#else +#if (@SIZEOF_LONG_LONG@ == 8) #if defined(__GNUC__) typedef __signed__ long long __s64; #else typedef signed long long __s64; -#endif +#endif /* __GNUC__ */ typedef unsigned long long __u64; -#endif +#endif /* SIZEOF_LONG_LONG == 8 */ +#endif /* SIZEOF_LONG == 8 */ +#endif /* SIZEOF_INT == 8 */ #if (@SIZEOF_INT@ == 2) typedef int __s16; typedef unsigned int __u16; -#elif (@SIZEOF_SHORT@ == 2) +#else +#if (@SIZEOF_SHORT@ == 2) typedef short __s16; typedef unsigned short __u16; #else ?==error: undefined 16 bit type -#endif +#endif /* SIZEOF_SHORT == 2 */ +#endif /* SIZEOF_INT == 2 */ #if (@SIZEOF_INT@ == 4) typedef int __s32; typedef unsigned int __u32; -#elif (@SIZEOF_LONG@ == 4) +#else +#if (@SIZEOF_LONG@ == 4) typedef long __s32; typedef unsigned long __u32; -#elif (@SIZEOF_SHORT@ == 4) +#else +#if (@SIZEOF_SHORT@ == 4) typedef short __s32; typedef unsigned short __u32; #else ?== error: undefined 32 bit type -#endif +#endif /* SIZEOF_SHORT == 4 */ +#endif /* SIZEOF_LONG == 4 */ +#endif /* SIZEOF_INT == 4 */ #endif /* _*_TYPES_H */ diff --git a/lib/blkid/cache.c b/lib/blkid/cache.c index bfa104e6..5d824d2f 100644 --- a/lib/blkid/cache.c +++ b/lib/blkid/cache.c @@ -11,6 +11,7 @@ */ #include <stdlib.h> +#include <string.h> #include "blkidP.h" int blkid_debug_mask = 0; diff --git a/lib/blkid/probe.c b/lib/blkid/probe.c index 0fbbda37..a196ed52 100644 --- a/lib/blkid/probe.c +++ b/lib/blkid/probe.c @@ -220,8 +220,8 @@ static int probe_jfs(int fd, blkid_cache cache, blkid_dev dev, js = (struct jfs_super_block *)buf; - if (strlen(js->js_label)) - blkid_set_tag(dev, "LABEL", js->js_label, + if (strlen((char *) js->js_label)) + blkid_set_tag(dev, "LABEL", (char *) js->js_label, sizeof(js->js_label)); set_uuid(dev, js->js_uuid); return 0; @@ -235,9 +235,9 @@ static int probe_romfs(int fd, blkid_cache cache, blkid_dev dev, ros = (struct romfs_super_block *)buf; /* can be longer, padded to a 16 bytes boundary */ - if (strlen(ros->ros_volume)) { - blkid_set_tag(dev, "LABEL", ros->ros_volume, - (strlen(ros->ros_volume)|15)+1); + if (strlen((char *) ros->ros_volume)) { + blkid_set_tag(dev, "LABEL", (char *) ros->ros_volume, + (strlen((char *) ros->ros_volume)|15)+1); } return 0; } diff --git a/lib/e2p/ChangeLog b/lib/e2p/ChangeLog index 31a2de13..6722d099 100644 --- a/lib/e2p/ChangeLog +++ b/lib/e2p/ChangeLog @@ -1,3 +1,7 @@ +2003-07-06 Theodore Ts'o <tytso@mit.edu> + + * iod.c: Fix gcc -Wall nitpicks (missing #include <string.h>) + 2003-04-21 Theodore Ts'o <tytso@mit.edu> * Release of E2fsprogs 1.33 diff --git a/lib/e2p/iod.c b/lib/e2p/iod.c index 255bfdf2..808d3a39 100644 --- a/lib/e2p/iod.c +++ b/lib/e2p/iod.c @@ -19,6 +19,7 @@ #include <unistd.h> #endif #include <stdlib.h> +#include <string.h> int iterate_on_dir (const char * dir_name, int (*func) (const char *, struct dirent *, void *), diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 76102e58..9745e331 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,3 +1,20 @@ +2003-07-06 Theodore Ts'o <tytso@mit.edu> + + * kernel-jbd.h, flushb.c: Fix gcc -Wall nitpicks (indented cpp + directives) + + * ext2_types.h.in, initialize.c: Fix gcc -Wall nitpicks + (don't use #elsif) + + * ismounted.c: Fix gcc -Wall nitpicks (Don't use exit as a goto label) + + * llseek.c: Fix gcc -Wall nitpicks (don't use #elsif) + + * lookup.c, read_bb.c: Fix gcc -Wall nitpicks (indent + non-traditional #pragma) + + * test_io.c: Fix gcc -Wall nitpicks (const/unsigned type issues) + 2003-06-24 <tytso@snap.thunk.org> * badblocks.c, ext2fs.h (ext2fs_u32_list_find, diff --git a/lib/ext2fs/ext2_fs.h b/lib/ext2fs/ext2_fs.h index fc7e36c6..6ace0a91 100644 --- a/lib/ext2fs/ext2_fs.h +++ b/lib/ext2fs/ext2_fs.h @@ -315,7 +315,8 @@ struct ext2_inode { #define i_gid_high osd2.linux2.l_i_gid_high #define i_reserved2 osd2.linux2.l_i_reserved2 -#elif defined(__GNU__) +#else +#if defined(__GNU__) #define i_translator osd1.hurd1.h_i_translator #define i_frag osd2.hurd2.h_i_frag; @@ -324,13 +325,16 @@ struct ext2_inode { #define i_gid_high osd2.hurd2.h_i_gid_high #define i_author osd2.hurd2.h_i_author -#elif defined(__masix__) +#else +#if defined(__masix__) #define i_reserved1 osd1.masix1.m_i_reserved1 #define i_frag osd2.masix2.m_i_frag #define i_fsize osd2.masix2.m_i_fsize #define i_reserved2 osd2.masix2.m_i_reserved2 +#endif /* __masix__ */ +#endif /* __GNU__ */ #endif /* defined(__KERNEL__) || defined(__linux__) */ /* diff --git a/lib/ext2fs/ext2_types.h.in b/lib/ext2fs/ext2_types.h.in index 1d82c5d2..56897dd5 100644 --- a/lib/ext2fs/ext2_types.h.in +++ b/lib/ext2fs/ext2_types.h.in @@ -13,39 +13,49 @@ typedef signed char __s8; #if (@SIZEOF_INT@ == 8) typedef int __s64; typedef unsigned int __u64; -#elif (@SIZEOF_LONG@ == 8) +#else +#if (@SIZEOF_LONG@ == 8) typedef long __s64; typedef unsigned long __u64; -#elif (@SIZEOF_LONG_LONG@ == 8) +#else +#if (@SIZEOF_LONG_LONG@ == 8) #if defined(__GNUC__) typedef __signed__ long long __s64; #else typedef signed long long __s64; -#endif +#endif /* __GNUC__ */ typedef unsigned long long __u64; -#endif +#endif /* SIZEOF_LONG_LONG == 8 */ +#endif /* SIZEOF_LONG == 8 */ +#endif /* SIZEOF_INT == 8 */ #if (@SIZEOF_INT@ == 2) typedef int __s16; typedef unsigned int __u16; -#elif (@SIZEOF_SHORT@ == 2) +#else +#if (@SIZEOF_SHORT@ == 2) typedef short __s16; typedef unsigned short __u16; #else ?==error: undefined 16 bit type -#endif +#endif /* SIZEOF_SHORT == 2 */ +#endif /* SIZEOF_INT == 2 */ #if (@SIZEOF_INT@ == 4) typedef int __s32; typedef unsigned int __u32; -#elif (@SIZEOF_LONG@ == 4) +#else +#if (@SIZEOF_LONG@ == 4) typedef long __s32; typedef unsigned long __u32; -#elif (@SIZEOF_SHORT@ == 4) +#else +#if (@SIZEOF_SHORT@ == 4) typedef short __s32; typedef unsigned short __u32; #else ?== error: undefined 32 bit type -#endif +#endif /* SIZEOF_SHORT == 4 */ +#endif /* SIZEOF_LONG == 4 */ +#endif /* SIZEOF_INT == 4 */ #endif /* _*_TYPES_H */ diff --git a/lib/ext2fs/flushb.c b/lib/ext2fs/flushb.c index 80a21179..81d5adb0 100644 --- a/lib/ext2fs/flushb.c +++ b/lib/ext2fs/flushb.c @@ -65,16 +65,16 @@ errcode_t ext2fs_sync_device(int fd, int flushb) if (ioctl (fd, BLKFLSBUF, 0) == 0) return 0; #else - #ifdef __GNUC__ - #warning BLKFLSBUF not defined - #endif +#ifdef __GNUC__ + #warning BLKFLSBUF not defined +#endif /* __GNUC__ */ #endif #ifdef FDFLUSH ioctl (fd, FDFLUSH, 0); /* In case this is a floppy */ #else - #ifdef __GNUC__ - #warning FDFLUSH not defined - #endif +#ifdef __GNUC__ + #warning FDFLUSH not defined +#endif /* __GNUC__ */ #endif } return 0; diff --git a/lib/ext2fs/initialize.c b/lib/ext2fs/initialize.c index 32b9c87a..0e2b8d49 100644 --- a/lib/ext2fs/initialize.c +++ b/lib/ext2fs/initialize.c @@ -27,18 +27,24 @@ #include "ext2_fs.h" #include "ext2fs.h" -#if defined(__linux__) && defined(EXT2_OS_LINUX) +#if defined(__linux__) && defined(EXT2_OS_LINUX) #define CREATOR_OS EXT2_OS_LINUX -#elif defined(__GNU__) && defined(EXT2_OS_HURD) +#else +#if defined(__GNU__) && defined(EXT2_OS_HURD) #define CREATOR_OS EXT2_OS_HURD -#elif defined(__FreeBSD__) && defined(EXT2_OS_FREEBSD) +#else +#if defined(__FreeBSD__) && defined(EXT2_OS_FREEBSD) #define CREATOR_OS EXT2_OS_FREEBSD -#elif defined(LITES) && defined(EXT2_OS_LITES) +#else +#if defined(LITES) && defined(EXT2_OS_LITES) #define CREATOR_OS EXT2_OS_LITES #else #define CREATOR_OS EXT2_OS_LINUX /* by default */ -#endif - +#endif /* defined(LITES) && defined(EXT2_OS_LITES) */ +#endif /* defined(__FreeBSD__) && defined(EXT2_OS_FREEBSD) */ +#endif /* defined(__GNU__) && defined(EXT2_OS_HURD) */ +#endif /* defined(__linux__) && defined(EXT2_OS_LINUX) */ + /* * Note we override the kernel include file's idea of what the default * check interval (never) should be. It's a good idea to check at diff --git a/lib/ext2fs/ismounted.c b/lib/ext2fs/ismounted.c index d3ff2763..3f2241d2 100644 --- a/lib/ext2fs/ismounted.c +++ b/lib/ext2fs/ismounted.c @@ -99,7 +99,7 @@ static errcode_t check_mntent_file(const char *mtab_file, const char *file, } } #endif /* __GNU__ */ - goto exit; + goto errout; } #ifndef __GNU__ /* The GNU hurd is deficient; what else is new? */ /* Validate the entry in case /etc/mtab is out of date */ @@ -117,14 +117,14 @@ static errcode_t check_mntent_file(const char *mtab_file, const char *file, #endif /* DEBUG */ retval = 0; } - goto exit; + goto errout; } if (file_rdev && (st_buf.st_dev != file_rdev)) { #ifdef DEBUG printf("Bogus entry in %s! (%s not mounted on %s)\n", mtab_file, file, mnt->mnt_dir); #endif /* DEBUG */ - goto exit; + goto errout; } #endif /* __GNU__ */ *mount_flags = EXT2_MF_MOUNTED; @@ -156,7 +156,7 @@ is_root: (void) unlink(TEST_FILE); } retval = 0; -exit: +errout: endmntent (f); return retval; } @@ -190,7 +190,8 @@ static errcode_t check_mntent(const char *file, int *mount_flags, #endif /* defined(MOUNTED) || defined(_PATH_MOUNTED) */ } -#elif defined(HAVE_GETMNTINFO) +#else +#if defined(HAVE_GETMNTINFO) static errcode_t check_getmntinfo(const char *file, int *mount_flags, char *mtpt, int mtlen) @@ -227,6 +228,7 @@ static errcode_t check_getmntinfo(const char *file, int *mount_flags, return 0; } #endif /* HAVE_GETMNTINFO */ +#endif /* HAVE_MNTENT_H */ /* * Check to see if we're dealing with the swap device. @@ -299,7 +301,7 @@ errcode_t ext2fs_check_mount_point(const char *device, int *mount_flags, return check_getmntinfo(device, mount_flags, mtpt, mtlen); #else #ifdef __GNUC__ -#warning "Can't use getmntent or getmntinfo to check for mounted filesystems!" + #warning "Can't use getmntent or getmntinfo to check for mounted filesystems!" #endif *mount_flags = 0; return 0; diff --git a/lib/ext2fs/kernel-jbd.h b/lib/ext2fs/kernel-jbd.h index 4d97b7f9..f3db3a7f 100644 --- a/lib/ext2fs/kernel-jbd.h +++ b/lib/ext2fs/kernel-jbd.h @@ -769,7 +769,7 @@ static inline void journal_abort_handle(handle_t *handle) /* Not all architectures define BUG() */ #ifndef BUG - #define BUG() do { \ +#define BUG() do { \ printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ * ((char *) 0) = 0; \ } while (0) diff --git a/lib/ext2fs/llseek.c b/lib/ext2fs/llseek.c index 17d3d086..855560f1 100644 --- a/lib/ext2fs/llseek.c +++ b/lib/ext2fs/llseek.c @@ -34,7 +34,8 @@ #define my_llseek lseek64 -#elif defined(HAVE_LLSEEK) +#else +#if defined(HAVE_LLSEEK) #include <syscall.h> #ifndef HAVE_LLSEEK_PROTOTYPE @@ -84,6 +85,7 @@ static ext2_loff_t my_llseek (int fd, ext2_loff_t offset, int origin) #endif /* __alpha__ || __ia64__ */ #endif /* HAVE_LLSEEK */ +#endif /* defined(HAVE_LSEEK64) && defined(HAVE_LSEEK64_PROTOTYPE) */ ext2_loff_t ext2fs_llseek (int fd, ext2_loff_t offset, int origin) { diff --git a/lib/ext2fs/lookup.c b/lib/ext2fs/lookup.c index 6010c457..af9fdd1d 100644 --- a/lib/ext2fs/lookup.c +++ b/lib/ext2fs/lookup.c @@ -26,7 +26,7 @@ struct lookup_struct { }; #ifdef __TURBOC__ -#pragma argsused + #pragma argsused #endif static int lookup_proc(struct ext2_dir_entry *dirent, int offset, diff --git a/lib/ext2fs/read_bb.c b/lib/ext2fs/read_bb.c index 5d847fb2..d0f31391 100644 --- a/lib/ext2fs/read_bb.c +++ b/lib/ext2fs/read_bb.c @@ -35,7 +35,7 @@ struct read_bb_record { * Helper function for ext2fs_read_bb_inode() */ #ifdef __TURBOC__ -#pragma argsused + #pragma argsused #endif static int mark_bad_block(ext2_filsys fs, blk_t *block_nr, e2_blkcnt_t blockcnt, blk_t ref_block, diff --git a/lib/ext2fs/test_io.c b/lib/ext2fs/test_io.c index 35106660..9ce8334f 100644 --- a/lib/ext2fs/test_io.c +++ b/lib/ext2fs/test_io.c @@ -95,7 +95,7 @@ void (*test_io_cb_write_byte) static void test_dump_block(io_channel channel, struct test_private_data *data, - unsigned long block, void *buf) + unsigned long block, const void *buf) { const unsigned char *cp; FILE *f = data->outfile; @@ -105,7 +105,7 @@ static void test_dump_block(io_channel channel, for (i=0, cp = buf; i < channel->block_size; i++, cp++) { cksum += *cp; } - fprintf(f, "Contents of block %d, checksum %08x: \n", block, cksum); + fprintf(f, "Contents of block %lu, checksum %08lu: \n", block, cksum); for (i=0, cp = buf; i < channel->block_size; i++, cp++) { if ((i % 16) == 0) fprintf(f, "%04x: ", i); diff --git a/misc/ChangeLog b/misc/ChangeLog index 3f94898b..5df33e86 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,9 @@ +2003-07-06 Theodore Ts'o <tytso@mit.edu> + + * badblocks.c: Fix gcc -Wall nitpicks (signed/unsigned type issues) + + * blkid.c: Fix gcc -Wall nitpicks (missing #include <string.h>) + 2003-05-21 Theodore Ts'o <tytso@mit.edu> * mke2fs.c (PRS, set_fs_defaults): If the sector size of the diff --git a/misc/badblocks.c b/misc/badblocks.c index 3c25b46f..408c6961 100644 --- a/misc/badblocks.c +++ b/misc/badblocks.c @@ -198,7 +198,7 @@ static void pattern_fill(unsigned char *buffer, unsigned long pattern, * Perform a read of a sequence of blocks; return the number of blocks * successfully sequentially read. */ -static long do_read (int dev, char * buffer, int try, int block_size, +static long do_read (int dev, unsigned char * buffer, int try, int block_size, unsigned long current_block) { long got; @@ -225,7 +225,7 @@ static long do_read (int dev, char * buffer, int try, int block_size, * Perform a write of a sequence of blocks; return the number of blocks * successfully sequentially written. */ -static long do_write (int dev, char * buffer, int try, int block_size, +static long do_write (int dev, unsigned char * buffer, int try, int block_size, unsigned long current_block) { long got; @@ -264,7 +264,7 @@ static unsigned int test_ro (int dev, unsigned long last_block, int block_size, unsigned long from_count, unsigned long blocks_at_once) { - char * blkbuf; + unsigned char * blkbuf; int try; long got; unsigned int bb_count = 0; @@ -348,7 +348,7 @@ static unsigned int test_ro (int dev, unsigned long last_block, num_blocks = 0; alarm(0); if (s_flag || v_flag) - fprintf(stderr, _(done_string)); + fputs(done_string, stderr); fflush (stderr); free (blkbuf); @@ -362,7 +362,7 @@ static unsigned int test_rw (int dev, unsigned long last_block, int block_size, unsigned long from_count, unsigned long blocks_at_once) { - char * buffer; + unsigned char * buffer; const unsigned long patterns[] = {0xaa, 0x55, 0xff, 0x00}; const unsigned long *pattern; int nr_pattern, pat_idx; @@ -413,7 +413,7 @@ static unsigned int test_rw (int dev, unsigned long last_block, num_blocks = 0; alarm (0); if (s_flag | v_flag) - fprintf(stderr, _(done_string)); + fputs(done_string, stderr); flush_bufs(); if (s_flag | v_flag) fprintf (stderr, _("Reading and comparing: ")); @@ -441,7 +441,7 @@ static unsigned int test_rw (int dev, unsigned long last_block, num_blocks = 0; alarm (0); if (s_flag | v_flag) - fprintf(stderr, _(done_string)); + fputs(done_string, stderr); flush_bufs(); } uncapture_terminate(); @@ -458,7 +458,7 @@ static unsigned int test_nd (int dev, unsigned long last_block, int block_size, unsigned long from_count, unsigned long blocks_at_once) { - char *blkbuf, *save_ptr, *test_ptr, *read_ptr; + unsigned char *blkbuf, *save_ptr, *test_ptr, *read_ptr; int try, i; const unsigned long patterns[] = { ~0 }; const unsigned long *pattern; @@ -470,7 +470,7 @@ static unsigned int test_nd (int dev, unsigned long last_block, jmp_buf terminate_env; errcode_t errcode; long buf_used; - unsigned int bb_count; + unsigned int bb_count = 0; errcode = ext2fs_badblocks_list_iterate_begin(bb_list,&bb_iter); if (errcode) { @@ -657,7 +657,7 @@ static unsigned int test_nd (int dev, unsigned long last_block, num_blocks = 0; alarm(0); if (s_flag || v_flag > 1) - fprintf(stderr, _(done_string)); + fputs(done_string, stderr); flush_bufs(); } @@ -789,7 +789,7 @@ int main (int argc, char ** argv) break; case 't': if (t_flag + 1 > t_max) { - long *t_patts_new; + unsigned long *t_patts_new; t_patts_new = realloc(t_patts, t_max + T_INC); if (!t_patts_new) { diff --git a/misc/blkid.c b/misc/blkid.c index 84ae3dd5..2b71a561 100644 --- a/misc/blkid.c +++ b/misc/blkid.c @@ -11,6 +11,7 @@ #include <stdio.h> #include <stdlib.h> +#include <string.h> #ifdef HAVE_GETOPT_H #include <getopt.h> #else |