always use %lld for INT64_FORMAT (rather than %ld on __alpha__ and __sparc_v9__

and %qd on everything else), and always cast the vars to (long long).
This commit is contained in:
lukem 2001-01-05 03:21:53 +00:00
parent 7d6cc9c5e5
commit 2537f730fa
2 changed files with 10 additions and 17 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: interface.h,v 1.14 2000/08/01 17:29:48 itojun Exp $ */ /* $NetBSD: interface.h,v 1.15 2001/01/05 03:21:53 lukem Exp $ */
/* /*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@ -129,18 +129,11 @@ extern int packettype; /* as specified by -T */
#endif #endif
/* /*
* XXX This is a really ugly hack, but the preprocessor simply doesn't * All NetBSD ports support 64 bit ints.
* know whether it's running on a 32- or 64-bit machine.
*/ */
#if defined(__alpha__) || defined(__sparc_v9__) #define INT64_FORMAT "%lld"
#define INT64_FORMAT "%ld" #define U_INT64_FORMAT "%llu"
#define U_INT64_FORMAT "%lu" #define HEX_INT64_FORMAT "%llx"
#define HEX_INT64_FORMAT "%lx"
#else
#define INT64_FORMAT "%qd"
#define U_INT64_FORMAT "%qu"
#define HEX_INT64_FORMAT "%qx"
#endif
extern char *program_name; /* used to generate self-identifying messages */ extern char *program_name; /* used to generate self-identifying messages */

View File

@ -1,4 +1,4 @@
/* $NetBSD: print-nfs.c,v 1.13 2000/08/19 15:59:43 fvdl Exp $ */ /* $NetBSD: print-nfs.c,v 1.14 2001/01/05 03:21:53 lukem Exp $ */
/* /*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@ -27,7 +27,7 @@
static const char rcsid[] = static const char rcsid[] =
"@(#) Header: print-nfs.c,v 1.65 97/08/17 13:24:22 leres Exp (LBL)"; "@(#) Header: print-nfs.c,v 1.65 97/08/17 13:24:22 leres Exp (LBL)";
#else #else
__RCSID("$NetBSD: print-nfs.c,v 1.13 2000/08/19 15:59:43 fvdl Exp $"); __RCSID("$NetBSD: print-nfs.c,v 1.14 2001/01/05 03:21:53 lukem Exp $");
#endif #endif
#endif #endif
@ -147,13 +147,13 @@ static int print_int64(const u_int32_t *dp, int how)
res = ((u_int64_t)ntohl(dp[0]) << 32) | (u_int64_t)ntohl(dp[1]); res = ((u_int64_t)ntohl(dp[0]) << 32) | (u_int64_t)ntohl(dp[1]);
switch (how) { switch (how) {
case SIGNED: case SIGNED:
printf(INT64_FORMAT, res); printf(INT64_FORMAT, (long long)res);
break; break;
case UNSIGNED: case UNSIGNED:
printf(U_INT64_FORMAT, res); printf(U_INT64_FORMAT, (long long)res);
break; break;
case HEX: case HEX:
printf(HEX_INT64_FORMAT, res); printf(HEX_INT64_FORMAT, (long long)res);
break; break;
default: default:
return (0); return (0);