From: Dmitry V. Levin Date: Wed, 21 Dec 2016 00:26:06 +0000 (+0000) Subject: ioctl: use uintptr_t for casts between 32-bit integers and pointers X-Git-Tag: v4.16~306 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c30f689384594dc78e701efd32ce60a39caaca10;p=strace ioctl: use uintptr_t for casts between 32-bit integers and pointers * ioctl.c (compare): Cast pointer to uintptr_t before assigning it to an integer. (ioctl_lookup): Cast integer to uintptr_t before passing it as a pointer. --- diff --git a/ioctl.c b/ioctl.c index e4fd59cb..126513fc 100644 --- a/ioctl.c +++ b/ioctl.c @@ -42,7 +42,7 @@ static int compare(const void *a, const void *b) { - const unsigned int code1 = (const unsigned long) a; + const unsigned int code1 = (const uintptr_t) a; const unsigned int code2 = ((struct_ioctlent *) b)->code; return (code1 > code2) ? 1 : (code1 < code2) ? -1 : 0; } @@ -52,7 +52,7 @@ ioctl_lookup(const unsigned int code) { struct_ioctlent *iop; - iop = bsearch((const void *) (const unsigned long) code, ioctlent, + iop = bsearch((const void *) (const uintptr_t) code, ioctlent, nioctlents, sizeof(ioctlent[0]), compare); while (iop > ioctlent) { iop--;