fix MSVC warning C4018: '...' : signed/unsigned mismatch
fix MSVC warning C4267: '...' : conversion from '...' to '...', possible loss of data
compile with /W4