avoid the need for a bogus initializer.

This commit is contained in:
chs 2005-10-08 03:21:17 +00:00
parent 20b89dd47f
commit 6c50e54c82
3 changed files with 8 additions and 21 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs.c,v 1.17 2005/09/13 04:14:17 christos Exp $ */
/* $NetBSD: lfs.c,v 1.18 2005/10/08 03:21:17 chs Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
* All rights reserved.
@ -240,8 +240,6 @@ ufs_getlbns(struct lfs * fs, struct uvnode * vp, daddr_t bn, struct indir * ap,
int i, numlevels, off;
int lognindir, indir;
metalbn = 0; /* XXXGCC -Wuninitialized [dreamcast] */
if (nump)
*nump = 0;
numlevels = 0;
@ -271,10 +269,7 @@ ufs_getlbns(struct lfs * fs, struct uvnode * vp, daddr_t bn, struct indir * ap,
}
/* Calculate the address of the first meta-block. */
if (realbn >= 0)
metalbn = -(realbn - bn + NIADDR - i);
else
metalbn = -(-realbn - bn + NIADDR - i);
metalbn = -((realbn >= 0 ? realbn : -realbn) - bn + NIADDR - i);
/* At each iteration, off is the offset into the bap array which is an
* array of disk addresses at the current level of indirection. The

View File

@ -1,4 +1,4 @@
/* $NetBSD: ufs_bmap.c,v 1.37 2005/08/12 22:31:51 jmmv Exp $ */
/* $NetBSD: ufs_bmap.c,v 1.38 2005/10/08 03:21:17 chs Exp $ */
/*
* Copyright (c) 1989, 1991, 1993
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ufs_bmap.c,v 1.37 2005/08/12 22:31:51 jmmv Exp $");
__KERNEL_RCSID(0, "$NetBSD: ufs_bmap.c,v 1.38 2005/10/08 03:21:17 chs Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -354,11 +354,7 @@ ufs_getlbns(struct vnode *vp, daddr_t bn, struct indir *ap, int *nump)
}
/* Calculate the address of the first meta-block. */
metalbn = 0; /* XXX: gcc3 */
if (realbn >= 0)
metalbn = -(realbn - bn + NIADDR - i);
else
metalbn = -(-realbn - bn + NIADDR - i);
metalbn = -((realbn >= 0 ? realbn : -realbn) - bn + NIADDR - i);
/*
* At each iteration, off is the offset into the bap array which is

View File

@ -1,4 +1,4 @@
/* $NetBSD: ufs_bmap.c,v 1.15 2005/06/07 13:54:55 he Exp $ */
/* $NetBSD: ufs_bmap.c,v 1.16 2005/10/08 03:21:17 chs Exp $ */
/* From: NetBSD: ufs_bmap.c,v 1.14 2001/11/08 05:00:51 chs Exp */
/*
@ -43,7 +43,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(__lint)
__RCSID("$NetBSD: ufs_bmap.c,v 1.15 2005/06/07 13:54:55 he Exp $");
__RCSID("$NetBSD: ufs_bmap.c,v 1.16 2005/10/08 03:21:17 chs Exp $");
#endif /* !__lint */
#include <sys/param.h>
@ -80,7 +80,6 @@ ufs_getlbns(struct inode *ip, daddr_t bn, struct indir *ap, int *nump)
int i, numlevels, off;
u_long lognindir;
metalbn = 0; /* XXXGCC -Wuninitialized [sparc64] */
lognindir = ffs(NINDIR(ip->i_fs)) - 1;
if (nump)
*nump = 0;
@ -111,10 +110,7 @@ ufs_getlbns(struct inode *ip, daddr_t bn, struct indir *ap, int *nump)
}
/* Calculate the address of the first meta-block. */
if (realbn >= 0)
metalbn = -(realbn - bn + NIADDR - i);
else
metalbn = -(-realbn - bn + NIADDR - i);
metalbn = -((realbn >= 0 ? realbn : -realbn) - bn + NIADDR - i);
/*
* At each iteration, off is the offset into the bap array which is