]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove XFLOATINT
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 2 Mar 2017 17:21:19 +0000 (09:21 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 2 Mar 2017 17:22:17 +0000 (09:22 -0800)
* src/lisp.h (XFLOATINT): Remove this alias for extract_float.
All callers changed to use extract_float.
* src/frame.h (NUMVAL): Now an inline function, not a macro.

src/floatfns.c
src/frame.c
src/frame.h
src/image.c
src/lisp.h
src/nsterm.m
src/window.c
src/xdisp.c

index 96711faff624f06da02e0ad671a571766b29b023..737fb22091e674a5350d728989414000cda43f62 100644 (file)
@@ -178,7 +178,7 @@ The function returns the cons cell (SGNFCAND . EXP).
 If X is zero, both parts (SGNFCAND and EXP) are zero.  */)
   (Lisp_Object x)
 {
-  double f = XFLOATINT (x);
+  double f = extract_float (x);
   int exponent;
   double sgnfcand = frexp (f, &exponent);
   return Fcons (make_float (sgnfcand), make_number (exponent));
@@ -191,7 +191,7 @@ EXPONENT must be an integer.   */)
 {
   CHECK_NUMBER (exponent);
   int e = min (max (INT_MIN, XINT (exponent)), INT_MAX);
-  return make_float (ldexp (XFLOATINT (sgnfcand), e));
+  return make_float (ldexp (extract_float (sgnfcand), e));
 }
 \f
 DEFUN ("exp", Fexp, Sexp, 1, 1, 0,
index 5e1e2f19906837bdfb972749efcbd57b5f72c91d..daf424567dfdd489ad78f5a75aedd5eb00529a6b 100644 (file)
@@ -3530,9 +3530,9 @@ x_set_screen_gamma (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu
 
   if (NILP (new_value))
     f->gamma = 0;
-  else if (NUMBERP (new_value) && XFLOATINT (new_value) > 0)
+  else if (NUMBERP (new_value) && extract_float (new_value) > 0)
     /* The value 0.4545 is the normal viewing gamma.  */
-    f->gamma = 1.0 / (0.4545 * XFLOATINT (new_value));
+    f->gamma = 1.0 / (0.4545 * extract_float (new_value));
   else
     signal_error ("Invalid screen-gamma", new_value);
 
index 7331352a201b6d25dcefa0d1e5e8c300fb069be0..6f85f85e795b228be493c912e07be08c58412b17 100644 (file)
@@ -621,7 +621,11 @@ fset_desired_tool_bar_string (struct frame *f, Lisp_Object val)
 }
 #endif /* HAVE_WINDOW_SYSTEM && !USE_GTK && !HAVE_NS */
 
-#define NUMVAL(X) (NUMBERP (X) ? XFLOATINT (X) : -1)
+INLINE double
+NUMVAL (Lisp_Object x)
+{
+  return NUMBERP (x) ? extract_float (x) : -1;
+}
 
 INLINE double
 default_pixels_per_inch_x (void)
index fc396c7353de6ad4109dd21bf05ee6228625e12b..3711dd18d69868493a6b10a873b72e2f9576a451 100644 (file)
@@ -4915,19 +4915,19 @@ x_edge_detection (struct frame *f, struct image *img, Lisp_Object matrix,
       for (i = 0;
           i < 9 && CONSP (matrix) && NUMBERP (XCAR (matrix));
           ++i, matrix = XCDR (matrix))
-       trans[i] = XFLOATINT (XCAR (matrix));
+       trans[i] = extract_float (XCAR (matrix));
     }
   else if (VECTORP (matrix) && ASIZE (matrix) >= 9)
     {
       for (i = 0; i < 9 && NUMBERP (AREF (matrix, i)); ++i)
-       trans[i] = XFLOATINT (AREF (matrix, i));
+       trans[i] = extract_float (AREF (matrix, i));
     }
 
   if (NILP (color_adjust))
     color_adjust = make_number (0xffff / 2);
 
   if (i == 9 && NUMBERP (color_adjust))
-    x_detect_edges (f, img, trans, XFLOATINT (color_adjust));
+    x_detect_edges (f, img, trans, extract_float (color_adjust));
 }
 
 
index a757dfdbb3172163ee65c4ea416851302a8a74db..a9104110469e51ba0041b1a5cdd4da6f042515aa 100644 (file)
@@ -2803,12 +2803,6 @@ CHECK_NATNUM (Lisp_Object x)
       CHECK_TYPE (INTEGERP (x), Qinteger_or_marker_p, x);              \
   } while (false)
 
-INLINE double
-XFLOATINT (Lisp_Object n)
-{
-  return extract_float (n);
-}
-
 INLINE void
 CHECK_NUMBER_OR_FLOAT (Lisp_Object x)
 {
index eaefea79855e3476243ab598bae3fafdd3f9b9c0..80261d6d763c97b34d2edb7795365b48559065eb 100644 (file)
@@ -4814,7 +4814,7 @@ ns_term_init (Lisp_Object display_name)
       /* this is a standard variable */
       ns_default ("AppleAntiAliasingThreshold", &tmp,
                  make_float (10.0), make_float (6.0), YES, NO);
-      ns_antialias_threshold = NILP (tmp) ? 10.0 : XFLOATINT (tmp);
+      ns_antialias_threshold = NILP (tmp) ? 10.0 : extract_float (tmp);
     }
 
   NSTRACE_MSG ("Colors");
index 95690443f8e1a84e79ebe2d818df54c098880328..3e2eb1664c835276be945b6a3876feae9405c0d6 100644 (file)
@@ -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) * XFLOATINT (vscroll)
-                     : XFLOATINT (vscroll));
+                     ? FRAME_LINE_HEIGHT (f) * extract_float (vscroll)
+                     : extract_float (vscroll));
       w->vscroll = min (w->vscroll, 0);
 
       if (w->vscroll != old_dy)
index 851a32b4f88ce6ef761621c1702c81753b8af465..12f42d14cec7c1b45cc4a00e276848cf00e5141a 100644 (file)
@@ -4870,7 +4870,7 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
                  height = safe_call1 (it->font_height,
                                       face->lface[LFACE_HEIGHT_INDEX]);
                  if (NUMBERP (height))
-                   new_height = XFLOATINT (height);
+                   new_height = extract_float (height);
                }
              else if (NUMBERP (it->font_height))
                {
@@ -4879,7 +4879,7 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
 
                  f = FACE_FROM_ID (it->f,
                                    lookup_basic_face (it->f, DEFAULT_FACE_ID));
-                 new_height = (XFLOATINT (it->font_height)
+                 new_height = (extract_float (it->font_height)
                                * XINT (f->lface[LFACE_HEIGHT_INDEX]));
                }
              else
@@ -4894,7 +4894,7 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
                  unbind_to (count, Qnil);
 
                  if (NUMBERP (value))
-                   new_height = XFLOATINT (value);
+                   new_height = extract_float (value);
                }
 
              if (new_height > 0)
@@ -4916,7 +4916,7 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
            return 0;
 
          value = XCAR (XCDR (spec));
-         if (NUMBERP (value) && XFLOATINT (value) > 0)
+         if (NUMBERP (value) && extract_float (value) > 0)
            it->space_width = value;
        }
 
@@ -4968,7 +4968,7 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
          if (NUMBERP (value))
            {
              struct face *face = FACE_FROM_ID (it->f, it->face_id);
-             it->voffset = - (XFLOATINT (value)
+             it->voffset = - (extract_float (value)
                               * (normal_char_height (face->font, -1)));
            }
 #endif /* HAVE_WINDOW_SYSTEM */
@@ -11058,7 +11058,7 @@ resize_mini_window (struct window *w, bool exact_p)
 
       /* Compute the max. number of lines specified by the user.  */
       if (FLOATP (Vmax_mini_window_height))
-       max_height = XFLOATINT (Vmax_mini_window_height) * total_height;
+       max_height = extract_float (Vmax_mini_window_height) * total_height;
       else if (INTEGERP (Vmax_mini_window_height))
        max_height = XINT (Vmax_mini_window_height) * unit;
       else
@@ -15501,7 +15501,7 @@ try_scrolling (Lisp_Object window, bool just_this_one_p,
          height = WINDOW_BOX_TEXT_HEIGHT (w);
          if (NUMBERP (aggressive))
            {
-             double float_amount = XFLOATINT (aggressive) * height;
+             double float_amount = extract_float (aggressive) * height;
              int aggressive_scroll = float_amount;
              if (aggressive_scroll == 0 && float_amount > 0)
                aggressive_scroll = 1;
@@ -15617,7 +15617,7 @@ try_scrolling (Lisp_Object window, bool just_this_one_p,
              height = WINDOW_BOX_TEXT_HEIGHT (w);
              if (NUMBERP (aggressive))
                {
-                 double float_amount = XFLOATINT (aggressive) * height;
+                 double float_amount = extract_float (aggressive) * height;
                  int aggressive_scroll = float_amount;
                  if (aggressive_scroll == 0 && float_amount > 0)
                    aggressive_scroll = 1;
@@ -16968,7 +16968,7 @@ redisplay_window (Lisp_Object window, bool just_this_one_p)
             scroll-*-aggressively.  */
          if (!scroll_conservatively && NUMBERP (aggressive))
            {
-             double float_amount = XFLOATINT (aggressive);
+             double float_amount = extract_float (aggressive);
 
              pt_offset = float_amount * WINDOW_BOX_TEXT_HEIGHT (w);
              if (pt_offset == 0 && float_amount > 0)
@@ -24557,7 +24557,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop,
       int base_unit = (width_p
                       ? FRAME_COLUMN_WIDTH (it->f)
                       : FRAME_LINE_HEIGHT (it->f));
-      return OK_PIXELS (XFLOATINT (prop) * base_unit);
+      return OK_PIXELS (extract_float (prop) * base_unit);
     }
 
   if (CONSP (prop))
@@ -24612,7 +24612,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop,
       if (NUMBERP (car))
        {
          double fact;
-         pixels = XFLOATINT (car);
+         pixels = extract_float (car);
          if (NILP (cdr))
            return OK_PIXELS (pixels);
          if (calc_pixel_width_or_height (&fact, it, cdr,
@@ -27225,7 +27225,7 @@ x_produce_glyphs (struct it *it)
          bool stretched_p
            = it->char_to_display == ' ' && !NILP (it->space_width);
          if (stretched_p)
-           it->pixel_width *= XFLOATINT (it->space_width);
+           it->pixel_width *= extract_float (it->space_width);
 
          /* If face has a box, add the box thickness to the character
             height.  If character has a box line to the left and/or
@@ -29703,7 +29703,7 @@ on_hot_spot_p (Lisp_Object hot_spot, int x, int y)
          && (lx0 = XCAR (XCAR (circ)), INTEGERP (lx0))
          && (ly0 = XCDR (XCAR (circ)), INTEGERP (ly0)))
        {
-         double r = XFLOATINT (lr);
+         double r = extract_float (lr);
          double dx = XINT (lx0) - x;
          double dy = XINT (ly0) - y;
          return (dx * dx + dy * dy <= r * r);