Adds explicit type casts where necessary for ObjC++ compilation