summaryrefslogtreecommitdiff
path: root/src/intervals.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/intervals.c')
-rw-r--r--src/intervals.c12
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;
}