I'm a bit concerned here as the size of `int` and `short` are not strictly defined by the C standard. We should probably be using `npy_int16` and `npy_int32`, but that would require a significant refactoring to change the loop names. I don't know of any platforms for which the size assumptions are wrong, but...