Commit a1cd8c96 authored by Paul Eggert's avatar Paul Eggert
Browse files

Prefer NUMBERP to spelling it out

* src/editfns.c (styled_format):
* src/frame.h (NUMVAL):
* src/image.c (parse_image_spec):
* src/lisp.h (CHECK_NUMBER_OR_FLOAT)
(CHECK_NUMBER_OR_FLOAT_COERCE_MARKER):
* src/process.c (Fsignal_process):
* src/xdisp.c (calc_pixel_width_or_height, on_hot_spot_p):
* src/xfaces.c (check_lface_attrs):
* src/xselect.c (x_fill_property_data, x_send_client_event):
Use NUMBERP rather than INTEGERP || FLOATP.
parent b0030269
......@@ -4154,7 +4154,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
|| conversion == 'X'))
error ("Invalid format operation %%%c",
STRING_CHAR ((unsigned char *) format - 1));
else if (! (INTEGERP (args[n]) || FLOATP (args[n])))
else if (! NUMBERP (args[n]))
error ("Format specifier doesn't match argument type");
else
{
......
......@@ -618,7 +618,7 @@ fset_desired_tool_bar_string (struct frame *f, Lisp_Object val)
}
#endif /* HAVE_WINDOW_SYSTEM && !USE_GTK && !HAVE_NS */
#define NUMVAL(X) ((INTEGERP (X) || FLOATP (X)) ? XFLOATINT (X) : -1)
#define NUMVAL(X) (NUMBERP (X) ? XFLOATINT (X) : -1)
INLINE double
default_pixels_per_inch_x (void)
......
......@@ -797,7 +797,7 @@ parse_image_spec (Lisp_Object spec, struct image_keyword *keywords,
return 0;
case IMAGE_NUMBER_VALUE:
if (!INTEGERP (value) && !FLOATP (value))
if (! NUMBERP (value))
return 0;
break;
......
......@@ -2736,7 +2736,7 @@ XFLOATINT (Lisp_Object n)
INLINE void
CHECK_NUMBER_OR_FLOAT (Lisp_Object x)
{
CHECK_TYPE (FLOATP (x) || INTEGERP (x), Qnumberp, x);
CHECK_TYPE (NUMBERP (x), Qnumberp, x);
}
#define CHECK_NUMBER_OR_FLOAT_COERCE_MARKER(x) \
......@@ -2744,7 +2744,7 @@ CHECK_NUMBER_OR_FLOAT (Lisp_Object x)
if (MARKERP (x)) \
XSETFASTINT (x, marker_position (x)); \
else \
CHECK_TYPE (INTEGERP (x) || FLOATP (x), Qnumber_or_marker_p, x); \
CHECK_TYPE (NUMBERP (x), Qnumber_or_marker_p, x); \
} while (false)
/* Since we can't assign directly to the CAR or CDR fields of a cons
......
......@@ -6269,7 +6269,7 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */)
{
Lisp_Object process_number
= string_to_number (SSDATA (process), 10, 1);
if (INTEGERP (process_number) || FLOATP (process_number))
if (NUMBERP (process_number))
tem = process_number;
}
process = tem;
......
......@@ -24063,7 +24063,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop,
prop = Qnil;
}
 
if (INTEGERP (prop) || FLOATP (prop))
if (NUMBERP (prop))
{
int base_unit = (width_p
? FRAME_COLUMN_WIDTH (it->f)
......@@ -24115,7 +24115,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop,
car = Qnil;
}
 
if (INTEGERP (car) || FLOATP (car))
if (NUMBERP (car))
{
double fact;
pixels = XFLOATINT (car);
......@@ -29062,7 +29062,7 @@ on_hot_spot_p (Lisp_Object hot_spot, int x, int y)
Lisp_Object lr, lx0, ly0;
if (CONSP (circ)
&& CONSP (XCAR (circ))
&& (lr = XCDR (circ), INTEGERP (lr) || FLOATP (lr))
&& (lr = XCDR (circ), NUMBERP (lr))
&& (lx0 = XCAR (XCAR (circ)), INTEGERP (lx0))
&& (ly0 = XCDR (XCAR (circ)), INTEGERP (ly0)))
{
......
......@@ -1669,8 +1669,7 @@ check_lface_attrs (Lisp_Object attrs[LFACE_VECTOR_SIZE])
|| SYMBOLP (attrs[LFACE_SWIDTH_INDEX]));
eassert (UNSPECIFIEDP (attrs[LFACE_HEIGHT_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_HEIGHT_INDEX])
|| INTEGERP (attrs[LFACE_HEIGHT_INDEX])
|| FLOATP (attrs[LFACE_HEIGHT_INDEX])
|| NUMBERP (attrs[LFACE_HEIGHT_INDEX])
|| FUNCTIONP (attrs[LFACE_HEIGHT_INDEX]));
eassert (UNSPECIFIEDP (attrs[LFACE_WEIGHT_INDEX])
|| IGNORE_DEFFACE_P (attrs[LFACE_WEIGHT_INDEX])
......
......@@ -2271,7 +2271,7 @@ x_fill_property_data (Display *dpy, Lisp_Object data, void *ret, int format)
{
Lisp_Object o = XCAR (iter);
if (INTEGERP (o) || FLOATP (o) || CONSP (o))
if (NUMBERP (o) || CONSP (o))
{
if (CONSP (o)
&& RANGED_INTEGERP (X_LONG_MIN >> 16, XCAR (o), X_LONG_MAX >> 16)
......@@ -2547,7 +2547,7 @@ x_send_client_event (Lisp_Object display, Lisp_Object dest, Lisp_Object from,
else
error ("DEST as a string must be one of PointerWindow or InputFocus");
}
else if (INTEGERP (dest) || FLOATP (dest) || CONSP (dest))
else if (NUMBERP (dest) || CONSP (dest))
CONS_TO_INTEGER (dest, Window, wdest);
else
error ("DEST must be a frame, nil, string, number or cons");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment