# HG changeset patch # User Richard M. Stallman # Date 730671883 0 # Node ID 8bc716df45e359461d9d9ac33c55332b1a417dc2 # Parent 54c8c66cd9acc46af6e9596b6acff1246891310c (traverse_intervals): New arg ARG. diff -r 54c8c66cd9ac -r 8bc716df45e3 src/intervals.c --- 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; }