replace c-style casts with c++ style in ioDevice