The question to use signed or unsigned integer arithmetic usually is whether one wants to store negative numbers. However, I now have the impression that the actual question rather is whether one needs well-defined overflow, i.e. modular arithmetics. And in our cases here we do not want that.
Therefore we should eventually change everything to a signed integer type, be it int, int8_t or int64_t or ssize_t.
The question to use signed or unsigned integer arithmetic usually is whether one wants to store negative numbers. However, I now have the impression that the actual question rather is whether one needs well-defined overflow, i.e. modular arithmetics. And in our cases here we do not want that.
Therefore we should eventually change everything to a signed integer type, be it
int
,int8_t
orint64_t
orssize_t
.