Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2993D200B40 for ; Fri, 17 Jun 2016 07:07:39 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 281DF160A52; Fri, 17 Jun 2016 05:07:39 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4D35B160A51 for ; Fri, 17 Jun 2016 07:07:38 +0200 (CEST) Received: (qmail 89411 invoked by uid 500); 17 Jun 2016 05:07:37 -0000 Mailing-List: contact commits-help@arrow.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@arrow.apache.org Delivered-To: mailing list commits@arrow.apache.org Received: (qmail 89402 invoked by uid 99); 17 Jun 2016 05:07:37 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Jun 2016 05:07:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4756DE009D; Fri, 17 Jun 2016 05:07:37 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: wesm@apache.org To: commits@arrow.apache.org Message-Id: <25a17008dd6e4f0f9b55dd70476824d3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: arrow git commit: ARROW-219: Preserve CMAKE_CXX_FLAGS, fix compiler warnings Date: Fri, 17 Jun 2016 05:07:37 +0000 (UTC) archived-at: Fri, 17 Jun 2016 05:07:39 -0000 Repository: arrow Updated Branches: refs/heads/master 27edd25eb -> a3e3849cd ARROW-219: Preserve CMAKE_CXX_FLAGS, fix compiler warnings Some undesired compiler warnings had crept into our build; future warnings should fail the build now. Author: Wes McKinney Closes #92 from wesm/ARROW-219 and squashes the following commits: fd68a74 [Wes McKinney] Buglet 6507351 [Wes McKinney] Fix clang warning 0f9e3ca [Wes McKinney] Preserve CMAKE_CXX_FLAGS, fix compiler warnings Project: http://git-wip-us.apache.org/repos/asf/arrow/repo Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/a3e3849c Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/a3e3849c Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/a3e3849c Branch: refs/heads/master Commit: a3e3849cde60f611ea47271f510a96c2f36606a7 Parents: 27edd25 Author: Wes McKinney Authored: Thu Jun 16 22:07:30 2016 -0700 Committer: Wes McKinney Committed: Thu Jun 16 22:07:30 2016 -0700 ---------------------------------------------------------------------- cpp/CMakeLists.txt | 13 +++++++------ cpp/src/arrow/parquet/test-util.h | 2 +- cpp/src/arrow/parquet/writer.cc | 8 +++++++- cpp/src/arrow/parquet/writer.h | 2 ++ cpp/src/arrow/util/macros.h | 2 ++ 5 files changed, 19 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/arrow/blob/a3e3849c/cpp/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index a3fb010..bdf7572 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -139,15 +139,15 @@ string (TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE) # Set compile flags based on the build type. message("Configured for ${CMAKE_BUILD_TYPE} build (set with cmake -DCMAKE_BUILD_TYPE={release,debug,...})") if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG") - set(CMAKE_CXX_FLAGS ${CXX_FLAGS_DEBUG}) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAGS_DEBUG}") elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "FASTDEBUG") - set(CMAKE_CXX_FLAGS ${CXX_FLAGS_FASTDEBUG}) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAGS_FASTDEBUG}") elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE") - set(CMAKE_CXX_FLAGS ${CXX_FLAGS_RELEASE}) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAGS_RELEASE}") elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "PROFILE_GEN") - set(CMAKE_CXX_FLAGS ${CXX_FLAGS_PROFILE_GEN}) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAGS_PROFILE_GEN}") elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "PROFILE_BUILD") - set(CMAKE_CXX_FLAGS ${CXX_FLAGS_PROFILE_BUILD}) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAGS_PROFILE_BUILD}") else() message(FATAL_ERROR "Unknown build type: ${CMAKE_BUILD_TYPE}") endif () @@ -165,6 +165,7 @@ if ("${COMPILER_FAMILY}" STREQUAL "clang") # http://petereisentraut.blogspot.com/2011/05/ccache-and-clang.html # http://petereisentraut.blogspot.com/2011/09/ccache-and-clang-part-2.html set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CLANG_OPTIONS}") endif() # Sanity check linking option. @@ -559,7 +560,7 @@ if (${CLANG_TIDY_FOUND}) add_custom_target(clang-tidy ${BUILD_SUPPORT_DIR}/run-clang-tidy.sh ${CLANG_TIDY_BIN} ${CMAKE_BINARY_DIR}/compile_commands.json 1 `find ${CMAKE_CURRENT_SOURCE_DIR}/src -name \\*.cc | sed -e '/_generated/g'`) # runs clang-tidy and exits with a non-zero exit code if any errors are found. - add_custom_target(check-clang-tidy ${BUILD_SUPPORT_DIR}/run-clang-tidy.sh ${CLANG_TIDY_BIN} ${CMAKE_BINARY_DIR}/compile_commands.json + add_custom_target(check-clang-tidy ${BUILD_SUPPORT_DIR}/run-clang-tidy.sh ${CLANG_TIDY_BIN} ${CMAKE_BINARY_DIR}/compile_commands.json 0 `find ${CMAKE_CURRENT_SOURCE_DIR}/src -name \\*.cc |grep -v -F -f ${CMAKE_CURRENT_SOURCE_DIR}/src/.clang-tidy-ignore | sed -e '/_generated/g'`) endif() http://git-wip-us.apache.org/repos/asf/arrow/blob/a3e3849c/cpp/src/arrow/parquet/test-util.h ---------------------------------------------------------------------- diff --git a/cpp/src/arrow/parquet/test-util.h b/cpp/src/arrow/parquet/test-util.h index 1496082..cc8723b 100644 --- a/cpp/src/arrow/parquet/test-util.h +++ b/cpp/src/arrow/parquet/test-util.h @@ -67,7 +67,7 @@ std::shared_ptr MakeSimpleTable( template void ExpectArray(T* expected, Array* result) { PrimitiveArray* p_array = static_cast(result); - for (size_t i = 0; i < result->length(); i++) { + for (int i = 0; i < result->length(); i++) { EXPECT_EQ(expected[i], reinterpret_cast(p_array->data()->data())[i]); } } http://git-wip-us.apache.org/repos/asf/arrow/blob/a3e3849c/cpp/src/arrow/parquet/writer.cc ---------------------------------------------------------------------- diff --git a/cpp/src/arrow/parquet/writer.cc b/cpp/src/arrow/parquet/writer.cc index 1223901..4005e3b 100644 --- a/cpp/src/arrow/parquet/writer.cc +++ b/cpp/src/arrow/parquet/writer.cc @@ -50,6 +50,8 @@ class FileWriter::Impl { virtual ~Impl() {} private: + friend class FileWriter; + MemoryPool* pool_; PoolBuffer data_buffer_; PoolBuffer def_levels_buffer_; @@ -94,7 +96,7 @@ Status FileWriter::Impl::TypedWriteBatch(::parquet::ColumnWriter* column_writer, auto buffer_ptr = reinterpret_cast(data_buffer_.mutable_data()); int buffer_idx = 0; - for (size_t i = 0; i < length; i++) { + for (int i = 0; i < length; i++) { if (data->IsNull(offset + i)) { def_levels_ptr[i] = 0; } else { @@ -156,6 +158,10 @@ Status FileWriter::Close() { return impl_->Close(); } +MemoryPool* FileWriter::memory_pool() const { + return impl_->pool_; +} + FileWriter::~FileWriter() {} Status WriteFlatTable(const Table* table, MemoryPool* pool, http://git-wip-us.apache.org/repos/asf/arrow/blob/a3e3849c/cpp/src/arrow/parquet/writer.h ---------------------------------------------------------------------- diff --git a/cpp/src/arrow/parquet/writer.h b/cpp/src/arrow/parquet/writer.h index 83e799f..93693f5 100644 --- a/cpp/src/arrow/parquet/writer.h +++ b/cpp/src/arrow/parquet/writer.h @@ -49,6 +49,8 @@ class FileWriter { virtual ~FileWriter(); + MemoryPool* memory_pool() const; + private: class Impl; std::unique_ptr impl_; http://git-wip-us.apache.org/repos/asf/arrow/blob/a3e3849c/cpp/src/arrow/util/macros.h ---------------------------------------------------------------------- diff --git a/cpp/src/arrow/util/macros.h b/cpp/src/arrow/util/macros.h index 69ecda1..e2bb355 100644 --- a/cpp/src/arrow/util/macros.h +++ b/cpp/src/arrow/util/macros.h @@ -19,8 +19,10 @@ #define ARROW_UTIL_MACROS_H // From Google gutil +#ifndef DISALLOW_COPY_AND_ASSIGN #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&) = delete; \ TypeName& operator=(const TypeName&) = delete +#endif #endif // ARROW_UTIL_MACROS_H