]> git.eshelyaron.com Git - emacs.git/commitdiff
Use mpz_sgn rather than comparisons against 0
authorTom Tromey <tom@tromey.com>
Thu, 9 Aug 2018 19:21:45 +0000 (13:21 -0600)
committerTom Tromey <tom@tromey.com>
Thu, 9 Aug 2018 19:28:37 +0000 (13:28 -0600)
* src/data.c (Fmod): Use mpz_sgn.
* src/lisp.h (NATNUMP): Use mpz_sgn.

src/data.c
src/lisp.h

index 6512e7e67068e3f811e130e1b59e090d2e75037e..7d701fde0e2e89be185bed8eb558e76574d47a2e 100644 (file)
@@ -3251,8 +3251,8 @@ Both X and Y must be numbers or markers.  */)
       mpz_mod (result, *xmp, *ymp);
 
       /* Fix the sign if needed.  */
-      cmpr = mpz_cmp_si (result, 0);
-      cmpy = mpz_cmp_si (*ymp, 0);
+      cmpr = mpz_sgn (result);
+      cmpy = mpz_sgn (*ymp);
       if (cmpy < 0 ? cmpr > 0 : cmpr < 0)
        mpz_add (result, result, *ymp);
 
index 9047d217249207b0e1adcbcf03a4930ee1ee229d..6726d69fced3831fc369a4fdbb957f89132a1d7f 100644 (file)
@@ -2772,7 +2772,7 @@ INLINE bool
 NATNUMP (Lisp_Object x)
 {
   if (BIGNUMP (x))
-    return mpz_cmp_si (XBIGNUM (x)->value, 0) >= 0;
+    return mpz_sgn (XBIGNUM (x)->value) >= 0;
   return FIXNUMP (x) && 0 <= XFIXNUM (x);
 }
 INLINE bool