Cast pointers to [u]intptr_t instead of to [unsigned] long.

This commit is contained in:
Bruce Evans 1998-07-15 04:17:55 +00:00
parent 4b81ec76d1
commit 15c7382561
6 changed files with 15 additions and 14 deletions

View file

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)union_subr.c 8.20 (Berkeley) 5/20/95
* $Id: union_subr.c,v 1.29 1998/02/26 03:23:54 kato Exp $
* $Id: union_subr.c,v 1.30 1998/05/07 04:58:36 msmith Exp $
*/
#include <sys/param.h>
@ -61,7 +61,7 @@ extern int union_init __P((void));
/* unsigned int ... */
#define UNION_HASH(u, l) \
(((((unsigned long) (u)) + ((unsigned long) l)) >> 8) & (NHASH-1))
(((((uintptr_t) (u)) + ((uintptr_t) l)) >> 8) & (NHASH-1))
static LIST_HEAD(unhead, union_node) unhead[NHASH];
static int unvplock[NHASH];

View file

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)union_subr.c 8.20 (Berkeley) 5/20/95
* $Id: union_subr.c,v 1.29 1998/02/26 03:23:54 kato Exp $
* $Id: union_subr.c,v 1.30 1998/05/07 04:58:36 msmith Exp $
*/
#include <sys/param.h>
@ -61,7 +61,7 @@ extern int union_init __P((void));
/* unsigned int ... */
#define UNION_HASH(u, l) \
(((((unsigned long) (u)) + ((unsigned long) l)) >> 8) & (NHASH-1))
(((((uintptr_t) (u)) + ((uintptr_t) l)) >> 8) & (NHASH-1))
static LIST_HEAD(unhead, union_node) unhead[NHASH];
static int unvplock[NHASH];

View file

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)buf.h 8.9 (Berkeley) 3/30/95
* $Id: buf.h,v 1.51 1998/05/06 01:44:12 gibbs Exp $
* $Id: buf.h,v 1.52 1998/05/13 16:03:33 gibbs Exp $
*/
#ifndef _SYS_BUF_H_
@ -226,7 +226,7 @@ bufq_first(buf_queue_head *head)
* buffer hash table calculation, originally by David Greenman
*/
#define BUFHASH(vnp, bn) \
(&bufhashtbl[(((unsigned long)(vnp) >> 7)+(int)(bn)) % BUFHSZ])
(&bufhashtbl[(((uintptr_t)(vnp) >> 7)+(int)(bn)) % BUFHSZ])
/*
* Definitions for the buffer free lists.

View file

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)buf.h 8.9 (Berkeley) 3/30/95
* $Id: buf.h,v 1.51 1998/05/06 01:44:12 gibbs Exp $
* $Id: buf.h,v 1.52 1998/05/13 16:03:33 gibbs Exp $
*/
#ifndef _SYS_BUF_H_
@ -226,7 +226,7 @@ bufq_first(buf_queue_head *head)
* buffer hash table calculation, originally by David Greenman
*/
#define BUFHASH(vnp, bn) \
(&bufhashtbl[(((unsigned long)(vnp) >> 7)+(int)(bn)) % BUFHSZ])
(&bufhashtbl[(((uintptr_t)(vnp) >> 7)+(int)(bn)) % BUFHSZ])
/*
* Definitions for the buffer free lists.

View file

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)mbuf.h 8.5 (Berkeley) 2/19/95
* $Id: mbuf.h,v 1.25 1997/10/12 20:26:00 phk Exp $
* $Id: mbuf.h,v 1.26 1997/12/28 01:04:47 bde Exp $
*/
#ifndef _SYS_MBUF_H_
@ -59,9 +59,10 @@
* cltom(x) - convert cluster # to ptr to beginning of cluster
*/
#define mtod(m,t) ((t)((m)->m_data))
#define dtom(x) ((struct mbuf *)((long)(x) & ~(MSIZE-1)))
#define mtocl(x) (((u_long)(x) - (u_long)mbutl) >> MCLSHIFT)
#define cltom(x) ((caddr_t)((u_long)mbutl + ((u_long)(x) << MCLSHIFT)))
#define dtom(x) ((struct mbuf *)((intptr_t)(x) & ~(MSIZE-1)))
#define mtocl(x) (((uintptr_t)(x) - (uintptr_t)mbutl) >> MCLSHIFT)
#define cltom(x) ((caddr_t)((uintptr_t)mbutl + \
((uintptr_t)(x) << MCLSHIFT)))
/* header at beginning of each mbuf: */
struct m_hdr {

View file

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)vm_page.c 7.4 (Berkeley) 5/7/91
* $Id: vm_page.c,v 1.102 1998/06/21 18:02:48 bde Exp $
* $Id: vm_page.c,v 1.103 1998/07/11 07:46:14 bde Exp $
*/
/*
@ -358,7 +358,7 @@ vm_page_hash(object, pindex)
vm_object_t object;
vm_pindex_t pindex;
{
return ((((unsigned long) object) >> 5) + (pindex >> 1)) & vm_page_hash_mask;
return ((((uintptr_t) object) >> 5) + (pindex >> 1)) & vm_page_hash_mask;
}
/*