dda48b6f84
`usize` is made exactly for this (e.g.: the size of a buffer), and signatures are a bit more idiomatic. These changes also try to cast the u32 to a usize as soon as we read it, and will panic if there is an issue (whereas using `as usize` may result in silent conversion errors on uncommon architectures.