fix compiler warnings due to comparison of signed and unsigned
Merge pull request #224 from norihiro-w/fix-warnings

Fix compiler warnings due to comparison of signed and unsigned