explicit (int) casts

added explicit int casts to prevent warnings when compiling for 64 bit.