convert old style casts to fix warnings