This is an automated email from the ASF dual-hosted git repository.

marong pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git


The following commit(s) were added to refs/heads/main by this push:
     new 7e4a6bb493 [MINOR][VL] Replace C-style casts with C++ casts in shuffle 
writers (#11621)
7e4a6bb493 is described below

commit 7e4a6bb493d1bddec23349108334e40869ada3b4
Author: Ankita Victor <[email protected]>
AuthorDate: Mon Feb 16 17:56:03 2026 +0530

    [MINOR][VL] Replace C-style casts with C++ casts in shuffle writers (#11621)
---
 cpp/velox/shuffle/VeloxGpuShuffleWriter.cc  | 4 ++--
 cpp/velox/shuffle/VeloxHashShuffleWriter.cc | 6 +++---
 cpp/velox/shuffle/VeloxHashShuffleWriter.h  | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/cpp/velox/shuffle/VeloxGpuShuffleWriter.cc 
b/cpp/velox/shuffle/VeloxGpuShuffleWriter.cc
index f7233e7c1a..36ee60c309 100644
--- a/cpp/velox/shuffle/VeloxGpuShuffleWriter.cc
+++ b/cpp/velox/shuffle/VeloxGpuShuffleWriter.cc
@@ -26,7 +26,7 @@ void VeloxGpuHashShuffleWriter::splitBoolValueType(const 
uint8_t* srcAddr, const
     if (dstaddr == nullptr) {
       continue;
     }
-    auto dstPidBase = (uint8_t*)(dstaddr + partitionBufferBase_[pid] * 
sizeof(uint8_t));
+    auto dstPidBase = reinterpret_cast<uint8_t*>(dstaddr + 
partitionBufferBase_[pid] * sizeof(uint8_t));
     auto pos = partition2RowOffsetBase_[pid];
     auto end = partition2RowOffsetBase_[pid + 1];
     for (; pos < end; ++pos) {
@@ -42,7 +42,7 @@ void VeloxGpuHashShuffleWriter::splitBoolValueType(const 
uint8_t* srcAddr, const
 // Split timestamp from int128_t to int64_t, both of them represents the 
timestamp nanoseconds.
 arrow::Status VeloxGpuHashShuffleWriter::splitTimestamp(const uint8_t* 
srcAddr, const std::vector<uint8_t*>& dstAddrs) {
    for (auto& pid : partitionUsed_) {
-      auto dstPidBase = (int64_t*)(dstAddrs[pid] + partitionBufferBase_[pid] * 
sizeof(int64_t));
+      auto dstPidBase = reinterpret_cast<int64_t*>(dstAddrs[pid] + 
partitionBufferBase_[pid] * sizeof(int64_t));
       auto pos = partition2RowOffsetBase_[pid];
       auto end = partition2RowOffsetBase_[pid + 1];
       for (; pos < end; ++pos) {
diff --git a/cpp/velox/shuffle/VeloxHashShuffleWriter.cc 
b/cpp/velox/shuffle/VeloxHashShuffleWriter.cc
index dda2c42a2e..e8b455e448 100644
--- a/cpp/velox/shuffle/VeloxHashShuffleWriter.cc
+++ b/cpp/velox/shuffle/VeloxHashShuffleWriter.cc
@@ -637,7 +637,7 @@ arrow::Status VeloxHashShuffleWriter::splitBinaryType(
     auto& binaryBuf = dst[pid];
 
     // use 32bit offset
-    auto dstLengthBase = (StringLengthType*)(binaryBuf.lengthPtr) + 
partitionBufferBase_[pid];
+    auto dstLengthBase = 
reinterpret_cast<StringLengthType*>(binaryBuf.lengthPtr) + 
partitionBufferBase_[pid];
 
     auto valueOffset = binaryBuf.valueOffset;
     auto dstValuePtr = binaryBuf.valuePtr + valueOffset;
@@ -661,7 +661,7 @@ arrow::Status VeloxHashShuffleWriter::splitBinaryType(
       if (valueOffset >= capacity) {
         auto oldCapacity = capacity;
         (void)oldCapacity; // suppress warning
-        capacity = capacity + std::max((capacity >> multiply), 
(uint64_t)stringLen);
+        capacity = capacity + std::max((capacity >> multiply), 
static_cast<uint64_t>(stringLen));
         multiply = std::min(3, multiply + 1);
 
         const auto& valueBuffer = partitionBuffers_[fixedWidthColumnCount_ + 
binaryIdx][pid][kBinaryValueBufferIndex];
@@ -675,7 +675,7 @@ arrow::Status VeloxHashShuffleWriter::splitBinaryType(
         binaryBuf.valueCapacity = capacity;
         dstValuePtr = binaryBuf.valuePtr + valueOffset - stringLen;
         // Need to update dstLengthBase because lengthPtr can be updated if 
Reserve triggers spill.
-        dstLengthBase = (StringLengthType*)(binaryBuf.lengthPtr) + 
partitionBufferBase_[pid];
+        dstLengthBase = 
reinterpret_cast<StringLengthType*>(binaryBuf.lengthPtr) + 
partitionBufferBase_[pid];
       }
 
       // 2. copy value
diff --git a/cpp/velox/shuffle/VeloxHashShuffleWriter.h 
b/cpp/velox/shuffle/VeloxHashShuffleWriter.h
index da67413eb2..fd889d4c32 100644
--- a/cpp/velox/shuffle/VeloxHashShuffleWriter.h
+++ b/cpp/velox/shuffle/VeloxHashShuffleWriter.h
@@ -270,7 +270,7 @@ class VeloxHashShuffleWriter : public VeloxShuffleWriter {
   template <typename T>
   arrow::Status splitFixedType(const uint8_t* srcAddr, const 
std::vector<uint8_t*>& dstAddrs) {
     for (auto& pid : partitionUsed_) {
-      auto dstPidBase = (T*)(dstAddrs[pid] + partitionBufferBase_[pid] * 
sizeof(T));
+      auto dstPidBase = reinterpret_cast<T*>(dstAddrs[pid] + 
partitionBufferBase_[pid] * sizeof(T));
       auto pos = partition2RowOffsetBase_[pid];
       auto end = partition2RowOffsetBase_[pid + 1];
       for (; pos < end; ++pos) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to