parquet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jul...@apache.org
Subject parquet-cpp git commit: PARQUET-519: Remove last of suppressed compiler warnings
Date Wed, 02 Mar 2016 01:35:00 GMT
Repository: parquet-cpp
Updated Branches:
  refs/heads/master 46e40e20e -> 57383cf3c


PARQUET-519: Remove last of suppressed compiler warnings

Author: Wes McKinney <wesm@apache.org>

Closes #69 from wesm/PARQUET-519 and squashes the following commits:

cde787e [Wes McKinney] Initialize RleDecoder with encoded_len
b8f0234 [Wes McKinney] Remove -Wno-unused-variable and fix compiler warnings


Project: http://git-wip-us.apache.org/repos/asf/parquet-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/parquet-cpp/commit/57383cf3
Tree: http://git-wip-us.apache.org/repos/asf/parquet-cpp/tree/57383cf3
Diff: http://git-wip-us.apache.org/repos/asf/parquet-cpp/diff/57383cf3

Branch: refs/heads/master
Commit: 57383cf3cadf302992ab0ef8ebae9cca95aabc15
Parents: 46e40e2
Author: Wes McKinney <wesm@apache.org>
Authored: Tue Mar 1 17:34:57 2016 -0800
Committer: Julien Le Dem <julien@dremio.com>
Committed: Tue Mar 1 17:34:57 2016 -0800

----------------------------------------------------------------------
 CMakeLists.txt                              | 2 +-
 example/parquet_reader.cc                   | 2 +-
 src/parquet/column/levels-test.cc           | 1 -
 src/parquet/column/levels.h                 | 1 -
 src/parquet/column/test-util.h              | 6 ------
 src/parquet/encodings/dictionary-encoding.h | 1 -
 src/parquet/encodings/encoding-test.cc      | 1 -
 src/parquet/file/file-deserialize-test.cc   | 1 -
 src/parquet/file/reader.cc                  | 1 -
 src/parquet/thrift/CMakeLists.txt           | 3 +++
 src/parquet/util/rle-test.cc                | 6 ++----
 11 files changed, 7 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/57383cf3/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index de3dd14..b84c3f3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -244,7 +244,7 @@ message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
 
 # Build with C++11 and SSE3 by default
 # TODO(wesm): These compiler warning suppressions should be removed one by one
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -msse3 -Wall -Wno-unused-variable")
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -msse3 -Wall")
 
 if (APPLE)
   # Use libc++ to avoid linker errors on some platforms

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/57383cf3/example/parquet_reader.cc
----------------------------------------------------------------------
diff --git a/example/parquet_reader.cc b/example/parquet_reader.cc
index 8acc4a7..c4c2352 100644
--- a/example/parquet_reader.cc
+++ b/example/parquet_reader.cc
@@ -34,7 +34,7 @@ int main(int argc, char** argv) {
   bool memory_map = true;
 
   // Read command-line options
-  char *param, *value;
+  char *param;
   for (int i = 1; i < argc; i++) {
     if ((param = std::strstr(argv[i], "--only-stats"))) {
       print_values = false;

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/57383cf3/src/parquet/column/levels-test.cc
----------------------------------------------------------------------
diff --git a/src/parquet/column/levels-test.cc b/src/parquet/column/levels-test.cc
index 57aa562..17537be 100644
--- a/src/parquet/column/levels-test.cc
+++ b/src/parquet/column/levels-test.cc
@@ -30,7 +30,6 @@ namespace parquet_cpp {
 
 void GenerateLevels(int min_repeat_factor, int max_repeat_factor,
     int max_level, std::vector<int16_t>& input_levels) {
-  int total_count = 0;
   // for each repetition count upto max_repeat_factor
   for (int repeat = min_repeat_factor; repeat <= max_repeat_factor; repeat++) {
     // repeat count increases by a factor of 2 for every iteration

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/57383cf3/src/parquet/column/levels.h
----------------------------------------------------------------------
diff --git a/src/parquet/column/levels.h b/src/parquet/column/levels.h
index 55f36ad..9d66188 100644
--- a/src/parquet/column/levels.h
+++ b/src/parquet/column/levels.h
@@ -104,7 +104,6 @@ class LevelDecoder {
   int SetData(Encoding::type encoding, int16_t max_level,
       int num_buffered_values, const uint8_t* data) {
     uint32_t num_bytes = 0;
-    uint32_t total_bytes = 0;
     encoding_ = encoding;
     num_values_remaining_ = num_buffered_values;
     bit_width_ = BitUtil::Log2(max_level + 1);

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/57383cf3/src/parquet/column/test-util.h
----------------------------------------------------------------------
diff --git a/src/parquet/column/test-util.h b/src/parquet/column/test-util.h
index a2cd77f..36e9860 100644
--- a/src/parquet/column/test-util.h
+++ b/src/parquet/column/test-util.h
@@ -102,8 +102,6 @@ class DataPageBuilder {
     if (encoding != Encoding::PLAIN) {
       ParquetException::NYI("only plain encoding currently implemented");
     }
-    int bytes_to_encode = values.size() * sizeof(T);
-
     PlainEncoder<TYPE> encoder(d);
     encoder.Encode(&values[0], values.size(), sink_);
 
@@ -171,8 +169,6 @@ void DataPageBuilder<Type::BOOLEAN>::AppendValues(const ColumnDescriptor
*d,
   if (encoding != Encoding::PLAIN) {
     ParquetException::NYI("only plain encoding currently implemented");
   }
-  int bytes_to_encode = values.size() * sizeof(bool);
-
   PlainEncoder<Type::BOOLEAN> encoder(d);
   encoder.Encode(values, values.size(), sink_);
 
@@ -186,8 +182,6 @@ static std::shared_ptr<DataPage> MakeDataPage(const ColumnDescriptor
*d,
     const std::vector<T>& values,
     const std::vector<int16_t>& def_levels, int16_t max_def_level,
     const std::vector<int16_t>& rep_levels, int16_t max_rep_level) {
-  int num_values = values.size();
-
   InMemoryOutputStream page_stream;
   test::DataPageBuilder<TYPE> page_builder(&page_stream);
 

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/57383cf3/src/parquet/encodings/dictionary-encoding.h
----------------------------------------------------------------------
diff --git a/src/parquet/encodings/dictionary-encoding.h b/src/parquet/encodings/dictionary-encoding.h
index eba9b49..93780a1 100644
--- a/src/parquet/encodings/dictionary-encoding.h
+++ b/src/parquet/encodings/dictionary-encoding.h
@@ -314,7 +314,6 @@ inline void DictEncoder<T>::Put(const T& v) {
     index = hash_slots_[j];
   }
 
-  int bytes_added = 0;
   if (index == HASH_SLOT_EMPTY) {
     // Not in the hash table, so we insert it now
     index = uniques_.size();

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/57383cf3/src/parquet/encodings/encoding-test.cc
----------------------------------------------------------------------
diff --git a/src/parquet/encodings/encoding-test.cc b/src/parquet/encodings/encoding-test.cc
index f45736a..e74f4ff 100644
--- a/src/parquet/encodings/encoding-test.cc
+++ b/src/parquet/encodings/encoding-test.cc
@@ -96,7 +96,6 @@ template <>
 void GenerateData<ByteArray>(int num_values, ByteArray* out, vector<uint8_t>*
heap) {
   // seed the prng so failure is deterministic
   int max_byte_array_len = 12;
-  int num_bytes = max_byte_array_len + sizeof(uint32_t);
   heap->resize(num_values * max_byte_array_len);
   random_byte_array(num_values, 0, heap->data(), out, 2, max_byte_array_len);
 }

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/57383cf3/src/parquet/file/file-deserialize-test.cc
----------------------------------------------------------------------
diff --git a/src/parquet/file/file-deserialize-test.cc b/src/parquet/file/file-deserialize-test.cc
index 1cbdaed..2a7c347 100644
--- a/src/parquet/file/file-deserialize-test.cc
+++ b/src/parquet/file/file-deserialize-test.cc
@@ -77,7 +77,6 @@ class TestPageSerde : public ::testing::Test {
     // have meaningful data associated with them
 
     // Serialize the Page header
-    uint32_t serialized_len = max_serialized_len;
     page_header_.__set_data_page_header(data_page_header_);
     page_header_.uncompressed_page_size = uncompressed_size;
     page_header_.compressed_page_size = compressed_size;

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/57383cf3/src/parquet/file/reader.cc
----------------------------------------------------------------------
diff --git a/src/parquet/file/reader.cc b/src/parquet/file/reader.cc
index 8f639e9..beace09 100644
--- a/src/parquet/file/reader.cc
+++ b/src/parquet/file/reader.cc
@@ -170,7 +170,6 @@ void ParquetFileReader::DebugPrint(std::ostream& stream, bool print_values)
{
     vector<std::shared_ptr<Scanner> > scanners(num_columns, NULL);
     for (int i = 0; i < num_columns; ++i) {
       std::shared_ptr<ColumnReader> col_reader = group_reader->Column(i);
-      Type::type col_type = col_reader->type();
 
       std::stringstream ss;
       ss << "%-" << COL_WIDTH << "s";

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/57383cf3/src/parquet/thrift/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/src/parquet/thrift/CMakeLists.txt b/src/parquet/thrift/CMakeLists.txt
index f43c2a5..1c38702 100644
--- a/src/parquet/thrift/CMakeLists.txt
+++ b/src/parquet/thrift/CMakeLists.txt
@@ -19,6 +19,9 @@ set(THRIFT_SRCS
   parquet_constants.cpp
   parquet_types.cpp)
 
+set_source_files_properties(parquet_types.cpp PROPERTIES
+  COMPILE_FLAGS -Wno-unused-variable)
+
 add_library(parquet_thrift STATIC
   ${THRIFT_SRCS}
 )

http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/57383cf3/src/parquet/util/rle-test.cc
----------------------------------------------------------------------
diff --git a/src/parquet/util/rle-test.cc b/src/parquet/util/rle-test.cc
index 0a8309e..9ac973c 100644
--- a/src/parquet/util/rle-test.cc
+++ b/src/parquet/util/rle-test.cc
@@ -221,10 +221,9 @@ bool CheckRoundTrip(const vector<int>& values, int bit_width)
{
   int encoded_len = encoder.Flush();
   int out;
 
-  RleDecoder decoder(buffer, len, bit_width);
+  RleDecoder decoder(buffer, encoded_len, bit_width);
   for (size_t i = 0; i < values.size(); ++i) {
-    uint64_t val;
-    bool result = decoder.Get(&out);
+    EXPECT_TRUE(decoder.Get(&out));
     if (values[i] != out) {
       return false;
     }
@@ -354,7 +353,6 @@ TEST(BitRle, Random) {
   std::random_device rd;
   std::uniform_int_distribution<int> dist(1, 20);
 
-  uint32_t seed = 0;
   for (int iter = 0; iter < niters; ++iter) {
     // generate a seed with device entropy
     uint32_t seed = rd();


Mime
View raw message