[th/signedness-check-minmax] add static assertions to NM_MIN()/NM_MAX()/NM_CLAMP() for mixing signed/unsigned arguments
The macros NM_MIN()
/NM_MAX()
/NM_CLAMP()
use typeof()
to accept any
integer type as argument. Internally, they rely on standard C integral
conversions of the <> operators and the ternary operator for evaluating
the comparison and the result(type).
That works mostly great. Except, comparing signed and unsigned values in C leads to oddities and the caller should explicitly take care of that.
Add static assertions to check that the compared arguments have the same signedness.