From cb7ba2b0c81085a1de2144817c3a6d59178b4e12 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 25 Apr 2005 13:21:46 +0000 Subject: [PATCH] GCC4 signedness fixes cvtnum and init_cvtnum take unsigned paramaters now --- include/input.h | 3 ++- io/init.c | 4 ++-- io/init.h | 2 +- io/madvise.c | 4 ++-- io/mincore.c | 3 ++- io/mmap.c | 12 +++++++----- io/open.c | 2 +- io/pread.c | 2 +- io/prealloc.c | 2 +- io/pwrite.c | 2 +- io/truncate.c | 2 +- libxcmd/input.c | 4 ++-- mkfs/proto.c | 1 - mkfs/xfs_mkfs.c | 8 ++++---- mkfs/xfs_mkfs.h | 3 ++- quota/init.c | 4 ++-- quota/init.h | 2 +- 17 files changed, 32 insertions(+), 28 deletions(-) diff --git a/include/input.h b/include/input.h index d7f836295..be2bf7413 100644 --- a/include/input.h +++ b/include/input.h @@ -41,7 +41,8 @@ extern char **breakline(char *input, int *count); extern void doneline(char *input, char **vec); extern char *fetchline(void); -extern long long cvtnum(int blocksize, int sectorsize, char *s); +extern long long cvtnum(unsigned int blocksize, + unsigned int sectorsize, char *s); extern void cvtstr(double value, char *str, size_t sz); extern unsigned long cvttime(char *s); diff --git a/io/init.c b/io/init.c index c1f81ff9e..60fb024bd 100644 --- a/io/init.c +++ b/io/init.c @@ -53,8 +53,8 @@ usage(void) void init_cvtnum( - int *blocksize, - int *sectsize) + unsigned int *blocksize, + unsigned int *sectsize) { if (!file || (file->flags & IO_FOREIGN)) { *blocksize = 4096; diff --git a/io/init.h b/io/init.h index 57b17a765..bc87165d2 100644 --- a/io/init.h +++ b/io/init.h @@ -42,4 +42,4 @@ extern struct timeval stopwatch; #define min(a,b) (((a)<(b))?(a):(b)) -extern void init_cvtnum(int *blocksize, int *sectsize); +extern void init_cvtnum(unsigned int *blocksize, unsigned int *sectsize); diff --git a/io/madvise.c b/io/madvise.c index a687c33cc..d611fb107 100644 --- a/io/madvise.c +++ b/io/madvise.c @@ -69,8 +69,8 @@ madvise_f( off64_t offset; size_t length; void *start; - int advise = MADV_NORMAL; - int c, blocksize, sectsize; + int advise = MADV_NORMAL, c; + unsigned int blocksize, sectsize; while ((c = getopt(argc, argv, "drsw")) != EOF) { switch (c) { diff --git a/io/mincore.c b/io/mincore.c index 80b4ac495..e182b954e 100644 --- a/io/mincore.c +++ b/io/mincore.c @@ -49,7 +49,8 @@ mincore_f( void *start; void *current, *previous; unsigned char *vec; - int i, blocksize, sectsize; + int i; + unsigned int blocksize, sectsize; if (argc == 1) { offset = mapping->offset; diff --git a/io/mmap.c b/io/mmap.c index 07c54c75b..cb7531d91 100644 --- a/io/mmap.c +++ b/io/mmap.c @@ -171,7 +171,7 @@ mmap_f( ssize_t length; void *address; char *filename; - int blocksize, sectsize; + unsigned int blocksize, sectsize; int c, prot = 0; if (argc == 1) { @@ -286,7 +286,8 @@ msync_f( off64_t offset; ssize_t length; void *start; - int c, flags = 0, blocksize, sectsize; + int c, flags = 0; + unsigned int blocksize, sectsize; while ((c = getopt(argc, argv, "ais")) != EOF) { switch (c) { @@ -391,8 +392,8 @@ mread_f( size_t dumplen; char *bp; void *start; - int dump = 0, rflag = 0; - int c, blocksize, sectsize; + int dump = 0, rflag = 0, c; + unsigned int blocksize, sectsize; while ((c = getopt(argc, argv, "frv")) != EOF) { switch (c) { @@ -537,7 +538,8 @@ mwrite_f( char *sp; int seed = 'X'; int rflag = 0; - int c, blocksize, sectsize; + int c; + unsigned int blocksize, sectsize; while ((c = getopt(argc, argv, "rS:")) != EOF) { switch (c) { diff --git a/io/open.c b/io/open.c index 398e291fb..6a4bc3ec9 100644 --- a/io/open.c +++ b/io/open.c @@ -548,7 +548,7 @@ extsize_f( { struct fsxattr fsx; long extsize; - int blocksize, sectsize; + unsigned int blocksize, sectsize; init_cvtnum(&blocksize, §size); extsize = (long)cvtnum(blocksize, sectsize, argv[1]); diff --git a/io/pread.c b/io/pread.c index 52b38ce3a..3d5a01466 100644 --- a/io/pread.c +++ b/io/pread.c @@ -149,7 +149,7 @@ pread_f( { off64_t offset; long long count, total; - int blocksize, sectsize; + unsigned int blocksize, sectsize; struct timeval t1, t2; char s1[64], s2[64], ts[64]; int Cflag, uflag, vflag; diff --git a/io/prealloc.c b/io/prealloc.c index f2fe83b1a..ae12f5045 100644 --- a/io/prealloc.c +++ b/io/prealloc.c @@ -47,7 +47,7 @@ offset_length( char *length, xfs_flock64_t *segment) { - int blocksize, sectsize; + unsigned int blocksize, sectsize; init_cvtnum(&blocksize, §size); memset(segment, 0, sizeof(*segment)); diff --git a/io/pwrite.c b/io/pwrite.c index f1d47c5fa..3ff05e846 100644 --- a/io/pwrite.c +++ b/io/pwrite.c @@ -106,7 +106,7 @@ pwrite_f( off64_t offset, skip = 0; long long count, total; unsigned int seed = 0xcdcdcdcd; - int blocksize, sectsize; + unsigned int blocksize, sectsize; struct timeval t1, t2; char s1[64], s2[64], ts[64]; char *sp, *infile = NULL; diff --git a/io/truncate.c b/io/truncate.c index 1a9b2be78..1d9d6a41a 100644 --- a/io/truncate.c +++ b/io/truncate.c @@ -44,7 +44,7 @@ truncate_f( char **argv) { off64_t offset; - int blocksize, sectsize; + unsigned int blocksize, sectsize; init_cvtnum(&blocksize, §size); offset = cvtnum(blocksize, sectsize, argv[1]); diff --git a/libxcmd/input.c b/libxcmd/input.c index 5758d8c2c..37bd8fb05 100644 --- a/libxcmd/input.c +++ b/libxcmd/input.c @@ -155,8 +155,8 @@ doneline( long long cvtnum( - int blocksize, - int sectorsize, + unsigned int blocksize, + unsigned int sectorsize, char *s) { long long i; diff --git a/mkfs/proto.c b/mkfs/proto.c index 4bde45bb8..318a0511c 100644 --- a/mkfs/proto.c +++ b/mkfs/proto.c @@ -37,7 +37,6 @@ /* * Prototypes for internal functions. */ -extern long long cvtnum(int blocksize, int sectorsize, char *s); extern void parseproto(xfs_mount_t *mp, xfs_inode_t *pip, char **pp, char *name); static long getnum(char **pp); diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 8d1765913..d4f7c9508 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -516,7 +516,7 @@ main( xfs_btree_sblock_t *block; int blflag; int blocklog; - int blocksize; + unsigned int blocksize; int bsflag; int bsize; xfs_buf_t *buf; @@ -588,7 +588,7 @@ main( char *rtsize; xfs_sb_t *sbp; int sectorlog; - int sectorsize; + unsigned int sectorsize; int slflag; int ssflag; __uint64_t tmp_agsize; @@ -2381,8 +2381,8 @@ isdigits( long long cvtnum( - int blocksize, - int sectorsize, + unsigned int blocksize, + unsigned int sectorsize, char *s) { long long i; diff --git a/mkfs/xfs_mkfs.h b/mkfs/xfs_mkfs.h index 79387f984..cda57b428 100644 --- a/mkfs/xfs_mkfs.h +++ b/mkfs/xfs_mkfs.h @@ -60,7 +60,8 @@ /* xfs_mkfs.c */ extern void usage (void); extern int isdigits (char *str); -extern long long cvtnum (int blocksize, int sectorsize, char *s); +extern long long cvtnum (unsigned int blocksize, + unsigned int sectorsize, char *s); /* proto.c */ extern char *setup_proto (char *fname); diff --git a/quota/init.c b/quota/init.c index b3ddeadca..3c52c4001 100644 --- a/quota/init.c +++ b/quota/init.c @@ -66,8 +66,8 @@ usage(void) void init_cvtnum( - int *blocksize, - int *sectsize) + unsigned int *blocksize, + unsigned int *sectsize) { *blocksize = 4096; *sectsize = 512; diff --git a/quota/init.h b/quota/init.h index 476f34b23..773f94320 100644 --- a/quota/init.h +++ b/quota/init.h @@ -43,4 +43,4 @@ extern void quota_init(void); extern void report_init(void); extern void state_init(void); -extern void init_cvtnum(int *, int *); +extern void init_cvtnum(unsigned int *, unsigned int *); -- 2.47.2