Skip to content

Commit

Permalink
ORC-552: Fix c++ compilation for centos 6 and 8, and MacOs 10.14.
Browse files Browse the repository at this point in the history
Fixes apache#436

Signed-off-by: Owen O'Malley <omalley@apache.org>
  • Loading branch information
omalley committed Dec 6, 2019
1 parent 1c3c5a4 commit 6ecc8eb
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 42 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set (WARN_FLAGS "${WARN_FLAGS} -Wno-c++98-compat-pedantic -Wno-padded")
set (WARN_FLAGS "${WARN_FLAGS} -Wno-covered-switch-default")
set (WARN_FLAGS "${WARN_FLAGS} -Wno-missing-noreturn -Wno-unknown-pragmas")
set (WARN_FLAGS "${WARN_FLAGS} -Wno-gnu-zero-variadic-macro-arguments")
set (WARN_FLAGS "${WARN_FLAGS} -Wconversion")
if (CMAKE_HOST_APPLE AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "11.0")
set (WARN_FLAGS "${WARN_FLAGS} -Wno-c++2a-compat")
Expand Down
56 changes: 28 additions & 28 deletions c++/src/ColumnPrinter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ namespace orc {
return std::unique_ptr<ColumnPrinter>(result);
}

VoidColumnPrinter::VoidColumnPrinter(std::string& buffer
): ColumnPrinter(buffer) {
VoidColumnPrinter::VoidColumnPrinter(std::string& _buffer
): ColumnPrinter(_buffer) {
// PASS
}

Expand All @@ -302,8 +302,8 @@ namespace orc {
writeString(buffer, "null");
}

LongColumnPrinter::LongColumnPrinter(std::string& buffer
): ColumnPrinter(buffer),
LongColumnPrinter::LongColumnPrinter(std::string& _buffer
): ColumnPrinter(_buffer),
data(nullptr) {
// PASS
}
Expand All @@ -324,9 +324,9 @@ namespace orc {
}
}

DoubleColumnPrinter::DoubleColumnPrinter(std::string& buffer,
DoubleColumnPrinter::DoubleColumnPrinter(std::string& _buffer,
const Type& type
): ColumnPrinter(buffer),
): ColumnPrinter(_buffer),
data(nullptr),
isFloat(type.getKind() == FLOAT){
// PASS
Expand All @@ -348,8 +348,8 @@ namespace orc {
}
}

Decimal64ColumnPrinter::Decimal64ColumnPrinter(std::string& buffer
): ColumnPrinter(buffer),
Decimal64ColumnPrinter::Decimal64ColumnPrinter(std::string& _buffer
): ColumnPrinter(_buffer),
data(nullptr),
scale(0) {
// PASS
Expand Down Expand Up @@ -398,8 +398,8 @@ namespace orc {
}
}

Decimal128ColumnPrinter::Decimal128ColumnPrinter(std::string& buffer
): ColumnPrinter(buffer),
Decimal128ColumnPrinter::Decimal128ColumnPrinter(std::string& _buffer
): ColumnPrinter(_buffer),
data(nullptr),
scale(0) {
// PASS
Expand All @@ -419,8 +419,8 @@ namespace orc {
}
}

StringColumnPrinter::StringColumnPrinter(std::string& buffer
): ColumnPrinter(buffer),
StringColumnPrinter::StringColumnPrinter(std::string& _buffer
): ColumnPrinter(_buffer),
start(nullptr),
length(nullptr) {
// PASS
Expand Down Expand Up @@ -470,9 +470,9 @@ namespace orc {
}
}

ListColumnPrinter::ListColumnPrinter(std::string& buffer,
ListColumnPrinter::ListColumnPrinter(std::string& _buffer,
const Type& type
): ColumnPrinter(buffer),
): ColumnPrinter(_buffer),
offsets(nullptr) {
elementPrinter = createColumnPrinter(buffer, type.getSubtype(0));
}
Expand All @@ -499,9 +499,9 @@ namespace orc {
}
}

MapColumnPrinter::MapColumnPrinter(std::string& buffer,
MapColumnPrinter::MapColumnPrinter(std::string& _buffer,
const Type& type
): ColumnPrinter(buffer),
): ColumnPrinter(_buffer),
offsets(nullptr) {
keyPrinter = createColumnPrinter(buffer, type.getSubtype(0));
elementPrinter = createColumnPrinter(buffer, type.getSubtype(1));
Expand Down Expand Up @@ -534,9 +534,9 @@ namespace orc {
}
}

UnionColumnPrinter::UnionColumnPrinter(std::string& buffer,
UnionColumnPrinter::UnionColumnPrinter(std::string& _buffer,
const Type& type
): ColumnPrinter(buffer),
): ColumnPrinter(_buffer),
tags(nullptr),
offsets(nullptr) {
for(unsigned int i=0; i < type.getSubtypeCount(); ++i) {
Expand Down Expand Up @@ -577,9 +577,9 @@ namespace orc {
}
}

StructColumnPrinter::StructColumnPrinter(std::string& buffer,
StructColumnPrinter::StructColumnPrinter(std::string& _buffer,
const Type& type
): ColumnPrinter(buffer) {
): ColumnPrinter(_buffer) {
for(unsigned int i=0; i < type.getSubtypeCount(); ++i) {
fieldNames.push_back(type.getFieldName(i));
fieldPrinter.push_back(createColumnPrinter(buffer,
Expand Down Expand Up @@ -621,8 +621,8 @@ namespace orc {
}
}

DateColumnPrinter::DateColumnPrinter(std::string& buffer
): ColumnPrinter(buffer),
DateColumnPrinter::DateColumnPrinter(std::string& _buffer
): ColumnPrinter(_buffer),
data(nullptr) {
// PASS
}
Expand All @@ -647,8 +647,8 @@ namespace orc {
data = dynamic_cast<const LongVectorBatch&>(batch).data.data();
}

BooleanColumnPrinter::BooleanColumnPrinter(std::string& buffer
): ColumnPrinter(buffer),
BooleanColumnPrinter::BooleanColumnPrinter(std::string& _buffer
): ColumnPrinter(_buffer),
data(nullptr) {
// PASS
}
Expand All @@ -666,8 +666,8 @@ namespace orc {
data = dynamic_cast<const LongVectorBatch&>(batch).data.data();
}

BinaryColumnPrinter::BinaryColumnPrinter(std::string& buffer
): ColumnPrinter(buffer),
BinaryColumnPrinter::BinaryColumnPrinter(std::string& _buffer
): ColumnPrinter(_buffer),
start(nullptr),
length(nullptr) {
// PASS
Expand Down Expand Up @@ -697,8 +697,8 @@ namespace orc {
length = dynamic_cast<const StringVectorBatch&>(batch).length.data();
}

TimestampColumnPrinter::TimestampColumnPrinter(std::string& buffer
): ColumnPrinter(buffer),
TimestampColumnPrinter::TimestampColumnPrinter(std::string& _buffer
): ColumnPrinter(_buffer),
seconds(nullptr),
nanoseconds(nullptr) {
// PASS
Expand Down
28 changes: 14 additions & 14 deletions c++/src/Vector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ namespace orc {
return false;
}

LongVectorBatch::LongVectorBatch(uint64_t capacity, MemoryPool& pool
): ColumnVectorBatch(capacity, pool),
data(pool, capacity) {
LongVectorBatch::LongVectorBatch(uint64_t _capacity, MemoryPool& pool
): ColumnVectorBatch(_capacity, pool),
data(pool, _capacity) {
// PASS
}

Expand All @@ -84,9 +84,9 @@ namespace orc {
static_cast<uint64_t>(data.capacity() * sizeof(int64_t));
}

DoubleVectorBatch::DoubleVectorBatch(uint64_t capacity, MemoryPool& pool
): ColumnVectorBatch(capacity, pool),
data(pool, capacity) {
DoubleVectorBatch::DoubleVectorBatch(uint64_t _capacity, MemoryPool& pool
): ColumnVectorBatch(_capacity, pool),
data(pool, _capacity) {
// PASS
}

Expand All @@ -112,10 +112,10 @@ namespace orc {
+ static_cast<uint64_t>(data.capacity() * sizeof(double));
}

StringVectorBatch::StringVectorBatch(uint64_t capacity, MemoryPool& pool
): ColumnVectorBatch(capacity, pool),
data(pool, capacity),
length(pool, capacity) {
StringVectorBatch::StringVectorBatch(uint64_t _capacity, MemoryPool& pool
): ColumnVectorBatch(_capacity, pool),
data(pool, _capacity),
length(pool, _capacity) {
// PASS
}

Expand Down Expand Up @@ -400,12 +400,12 @@ namespace orc {
return value.toDecimalString(scale);
}

TimestampVectorBatch::TimestampVectorBatch(uint64_t capacity,
TimestampVectorBatch::TimestampVectorBatch(uint64_t _capacity,
MemoryPool& pool
): ColumnVectorBatch(capacity,
): ColumnVectorBatch(_capacity,
pool),
data(pool, capacity),
nanoseconds(pool, capacity) {
data(pool, _capacity),
nanoseconds(pool, _capacity) {
// PASS
}

Expand Down
1 change: 1 addition & 0 deletions c++/src/wrap/gmock.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "Adaptor.hh"

DIAGNOSTIC_PUSH
DIAGNOSTIC_IGNORE("-Wconversion")
DIAGNOSTIC_IGNORE("-Wdeprecated")
DIAGNOSTIC_IGNORE("-Wmissing-noreturn")
DIAGNOSTIC_IGNORE("-Wpadded")
Expand Down
1 change: 1 addition & 0 deletions c++/src/wrap/gtest-wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ DIAGNOSTIC_IGNORE("-Wsign-compare")

DIAGNOSTIC_PUSH

DIAGNOSTIC_IGNORE("-Wconversion")
DIAGNOSTIC_IGNORE("-Wdeprecated")
DIAGNOSTIC_IGNORE("-Wmissing-noreturn")
DIAGNOSTIC_IGNORE("-Wpadded")
Expand Down
3 changes: 3 additions & 0 deletions c++/test/TestColumnReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
#ifdef __clang__
DIAGNOSTIC_IGNORE("-Winconsistent-missing-override")
#endif
#ifdef __GNUC__
DIAGNOSTIC_IGNORE("-Wparentheses")
#endif

namespace orc {

Expand Down

0 comments on commit 6ecc8eb

Please sign in to comment.