make g++ happy with some casts