summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Bodrato <bodrato@mail.dm.unipi.it>2013-01-26 10:50:29 +0100
committerMarco Bodrato <bodrato@mail.dm.unipi.it>2013-01-26 10:50:29 +0100
commit5e894fd309b9aed9cd2c27344f0bcc994a3eccdd (patch)
tree9993a571ab29cfc1480833e0b1b9b17056261ecd
parentb562a43f552c5260313876171420b7c73d45db13 (diff)
downloadgmp-5e894fd309b9aed9cd2c27344f0bcc994a3eccdd.tar.gz
mpz/cmp_si.c: Use ABS_CAST.
-rw-r--r--mpz/cmp_si.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mpz/cmp_si.c b/mpz/cmp_si.c
index 699a77e37..9feac962d 100644
--- a/mpz/cmp_si.c
+++ b/mpz/cmp_si.c
@@ -1,8 +1,8 @@
/* mpz_cmp_si(u,v) -- Compare an integer U with a single-word int V.
Return positive, zero, or negative based on if U > V, U == V, or U < V.
-Copyright 1991, 1993, 1994, 1995, 1996, 2000, 2001, 2002, 2012 Free Software
-Foundation, Inc.
+Copyright 1991, 1993, 1994, 1995, 1996, 2000, 2001, 2002, 2012, 2013 Free
+Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -28,7 +28,7 @@ _mpz_cmp_si (mpz_srcptr u, signed long int v_digit) __GMP_NOTHROW
mp_size_t usize = SIZ (u);
mp_size_t vsize;
mp_limb_t u_digit;
- unsigned long int absv_digit = (unsigned long int) v_digit;
+ unsigned long int absv_digit;
#if GMP_NAIL_BITS != 0
/* FIXME. This isn't very pretty. */
@@ -46,8 +46,8 @@ _mpz_cmp_si (mpz_srcptr u, signed long int v_digit) __GMP_NOTHROW
else if (v_digit < 0)
{
vsize = -1;
- absv_digit = -absv_digit;
}
+ absv_digit = ABS_CAST (unsigned long int, v_digit);
if (usize != vsize)
return usize - vsize;