For integer comparisons, ensure the signed-unsigned comparison is safe.

1. If the sizeof(signed type) > sizeof(unsigned type), cast to unsigned to signed
2. If min(signed value) >= 0, cast signed to unsigned
3. If max(unsigned value) < max(unsigned type)/2, cast unsigned to signed-of-same-size
else the comparison is in error.