aboutsummaryrefslogtreecommitdiffstats
path: root/src/intervals.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/intervals.c')
-rw-r--r--src/intervals.c66
1 files changed, 2 insertions, 64 deletions
diff --git a/src/intervals.c b/src/intervals.c
index d17d80ac865..0089ecb8dde 100644
--- a/src/intervals.c
+++ b/src/intervals.c
@@ -224,7 +224,8 @@ intervals_equal (INTERVAL i0, INTERVAL i1)
224 Pass FUNCTION two args: an interval, and ARG. */ 224 Pass FUNCTION two args: an interval, and ARG. */
225 225
226void 226void
227traverse_intervals_noorder (INTERVAL tree, void (*function) (INTERVAL, Lisp_Object), Lisp_Object arg) 227traverse_intervals_noorder (INTERVAL tree, void (*function) (INTERVAL, void *),
228 void *arg)
228{ 229{
229 /* Minimize stack usage. */ 230 /* Minimize stack usage. */
230 while (tree) 231 while (tree)
@@ -257,69 +258,6 @@ traverse_intervals (INTERVAL tree, ptrdiff_t position,
257 } 258 }
258} 259}
259 260
260#if 0
261
262static int icount;
263static int idepth;
264static int zero_length;
265
266/* These functions are temporary, for debugging purposes only. */
267
268INTERVAL search_interval, found_interval;
269
270void
271check_for_interval (INTERVAL i)
272{
273 if (i == search_interval)
274 {
275 found_interval = i;
276 icount++;
277 }
278}
279
280INTERVAL
281search_for_interval (INTERVAL i, INTERVAL tree)
282{
283 icount = 0;
284 search_interval = i;
285 found_interval = NULL;
286 traverse_intervals_noorder (tree, &check_for_interval, Qnil);
287 return found_interval;
288}
289
290static void
291inc_interval_count (INTERVAL i)
292{
293 icount++;
294 if (LENGTH (i) == 0)
295 zero_length++;
296 if (depth > idepth)
297 idepth = depth;
298}
299
300int
301count_intervals (INTERVAL i)
302{
303 icount = 0;
304 idepth = 0;
305 zero_length = 0;
306 traverse_intervals_noorder (i, &inc_interval_count, Qnil);
307
308 return icount;
309}
310
311static INTERVAL
312root_interval (INTERVAL interval)
313{
314 register INTERVAL i = interval;
315
316 while (! ROOT_INTERVAL_P (i))
317 i = INTERVAL_PARENT (i);
318
319 return i;
320}
321#endif
322
323/* Assuming that a left child exists, perform the following operation: 261/* Assuming that a left child exists, perform the following operation:
324 262
325 A B 263 A B