Add casts to avoid precision loss warnings under MSVC.

Signed-off-by: Nathan E. Egge <negge@dgql.org>