aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2018-08-28 09:51:49 -0700
committerPaul Eggert2018-08-28 09:52:12 -0700
commit5cb057a854a848be85dc2b81f6497964f5a93dbb (patch)
treea140c670a5a1b91eb3191eb55ca2fc1cca5039f6 /src
parentc39ca701d3ffa3a7fcb987170436ad441e8f8ad6 (diff)
downloademacs-5cb057a854a848be85dc2b81f6497964f5a93dbb.tar.gz
emacs-5cb057a854a848be85dc2b81f6497964f5a93dbb.zip
Fix Fnatnump typos
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.
Diffstat (limited to 'src')
-rw-r--r--src/floatfns.c2
-rw-r--r--src/xselect.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/floatfns.c b/src/floatfns.c
index 8008929be61..77e20d5640b 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -210,7 +210,7 @@ DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0,
210 210
211 /* Common Lisp spec: don't promote if both are integers, and if the 211 /* Common Lisp spec: don't promote if both are integers, and if the
212 result is not fractional. */ 212 result is not fractional. */
213 if (INTEGERP (arg1) && Fnatnump (arg2)) 213 if (INTEGERP (arg1) && !NILP (Fnatnump (arg2)))
214 return expt_integer (arg1, arg2); 214 return expt_integer (arg1, arg2);
215 215
216 return make_float (pow (XFLOATINT (arg1), XFLOATINT (arg2))); 216 return make_float (pow (XFLOATINT (arg1), XFLOATINT (arg2)));
diff --git a/src/xselect.c b/src/xselect.c
index 4b28d474a03..53e788523cc 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1693,7 +1693,7 @@ static unsigned long
1693cons_to_x_long (Lisp_Object obj) 1693cons_to_x_long (Lisp_Object obj)
1694{ 1694{
1695 if (X_ULONG_MAX <= INTMAX_MAX 1695 if (X_ULONG_MAX <= INTMAX_MAX
1696 || !Fnatnump (CONSP (obj) ? XCAR (obj) : obj)) 1696 || NILP (Fnatnump (CONSP (obj) ? XCAR (obj) : obj)))
1697 return cons_to_signed (obj, X_LONG_MIN, min (X_ULONG_MAX, INTMAX_MAX)); 1697 return cons_to_signed (obj, X_LONG_MIN, min (X_ULONG_MAX, INTMAX_MAX));
1698 else 1698 else
1699 return cons_to_unsigned (obj, X_ULONG_MAX); 1699 return cons_to_unsigned (obj, X_ULONG_MAX);