#
25392fac |
|
02-Jul-2021 |
Lutz Donnerhacke <donner@FreeBSD.org> |
libalias: Fix splay comparsion bug Comparing elements in a tree requires transitiviy. If a < b and b < c then a must be smaller than c. This way the tree elements are always pairwise comparable. Tristate comparsion functions returning values lower, equal, or greater than zero, are usually implemented by a simple subtraction of the operands. If the size of the operands are equal to the size of the result, integer modular arithmetics kick in and violates the transitivity. Example: Working on byte with 0, 120, and 240. Now computing the differences: 120 - 0 = 120 240 - 120 = 120 240 - 0 = -16 MFC after: 3 days
|
#
f70c98a2 |
|
21-Jun-2021 |
Lutz Donnerhacke <donner@FreeBSD.org> |
libalias: Fix compile time warning about unused functions Compiling libalias results in warnings about unused functions. Those warnings are caused by clang's heuristic to consider an inline function as in use, iff the declaration is in a *.c file. Declarations in *.h files do not emit those warnings. Hence the declarations must be moved to an extra *.h file. MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D30844
|