Why the casts? Just make `b`, `kb`, etc. `size_t`, as well.