Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/lfs fix sign confusion



details:   https://anonhg.NetBSD.org/src/rev/8d56856bc1ae
branches:  trunk
changeset: 820628:8d56856bc1ae
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jan 12 18:40:02 2017 +0000

description:
fix sign confusion

diffstat:

 sys/ufs/lfs/lfs_accessors.h |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (53 lines):

diff -r 219e6eb23f44 -r 8d56856bc1ae sys/ufs/lfs/lfs_accessors.h
--- a/sys/ufs/lfs/lfs_accessors.h       Thu Jan 12 18:37:09 2017 +0000
+++ b/sys/ufs/lfs/lfs_accessors.h       Thu Jan 12 18:40:02 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_accessors.h,v 1.46 2016/06/20 03:25:46 dholland Exp $      */
+/*     $NetBSD: lfs_accessors.h,v 1.47 2017/01/12 18:40:02 christos Exp $      */
 
 /*  from NetBSD: lfs.h,v 1.165 2015/07/24 06:59:32 dholland Exp  */
 /*  from NetBSD: dinode.h,v 1.25 2016/01/22 23:06:10 dholland Exp  */
@@ -504,10 +504,10 @@
 {
        KASSERT(ix < ULFS_NDADDR);
        if (fs->lfs_is64) {
-               return LFS_SWAP_uint64_t(fs, dip->u_64.di_db[ix]);
+               return LFS_SWAP_int64_t(fs, dip->u_64.di_db[ix]);
        } else {
                /* note: this must sign-extend or UNWRITTEN gets trashed */
-               return (int32_t)LFS_SWAP_uint32_t(fs, dip->u_32.di_db[ix]);
+               return (int32_t)LFS_SWAP_int32_t(fs, dip->u_32.di_db[ix]);
        }
 }
 
@@ -516,10 +516,10 @@
 {
        KASSERT(ix < ULFS_NIADDR);
        if (fs->lfs_is64) {
-               return LFS_SWAP_uint64_t(fs, dip->u_64.di_ib[ix]);
+               return LFS_SWAP_int64_t(fs, dip->u_64.di_ib[ix]);
        } else {
                /* note: this must sign-extend or UNWRITTEN gets trashed */
-               return (int32_t)LFS_SWAP_uint32_t(fs, dip->u_32.di_ib[ix]);
+               return (int32_t)LFS_SWAP_int32_t(fs, dip->u_32.di_ib[ix]);
        }
 }
 
@@ -528,7 +528,7 @@
 {
        KASSERT(ix < ULFS_NDADDR);
        if (fs->lfs_is64) {
-               dip->u_64.di_db[ix] = LFS_SWAP_uint64_t(fs, val);
+               dip->u_64.di_db[ix] = LFS_SWAP_int64_t(fs, val);
        } else {
                dip->u_32.di_db[ix] = LFS_SWAP_uint32_t(fs, val);
        }
@@ -539,7 +539,7 @@
 {
        KASSERT(ix < ULFS_NIADDR);
        if (fs->lfs_is64) {
-               dip->u_64.di_ib[ix] = LFS_SWAP_uint64_t(fs, val);
+               dip->u_64.di_ib[ix] = LFS_SWAP_int64_t(fs, val);
        } else {
                dip->u_32.di_ib[ix] = LFS_SWAP_uint32_t(fs, val);
        }



Home | Main Index | Thread Index | Old Index