Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
6865fc37
Commit
6865fc37
authored
Nov 10, 2021
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish to track original in FreeBSD
parent
5ea133b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
vtree.h
include/vtree.h
+12
-14
No files found.
include/vtree.h
View file @
6865fc37
...
...
@@ -182,7 +182,7 @@ name##_VSPLAY_INSERT(struct name *head, struct type *elm) \
int __comp; \
name##_VSPLAY(head, elm); \
__comp = (cmp)(elm, (head)->sph_root); \
if(__comp < 0) { \
if
(__comp < 0) { \
VSPLAY_LEFT(elm, field) = VSPLAY_LEFT((head)->sph_root, field);\
VSPLAY_RIGHT(elm, field) = (head)->sph_root; \
VSPLAY_LEFT((head)->sph_root, field) = NULL; \
...
...
@@ -370,16 +370,7 @@ struct { \
* from the bottom up to the root, to update augmented node data.
*/
#ifndef VRBT_AUGMENT
#define VRBT_AUGMENT(x) do {} while (0)
#define VRBT_AUGMENT_UP(x) do {} while (0)
#else
#define VRBT_AUGMENT_UP(x) \
do { \
while((x) != NULL) { \
VRBT_AUGMENT(x); \
x = VRBT_PARENT(x, field); \
} \
} while (0)
#define VRBT_AUGMENT(x) break
#endif
#define VRBT_SWAP_CHILD(head, out, in, field) do { \
...
...
@@ -495,7 +486,7 @@ name##_VRBT_INSERT_COLOR(struct name *head, struct type *elm) \
VRBT_FLIP_RIGHT(elm, field); \
else if (VRBT_RED_RIGHT(child, field)) \
VRBT_FLIP_LEFT(parent, field); \
AN(parent);
\
AN(parent);
\
elm = child; \
} \
VRBT_ROTATE_RIGHT(head, parent, elm, field); \
...
...
@@ -640,7 +631,10 @@ name##_VRBT_REMOVE(struct name *head, struct type *elm) \
VRBT_SET_PARENT(child, parent, field); \
if (parent != NULL) \
name##_VRBT_REMOVE_COLOR(head, parent, child); \
VRBT_AUGMENT_UP(parent); \
while (parent != NULL) { \
VRBT_AUGMENT(parent); \
parent = VRBT_PARENT(parent, field); \
} \
return (old); \
}
...
...
@@ -671,7 +665,10 @@ name##_VRBT_INSERT(struct name *head, struct type *elm) \
else \
VRBT_RIGHT(parent, field) = elm; \
name##_VRBT_INSERT_COLOR(head, elm); \
VRBT_AUGMENT_UP(elm); \
while (elm != NULL) { \
VRBT_AUGMENT(elm); \
elm = VRBT_PARENT(elm, field); \
} \
return (NULL); \
}
...
...
@@ -836,4 +833,5 @@ name##_VRBT_REINSERT(struct name *head, struct type *elm) \
for ((x) = VRBT_MAX(name, head); \
((x) != NULL) && ((y) = name##_VRBT_PREV(x), (x) != NULL); \
(x) = (y))
#endif
/* _VTREE_H_ */
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