[1/N] Change C-style casts to static_cast or reinterpret_cast (#165750)

This series of changes try to cover C style casts into C++ alternatives.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/165750
Approved by: https://github.com/Skylion007
This commit is contained in:
Yuanyuan Chen
2025-10-20 04:36:19 +00:00
committed by PyTorch MergeBot
parent 767199fd9b
commit e1e8491b31
52 changed files with 463 additions and 322 deletions

View File

@ -13,7 +13,7 @@ RegisterWorkerInfoOnce::RegisterWorkerInfoOnce() {
}
WorkerInfo::WorkerInfo(std::string name, int64_t id)
: WorkerInfo(std::move(name), (worker_id_t)id) {
: WorkerInfo(std::move(name), static_cast<worker_id_t>(id)) {
TORCH_CHECK(
id <= std::numeric_limits<worker_id_t>::max(),
"RPC worker id ",