Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apacheGH-40882: [C++] Suppress shorten-64-to-32 warnings in CUDA/Skyh…
…ook codes (apache#40883) ### Rationale for this change ```text cpp/src/arrow/gpu/cuda_memory.cc:497:72: error: implicit conversion loses integer precision: 'int64_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32] ARROW_ASSIGN_OR_RAISE(auto device, arrow::cuda::CudaDevice::Make(device_id)); ~~~~~ ^~~~~~~~~ ``` ```text cpp/src/arrow/gpu/cuda_memory.cc:508:68: error: implicit conversion loses integer precision: 'int64_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32] ARROW_ASSIGN_OR_RAISE(auto device, arrow::cuda::CudaDevice::Make(device_id)); ~~~~~ ^~~~~~~~~ ``` ```text cpp/src/skyhook/protocol/skyhook_protocol.cc:109:69: error: implicit conversion loses integer precision: 'int64_t' (aka 'long') to 'unsigned int' [-Werror,-Wshorten-64-to-32] bl->append(reinterpret_cast<const char*>(buffer->data()), buffer->size()); ~~~~~~ ~~~~~~~~^~~~~~ ``` ```text cpp/src/skyhook/cls/cls_skyhook.cc:87:37: error: implicit conversion loses integer precision: 'int64_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32] cls_cxx_read(hctx_, position, nbytes, bl.get()); ~~~~~~~~~~~~ ^~~~~~ cpp/src/skyhook/cls/cls_skyhook.cc:87:27: error: implicit conversion loses integer precision: 'int64_t' (aka 'long') to 'int' [-Werror,-Wshorten-64-to-32] cls_cxx_read(hctx_, position, nbytes, bl.get()); ~~~~~~~~~~~~ ^~~~~~~~ ``` ```text cpp/src/skyhook/protocol/skyhook_protocol.cc:109:69: error: implicit conversion loses integer precision: 'int64_t' (aka 'long') to 'unsigned int' [-Werror,-Wshorten-64-to-32] bl->append(reinterpret_cast<const char*>(buffer->data()), buffer->size()); ~~~~~~ ``` ### What changes are included in this PR? Add casts explicitly. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * GitHub Issue: apache#40882 Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
- Loading branch information