Add const to slicing parameters

This commit is contained in:
Uwe L. Korn committed 2016-06-03 22:29:36 +02:00
1 parent 0463995eae
commit 7192cfbd31
2 files changed
+5 -5

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ echo $GTEST_HOME
: ${ARROW_CPP_INSTALL=$TRAVIS_BUILD_DIR/cpp-install}
CMAKE_COMMON_FLAGS="-DARROW_BUILD_BENCHMARKS=ON -DCMAKE_INSTALL_PREFIX=$ARROW_CPP_INSTALL"
CMAKE_COMMON_FLAGS="-DARROW_BUILD_BENCHMARKS=ON -DARROW_PARQUET=ON -DCMAKE_INSTALL_PREFIX=$ARROW_CPP_INSTALL"
if [ $TRAVIS_OS_NAME == "linux" ]; then
cmake -DARROW_TEST_MEMCHECK=on $CMAKE_COMMON_FLAGS -DCMAKE_CXX_FLAGS="-Werror" $CPP_DIR
+4 -4
View File
@@ -157,12 +157,12 @@ FileWriter::~FileWriter() {}
//
// This method is specially crafted for WriteFlatTable and assumes the following:
// * chunk_size is a multiple of 512
Status TemporaryArraySlice(int64_t chunk, int64_t chunk_size, PrimitiveArray* array,
Status TemporaryArraySlice(int64_t chunk, int64_t chunk_size, const PrimitiveArray* array,
std::shared_ptr<PrimitiveArray>* out) {
// The last chunk may be smaller than the chunk_size
int64_t size = std::min(chunk_size, array->length() - chunk * chunk_size);
int64_t buffer_offset = chunk * chunk_size * array->type()->value_size();
int64_t value_size = size * array->type()->value_size();
const int64_t size = std::min(chunk_size, array->length() - chunk * chunk_size);
const int64_t buffer_offset = chunk * chunk_size * array->type()->value_size();
const int64_t value_size = size * array->type()->value_size();
auto chunk_buffer = std::make_shared<Buffer>(array->data(), buffer_offset, value_size);
std::shared_ptr<Buffer> null_bitmap;
int32_t null_count = 0;