Add some casts to silence C problems