From 5f9abe1e5ce689a53acc3f68689fc7703b5b9833 Mon Sep 17 00:00:00 2001 From: "wtc%netscape.com" Date: Fri, 16 Apr 1999 00:15:12 +0000 Subject: [PATCH] Bugzilla bug #146: cast unsigned to signed type before applying the unary minus operator to get rid of a compiler warning. Thanks to rick@rixsoft.com for the bug report. git-svn-id: svn://10.0.0.236/trunk@27762 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/nsprpub/pr/src/io/prscanf.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mozilla/nsprpub/pr/src/io/prscanf.c b/mozilla/nsprpub/pr/src/io/prscanf.c index 8a29af356b7..66bdd0d757f 100644 --- a/mozilla/nsprpub/pr/src/io/prscanf.c +++ b/mozilla/nsprpub/pr/src/io/prscanf.c @@ -184,7 +184,12 @@ _pr_strtoull(const char *str, char **endptr, int base) } if (negative) { +#ifdef HAVE_LONG_LONG + /* The cast to a signed type is to avoid a compiler warning */ + x = -(PRInt64)x; +#else LL_NEG(x, x); +#endif } if (endptr) {