From 107ab090e23dfc517bc74bb553315cd3528e1f7d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 17 Apr 2008 14:47:07 +0200 Subject: use uintptr_t instead of intptr_t where appropriate (This used to be commit d62f2bcc85c13605c133db250e0a86d2d6ccc481) --- source4/lib/replace/libreplace_cc.m4 | 3 ++- source4/lib/replace/replace.c | 2 +- source4/lib/replace/replace.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'source4/lib/replace') diff --git a/source4/lib/replace/libreplace_cc.m4 b/source4/lib/replace/libreplace_cc.m4 index bf5056838d..0ce0958a96 100644 --- a/source4/lib/replace/libreplace_cc.m4 +++ b/source4/lib/replace/libreplace_cc.m4 @@ -132,7 +132,8 @@ AC_CHECK_SIZEOF(off_t) AC_CHECK_SIZEOF(size_t) AC_CHECK_SIZEOF(ssize_t) -AC_CHECK_TYPE(intptr_t, unsigned long long) +AC_CHECK_TYPE(intptr_t, long long) +AC_CHECK_TYPE(uintptr_t, unsigned long long) AC_CHECK_TYPE(ptrdiff_t, unsigned long long) if test x"$ac_cv_type_long_long" != x"yes";then diff --git a/source4/lib/replace/replace.c b/source4/lib/replace/replace.c index 6930f9b079..443da2ab24 100644 --- a/source4/lib/replace/replace.c +++ b/source4/lib/replace/replace.c @@ -458,7 +458,7 @@ char *rep_strcasestr(const char *haystack, const char *needle) for (s=haystack;*s;s++) { if (toupper(*needle) == toupper(*s) && strncasecmp(s, needle, nlen) == 0) { - return (char *)((intptr_t)s); + return (char *)((uintptr_t)s); } } return NULL; diff --git a/source4/lib/replace/replace.h b/source4/lib/replace/replace.h index 5fe79394eb..bf95169352 100644 --- a/source4/lib/replace/replace.h +++ b/source4/lib/replace/replace.h @@ -499,7 +499,7 @@ typedef int bool; Also, please call this via the discard_const_p() macro interface, as that makes the return type safe. */ -#define discard_const(ptr) ((void *)((intptr_t)(ptr))) +#define discard_const(ptr) ((void *)((uintptr_t)(ptr))) /** Type-safe version of discard_const */ #define discard_const_p(type, ptr) ((type *)discard_const(ptr)) -- cgit