Skip to content

Commit

Permalink
apacheGH-38090: [C++][Emscripten] chunked_array: Suppress shorten-64-…
Browse files Browse the repository at this point in the history
…to-32 warnings

We need explicit cast to use `int64_t` for `size_t` on Emscripten.

Explicit casts.
  • Loading branch information
kou committed Oct 6, 2023
1 parent 3697bcd commit 46fcfeb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/src/arrow/chunked_array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Result<std::shared_ptr<Scalar>> ChunkedArray::GetScalar(int64_t index) const {
return Status::IndexError("index with value of ", index,
" is out-of-bounds for chunked array of length ", length_);
}
return chunks_[loc.chunk_index]->GetScalar(loc.index_in_chunk);
return chunks_[static_cast<size_t>(loc.chunk_index)]->GetScalar(loc.index_in_chunk);
}

std::shared_ptr<ChunkedArray> ChunkedArray::Slice(int64_t offset, int64_t length) const {
Expand Down

0 comments on commit 46fcfeb

Please sign in to comment.