comparison src/extents.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 4dee0387b9de
children 77d7b77909c2 e2fae7783046
comparison
equal deleted inserted replaced
5580:a0e81357194e 5581:56144c8593a8
2849 *bp++ = (extent_start_open_p (anc) ? '(': '['); 2849 *bp++ = (extent_start_open_p (anc) ? '(': '[');
2850 if (extent_detached_p (ext)) 2850 if (extent_detached_p (ext))
2851 strcpy (bp, "detached"); 2851 strcpy (bp, "detached");
2852 else 2852 else
2853 sprintf (bp, "%ld, %ld", 2853 sprintf (bp, "%ld, %ld",
2854 XINT (Fextent_start_position (obj)), 2854 XFIXNUM (Fextent_start_position (obj)),
2855 XINT (Fextent_end_position (obj))); 2855 XFIXNUM (Fextent_end_position (obj)));
2856 bp += strlen (bp); 2856 bp += strlen (bp);
2857 *bp++ = (extent_end_open_p (anc) ? ')': ']'); 2857 *bp++ = (extent_end_open_p (anc) ? ')': ']');
2858 if (!NILP (extent_end_glyph (anc))) *bp++ = '*'; 2858 if (!NILP (extent_end_glyph (anc))) *bp++ = '*';
2859 *bp++ = ' '; 2859 *bp++ = ' ';
2860 2860
3127 EXTENT extent = decode_extent (extent_obj, 0); 3127 EXTENT extent = decode_extent (extent_obj, 0);
3128 3128
3129 if (extent_detached_p (extent)) 3129 if (extent_detached_p (extent))
3130 return Qnil; 3130 return Qnil;
3131 else 3131 else
3132 return make_int (extent_endpoint_char (extent, endp)); 3132 return make_fixnum (extent_endpoint_char (extent, endp));
3133 } 3133 }
3134 3134
3135 DEFUN ("extentp", Fextentp, 1, 1, 0, /* 3135 DEFUN ("extentp", Fextentp, 1, 1, 0, /*
3136 Return t if OBJECT is an extent. 3136 Return t if OBJECT is an extent.
3137 */ 3137 */
3184 Return length of EXTENT in characters. 3184 Return length of EXTENT in characters.
3185 */ 3185 */
3186 (extent)) 3186 (extent))
3187 { 3187 {
3188 EXTENT e = decode_extent (extent, DE_MUST_BE_ATTACHED); 3188 EXTENT e = decode_extent (extent, DE_MUST_BE_ATTACHED);
3189 return make_int (extent_endpoint_char (e, 1) 3189 return make_fixnum (extent_endpoint_char (e, 1)
3190 - extent_endpoint_char (e, 0)); 3190 - extent_endpoint_char (e, 0));
3191 } 3191 }
3192 3192
3193 DEFUN ("next-extent", Fnext_extent, 1, 1, 0, /* 3193 DEFUN ("next-extent", Fnext_extent, 1, 1, 0, /*
3194 Find next extent after EXTENT. 3194 Find next extent after EXTENT.
3292 Lisp_Object obj = decode_buffer_or_string (object); 3292 Lisp_Object obj = decode_buffer_or_string (object);
3293 Bytexpos xpos; 3293 Bytexpos xpos;
3294 3294
3295 xpos = get_buffer_or_string_pos_byte (obj, pos, GB_ALLOW_PAST_ACCESSIBLE); 3295 xpos = get_buffer_or_string_pos_byte (obj, pos, GB_ALLOW_PAST_ACCESSIBLE);
3296 xpos = extent_find_end_of_run (obj, xpos, 1); 3296 xpos = extent_find_end_of_run (obj, xpos, 1);
3297 return make_int (buffer_or_string_bytexpos_to_charxpos (obj, xpos)); 3297 return make_fixnum (buffer_or_string_bytexpos_to_charxpos (obj, xpos));
3298 } 3298 }
3299 3299
3300 DEFUN ("previous-extent-change", Fprevious_extent_change, 1, 2, 0, /* 3300 DEFUN ("previous-extent-change", Fprevious_extent_change, 1, 2, 0, /*
3301 Return the last position before POS where an extent begins or ends. 3301 Return the last position before POS where an extent begins or ends.
3302 If POS is at the beginning of the buffer or string, POS will be returned; 3302 If POS is at the beginning of the buffer or string, POS will be returned;
3308 Lisp_Object obj = decode_buffer_or_string (object); 3308 Lisp_Object obj = decode_buffer_or_string (object);
3309 Bytexpos xpos; 3309 Bytexpos xpos;
3310 3310
3311 xpos = get_buffer_or_string_pos_byte (obj, pos, GB_ALLOW_PAST_ACCESSIBLE); 3311 xpos = get_buffer_or_string_pos_byte (obj, pos, GB_ALLOW_PAST_ACCESSIBLE);
3312 xpos = extent_find_beginning_of_run (obj, xpos, 1); 3312 xpos = extent_find_beginning_of_run (obj, xpos, 1);
3313 return make_int (buffer_or_string_bytexpos_to_charxpos (obj, xpos)); 3313 return make_fixnum (buffer_or_string_bytexpos_to_charxpos (obj, xpos));
3314 } 3314 }
3315 3315
3316 3316
3317 /************************************************************************/ 3317 /************************************************************************/
3318 /* parent and children stuff */ 3318 /* parent and children stuff */
4656 : extent_before_change_functions (extent)); 4656 : extent_before_change_functions (extent));
4657 if (NILP (hook)) 4657 if (NILP (hook))
4658 return 0; 4658 return 0;
4659 4659
4660 exobj = wrap_extent (extent); 4660 exobj = wrap_extent (extent);
4661 startobj = make_int (closure->start); 4661 startobj = make_fixnum (closure->start);
4662 endobj = make_int (closure->end); 4662 endobj = make_fixnum (closure->end);
4663 4663
4664 /* Now that we are sure to call elisp, set up an unwind-protect so 4664 /* Now that we are sure to call elisp, set up an unwind-protect so
4665 inside_change_hook gets restored in case we throw. Also record 4665 inside_change_hook gets restored in case we throw. Also record
4666 the current buffer, in case we change it. Do the recording only 4666 the current buffer, in case we change it. Do the recording only
4667 once. 4667 once.
4774 rather than face objects. 4774 rather than face objects.
4775 2) We don't want things to get quite so messed up if the user 4775 2) We don't want things to get quite so messed up if the user
4776 maliciously side-effects the returned lists. 4776 maliciously side-effects the returned lists.
4777 */ 4777 */
4778 4778
4779 len = XINT (Flength (list)); 4779 len = XFIXNUM (Flength (list));
4780 thelen = XINT (Flength (Vextent_face_reusable_list)); 4780 thelen = XFIXNUM (Flength (Vextent_face_reusable_list));
4781 oldtail = Qnil; 4781 oldtail = Qnil;
4782 tail = Qnil; 4782 tail = Qnil;
4783 GCPRO1 (oldtail); 4783 GCPRO1 (oldtail);
4784 4784
4785 /* We canonicalize the given list into another list. 4785 /* We canonicalize the given list into another list.
4790 if (thelen < len) 4790 if (thelen < len)
4791 { 4791 {
4792 cons = Vextent_face_reusable_list; 4792 cons = Vextent_face_reusable_list;
4793 while (!NILP (XCDR (cons))) 4793 while (!NILP (XCDR (cons)))
4794 cons = XCDR (cons); 4794 cons = XCDR (cons);
4795 XCDR (cons) = Fmake_list (make_int (len - thelen), Qnil); 4795 XCDR (cons) = Fmake_list (make_fixnum (len - thelen), Qnil);
4796 } 4796 }
4797 else if (thelen > len) 4797 else if (thelen > len)
4798 { 4798 {
4799 int i; 4799 int i;
4800 4800
5137 */ 5137 */
5138 (extent, priority)) 5138 (extent, priority))
5139 { 5139 {
5140 EXTENT e = decode_extent (extent, 0); 5140 EXTENT e = decode_extent (extent, 0);
5141 5141
5142 CHECK_INT (priority); 5142 CHECK_FIXNUM (priority);
5143 e = extent_ancestor (e); 5143 e = extent_ancestor (e);
5144 set_extent_priority (e, XINT (priority)); 5144 set_extent_priority (e, XFIXNUM (priority));
5145 signal_extent_property_changed (e, Qpriority, 1); 5145 signal_extent_property_changed (e, Qpriority, 1);
5146 return priority; 5146 return priority;
5147 } 5147 }
5148 5148
5149 DEFUN ("extent-priority", Fextent_priority, 1, 1, 0, /* 5149 DEFUN ("extent-priority", Fextent_priority, 1, 1, 0, /*
5150 Return the display priority of EXTENT; see `set-extent-priority'. 5150 Return the display priority of EXTENT; see `set-extent-priority'.
5151 */ 5151 */
5152 (extent)) 5152 (extent))
5153 { 5153 {
5154 EXTENT e = decode_extent (extent, 0); 5154 EXTENT e = decode_extent (extent, 0);
5155 return make_int (extent_priority (e)); 5155 return make_fixnum (extent_priority (e));
5156 } 5156 }
5157 5157
5158 DEFUN ("set-extent-property", Fset_extent_property, 3, 3, 0, /* 5158 DEFUN ("set-extent-property", Fset_extent_property, 3, 3, 0, /*
5159 Change a property of an extent. 5159 Change a property of an extent.
5160 PROPERTY may be any symbol; the value stored may be accessed with 5160 PROPERTY may be any symbol; the value stored may be accessed with
5508 else if (EQ (property, Qstart_closed)) 5508 else if (EQ (property, Qstart_closed))
5509 return extent_start_open_p (e) ? Qnil : Qt; 5509 return extent_start_open_p (e) ? Qnil : Qt;
5510 else if (EQ (property, Qend_closed)) 5510 else if (EQ (property, Qend_closed))
5511 return extent_end_open_p (e) ? Qnil : Qt; 5511 return extent_end_open_p (e) ? Qnil : Qt;
5512 else if (EQ (property, Qpriority)) 5512 else if (EQ (property, Qpriority))
5513 return make_int (extent_priority (e)); 5513 return make_fixnum (extent_priority (e));
5514 else if (EQ (property, Qread_only)) 5514 else if (EQ (property, Qread_only))
5515 return extent_read_only (e); 5515 return extent_read_only (e);
5516 else if (EQ (property, Qinvisible)) 5516 else if (EQ (property, Qinvisible))
5517 return extent_invisible (e); 5517 return extent_invisible (e);
5518 else if (EQ (property, Qface)) 5518 else if (EQ (property, Qface))
5599 5599
5600 if (!NILP (extent_begin_glyph (anc))) 5600 if (!NILP (extent_begin_glyph (anc)))
5601 ADD_PROP (Qbegin_glyph, extent_begin_glyph (anc)); 5601 ADD_PROP (Qbegin_glyph, extent_begin_glyph (anc));
5602 5602
5603 if (extent_priority (anc) != 0) 5603 if (extent_priority (anc) != 0)
5604 ADD_PROP (Qpriority, make_int (extent_priority (anc))); 5604 ADD_PROP (Qpriority, make_fixnum (extent_priority (anc)));
5605 5605
5606 if (!NILP (extent_initial_redisplay_function (anc))) 5606 if (!NILP (extent_initial_redisplay_function (anc)))
5607 ADD_PROP (Qinitial_redisplay_function, 5607 ADD_PROP (Qinitial_redisplay_function,
5608 extent_initial_redisplay_function (anc)); 5608 extent_initial_redisplay_function (anc));
5609 5609
5752 Lisp_Object flag; 5752 Lisp_Object flag;
5753 struct gcpro gcpro1, gcpro2, gcpro3; 5753 struct gcpro gcpro1, gcpro2, gcpro3;
5754 GCPRO3 (extent, copy_fn, object); 5754 GCPRO3 (extent, copy_fn, object);
5755 if (BUFFERP (object)) 5755 if (BUFFERP (object))
5756 flag = call3_in_buffer (XBUFFER (object), copy_fn, extent, 5756 flag = call3_in_buffer (XBUFFER (object), copy_fn, extent,
5757 make_int (from), make_int (to)); 5757 make_fixnum (from), make_fixnum (to));
5758 else 5758 else
5759 flag = call3 (copy_fn, extent, make_int (from), make_int (to)); 5759 flag = call3 (copy_fn, extent, make_fixnum (from), make_fixnum (to));
5760 UNGCPRO; 5760 UNGCPRO;
5761 if (NILP (flag) || !EXTENT_LIVE_P (XEXTENT (extent))) 5761 if (NILP (flag) || !EXTENT_LIVE_P (XEXTENT (extent)))
5762 return 0; 5762 return 0;
5763 } 5763 }
5764 return 1; 5764 return 1;
6885 next, text_props_only); 6885 next, text_props_only);
6886 6886
6887 if (blim < 0) 6887 if (blim < 0)
6888 return Qnil; 6888 return Qnil;
6889 else 6889 else
6890 return make_int (buffer_or_string_bytexpos_to_charxpos (object, blim)); 6890 return make_fixnum (buffer_or_string_bytexpos_to_charxpos (object, blim));
6891 } 6891 }
6892 6892
6893 DEFUN ("next-single-property-change", Fnext_single_property_change, 6893 DEFUN ("next-single-property-change", Fnext_single_property_change,
6894 2, 4, 0, /* 6894 2, 4, 0, /*
6895 Return the position of next property change for a specific property. 6895 Return the position of next property change for a specific property.