need int64 cast to prevent overflow on the 32-bit architecture

Signed-off-by: Chanwit Kaewkasi <chanwit@gmail.com>
Merge pull request #211 from chanwit/int-overflow

Cleanup: need int64 cast to prevent overflow on the 32-bit architecture