Avoid warnings about comparison between signed and unsigned

There's no need for these variables to be explicitly unsigned.
This also matches the function above.
Merge pull request #1316 from mstorsjo/avoid-warnings

Avoid warnings about comparison between signed and unsigned