diff options
author | jmallett <jmallett@FreeBSD.org> | 2003-02-19 00:32:48 +0000 |
---|---|---|
committer | jmallett <jmallett@FreeBSD.org> | 2003-02-19 00:32:48 +0000 |
commit | b11abed927aea2ac9aeaa9263d3162f1a25eaa5f (patch) | |
tree | 3c8471670fcb6130212dbcd6edaef8bc8027b1d4 /lib/libufs/sblock.c | |
parent | 8d210b1fbaa6dd70bc73e17512235fdf9aa8a090 (diff) | |
download | FreeBSD-src-b11abed927aea2ac9aeaa9263d3162f1a25eaa5f.zip FreeBSD-src-b11abed927aea2ac9aeaa9263d3162f1a25eaa5f.tar.gz |
Clean up error reporting in block.c, so that it gives honest error strings
for the sorts of errors we run into[1]. This also gives us room to put in a
vaguely appropriate casts to silence warnings since our compiler doesn't like
when we compare ssize_t to size_t[2]. Add a cast in sblock.c[3] to silence
a warning because of signed vs. size_t hell (again). Clean up nearby
excessive parenthemutilation[4].
Reviewed by: bde [2] [3]
Suggested by: bde, many [1]
Submitted by: bde [4]
An aside about [4], bde notes that we do not check for a negative value for
the fs bsize. I'm nto going to do that in every situation we use it, one must
expect a reasonable program to pass down reasonable values. Some foot shooting
protection I will tolerate, some I will not. Also he suggests some possible
conditional improvements there, which I may take to heart.
PS: For me at least, this is now WARNS=5 clean...
Diffstat (limited to 'lib/libufs/sblock.c')
-rw-r--r-- | lib/libufs/sblock.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libufs/sblock.c b/lib/libufs/sblock.c index 455fee0..7f87f65 100644 --- a/lib/libufs/sblock.c +++ b/lib/libufs/sblock.c @@ -64,11 +64,11 @@ sbread(struct uufsd *disk) } if (fs->fs_magic == FS_UFS1_MAGIC) disk->d_ufs = 1; - if ((fs->fs_magic == FS_UFS2_MAGIC) && - (fs->fs_sblockloc == superblock)) + if (fs->fs_magic == FS_UFS2_MAGIC && + fs->fs_sblockloc == superblock) disk->d_ufs = 2; - if ((fs->fs_bsize <= MAXBSIZE) && - (fs->fs_bsize >= sizeof(*fs))) { + if (fs->fs_bsize <= MAXBSIZE && + (size_t)fs->fs_bsize >= sizeof(*fs)) { if (disk->d_ufs) break; } |