Module Name: src
Committed By: christos
Date: Thu Jan 12 18:40:02 UTC 2017
Modified Files:
src/sys/ufs/lfs: lfs_accessors.h
Log Message:
fix sign confusion
To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/ufs/lfs/lfs_accessors.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/ufs/lfs/lfs_accessors.h
diff -u src/sys/ufs/lfs/lfs_accessors.h:1.46 src/sys/ufs/lfs/lfs_accessors.h:1.47
--- src/sys/ufs/lfs/lfs_accessors.h:1.46 Sun Jun 19 23:25:46 2016
+++ src/sys/ufs/lfs/lfs_accessors.h Thu Jan 12 13:40:02 2017
@@ -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 @@ lfs_dino_getdb(STRUCT_LFS *fs, union lfs
{
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 @@ lfs_dino_getib(STRUCT_LFS *fs, union lfs
{
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 @@ lfs_dino_setdb(STRUCT_LFS *fs, union lfs
{
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 @@ lfs_dino_setib(STRUCT_LFS *fs, union lfs
{
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);
}