HomeFreeBSD

tree(3): allow the compare function to return any signed type

Description

tree(3): allow the compare function to return any signed type

This allows to write very short comparison function when we are
comparing just pointer values:

return ((intptr_t)((uintptr_t)a->ptr/2 - (uintptr_t)b->ptr/2));

Reviewed by: dougm, alc
Differential revision: https://reviews.freebsd.org/D35722

Details

Provenance
glebiusAuthored on Jul 7 2022, 5:19 AM
Reviewer
dougm
Differential Revision
D35722: tree(3): allow the compare function to return any signed type
Parents
rG1b91978f6375: tcp: remove a condition in tcp_usr_detach() that never happens
Branches
Unknown
Tags
Unknown