use static_cast to get rid of windows warning.

warning C4244: 'argument' : conversion from 'uint64_t' to 'const unsigned int', possible loss of data