Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/ffs Cast pointers first to uintptr_t before casting ...



details:   https://anonhg.NetBSD.org/src/rev/84ea86817055
branches:  trunk
changeset: 533617:84ea86817055
user:      scw <scw%NetBSD.org@localhost>
date:      Fri Jul 05 13:49:26 2002 +0000

description:
Cast pointers first to uintptr_t before casting to register_t.
On SH-5, sizeof(register_t) is always 8, even if sizeof(void *) is 4
as is the case when compiling for ILP32.

diffstat:

 sys/ufs/ffs/ffs_softdep.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (47 lines):

diff -r d884f956d0bc -r 84ea86817055 sys/ufs/ffs/ffs_softdep.c
--- a/sys/ufs/ffs/ffs_softdep.c Fri Jul 05 13:40:10 2002 +0000
+++ b/sys/ufs/ffs/ffs_softdep.c Fri Jul 05 13:49:26 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs_softdep.c,v 1.32 2002/06/18 20:24:31 jdolecek Exp $        */
+/*     $NetBSD: ffs_softdep.c,v 1.33 2002/07/05 13:49:26 scw Exp $     */
 
 /*
  * Copyright 1998 Marshall Kirk McKusick. All Rights Reserved.
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_softdep.c,v 1.32 2002/06/18 20:24:31 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_softdep.c,v 1.33 2002/07/05 13:49:26 scw Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -848,7 +848,8 @@
 LIST_HEAD(pagedep_hashhead, pagedep) *pagedep_hashtbl;
 u_long pagedep_hash;           /* size of hash table - 1 */
 #define        PAGEDEP_HASH(mp, inum, lbn) \
-       (((((register_t)(mp)) >> 13) + (inum) + (lbn)) & pagedep_hash)
+       (((((register_t)(uintptr_t)(mp)) >> 13) + \
+           (inum) + (lbn)) & pagedep_hash)
 static struct sema pagedep_in_progress;
 
 /*
@@ -922,7 +923,7 @@
 static u_long  inodedep_hash;  /* size of hash table - 1 */
 static long    num_inodedep;   /* number of inodedep allocated */
 #define        INODEDEP_HASH(fs, inum) \
-       (((((register_t)(fs)) >> 13) + (inum)) & inodedep_hash)
+       (((((register_t)(uintptr_t)(fs)) >> 13) + (inum)) & inodedep_hash)
 static struct sema inodedep_in_progress;
 
 /*
@@ -1001,7 +1002,8 @@
 LIST_HEAD(newblk_hashhead, newblk) *newblk_hashtbl;
 u_long newblk_hash;            /* size of hash table - 1 */
 #define        NEWBLK_HASH(fs, inum) \
-       (&newblk_hashtbl[((((register_t)(fs)) >> 13) + (inum)) & newblk_hash])
+       (&newblk_hashtbl[((((register_t)(uintptr_t)(fs)) >> 13) + \
+           (inum)) & newblk_hash])
 static struct sema newblk_in_progress;
 
 /*



Home | Main Index | Thread Index | Old Index