Bow to incomplete GCC 4. constant propagation optimizations and

initialize some of the local variables GCC claims are being used
uninitialized.
This commit is contained in:
Alexander Kabaev 2007-05-30 03:03:06 +00:00
parent 923e1044a4
commit 4e5001c263
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=170124
13 changed files with 17 additions and 13 deletions

View File

@ -33,10 +33,10 @@ static __inline register_t
mutex_spinlock(lock_t *lock) { mtx_lock(lock); return 0; }
#endif
#define mutex_spinunlock(lock,s) \
#define mutex_spinunlock(lock, s) \
do { \
spin_unlock(lock); \
if (&s) {} \
if (s != 0) {} \
} while (0)
#endif /* __XFS_SUPPORT_SPIN_H__ */

View File

@ -391,7 +391,7 @@ xfs_readlink_by_handle(
struct uio auio;
struct inode *inode;
xfs_fsop_handlereq_t hreq;
xfs_vnode_t *vp;
xfs_vnode_t *vp = NULL;
__u32 olen;
if (!capable(CAP_SYS_ADMIN))

View File

@ -361,7 +361,7 @@ _xfs_vget(mp, ino, flags, vpp)
int flags;
struct vnode **vpp;
{
xfs_vnode_t *vp;
xfs_vnode_t *vp = NULL;
int error;
printf("XVFS_GET_VNODE(MNTTOVFS(mp), &vp, ino, error);\n");

View File

@ -106,7 +106,7 @@ static const char xfs_countbit[256] = {
/*
* xfs_highbit32: get high bit set out of 32-bit argument, -1 if none set.
*/
inline int
int
xfs_highbit32(
__uint32_t v)
{

View File

@ -4992,7 +4992,7 @@ xfs_bmapi(
bma.firstblock = *firstblock;
bma.alen = alen;
bma.off = aoff;
bma.conv = (flags & XFS_BMAPI_CONVERT);
bma.conv = (flags & XFS_BMAPI_CONVERT) != 0;
bma.wasdel = wasdelay;
bma.minlen = minlen;
bma.low = flist->xbf_low;

View File

@ -773,6 +773,7 @@ xfs_bmbt_insrec(
XFS_STATS_INC(xs_bmbt_insrec);
block = xfs_bmbt_get_block(cur, level, &bp);
numrecs = be16_to_cpu(block->bb_numrecs);
nkey.br_startoff = 0;
#ifdef DEBUG
if ((error = xfs_btree_check_lblock(cur, block, level, bp))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);

View File

@ -385,6 +385,7 @@ xfs_dir_removename(xfs_trans_t *trans, xfs_inode_t *dp, char *name,
if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL) {
retval = xfs_dir_shortform_removename(&args);
} else if (xfs_bmap_one_block(dp, XFS_DATA_FORK)) {
count = totallen = 0;
retval = xfs_dir_leaf_removename(&args, &count, &totallen);
if (retval == 0) {
newsize = XFS_DIR_SF_ALLFIT(count, totallen);

View File

@ -522,7 +522,7 @@ xfs_dialloc(
xfs_btree_cur_t *cur; /* inode allocation btree cursor */
int error; /* error return value */
int i; /* result code */
int ialloced; /* inode allocation status */
int ialloced = 0; /* inode allocation status */
int noroom = 0; /* no space for inode blk allocation */
xfs_ino_t ino; /* fs-relative inode to be returned */
/* REFERENCED */

View File

@ -1960,9 +1960,9 @@ xfs_iunlink_remove(
xfs_agino_t agino;
xfs_agino_t next_agino;
xfs_buf_t *last_ibp;
xfs_dinode_t *last_dip;
xfs_dinode_t *last_dip = NULL;
short bucket_index;
int offset, last_offset;
int offset, last_offset = 0;
int error;
int agi_ok;

View File

@ -1754,11 +1754,11 @@ xlog_write(xfs_mount_t * mp,
xlog_t *log = mp->m_log;
xlog_ticket_t *ticket = (xlog_ticket_t *)tic;
xlog_op_header_t *logop_head; /* ptr to log operation header */
xlog_in_core_t *iclog; /* ptr to current in-core log */
xlog_in_core_t *iclog = NULL; /* ptr to current in-core log */
__psint_t ptr; /* copy address into data region */
int len; /* # xlog_write() bytes 2 still copy */
int index; /* region index currently copying */
int log_offset; /* offset (from 0) into data region */
int log_offset = 0; /* offset (from 0) into data region */
int start_rec_copy; /* # bytes to copy for start record */
int partial_copy; /* did we split a region? */
int partial_copy_len;/* # bytes copied if split region */

View File

@ -520,7 +520,7 @@ xlog_find_head(
{
xfs_buf_t *bp;
xfs_caddr_t offset;
xfs_daddr_t new_blk, first_blk, start_blk, last_blk, head_blk;
xfs_daddr_t new_blk, first_blk = 0, start_blk, last_blk, head_blk;
int num_scan_bblks;
uint first_half_cycle, last_half_cycle;
uint stop_on_cycle;

View File

@ -162,7 +162,7 @@ xfs_growfs_rt(
#else
# define xfs_rtallocate_extent(t,b,min,max,l,a,f,p,rb) (ENOSYS)
# define xfs_rtfree_extent(t,b,l) (ENOSYS)
# define xfs_rtpick_extent(m,t,l,rb) (ENOSYS)
# define xfs_rtpick_extent(m,t,l,rb) ((*rb = 0), ENOSYS)
# define xfs_growfs_rt(mp,in) (ENOSYS)
# define xfs_rtmount_init(m) (((mp)->m_sb.sb_rblocks == 0)? 0 : (ENOSYS))
# define xfs_rtmount_inodes(m) (((mp)->m_sb.sb_rblocks == 0)? 0 : (ENOSYS))

View File

@ -381,6 +381,8 @@ xfs_setattr(
/* boolean: are we the file owner? */
#if 0
file_owner = (current_fsuid(credp) == ip->i_d.di_uid);
#else
file_owner = (credp->cr_uid == ip->i_d.di_uid);
#endif
/*