Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/ufs/ufs



In article <20040227001936.7E5522DA1D%cvs.netbsd.org@localhost>
uwe%netbsd.org@localhost wrote:

> Module Name:  src
> Committed By: uwe
> Date:         Fri Feb 27 00:19:36 UTC 2004
> 
> Modified Files:
>       src/sys/ufs/ufs: ufs_bmap.c
> 
> Log Message:
> Shut up gcc3 warning that `metalbn' might be used uninitialized.
> XXX: The warning is bogus and only triggered on sh3.

Isn't it better to use abs()?

---
Index: ufs_bmap.c
===================================================================
RCS file: /cvsroot/src/sys/ufs/ufs/ufs_bmap.c,v
retrieving revision 1.28
diff -u -r1.28 ufs_bmap.c
--- ufs_bmap.c  27 Feb 2004 00:19:36 -0000      1.28
+++ ufs_bmap.c  28 Feb 2004 16:57:23 -0000
@@ -341,11 +341,7 @@
        }
 
        /* 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 = -(abs(realbn) - bn + NIADDR - i);
 
        /* 
         * At each iteration, off is the offset into the bap array which is
---
Izumi Tsutsui
tsutsui%ceres.dti.ne.jp@localhost



Home | Main Index | Thread Index | Old Index