]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix Fnatnump typos
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 28 Aug 2018 16:51:49 +0000 (09:51 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 28 Aug 2018 16:52:12 +0000 (09:52 -0700)
Problem reported by Glenn Morris in:
https://lists.gnu.org/r/emacs-devel/2018-08/msg00946.html
* src/floatfns.c (Fexpt):
* src/xselect.c (cons_to_x_long):
Don't assume Lisp_Object values are scalars.

src/floatfns.c
src/xselect.c

index 8008929be61a76d65fc176074a9a7ab59c7048c9..77e20d5640be16c7dd6cfcf8c994a3d10c2e3803 100644 (file)
@@ -210,7 +210,7 @@ DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0,
 
   /* Common Lisp spec: don't promote if both are integers, and if the
      result is not fractional.  */
-  if (INTEGERP (arg1) && Fnatnump (arg2))
+  if (INTEGERP (arg1) && !NILP (Fnatnump (arg2)))
     return expt_integer (arg1, arg2);
 
   return make_float (pow (XFLOATINT (arg1), XFLOATINT (arg2)));
index 4b28d474a0325967a1415e7180352e42b12f303f..53e788523cc12cf9e1e64148e22ab2a794795593 100644 (file)
@@ -1693,7 +1693,7 @@ static unsigned long
 cons_to_x_long (Lisp_Object obj)
 {
   if (X_ULONG_MAX <= INTMAX_MAX
-      || !Fnatnump (CONSP (obj) ? XCAR (obj) : obj))
+      || NILP (Fnatnump (CONSP (obj) ? XCAR (obj) : obj)))
     return cons_to_signed (obj, X_LONG_MIN, min (X_ULONG_MAX, INTMAX_MAX));
   else
     return cons_to_unsigned (obj, X_ULONG_MAX);