aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-02-25 20:24:43 +0000
committerRichard M. Stallman1993-02-25 20:24:43 +0000
commit4a93c90596a0eabe06d17b6a203f6dd0fcee79a3 (patch)
tree5d3e16681aa1000e2d33235a576cc85014b302af
parentd393c06819d87fd26ad13768230895c5ec5100ee (diff)
downloademacs-4a93c90596a0eabe06d17b6a203f6dd0fcee79a3.tar.gz
emacs-4a93c90596a0eabe06d17b6a203f6dd0fcee79a3.zip
(traverse_intervals): New arg ARG.
-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;
174static int zero_length; 174static int zero_length;
175 175
176/* Traverse an interval tree TREE, performing FUNCTION on each node. 176/* Traverse an interval tree TREE, performing FUNCTION on each node.
177 177 Pass FUNCTION two args: an interval, and ARG. */
178 Perhaps we should pass the depth as an argument. */
179 178
180void 179void
181traverse_intervals (tree, position, depth, function) 180traverse_intervals (tree, position, depth, function, arg)
182 INTERVAL tree; 181 INTERVAL tree;
183 int position, depth; 182 int position, depth;
184 void (* function) (); 183 void (* function) ();
184 Lisp_Object arg;
185{ 185{
186 if (NULL_INTERVAL_P (tree)) 186 if (NULL_INTERVAL_P (tree))
187 return; 187 return;
@@ -189,7 +189,7 @@ traverse_intervals (tree, position, depth, function)
189 traverse_intervals (tree->left, position, depth + 1, function); 189 traverse_intervals (tree->left, position, depth + 1, function);
190 position += LEFT_TOTAL_LENGTH (tree); 190 position += LEFT_TOTAL_LENGTH (tree);
191 tree->position = position; 191 tree->position = position;
192 (*function) (tree); 192 (*function) (tree, arg);
193 position += LENGTH (tree); 193 position += LENGTH (tree);
194 traverse_intervals (tree->right, position, depth + 1, function); 194 traverse_intervals (tree->right, position, depth + 1, function);
195} 195}
@@ -217,7 +217,7 @@ search_for_interval (i, tree)
217 icount = 0; 217 icount = 0;
218 search_interval = i; 218 search_interval = i;
219 found_interval = NULL_INTERVAL; 219 found_interval = NULL_INTERVAL;
220 traverse_intervals (tree, 1, 0, &check_for_interval); 220 traverse_intervals (tree, 1, 0, &check_for_interval, Qnil);
221 return found_interval; 221 return found_interval;
222} 222}
223 223
@@ -239,7 +239,7 @@ count_intervals (i)
239 icount = 0; 239 icount = 0;
240 idepth = 0; 240 idepth = 0;
241 zero_length = 0; 241 zero_length = 0;
242 traverse_intervals (i, 1, 0, &inc_interval_count); 242 traverse_intervals (i, 1, 0, &inc_interval_count, Qnil);
243 243
244 return icount; 244 return icount;
245} 245}