summaryrefslogtreecommitdiffstats
path: root/sbin/growfs
diff options
context:
space:
mode:
authorle <le@FreeBSD.org>2004-07-29 11:28:24 +0000
committerle <le@FreeBSD.org>2004-07-29 11:28:24 +0000
commite647ca0c36cb97a5ba49fe9560c724be511c571d (patch)
tree84828747af22b380300e88b400f24885f344d0d6 /sbin/growfs
parent0b3301069c7bff1e6de387451ce93de4de8f0469 (diff)
downloadFreeBSD-src-e647ca0c36cb97a5ba49fe9560c724be511c571d.zip
FreeBSD-src-e647ca0c36cb97a5ba49fe9560c724be511c571d.tar.gz
Catch up with recent gcc changes and introduce a DIP_SET macro
to use when setting values that depend on the UFS version. Raise WARNS again.
Diffstat (limited to 'sbin/growfs')
-rw-r--r--sbin/growfs/Makefile2
-rw-r--r--sbin/growfs/growfs.c10
2 files changed, 9 insertions, 3 deletions
diff --git a/sbin/growfs/Makefile b/sbin/growfs/Makefile
index d6ddfd5..21b5596 100644
--- a/sbin/growfs/Makefile
+++ b/sbin/growfs/Makefile
@@ -10,7 +10,7 @@ PROG= growfs
SRCS= growfs.c
MAN= growfs.8
-WARNS?= 0
+WARNS?= 6
.if defined(GFSDBG)
SRCS+= debug.c
diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c
index 6f972fa..cf58071 100644
--- a/sbin/growfs/growfs.c
+++ b/sbin/growfs/growfs.c
@@ -110,6 +110,12 @@ union dinode {
#define DIP(dp, field) \
((sblock.fs_magic == FS_UFS1_MAGIC) ? \
(uint32_t)(dp)->dp1.field : (dp)->dp2.field)
+#define DIP_SET(dp, field, val) do { \
+ if (sblock.fs_magic == FS_UFS1_MAGIC) \
+ (dp)->dp1.field = (val); \
+ else \
+ (dp)->dp2.field = (val); \
+ } while (0)
static ufs2_daddr_t inoblk; /* inode block address */
static char inobuf[MAXBSIZE]; /* inode block */
ino_t maxino; /* last valid inode */
@@ -2420,7 +2426,7 @@ updrefs(int cg, ino_t in, struct gfs_bpp *bp, int fsi, int fso, unsigned int
if (iptr == 0)
continue;
if (cond_bl_upd(&iptr, bp, fsi, fso, Nflag)) {
- DIP(ino, di_db[i]) = iptr;
+ DIP_SET(ino, di_db[i], iptr);
inodeupdated++;
}
}
@@ -2434,7 +2440,7 @@ updrefs(int cg, ino_t in, struct gfs_bpp *bp, int fsi, int fso, unsigned int
if (iptr == 0)
continue;
if (cond_bl_upd(&iptr, bp, fsi, fso, Nflag)) {
- DIP(ino, di_ib[i]) = iptr;
+ DIP_SET(ino, di_ib[i], iptr);
inodeupdated++;
}
indirchk(blksperindir, lbn, iptr, numblks, bp, fsi, fso, Nflag);
OpenPOWER on IntegriCloud