summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>1999-04-16 00:15:12 +0000
committerwtc%netscape.com <devnull@localhost>1999-04-16 00:15:12 +0000
commit94e023f144bd05bf49ab045aeec1619dc2ee1c3e (patch)
tree7cf18206cb8b052fdf1ff8d7e0fdfee2659157b1
parent65beccfb137e745641a0c6101e26971a5f3a4e17 (diff)
downloadnspr-hg-94e023f144bd05bf49ab045aeec1619dc2ee1c3e.tar.gz
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.
-rw-r--r--pr/src/io/prscanf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/pr/src/io/prscanf.c b/pr/src/io/prscanf.c
index 8a29af35..66bdd0d7 100644
--- a/pr/src/io/prscanf.c
+++ b/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) {