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

(cherry picked from commit 86cdadbed44ecd36469dfbc4f1e492dfe51fcd4e)

Details

Provenance
glebiusAuthored on Jul 7 2022, 5:19 AM
dougmCommitted on Sep 15 2022, 4:58 PM
Reviewer
dougm
Differential Revision
D35722: tree(3): allow the compare function to return any signed type
Parents
rG7b4561999c57: Add deprecation notices for OPIE.
Branches
Unknown
Tags
Unknown