]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
tree(3): allow the compare function to return any signed type
authorGleb Smirnoff <glebius@FreeBSD.org>
Thu, 7 Jul 2022 05:19:08 +0000 (22:19 -0700)
committerGleb Smirnoff <glebius@FreeBSD.org>
Thu, 7 Jul 2022 05:19:08 +0000 (22:19 -0700)
commit86cdadbed44ecd36469dfbc4f1e492dfe51fcd4e
tree10abdc2ad4f0621024f0236b3cefd84e3566cdf7
parent1b91978f6375023b00c7d2b49a778765ce4ee6b8
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
sys/sys/tree.h