From 4a93c90596a0eabe06d17b6a203f6dd0fcee79a3 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Thu, 25 Feb 1993 20:24:43 +0000 Subject: [PATCH] (traverse_intervals): New arg ARG. --- src/intervals.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/intervals.c b/src/intervals.c index b0f11114d1..f00b79cdfd 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -174,14 +174,14 @@ static int idepth; 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, position, depth, function) 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 @@ search_for_interval (i, tree) 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 @@ count_intervals (i) 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; } -- 2.20.1