This is an automated email from the ASF dual-hosted git repository. jking pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/thrift.git
commit 7007506960437a51fad46a2426ebadee50b7817f Author: cyy <cyye...@outlook.com> AuthorDate: Sun Jan 6 10:12:45 2019 +0800 replace boost static_assert with static_assert --- lib/cpp/src/thrift/protocol/TBase64Utils.cpp | 2 -- lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc | 8 ++++---- lib/cpp/src/thrift/protocol/TCompactProtocol.tcc | 8 ++++---- lib/cpp/src/thrift/protocol/TDebugProtocol.cpp | 1 - lib/cpp/src/thrift/protocol/THeaderProtocol.cpp | 1 - lib/cpp/src/thrift/protocol/TProtocol.h | 3 +-- 6 files changed, 9 insertions(+), 14 deletions(-) diff --git a/lib/cpp/src/thrift/protocol/TBase64Utils.cpp b/lib/cpp/src/thrift/protocol/TBase64Utils.cpp index beb76eb..7474f5a 100644 --- a/lib/cpp/src/thrift/protocol/TBase64Utils.cpp +++ b/lib/cpp/src/thrift/protocol/TBase64Utils.cpp @@ -19,8 +19,6 @@ #include <thrift/protocol/TBase64Utils.h> -#include <boost/static_assert.hpp> - using std::string; namespace apache { diff --git a/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc b/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc index d6f6dbb..902ef98 100644 --- a/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc +++ b/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc @@ -165,8 +165,8 @@ uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeI64(const int64_t i64) { template <class Transport_, class ByteOrder_> uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeDouble(const double dub) { - BOOST_STATIC_ASSERT(sizeof(double) == sizeof(uint64_t)); - BOOST_STATIC_ASSERT(std::numeric_limits<double>::is_iec559); + static_assert(sizeof(double) == sizeof(uint64_t)); + static_assert(std::numeric_limits<double>::is_iec559); uint64_t bits = bitwise_cast<uint64_t>(dub); bits = ByteOrder_::toWire64(bits); @@ -388,8 +388,8 @@ uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readI64(int64_t& i64) { template <class Transport_, class ByteOrder_> uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readDouble(double& dub) { - BOOST_STATIC_ASSERT(sizeof(double) == sizeof(uint64_t)); - BOOST_STATIC_ASSERT(std::numeric_limits<double>::is_iec559); + static_assert(sizeof(double) == sizeof(uint64_t)); + static_assert(std::numeric_limits<double>::is_iec559); union bytes { uint8_t b[8]; diff --git a/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc b/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc index d40c331..2b8207a 100644 --- a/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc +++ b/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc @@ -253,8 +253,8 @@ uint32_t TCompactProtocolT<Transport_>::writeI64(const int64_t i64) { */ template <class Transport_> uint32_t TCompactProtocolT<Transport_>::writeDouble(const double dub) { - BOOST_STATIC_ASSERT(sizeof(double) == sizeof(uint64_t)); - BOOST_STATIC_ASSERT(std::numeric_limits<double>::is_iec559); + static_assert(sizeof(double) == sizeof(uint64_t)); + static_assert(std::numeric_limits<double>::is_iec559); uint64_t bits = bitwise_cast<uint64_t>(dub); bits = THRIFT_htolell(bits); @@ -653,8 +653,8 @@ uint32_t TCompactProtocolT<Transport_>::readI64(int64_t& i64) { */ template <class Transport_> uint32_t TCompactProtocolT<Transport_>::readDouble(double& dub) { - BOOST_STATIC_ASSERT(sizeof(double) == sizeof(uint64_t)); - BOOST_STATIC_ASSERT(std::numeric_limits<double>::is_iec559); + static_assert(sizeof(double) == sizeof(uint64_t)); + static_assert(std::numeric_limits<double>::is_iec559); union { uint64_t bits; diff --git a/lib/cpp/src/thrift/protocol/TDebugProtocol.cpp b/lib/cpp/src/thrift/protocol/TDebugProtocol.cpp index d3c6beb..0e6d4a2 100644 --- a/lib/cpp/src/thrift/protocol/TDebugProtocol.cpp +++ b/lib/cpp/src/thrift/protocol/TDebugProtocol.cpp @@ -24,7 +24,6 @@ #include <cctype> #include <cstdio> #include <stdexcept> -#include <boost/static_assert.hpp> using std::string; diff --git a/lib/cpp/src/thrift/protocol/THeaderProtocol.cpp b/lib/cpp/src/thrift/protocol/THeaderProtocol.cpp index a19d545..6242e30 100644 --- a/lib/cpp/src/thrift/protocol/THeaderProtocol.cpp +++ b/lib/cpp/src/thrift/protocol/THeaderProtocol.cpp @@ -26,7 +26,6 @@ #include <limits> -#include <boost/static_assert.hpp> #include <memory> namespace apache { diff --git a/lib/cpp/src/thrift/protocol/TProtocol.h b/lib/cpp/src/thrift/protocol/TProtocol.h index 28e1bb7..746973d 100644 --- a/lib/cpp/src/thrift/protocol/TProtocol.h +++ b/lib/cpp/src/thrift/protocol/TProtocol.h @@ -29,7 +29,6 @@ #include <thrift/protocol/TProtocolException.h> #include <memory> -#include <boost/static_assert.hpp> #ifdef HAVE_NETINET_IN_H #include <netinet/in.h> @@ -48,7 +47,7 @@ // http://cellperformance.beyond3d.com/articles/2006/06/understanding-strict-aliasing.html template <typename To, typename From> static inline To bitwise_cast(From from) { - BOOST_STATIC_ASSERT(sizeof(From) == sizeof(To)); + static_assert(sizeof(From) == sizeof(To)); // BAD!!! These are all broken with -O2. //return *reinterpret_cast<To*>(&from); // BAD!!!