}
static void
-collect_interval (INTERVAL interval, Lisp_Object collector)
+collect_interval (INTERVAL interval, void *arg)
{
- nconc2 (collector,
- list1(list3 (make_fixnum (interval->position),
- make_fixnum (interval->position + LENGTH (interval)),
- interval->plist)));
+ Lisp_Object *collector = arg;
+ *collector =
+ nconc2 (*collector,
+ list1(list3 (make_fixnum (interval->position),
+ make_fixnum (interval->position + LENGTH (interval)),
+ interval->plist)));
}
if (STRINGP (obj))
{
/* FIXME: This is very wasteful. We needn't cons at all. */
- Lisp_Object collector = Fcons (Qnil, Qnil);
+ Lisp_Object collector = Qnil;
traverse_intervals (string_intervals (obj), 0, collect_interval,
- collector);
+ &collector);
return
make_ufixnum (
SXHASH_REDUCE (sxhash_combine (sxhash (obj),
- sxhash (CDR (collector)))));
+ sxhash (collector))));
}
return hash_hash_to_fixnum (hashfn_equal (obj, NULL));
in OBJECT. */)
(register Lisp_Object object)
{
- Lisp_Object collector = Fcons (Qnil, Qnil);
+ Lisp_Object collector = Qnil;
INTERVAL intervals;
if (STRINGP (object))
if (! intervals)
return Qnil;
- traverse_intervals (intervals, 0, collect_interval, collector);
- return CDR (collector);
+ traverse_intervals (intervals, 0, collect_interval, &collector);
+ return collector;
}
DEFUN ("line-number-at-pos", Fline_number_at_pos,
extern void copy_properties (INTERVAL, INTERVAL);
extern bool intervals_equal (INTERVAL, INTERVAL);
extern void traverse_intervals (INTERVAL, ptrdiff_t,
- void (*) (INTERVAL, Lisp_Object),
- Lisp_Object);
+ void (*) (INTERVAL, void *),
+ void *);
extern void traverse_intervals_noorder (INTERVAL,
void (*) (INTERVAL, void *), void *);
extern INTERVAL split_interval_right (INTERVAL, ptrdiff_t)
print_number_index holds the largest N already used.
N has to be strictly larger than 0 since we need to distinguish -N. */
static ptrdiff_t print_number_index;
-static void print_interval (INTERVAL interval, Lisp_Object printcharfun);
+static void print_interval (INTERVAL interval, void *pprintcharfun);
/* GDB resets this to zero on W32 to disable OutputDebugString calls. */
bool print_output_debug_flag EXTERNALLY_VISIBLE = 1;
print_preprocess (interval->plist);
}
-static void print_check_string_charset_prop (INTERVAL interval, Lisp_Object string);
-
#define PRINT_STRING_NON_CHARSET_FOUND 1
#define PRINT_STRING_UNSAFE_CHARSET_FOUND 2
static int print_check_string_result;
static void
-print_check_string_charset_prop (INTERVAL interval, Lisp_Object string)
+print_check_string_charset_prop (INTERVAL interval, void *pstring)
{
Lisp_Object val;
if (! (print_check_string_result & PRINT_STRING_UNSAFE_CHARSET_FOUND))
{
ptrdiff_t charpos = interval->position;
+ Lisp_Object string = *(Lisp_Object *)pstring;
ptrdiff_t bytepos = string_char_to_byte (string, charpos);
Lisp_Object charset = XCAR (XCDR (val));
{
print_check_string_result = 0;
traverse_intervals (string_intervals (string), 0,
- print_check_string_charset_prop, string);
+ print_check_string_charset_prop, &string);
if (NILP (Vprint_charset_text_property)
|| ! (print_check_string_result & PRINT_STRING_UNSAFE_CHARSET_FOUND))
{
if (string_intervals (obj))
{
+ Lisp_Object pcf = printcharfun;
traverse_intervals (string_intervals (obj),
- 0, print_interval, printcharfun);
+ 0, print_interval, &pcf);
printchar (')', printcharfun);
}
}
This is part of printing a string that has text properties. */
static void
-print_interval (INTERVAL interval, Lisp_Object printcharfun)
+print_interval (INTERVAL interval, void *pprintcharfun)
{
if (NILP (interval->plist))
return;
+ Lisp_Object printcharfun = *(Lisp_Object *)pprintcharfun;
printchar (' ', printcharfun);
print_object (make_fixnum (interval->position), printcharfun, 1);
printchar (' ', printcharfun);