From 56aaaf9bbaf9772ea714b16aa7ed2a9693ac92e3 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 2 Mar 2017 13:48:47 -0800 Subject: Restore XFLOATINT but with restricted args Turn instances of extract_float into XFLOAT_DATA when possible, and to a resurrected XFLOATINT when the arg is a number. The resurrected XFLOATINT is more like XFLOAT and XINT in that is valid only if its arg is a number. This clarifies the ways in which floats can be extracted at the C level. * src/editfns.c (styled_format): * src/floatfns.c (extract_float, Fexpt): Use XFLOATINT rather than open-coding it. * src/fns.c (internal_equal): * src/image.c (imagemagick_load_image): * src/xdisp.c (resize_mini_window): Prefer XFLOAT_DATA to extract_float on values known to be floats. * src/frame.c (x_set_screen_gamma): * src/frame.h (NUMVAL): * src/image.c (x_edge_detection, compute_image_size): * src/lread.c (read_filtered_event): * src/window.c (Fset_window_vscroll): * src/xdisp.c (handle_single_display_spec, try_scrolling) (redisplay_window, calc_pixel_width_or_height, x_produce_glyphs) (on_hot_spot_p): Prefer XFLOATINT to extract_float on values known to be numbers. * src/lisp.h (XFLOATINT): Bring back this function, except it now assumes its argument is a number. --- src/window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/window.c') diff --git a/src/window.c b/src/window.c index 3e2eb1664c8..95690443f8e 100644 --- a/src/window.c +++ b/src/window.c @@ -7129,8 +7129,8 @@ If PIXELS-P is non-nil, the return value is VSCROLL. */) int old_dy = w->vscroll; w->vscroll = - (NILP (pixels_p) - ? FRAME_LINE_HEIGHT (f) * extract_float (vscroll) - : extract_float (vscroll)); + ? FRAME_LINE_HEIGHT (f) * XFLOATINT (vscroll) + : XFLOATINT (vscroll)); w->vscroll = min (w->vscroll, 0); if (w->vscroll != old_dy) -- cgit v1.2.1