arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject arrow git commit: ARROW-219: Preserve CMAKE_CXX_FLAGS, fix compiler warnings
Date Fri, 17 Jun 2016 05:07:37 GMT
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 <wesm@apache.org>

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 <wesm@apache.org>
Authored: Thu Jun 16 22:07:30 2016 -0700
Committer: Wes McKinney <wesm@apache.org>
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<Table> MakeSimpleTable(
 template <typename T>
 void ExpectArray(T* expected, Array* result) {
   PrimitiveArray* p_array = static_cast<PrimitiveArray*>(result);
-  for (size_t i = 0; i < result->length(); i++) {
+  for (int i = 0; i < result->length(); i++) {
     EXPECT_EQ(expected[i], reinterpret_cast<const T*>(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<typename ParquetType::c_type*>(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> 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


Mime
View raw message