Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emacs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
e0b63493
Commit
e0b63493
authored
Oct 14, 1992
by
Joseph Arceneaux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* intervals.c (traverse_intervals): New parameter `depth'.
Increment this when passing recursively.
parent
433c2175
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
src/intervals.c
src/intervals.c
+6
-10
No files found.
src/intervals.c
View file @
e0b63493
...
@@ -173,29 +173,25 @@ static int icount;
...
@@ -173,29 +173,25 @@ static int icount;
static
int
idepth
;
static
int
idepth
;
static
int
zero_length
;
static
int
zero_length
;
static
int
depth
;
/* Traverse an interval tree TREE, performing FUNCTION on each node.
/* Traverse an interval tree TREE, performing FUNCTION on each node.
Perhaps we should pass the depth as an argument. */
Perhaps we should pass the depth as an argument. */
void
void
traverse_intervals
(
tree
,
position
,
function
)
traverse_intervals
(
tree
,
position
,
depth
,
function
)
INTERVAL
tree
;
INTERVAL
tree
;
int
position
;
int
position
,
depth
;
void
(
*
function
)
();
void
(
*
function
)
();
{
{
if
(
NULL_INTERVAL_P
(
tree
))
if
(
NULL_INTERVAL_P
(
tree
))
return
;
return
;
depth
++
;
traverse_intervals
(
tree
->
left
,
position
,
depth
+
1
,
function
);
traverse_intervals
(
tree
->
left
,
position
,
function
);
position
+=
LEFT_TOTAL_LENGTH
(
tree
);
position
+=
LEFT_TOTAL_LENGTH
(
tree
);
tree
->
position
=
position
;
tree
->
position
=
position
;
(
*
function
)
(
tree
);
(
*
function
)
(
tree
);
position
+=
LENGTH
(
tree
);
position
+=
LENGTH
(
tree
);
traverse_intervals
(
tree
->
right
,
position
,
function
);
traverse_intervals
(
tree
->
right
,
position
,
depth
+
1
,
function
);
depth
--
;
}
}
#if 0
#if 0
...
@@ -221,7 +217,7 @@ search_for_interval (i, tree)
...
@@ -221,7 +217,7 @@ search_for_interval (i, tree)
icount = 0;
icount = 0;
search_interval = i;
search_interval = i;
found_interval = NULL_INTERVAL;
found_interval = NULL_INTERVAL;
traverse_intervals (tree, 1, &check_for_interval);
traverse_intervals (tree, 1,
0,
&check_for_interval);
return found_interval;
return found_interval;
}
}
...
@@ -243,7 +239,7 @@ count_intervals (i)
...
@@ -243,7 +239,7 @@ count_intervals (i)
icount = 0;
icount = 0;
idepth = 0;
idepth = 0;
zero_length = 0;
zero_length = 0;
traverse_intervals (i, 1, &inc_interval_count);
traverse_intervals (i, 1,
0,
&inc_interval_count);
return icount;
return icount;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment