avoid casting warning
fix gcc warnings