fix MSVC warning C4244: '...' : conversion from '...' to '...', possible loss of data
fix MSVC warning C4996: '...': This function or variable may be unsafe. Consider using ... instead.