From 5cb057a854a848be85dc2b81f6497964f5a93dbb Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 28 Aug 2018 09:51:49 -0700 Subject: [PATCH] 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. --- src/floatfns.c | 2 +- src/xselect.c | 2 +- 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, /* 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))); 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 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); -- 2.39.5