changeset 1958:8bc716df45e3

(traverse_intervals): New arg ARG.
author Richard M. Stallman <rms@gnu.org>
date Thu, 25 Feb 1993 20:24:43 +0000
parents 54c8c66cd9ac
children 3c827b8110db
files src/intervals.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/intervals.c	Thu Feb 25 20:24:25 1993 +0000
+++ b/src/intervals.c	Thu Feb 25 20:24:43 1993 +0000
@@ -174,14 +174,14 @@
 static int zero_length;
 
 /* Traverse an interval tree TREE, performing FUNCTION on each node.
-
-   Perhaps we should pass the depth as an argument. */
+   Pass FUNCTION two args: an interval, and ARG.  */
 
 void
-traverse_intervals (tree, position, depth, function)
+traverse_intervals (tree, position, depth, function, arg)
      INTERVAL tree;
      int position, depth;
      void (* function) ();
+     Lisp_Object arg;
 {
   if (NULL_INTERVAL_P (tree))
     return;
@@ -189,7 +189,7 @@
   traverse_intervals (tree->left, position, depth + 1, function);
   position += LEFT_TOTAL_LENGTH (tree);
   tree->position = position;
-  (*function) (tree);
+  (*function) (tree, arg);
   position += LENGTH (tree);
   traverse_intervals (tree->right, position, depth + 1,  function);
 }
@@ -217,7 +217,7 @@
   icount = 0;
   search_interval = i;
   found_interval = NULL_INTERVAL;
-  traverse_intervals (tree, 1, 0, &check_for_interval);
+  traverse_intervals (tree, 1, 0, &check_for_interval, Qnil);
   return found_interval;
 }
 
@@ -239,7 +239,7 @@
   icount = 0;
   idepth = 0;
   zero_length = 0;
-  traverse_intervals (i, 1, 0, &inc_interval_count);
+  traverse_intervals (i, 1, 0, &inc_interval_count, Qnil);
 
   return icount;
 }