Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142233248
D35722.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D35722.diff
View Options
diff --git a/sys/sys/tree.h b/sys/sys/tree.h
--- a/sys/sys/tree.h
+++ b/sys/sys/tree.h
@@ -176,7 +176,7 @@
if (SPLAY_EMPTY(head)) { \
SPLAY_LEFT(elm, field) = SPLAY_RIGHT(elm, field) = NULL; \
} else { \
- int __comp; \
+ __typeof(cmp(NULL, NULL)) __comp; \
name##_SPLAY(head, elm); \
__comp = (cmp)(elm, (head)->sph_root); \
if (__comp < 0) { \
@@ -219,7 +219,7 @@
name##_SPLAY(struct name *head, struct type *elm) \
{ \
struct type __node, *__left, *__right, *__tmp; \
- int __comp; \
+ __typeof(cmp(NULL, NULL)) __comp; \
\
SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\
__left = __right = &__node; \
@@ -694,7 +694,7 @@
{ \
struct type *tmp; \
struct type *parent = NULL; \
- int comp = 0; \
+ __typeof(cmp(NULL, NULL)) comp = 0; \
tmp = RB_ROOT(head); \
while (tmp) { \
parent = tmp; \
@@ -727,7 +727,7 @@
name##_RB_FIND(struct name *head, struct type *elm) \
{ \
struct type *tmp = RB_ROOT(head); \
- int comp; \
+ __typeof(cmp(NULL, NULL)) comp; \
while (tmp) { \
comp = cmp(elm, tmp); \
if (comp < 0) \
@@ -747,7 +747,7 @@
{ \
struct type *tmp = RB_ROOT(head); \
struct type *res = NULL; \
- int comp; \
+ __typeof(cmp(NULL, NULL)) comp; \
while (tmp) { \
comp = cmp(elm, tmp); \
if (comp < 0) { \
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 18, 3:04 PM (8 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27710787
Default Alt Text
D35722.diff (1 KB)
Attached To
Mode
D35722: tree(3): allow the compare function to return any signed type
Attached
Detach File
Event Timeline
Log In to Comment