io.cpp: fix warnings about narrowing conversions
Merge pull request #9 from rjw57/warn-fix

io.cpp: fix warnings about narrowing conversions