remove ignored parameter
make many more conversions explicit
downcast size_t to unsigned
use proper data types to avoid uncessary casts