comparison src/gutter.c @ 5581:56144c8593a8

Mechanically change INT to FIXNUM in our sources. src/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> [...] Mechanically change INT (where it refers to non-bignum Lisp integers) to FIXNUM in our sources. Done for the following functions, enums, and macros: Lisp_Type_Int_Even, Lisp_Type_Int_Odd, INT_GCBITS, INT_VALBITS, make_int(), INTP(), XINT(), CHECK_INT(), XREALINT(), INT_PLUS(), INT_MINUS(), EMACS_INT_MAX (to MOST_POSITIVE_FIXNUM), EMACS_INT_MIN (to MOST_NEGATIVE_FIXNUM), NUMBER_FITS_IN_AN_EMACS_INT() to NUMBER_FITS_IN_A_FIXNUM(), XFLOATINT, XCHAR_OR_INT, INT_OR_FLOAT. The EMACS_INT typedef was not changed, it does not describe non-bignum Lisp integers. Script that did the change available in http://mid.gmane.org/20067.17650.181273.12014@parhasard.net . modules/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> [...] Mechanically change INT to FIXNUM, where the usage describes non-bignum Lisp integers. See the src/ChangeLog entry for more details. man/ChangeLog addition: 2011-10-09 Aidan Kehoe <kehoea@parhasard.net> * internals/internals.texi (How Lisp Objects Are Represented in C): * internals/internals.texi (Integers and Characters): Mechanically change INT to FIXNUM, where the usage describes non-bignum Lisp integers.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 09 Oct 2011 09:51:57 +0100
parents 308d34e9f07d
children 77d7b77909c2
comparison
equal deleted inserted replaced
5580:a0e81357194e 5581:56144c8593a8
338 ddla, 0, DEFAULT_INDEX); 338 ddla, 0, DEFAULT_INDEX);
339 339
340 /* Let GC happen again. */ 340 /* Let GC happen again. */
341 exit_redisplay_critical_section (count); 341 exit_redisplay_critical_section (count);
342 342
343 ret = make_int (calculate_gutter_size_from_display_lines (pos, ddla)); 343 ret = make_fixnum (calculate_gutter_size_from_display_lines (pos, ddla));
344 free_display_lines (ddla); 344 free_display_lines (ddla);
345 } 345 }
346 346
347 return ret; 347 return ret;
348 } 348 }
774 p = decode_gutter_position (pos); 774 p = decode_gutter_position (pos);
775 775
776 get_gutter_coords (f, p, &x, &y, &width, &height); 776 get_gutter_coords (f, p, &x, &y, &width, &height);
777 width -= (FRAME_GUTTER_BORDER_WIDTH (f, p) * 2); 777 width -= (FRAME_GUTTER_BORDER_WIDTH (f, p) * 2);
778 778
779 return make_int (width); 779 return make_fixnum (width);
780 } 780 }
781 781
782 DEFUN ("gutter-pixel-height", Fgutter_pixel_height, 0, 2, 0, /* 782 DEFUN ("gutter-pixel-height", Fgutter_pixel_height, 0, 2, 0, /*
783 Return the pixel height of the gutter at POS in LOCALE. 783 Return the pixel height of the gutter at POS in LOCALE.
784 POS defaults to the default gutter position. LOCALE defaults to 784 POS defaults to the default gutter position. LOCALE defaults to
795 p = decode_gutter_position (pos); 795 p = decode_gutter_position (pos);
796 796
797 get_gutter_coords (f, p, &x, &y, &width, &height); 797 get_gutter_coords (f, p, &x, &y, &width, &height);
798 height -= (FRAME_GUTTER_BORDER_WIDTH (f, p) * 2); 798 height -= (FRAME_GUTTER_BORDER_WIDTH (f, p) * 2);
799 799
800 return make_int (height); 800 return make_fixnum (height);
801 } 801 }
802 802
803 DEFINE_SPECIFIER_TYPE (gutter); 803 DEFINE_SPECIFIER_TYPE (gutter);
804 804
805 static void 805 static void
860 860
861 static void 861 static void
862 gutter_specs_changed_1 (Lisp_Object arg) 862 gutter_specs_changed_1 (Lisp_Object arg)
863 { 863 {
864 gutter_specs_changed (X1ST (arg), XWINDOW (X2ND (arg)), 864 gutter_specs_changed (X1ST (arg), XWINDOW (X2ND (arg)),
865 X3RD (arg), (enum edge_pos) XINT (X4TH (arg))); 865 X3RD (arg), (enum edge_pos) XFIXNUM (X4TH (arg)));
866 free_list (arg); 866 free_list (arg);
867 } 867 }
868 868
869 static void 869 static void
870 gutter_specs_changed (Lisp_Object specifier, struct window *w, 870 gutter_specs_changed (Lisp_Object specifier, struct window *w,
871 Lisp_Object oldval, enum edge_pos pos) 871 Lisp_Object oldval, enum edge_pos pos)
872 { 872 {
873 if (in_display) 873 if (in_display)
874 register_post_redisplay_action (gutter_specs_changed_1, 874 register_post_redisplay_action (gutter_specs_changed_1,
875 list4 (specifier, wrap_window (w), 875 list4 (specifier, wrap_window (w),
876 oldval, make_int (pos))); 876 oldval, make_fixnum (pos)));
877 else 877 else
878 { 878 {
879 w->real_gutter[pos] = construct_window_gutter_spec (w, pos); 879 w->real_gutter[pos] = construct_window_gutter_spec (w, pos);
880 w->real_gutter_size[pos] = w->gutter_size[pos]; 880 w->real_gutter_size[pos] = w->gutter_size[pos];
881 881
1002 gutter_size_validate (Lisp_Object instantiator) 1002 gutter_size_validate (Lisp_Object instantiator)
1003 { 1003 {
1004 if (NILP (instantiator)) 1004 if (NILP (instantiator))
1005 return; 1005 return;
1006 1006
1007 if (!INTP (instantiator) && !EQ (instantiator, Qautodetect)) 1007 if (!FIXNUMP (instantiator) && !EQ (instantiator, Qautodetect))
1008 invalid_argument ("Gutter size must be an integer or `autodetect'", instantiator); 1008 invalid_argument ("Gutter size must be an integer or `autodetect'", instantiator);
1009 } 1009 }
1010 1010
1011 DEFUN ("gutter-size-specifier-p", Fgutter_size_specifier_p, 1, 1, 0, /* 1011 DEFUN ("gutter-size-specifier-p", Fgutter_size_specifier_p, 1, 1, 0, /*
1012 Return non-nil if OBJECT is a gutter-size specifier. 1012 Return non-nil if OBJECT is a gutter-size specifier.
1525 fb = Qnil; 1525 fb = Qnil;
1526 #ifdef HAVE_TTY 1526 #ifdef HAVE_TTY
1527 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb); 1527 fb = Fcons (Fcons (list1 (Qtty), Qzero), fb);
1528 #endif 1528 #endif
1529 #ifdef HAVE_X_WINDOWS 1529 #ifdef HAVE_X_WINDOWS
1530 fb = Fcons (Fcons (list1 (Qx), make_int (DEFAULT_GUTTER_BORDER_WIDTH)), fb); 1530 fb = Fcons (Fcons (list1 (Qx), make_fixnum (DEFAULT_GUTTER_BORDER_WIDTH)), fb);
1531 #endif 1531 #endif
1532 #ifdef HAVE_MS_WINDOWS 1532 #ifdef HAVE_MS_WINDOWS
1533 fb = Fcons (Fcons (list1 (Qmsprinter), Qzero), fb); 1533 fb = Fcons (Fcons (list1 (Qmsprinter), Qzero), fb);
1534 fb = Fcons (Fcons (list1 (Qmswindows), make_int (DEFAULT_GUTTER_BORDER_WIDTH)), fb); 1534 fb = Fcons (Fcons (list1 (Qmswindows), make_fixnum (DEFAULT_GUTTER_BORDER_WIDTH)), fb);
1535 #endif 1535 #endif
1536 if (!NILP (fb)) 1536 if (!NILP (fb))
1537 set_specifier_fallback (Vdefault_gutter_border_width, fb); 1537 set_specifier_fallback (Vdefault_gutter_border_width, fb);
1538 1538
1539 set_specifier_fallback (Vgutter_border_width[TOP_EDGE], Vdefault_gutter_border_width); 1539 set_specifier_fallback (Vgutter_border_width[TOP_EDGE], Vdefault_gutter_border_width);