fix a lot of compile warnings

all of them being `comparison between signed and unsigned integer expressions`