Skip to content

Commit

Permalink
Allow building the C++ client with clang. (#4153)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcferretti committed Jul 8, 2023
1 parent 8bedc20 commit acb7cd5
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 13 deletions.
5 changes: 5 additions & 0 deletions cpp-client/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BasedOnStyle: Google
IndentWidth: 2

---
Language: Cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ struct ImmerColumnSourceImpls {
if (destNullp != nullptr) {
*destNullp++ = value == deephaven::dhcore::DeephavenTraits<T>::NULL_VALUE;
}
} else {
// avoid clang complaining about unused variables
(void)destNullp;
}
}
};
Expand All @@ -83,6 +86,11 @@ struct ImmerColumnSourceImpls {
auto nullsEndp = srcNullFlags->begin() + srcEnd;
immer::for_each_chunk(nullsBeginp, nullsEndp, copyNullsInner);
}
} else {
// avoid clang complaining about unused variables.
(void)srcNullFlags;
(void)destNullp;
(void)copyNullsInner;
}
};
rows.forEachInterval(copyOuter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class DataInput {
public:
explicit DataInput(const flatbuffers::Vector<int8_t> &vec) : DataInput(vec.data(), vec.size()) {}

DataInput(const void *start, size_t size) : data_(static_cast<const char *>(start)),
size_(size) {}
DataInput(const void *start, size_t size) : data_(static_cast<const char *>(start))
{}

int64_t readValue(int command);

Expand All @@ -24,7 +24,6 @@ class DataInput {

private:
const char *data_ = nullptr;
size_t size_ = 0;
};

struct IndexDecoder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ class DeephavenConstants {
/**
* The minimum finite value for the Deephaven float type.
*/
static constexpr const float MIN_FINITE_FLOAT = std::nextafter(-std::numeric_limits<float>::max(),
0.0f);
static /* constexpr clang dislikes */ const float MIN_FINITE_FLOAT;
/**
* The maximum finite value for the Deephaven float type.
*/
Expand Down Expand Up @@ -155,8 +154,7 @@ class DeephavenConstants {
/**
* The minimum finite value for the Deephaven double type.
*/
static constexpr const double MIN_FINITE_DOUBLE = std::nextafter(
-std::numeric_limits<double>::max(), 0.0f);
static /* constexpr clang dislikes */ const double MIN_FINITE_DOUBLE;
/**
* The maximum finite value for the Deephaven double type.
*/
Expand Down
4 changes: 0 additions & 4 deletions cpp-client/deephaven/dhcore/src/ticking/space_mapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ struct SimpleRangeIterator {
return *this;
}

friend bool operator!=(const SimpleRangeIterator &lhs, const SimpleRangeIterator &rhs) {
return lhs.value_ != rhs.value_;
}

uint64_t value_;
};
}
Expand Down
8 changes: 6 additions & 2 deletions cpp-client/deephaven/dhcore/src/types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*/
#include "deephaven/dhcore/types.h"

#include <limits>

namespace deephaven::dhcore {
const char16_t DeephavenConstants::NULL_CHAR;

Expand All @@ -12,7 +14,8 @@ const float DeephavenConstants::NEG_INFINITY_FLOAT;
const float DeephavenConstants::POS_INFINITY_FLOAT;
const float DeephavenConstants::MIN_FLOAT;
const float DeephavenConstants::MAX_FLOAT;
const float DeephavenConstants::MIN_FINITE_FLOAT;
const float DeephavenConstants::MIN_FINITE_FLOAT =
std::nextafter(-std::numeric_limits<float>::max(), 0.0f);
const float DeephavenConstants::MAX_FINITE_FLOAT;
const float DeephavenConstants::MIN_POS_FLOAT;

Expand All @@ -22,7 +25,8 @@ const double DeephavenConstants::NEG_INFINITY_DOUBLE;
const double DeephavenConstants::POS_INFINITY_DOUBLE;
const double DeephavenConstants::MIN_DOUBLE;
const double DeephavenConstants::MAX_DOUBLE;
const double DeephavenConstants::MIN_FINITE_DOUBLE;
const double DeephavenConstants::MIN_FINITE_DOUBLE =
std::nextafter(-std::numeric_limits<double>::max(), 0.0);
const double DeephavenConstants::MAX_FINITE_DOUBLE;
const double DeephavenConstants::MIN_POS_DOUBLE;

Expand Down

0 comments on commit acb7cd5

Please sign in to comment.