[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master b82df00 2/2: * data.c (minmax_driver): Use CHECK_NU
From: |
Andreas Schwab |
Subject: |
[Emacs-diffs] master b82df00 2/2: * data.c (minmax_driver): Use CHECK_NUMBER_OR_FLOAT_COERCE_MARKER. |
Date: |
Wed, 8 Mar 2017 03:46:01 -0500 (EST) |
branch: master
commit b82df00445725211d868a67cae1869d2f95270b6
Author: Andreas Schwab <address@hidden>
Commit: Andreas Schwab <address@hidden>
* data.c (minmax_driver): Use CHECK_NUMBER_OR_FLOAT_COERCE_MARKER.
(Fmax, Fmin): Restore documentation.
---
src/data.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/data.c b/src/data.c
index b3234a7..997a41b 100644
--- a/src/data.c
+++ b/src/data.c
@@ -2969,16 +2969,18 @@ minmax_driver (ptrdiff_t nargs, Lisp_Object *args,
for (ptrdiff_t argnum = 0; argnum < nargs; argnum++)
{
Lisp_Object val = args[argnum];
+ CHECK_NUMBER_OR_FLOAT_COERCE_MARKER (val);
if (argnum == 0 || !NILP (arithcompare (val, accum, comparison)))
accum = val;
else if (FLOATP (accum) && isnan (XFLOAT_DATA (accum)))
return accum;
}
- return MARKERP (accum) ? make_number (marker_position (accum)) : accum;
+ return accum;
}
DEFUN ("max", Fmax, Smax, 1, MANY, 0,
doc: /* Return largest of all the arguments (which must be numbers or
markers).
+The value is always a number; markers are converted to numbers.
usage: (max NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */)
(ptrdiff_t nargs, Lisp_Object *args)
{
@@ -2987,6 +2989,7 @@ usage: (max NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS)
*/)
DEFUN ("min", Fmin, Smin, 1, MANY, 0,
doc: /* Return smallest of all the arguments (which must be numbers or
markers).
+The value is always a number; markers are converted to numbers.
usage: (min NUMBER-OR-MARKER &rest NUMBERS-OR-MARKERS) */)
(ptrdiff_t nargs, Lisp_Object *args)
{