Commit 01e9b9df authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

Remove conditional compilation on USE_TEXT_PROPERTIES.

parent 4015b3c0
No preview for this file type
...@@ -483,7 +483,6 @@ uninterrupt_malloc () ...@@ -483,7 +483,6 @@ uninterrupt_malloc ()
/* Interval allocation. */ /* Interval allocation. */
#ifdef USE_TEXT_PROPERTIES
#define INTERVAL_BLOCK_SIZE \ #define INTERVAL_BLOCK_SIZE \
((1020 - sizeof (struct interval_block *)) / sizeof (struct interval)) ((1020 - sizeof (struct interval_block *)) / sizeof (struct interval))
...@@ -596,14 +595,6 @@ mark_interval_tree (tree) ...@@ -596,14 +595,6 @@ mark_interval_tree (tree)
} \ } \
} }
#else /* no interval use */
#define INIT_INTERVALS
#define UNMARK_BALANCE_INTERVALS(i)
#define MARK_INTERVAL_TREE(i)
#endif /* no interval use */
/* Floating point allocation. */ /* Floating point allocation. */
...@@ -1554,9 +1545,7 @@ make_pure_string (data, length, length_byte, multibyte) ...@@ -1554,9 +1545,7 @@ make_pure_string (data, length, length_byte, multibyte)
/* We must give strings in pure storage some kind of interval. So we /* We must give strings in pure storage some kind of interval. So we
give them a null one. */ give them a null one. */
#if defined (USE_TEXT_PROPERTIES)
XSTRING (new)->intervals = NULL_INTERVAL; XSTRING (new)->intervals = NULL_INTERVAL;
#endif
pureptr += size; pureptr += size;
return new; return new;
} }
...@@ -1972,12 +1961,8 @@ Garbage collection happens automatically if you cons more than\n\ ...@@ -1972,12 +1961,8 @@ Garbage collection happens automatically if you cons more than\n\
(make_number (0), make_number (0)), (make_number (0), make_number (0)),
#endif /* not LISP_FLOAT_TYPE */ #endif /* not LISP_FLOAT_TYPE */
Fcons (Fcons Fcons (Fcons
#ifdef USE_TEXT_PROPERTIES
(make_number (total_intervals), (make_number (total_intervals),
make_number (total_free_intervals)), make_number (total_free_intervals)),
#else /* not USE_TEXT_PROPERTIES */
(make_number (0), make_number (0)),
#endif /* not USE_TEXT_PROPERTIES */
Qnil))))))); Qnil)))))));
} }
...@@ -2787,7 +2772,6 @@ gc_sweep () ...@@ -2787,7 +2772,6 @@ gc_sweep ()
} }
#endif /* LISP_FLOAT_TYPE */ #endif /* LISP_FLOAT_TYPE */
#ifdef USE_TEXT_PROPERTIES
/* Put all unmarked intervals on free list */ /* Put all unmarked intervals on free list */
{ {
register struct interval_block *iblk; register struct interval_block *iblk;
...@@ -2837,7 +2821,6 @@ gc_sweep () ...@@ -2837,7 +2821,6 @@ gc_sweep ()
total_intervals = num_used; total_intervals = num_used;
total_free_intervals = num_free; total_free_intervals = num_free;
} }
#endif /* USE_TEXT_PROPERTIES */
/* Put all unmarked symbols on free list */ /* Put all unmarked symbols on free list */
{ {
...@@ -3176,7 +3159,6 @@ compact_strings () ...@@ -3176,7 +3159,6 @@ compact_strings ()
/* Store the actual size in the size field. */ /* Store the actual size in the size field. */
newaddr->size = size; newaddr->size = size;
#ifdef USE_TEXT_PROPERTIES
/* Now that the string has been relocated, rebalance its /* Now that the string has been relocated, rebalance its
interval tree, and update the tree's parent pointer. */ interval tree, and update the tree's parent pointer. */
if (! NULL_INTERVAL_P (newaddr->intervals)) if (! NULL_INTERVAL_P (newaddr->intervals))
...@@ -3185,7 +3167,6 @@ compact_strings () ...@@ -3185,7 +3167,6 @@ compact_strings ()
XSETSTRING (* (Lisp_Object *) &newaddr->intervals->parent, XSETSTRING (* (Lisp_Object *) &newaddr->intervals->parent,
newaddr); newaddr);
} }
#endif /* USE_TEXT_PROPERTIES */
} }
else if (size_byte < 0) else if (size_byte < 0)
size_byte = size; size_byte = size;
......
...@@ -1185,10 +1185,7 @@ with SIGHUP.") ...@@ -1185,10 +1185,7 @@ with SIGHUP.")
m->chain = Qnil; m->chain = Qnil;
} }
BUF_MARKERS (b) = Qnil; BUF_MARKERS (b) = Qnil;
#ifdef USE_TEXT_PROPERTIES
BUF_INTERVALS (b) = NULL_INTERVAL; BUF_INTERVALS (b) = NULL_INTERVAL;
#endif
/* Perhaps we should explicitly free the interval tree here... */ /* Perhaps we should explicitly free the interval tree here... */
} }
...@@ -3826,10 +3823,8 @@ init_buffer_once () ...@@ -3826,10 +3823,8 @@ init_buffer_once ()
/* Prevent GC from getting confused. */ /* Prevent GC from getting confused. */
buffer_defaults.text = &buffer_defaults.own_text; buffer_defaults.text = &buffer_defaults.own_text;
buffer_local_symbols.text = &buffer_local_symbols.own_text; buffer_local_symbols.text = &buffer_local_symbols.own_text;
#ifdef USE_TEXT_PROPERTIES
BUF_INTERVALS (&buffer_defaults) = 0; BUF_INTERVALS (&buffer_defaults) = 0;
BUF_INTERVALS (&buffer_local_symbols) = 0; BUF_INTERVALS (&buffer_local_symbols) = 0;
#endif
XSETBUFFER (Vbuffer_defaults, &buffer_defaults); XSETBUFFER (Vbuffer_defaults, &buffer_defaults);
XSETBUFFER (Vbuffer_local_symbols, &buffer_local_symbols); XSETBUFFER (Vbuffer_local_symbols, &buffer_local_symbols);
......
...@@ -1939,7 +1939,6 @@ make_buffer_string_both (start, start_byte, end, end_byte, props) ...@@ -1939,7 +1939,6 @@ make_buffer_string_both (start, start_byte, end, end_byte, props)
end_byte - start_byte); end_byte - start_byte);
/* If desired, update and copy the text properties. */ /* If desired, update and copy the text properties. */
#ifdef USE_TEXT_PROPERTIES
if (props) if (props)
{ {
update_buffer_properties (start, end); update_buffer_properties (start, end);
...@@ -1951,7 +1950,6 @@ make_buffer_string_both (start, start_byte, end, end_byte, props) ...@@ -1951,7 +1950,6 @@ make_buffer_string_both (start, start_byte, end, end_byte, props)
copy_intervals_to_string (result, current_buffer, start, copy_intervals_to_string (result, current_buffer, start,
end - start); end - start);
} }
#endif
return result; return result;
} }
...@@ -1963,7 +1961,6 @@ static void ...@@ -1963,7 +1961,6 @@ static void
update_buffer_properties (start, end) update_buffer_properties (start, end)
int start, end; int start, end;
{ {
#ifdef USE_TEXT_PROPERTIES
/* If this buffer has some access functions, /* If this buffer has some access functions,
call them, specifying the range of the buffer being accessed. */ call them, specifying the range of the buffer being accessed. */
if (!NILP (Vbuffer_access_fontify_functions)) if (!NILP (Vbuffer_access_fontify_functions))
...@@ -1988,7 +1985,6 @@ update_buffer_properties (start, end) ...@@ -1988,7 +1985,6 @@ update_buffer_properties (start, end)
else else
Frun_hook_with_args (3, args); Frun_hook_with_args (3, args);
} }
#endif
} }
DEFUN ("buffer-substring", Fbuffer_substring, Sbuffer_substring, 2, 2, 0, DEFUN ("buffer-substring", Fbuffer_substring, Sbuffer_substring, 2, 2, 0,
...@@ -3341,10 +3337,8 @@ Transposing beyond buffer boundaries is an error.") ...@@ -3341,10 +3337,8 @@ Transposing beyond buffer boundaries is an error.")
int combined_before_bytes_2, combined_after_bytes_2; int combined_before_bytes_2, combined_after_bytes_2;
struct gcpro gcpro1, gcpro2; struct gcpro gcpro1, gcpro2;
#ifdef USE_TEXT_PROPERTIES
INTERVAL cur_intv, tmp_interval1, tmp_interval_mid, tmp_interval2; INTERVAL cur_intv, tmp_interval1, tmp_interval_mid, tmp_interval2;
cur_intv = BUF_INTERVALS (current_buffer); cur_intv = BUF_INTERVALS (current_buffer);
#endif /* USE_TEXT_PROPERTIES */
validate_region (&startr1, &endr1); validate_region (&startr1, &endr1);
validate_region (&startr2, &endr2); validate_region (&startr2, &endr2);
...@@ -3478,12 +3472,10 @@ Transposing beyond buffer boundaries is an error.") ...@@ -3478,12 +3472,10 @@ Transposing beyond buffer boundaries is an error.")
modify_region (current_buffer, start1, end2); modify_region (current_buffer, start1, end2);
record_change (start1, len1 + len2); record_change (start1, len1 + len2);
#ifdef USE_TEXT_PROPERTIES
tmp_interval1 = copy_intervals (cur_intv, start1, len1); tmp_interval1 = copy_intervals (cur_intv, start1, len1);
tmp_interval2 = copy_intervals (cur_intv, start2, len2); tmp_interval2 = copy_intervals (cur_intv, start2, len2);
Fset_text_properties (make_number (start1), make_number (end2), Fset_text_properties (make_number (start1), make_number (end2),
Qnil, Qnil); Qnil, Qnil);
#endif /* USE_TEXT_PROPERTIES */
/* First region smaller than second. */ /* First region smaller than second. */
if (len1_byte < len2_byte) if (len1_byte < len2_byte)
...@@ -3522,12 +3514,10 @@ Transposing beyond buffer boundaries is an error.") ...@@ -3522,12 +3514,10 @@ Transposing beyond buffer boundaries is an error.")
if (len1_byte > 20000) if (len1_byte > 20000)
free (temp); free (temp);
} }
#ifdef USE_TEXT_PROPERTIES
graft_intervals_into_buffer (tmp_interval1, start1 + len2, graft_intervals_into_buffer (tmp_interval1, start1 + len2,
len1, current_buffer, 0); len1, current_buffer, 0);
graft_intervals_into_buffer (tmp_interval2, start1, graft_intervals_into_buffer (tmp_interval2, start1,
len2, current_buffer, 0); len2, current_buffer, 0);
#endif /* USE_TEXT_PROPERTIES */
} }
/* Non-adjacent regions, because end1 != start2, bleagh... */ /* Non-adjacent regions, because end1 != start2, bleagh... */
else else
...@@ -3541,14 +3531,12 @@ Transposing beyond buffer boundaries is an error.") ...@@ -3541,14 +3531,12 @@ Transposing beyond buffer boundaries is an error.")
modify_region (current_buffer, start2, end2); modify_region (current_buffer, start2, end2);
record_change (start1, len1); record_change (start1, len1);
record_change (start2, len2); record_change (start2, len2);
#ifdef USE_TEXT_PROPERTIES
tmp_interval1 = copy_intervals (cur_intv, start1, len1); tmp_interval1 = copy_intervals (cur_intv, start1, len1);
tmp_interval2 = copy_intervals (cur_intv, start2, len2); tmp_interval2 = copy_intervals (cur_intv, start2, len2);
Fset_text_properties (make_number (start1), make_number (end1), Fset_text_properties (make_number (start1), make_number (end1),
Qnil, Qnil); Qnil, Qnil);
Fset_text_properties (make_number (start2), make_number (end2), Fset_text_properties (make_number (start2), make_number (end2),
Qnil, Qnil); Qnil, Qnil);
#endif /* USE_TEXT_PROPERTIES */
if (len1_byte > 20000) if (len1_byte > 20000)
temp = (unsigned char *) xmalloc (len1_byte); temp = (unsigned char *) xmalloc (len1_byte);
...@@ -3561,12 +3549,10 @@ Transposing beyond buffer boundaries is an error.") ...@@ -3561,12 +3549,10 @@ Transposing beyond buffer boundaries is an error.")
bcopy (temp, start2_addr, len1_byte); bcopy (temp, start2_addr, len1_byte);
if (len1_byte > 20000) if (len1_byte > 20000)
free (temp); free (temp);
#ifdef USE_TEXT_PROPERTIES
graft_intervals_into_buffer (tmp_interval1, start2, graft_intervals_into_buffer (tmp_interval1, start2,
len1, current_buffer, 0); len1, current_buffer, 0);
graft_intervals_into_buffer (tmp_interval2, start1, graft_intervals_into_buffer (tmp_interval2, start1,
len2, current_buffer, 0); len2, current_buffer, 0);
#endif /* USE_TEXT_PROPERTIES */
} }
else if (len1_byte < len2_byte) /* Second region larger than first */ else if (len1_byte < len2_byte) /* Second region larger than first */
...@@ -3574,13 +3560,11 @@ Transposing beyond buffer boundaries is an error.") ...@@ -3574,13 +3560,11 @@ Transposing beyond buffer boundaries is an error.")
{ {
modify_region (current_buffer, start1, end2); modify_region (current_buffer, start1, end2);
record_change (start1, (end2 - start1)); record_change (start1, (end2 - start1));
#ifdef USE_TEXT_PROPERTIES
tmp_interval1 = copy_intervals (cur_intv, start1, len1); tmp_interval1 = copy_intervals (cur_intv, start1, len1);
tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid); tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid);
tmp_interval2 = copy_intervals (cur_intv, start2, len2); tmp_interval2 = copy_intervals (cur_intv, start2, len2);
Fset_text_properties (make_number (start1), make_number (end2), Fset_text_properties (make_number (start1), make_number (end2),
Qnil, Qnil); Qnil, Qnil);
#endif /* USE_TEXT_PROPERTIES */
/* holds region 2 */ /* holds region 2 */
if (len2_byte > 20000) if (len2_byte > 20000)
...@@ -3595,14 +3579,12 @@ Transposing beyond buffer boundaries is an error.") ...@@ -3595,14 +3579,12 @@ Transposing beyond buffer boundaries is an error.")
bcopy (temp, start1_addr, len2_byte); bcopy (temp, start1_addr, len2_byte);
if (len2_byte > 20000) if (len2_byte > 20000)
free (temp); free (temp);
#ifdef USE_TEXT_PROPERTIES
graft_intervals_into_buffer (tmp_interval1, end2 - len1, graft_intervals_into_buffer (tmp_interval1, end2 - len1,
len1, current_buffer, 0); len1, current_buffer, 0);
graft_intervals_into_buffer (tmp_interval_mid, start1 + len2, graft_intervals_into_buffer (tmp_interval_mid, start1 + len2,
len_mid, current_buffer, 0); len_mid, current_buffer, 0);
graft_intervals_into_buffer (tmp_interval2, start1, graft_intervals_into_buffer (tmp_interval2, start1,
len2, current_buffer, 0); len2, current_buffer, 0);
#endif /* USE_TEXT_PROPERTIES */
} }
else else
/* Second region smaller than first. */ /* Second region smaller than first. */
...@@ -3610,13 +3592,11 @@ Transposing beyond buffer boundaries is an error.") ...@@ -3610,13 +3592,11 @@ Transposing beyond buffer boundaries is an error.")
record_change (start1, (end2 - start1)); record_change (start1, (end2 - start1));
modify_region (current_buffer, start1, end2); modify_region (current_buffer, start1, end2);
#ifdef USE_TEXT_PROPERTIES
tmp_interval1 = copy_intervals (cur_intv, start1, len1); tmp_interval1 = copy_intervals (cur_intv, start1, len1);
tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid); tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid);
tmp_interval2 = copy_intervals (cur_intv, start2, len2); tmp_interval2 = copy_intervals (cur_intv, start2, len2);
Fset_text_properties (make_number (start1), make_number (end2), Fset_text_properties (make_number (start1), make_number (end2),
Qnil, Qnil); Qnil, Qnil);
#endif /* USE_TEXT_PROPERTIES */
/* holds region 1 */ /* holds region 1 */
if (len1_byte > 20000) if (len1_byte > 20000)
...@@ -3631,14 +3611,12 @@ Transposing beyond buffer boundaries is an error.") ...@@ -3631,14 +3611,12 @@ Transposing beyond buffer boundaries is an error.")
bcopy (temp, start1_addr + len2_byte + len_mid, len1_byte); bcopy (temp, start1_addr + len2_byte + len_mid, len1_byte);
if (len1_byte > 20000) if (len1_byte > 20000)
free (temp); free (temp);
#ifdef USE_TEXT_PROPERTIES
graft_intervals_into_buffer (tmp_interval1, end2 - len1, graft_intervals_into_buffer (tmp_interval1, end2 - len1,
len1, current_buffer, 0); len1, current_buffer, 0);
graft_intervals_into_buffer (tmp_interval_mid, start1 + len2, graft_intervals_into_buffer (tmp_interval_mid, start1 + len2,
len_mid, current_buffer, 0); len_mid, current_buffer, 0);
graft_intervals_into_buffer (tmp_interval2, start1, graft_intervals_into_buffer (tmp_interval2, start1,
len2, current_buffer, 0); len2, current_buffer, 0);
#endif /* USE_TEXT_PROPERTIES */
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment