Change integer literals to unsigned to avoid warnings about comparison between signed and unsigned

This fixes warnings in gcc.
Merge pull request #1510 from mstorsjo/unsigned-int-literals

Change integer literals to unsigned to avoid warnings about comparison between signed and unsigned