Replace type(...) casting by static_cast<type>(...)