From 5264ab83366a5a2825e3f6a8eb4e66736b61b40d Mon Sep 17 00:00:00 2001 From: Christof Hanke Date: Mon, 22 Nov 2010 08:39:11 +0100 Subject: [PATCH] use intptr_t instead of ifdef Remove another ifdef AFS_64BITUSERPOINTER_ENV from the code. Change-Id: I1b932b892b39b824ba6ef521f0621fd3e7a51c74 Reviewed-on: http://gerrit.openafs.org/3343 Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman Tested-by: BuildBot --- src/util/snprintf.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/util/snprintf.c b/src/util/snprintf.c index 69507e9..200f125 100644 --- a/src/util/snprintf.c +++ b/src/util/snprintf.c @@ -43,6 +43,9 @@ #include #include #include +#ifdef HAVE_STDINT_H +#include +#endif #ifndef AFS_NT40_ENV #include #include @@ -88,7 +91,7 @@ * of 100 digits. * * - The 'p' specifier for printing pointers is implemented using - * compile time knowledge. (AFS_64BITUSERPOINTER_ENV) + * intptr_t (C99-standard). * * - Floating-point specifier (%e, %f, %g) are implemented by * calling the standard sprintf, and thus may be unsafe. @@ -707,11 +710,7 @@ xyzprintf (struct snprintf_state *state, const char *char_format, va_list ap) break; } case 'p' : { -#ifdef AFS_64BITUSERPOINTER_ENV - afs_uint64 arg = (afs_uint64)va_arg(ap, void*); -#else - afs_uint64 arg = (unsigned long)va_arg(ap, void*); -#endif + afs_uint64 arg = (intptr_t)va_arg(ap, void*); len += append_number (state, arg, 0x10, "0123456789ABCDEF", width, prec, flags, 0); break; -- 1.9.4