diff options
author | Richard M. Stallman <rms@gnu.org> | 1993-02-25 20:24:43 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1993-02-25 20:24:43 +0000 |
commit | 5f673a84c16e09b2c830273236886a248d5ccbf3 (patch) | |
tree | dcb02984d1afedf022ef5e0dcf17e18bfc2802c1 /src/intervals.c | |
parent | e001ab420740eecb1d00b2d11ed4b5f9ec3a21ea (diff) | |
download | emacs-5f673a84c16e09b2c830273236886a248d5ccbf3.tar.gz |
(traverse_intervals): New arg ARG.
Diffstat (limited to 'src/intervals.c')
-rw-r--r-- | src/intervals.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/intervals.c b/src/intervals.c index b0f11114d11..f00b79cdfd3 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; } |