From 01e9b9dfb9476cb4e054f3a0b07b819ddd2c0235 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Sun, 7 Nov 1999 15:53:30 +0000 Subject: [PATCH] Remove conditional compilation on USE_TEXT_PROPERTIES. --- src/ChangeLog | 3 +++ src/alloc.c | 19 ------------------- src/buffer.c | 5 ----- src/editfns.c | 22 ---------------------- 4 files changed, 3 insertions(+), 46 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index b3d13107c67..c7ff43ac1e7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 1999-11-07 Gerd Moellmann + * alloc.c, buffer.c, editfns.c: Remove conditional compilation on + USE_TEXT_PROPERTIES. + * Fbyte_code: Use block statements in cases and declare v1 and v2 locally there. Rearrange case statements so that thos most frequently executed come first. Avoid goto's in frequently diff --git a/src/alloc.c b/src/alloc.c index e87ad406667..03356fea00b 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -483,7 +483,6 @@ uninterrupt_malloc () /* Interval allocation. */ -#ifdef USE_TEXT_PROPERTIES #define INTERVAL_BLOCK_SIZE \ ((1020 - sizeof (struct interval_block *)) / sizeof (struct interval)) @@ -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. */ @@ -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 give them a null one. */ -#if defined (USE_TEXT_PROPERTIES) XSTRING (new)->intervals = NULL_INTERVAL; -#endif pureptr += size; return new; } @@ -1972,12 +1961,8 @@ Garbage collection happens automatically if you cons more than\n\ (make_number (0), make_number (0)), #endif /* not LISP_FLOAT_TYPE */ Fcons (Fcons -#ifdef USE_TEXT_PROPERTIES (make_number (total_intervals), make_number (total_free_intervals)), -#else /* not USE_TEXT_PROPERTIES */ - (make_number (0), make_number (0)), -#endif /* not USE_TEXT_PROPERTIES */ Qnil))))))); } @@ -2787,7 +2772,6 @@ gc_sweep () } #endif /* LISP_FLOAT_TYPE */ -#ifdef USE_TEXT_PROPERTIES /* Put all unmarked intervals on free list */ { register struct interval_block *iblk; @@ -2837,7 +2821,6 @@ gc_sweep () total_intervals = num_used; total_free_intervals = num_free; } -#endif /* USE_TEXT_PROPERTIES */ /* Put all unmarked symbols on free list */ { @@ -3176,7 +3159,6 @@ compact_strings () /* Store the actual size in the size field. */ newaddr->size = size; -#ifdef USE_TEXT_PROPERTIES /* Now that the string has been relocated, rebalance its interval tree, and update the tree's parent pointer. */ if (! NULL_INTERVAL_P (newaddr->intervals)) @@ -3185,7 +3167,6 @@ compact_strings () XSETSTRING (* (Lisp_Object *) &newaddr->intervals->parent, newaddr); } -#endif /* USE_TEXT_PROPERTIES */ } else if (size_byte < 0) size_byte = size; diff --git a/src/buffer.c b/src/buffer.c index 533103cb162..9233105a6e1 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1185,10 +1185,7 @@ with SIGHUP.") m->chain = Qnil; } BUF_MARKERS (b) = Qnil; - -#ifdef USE_TEXT_PROPERTIES BUF_INTERVALS (b) = NULL_INTERVAL; -#endif /* Perhaps we should explicitly free the interval tree here... */ } @@ -3826,10 +3823,8 @@ init_buffer_once () /* Prevent GC from getting confused. */ buffer_defaults.text = &buffer_defaults.own_text; buffer_local_symbols.text = &buffer_local_symbols.own_text; -#ifdef USE_TEXT_PROPERTIES BUF_INTERVALS (&buffer_defaults) = 0; BUF_INTERVALS (&buffer_local_symbols) = 0; -#endif XSETBUFFER (Vbuffer_defaults, &buffer_defaults); XSETBUFFER (Vbuffer_local_symbols, &buffer_local_symbols); diff --git a/src/editfns.c b/src/editfns.c index 1abd2696ba6..89db0a1bd3c 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -1939,7 +1939,6 @@ make_buffer_string_both (start, start_byte, end, end_byte, props) end_byte - start_byte); /* If desired, update and copy the text properties. */ -#ifdef USE_TEXT_PROPERTIES if (props) { update_buffer_properties (start, end); @@ -1951,7 +1950,6 @@ make_buffer_string_both (start, start_byte, end, end_byte, props) copy_intervals_to_string (result, current_buffer, start, end - start); } -#endif return result; } @@ -1963,7 +1961,6 @@ static void update_buffer_properties (start, end) int start, end; { -#ifdef USE_TEXT_PROPERTIES /* If this buffer has some access functions, call them, specifying the range of the buffer being accessed. */ if (!NILP (Vbuffer_access_fontify_functions)) @@ -1988,7 +1985,6 @@ update_buffer_properties (start, end) else Frun_hook_with_args (3, args); } -#endif } DEFUN ("buffer-substring", Fbuffer_substring, Sbuffer_substring, 2, 2, 0, @@ -3341,10 +3337,8 @@ Transposing beyond buffer boundaries is an error.") int combined_before_bytes_2, combined_after_bytes_2; struct gcpro gcpro1, gcpro2; -#ifdef USE_TEXT_PROPERTIES INTERVAL cur_intv, tmp_interval1, tmp_interval_mid, tmp_interval2; cur_intv = BUF_INTERVALS (current_buffer); -#endif /* USE_TEXT_PROPERTIES */ validate_region (&startr1, &endr1); validate_region (&startr2, &endr2); @@ -3478,12 +3472,10 @@ Transposing beyond buffer boundaries is an error.") modify_region (current_buffer, start1, end2); record_change (start1, len1 + len2); -#ifdef USE_TEXT_PROPERTIES tmp_interval1 = copy_intervals (cur_intv, start1, len1); tmp_interval2 = copy_intervals (cur_intv, start2, len2); Fset_text_properties (make_number (start1), make_number (end2), Qnil, Qnil); -#endif /* USE_TEXT_PROPERTIES */ /* First region smaller than second. */ if (len1_byte < len2_byte) @@ -3522,12 +3514,10 @@ Transposing beyond buffer boundaries is an error.") if (len1_byte > 20000) free (temp); } -#ifdef USE_TEXT_PROPERTIES graft_intervals_into_buffer (tmp_interval1, start1 + len2, len1, current_buffer, 0); graft_intervals_into_buffer (tmp_interval2, start1, len2, current_buffer, 0); -#endif /* USE_TEXT_PROPERTIES */ } /* Non-adjacent regions, because end1 != start2, bleagh... */ else @@ -3541,14 +3531,12 @@ Transposing beyond buffer boundaries is an error.") modify_region (current_buffer, start2, end2); record_change (start1, len1); record_change (start2, len2); -#ifdef USE_TEXT_PROPERTIES tmp_interval1 = copy_intervals (cur_intv, start1, len1); tmp_interval2 = copy_intervals (cur_intv, start2, len2); Fset_text_properties (make_number (start1), make_number (end1), Qnil, Qnil); Fset_text_properties (make_number (start2), make_number (end2), Qnil, Qnil); -#endif /* USE_TEXT_PROPERTIES */ if (len1_byte > 20000) temp = (unsigned char *) xmalloc (len1_byte); @@ -3561,12 +3549,10 @@ Transposing beyond buffer boundaries is an error.") bcopy (temp, start2_addr, len1_byte); if (len1_byte > 20000) free (temp); -#ifdef USE_TEXT_PROPERTIES graft_intervals_into_buffer (tmp_interval1, start2, len1, current_buffer, 0); graft_intervals_into_buffer (tmp_interval2, start1, len2, current_buffer, 0); -#endif /* USE_TEXT_PROPERTIES */ } else if (len1_byte < len2_byte) /* Second region larger than first */ @@ -3574,13 +3560,11 @@ Transposing beyond buffer boundaries is an error.") { modify_region (current_buffer, start1, end2); record_change (start1, (end2 - start1)); -#ifdef USE_TEXT_PROPERTIES tmp_interval1 = copy_intervals (cur_intv, start1, len1); tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid); tmp_interval2 = copy_intervals (cur_intv, start2, len2); Fset_text_properties (make_number (start1), make_number (end2), Qnil, Qnil); -#endif /* USE_TEXT_PROPERTIES */ /* holds region 2 */ if (len2_byte > 20000) @@ -3595,14 +3579,12 @@ Transposing beyond buffer boundaries is an error.") bcopy (temp, start1_addr, len2_byte); if (len2_byte > 20000) free (temp); -#ifdef USE_TEXT_PROPERTIES graft_intervals_into_buffer (tmp_interval1, end2 - len1, len1, current_buffer, 0); graft_intervals_into_buffer (tmp_interval_mid, start1 + len2, len_mid, current_buffer, 0); graft_intervals_into_buffer (tmp_interval2, start1, len2, current_buffer, 0); -#endif /* USE_TEXT_PROPERTIES */ } else /* Second region smaller than first. */ @@ -3610,13 +3592,11 @@ Transposing beyond buffer boundaries is an error.") record_change (start1, (end2 - start1)); modify_region (current_buffer, start1, end2); -#ifdef USE_TEXT_PROPERTIES tmp_interval1 = copy_intervals (cur_intv, start1, len1); tmp_interval_mid = copy_intervals (cur_intv, end1, len_mid); tmp_interval2 = copy_intervals (cur_intv, start2, len2); Fset_text_properties (make_number (start1), make_number (end2), Qnil, Qnil); -#endif /* USE_TEXT_PROPERTIES */ /* holds region 1 */ if (len1_byte > 20000) @@ -3631,14 +3611,12 @@ Transposing beyond buffer boundaries is an error.") bcopy (temp, start1_addr + len2_byte + len_mid, len1_byte); if (len1_byte > 20000) free (temp); -#ifdef USE_TEXT_PROPERTIES graft_intervals_into_buffer (tmp_interval1, end2 - len1, len1, current_buffer, 0); graft_intervals_into_buffer (tmp_interval_mid, start1 + len2, len_mid, current_buffer, 0); graft_intervals_into_buffer (tmp_interval2, start1, len2, current_buffer, 0); -#endif /* USE_TEXT_PROPERTIES */ } } -- 2.39.5