applied static casts from GCC warnings