Use uintptr_t to cast a pointer to an integer to avoid compiler warnings

on processors where sizeof(void *) > sizeof(int).
This commit is contained in:
John Birrell 2007-11-17 23:14:06 +00:00
parent 242ef17d6d
commit 16e790da5a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=173710
2 changed files with 2 additions and 2 deletions

View File

@ -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];

View File

@ -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)