From 16e790da5ad193ae538d181d71a2a1b14709d296 Mon Sep 17 00:00:00 2001 From: John Birrell Date: Sat, 17 Nov 2007 23:14:06 +0000 Subject: [PATCH] Use uintptr_t to cast a pointer to an integer to avoid compiler warnings on processors where sizeof(void *) > sizeof(int). --- usr.sbin/ppp/chap.h | 2 +- usr.sbin/ppp/physical.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/ppp/chap.h b/usr.sbin/ppp/chap.h index 617555d82d44..08c6865ca963 100644 --- a/usr.sbin/ppp/chap.h +++ b/usr.sbin/ppp/chap.h @@ -61,7 +61,7 @@ struct chap { #define descriptor2chap(d) \ ((d)->type == CHAP_DESCRIPTOR ? (struct chap *)(d) : NULL) #define auth2chap(a) \ - ((struct chap *)((char *)a - (int)&((struct chap *)0)->auth)) + ((struct chap *)((char *)a - (uintptr_t)&((struct chap *)0)->auth)) struct MSCHAPv2_resp { /* rfc2759 */ char PeerChallenge[16]; diff --git a/usr.sbin/ppp/physical.h b/usr.sbin/ppp/physical.h index f16e1a16139a..ab0cdba81a2a 100644 --- a/usr.sbin/ppp/physical.h +++ b/usr.sbin/ppp/physical.h @@ -116,7 +116,7 @@ struct physical { }; #define field2phys(fp, name) \ - ((struct physical *)((char *)fp - (int)(&((struct physical *)0)->name))) + ((struct physical *)((char *)fp - (uintptr_t)(&((struct physical *)0)->name))) #define link2physical(l) \ ((l)->type == PHYSICAL_LINK ? field2phys(l, link) : NULL)