From e6e1a42e1e84d7a24c79295d01aa8b1844d64c6b Mon Sep 17 00:00:00 2001 From: B Stack Date: Fri, 27 Dec 2019 08:28:17 -0500 Subject: add upstream 10.19 --- zen/globals.h | 2 +- zen/legacy_compiler.h | 6 +++--- zen/serialize.h | 1 + zen/stl_tools.h | 6 +++--- zen/string_tools.h | 48 ++++++++++++++++++++++++------------------------ zen/sys_error.h | 2 +- 6 files changed, 33 insertions(+), 32 deletions(-) (limited to 'zen') diff --git a/zen/globals.h b/zen/globals.h index e59d64c1..4c1453a2 100644 --- a/zen/globals.h +++ b/zen/globals.h @@ -206,7 +206,7 @@ void registerGlobalForDestruction(CleanUpEntry& entry) //------------------------------------------------------------------------------------------ #if __cpp_lib_atomic_wait -#error implement + rewiew improvements + #error implement + rewiew improvements #endif diff --git a/zen/legacy_compiler.h b/zen/legacy_compiler.h index 6ce1d765..54dd7f59 100644 --- a/zen/legacy_compiler.h +++ b/zen/legacy_compiler.h @@ -9,9 +9,9 @@ #if !__cpp_lib_erase_if -#include -#include -#include + #include + #include + #include #endif diff --git a/zen/serialize.h b/zen/serialize.h index 5a38303c..bdeec858 100644 --- a/zen/serialize.h +++ b/zen/serialize.h @@ -9,6 +9,7 @@ #include #include +#include #include "string_base.h" //keep header clean from specific stream implementations! (e.g.file_io.h)! used by abstract.h! diff --git a/zen/stl_tools.h b/zen/stl_tools.h index d09010ad..8856ce84 100644 --- a/zen/stl_tools.h +++ b/zen/stl_tools.h @@ -96,7 +96,7 @@ public: /**/ T& ref() { return *ref_; }; const T& ref() const { return *ref_; }; - std::shared_ptr< T> ptr() { return ref_; }; + std::shared_ptr< T> ptr() { return ref_; }; std::shared_ptr ptr() const { return ref_; }; private: @@ -207,9 +207,9 @@ BidirectionalIterator1 searchLast(const BidirectionalIterator1 first1, Bid //http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0458r2.html template >> inline -bool contains(const Container& c, const ValueType& val, int dummy = 0 /*overload string_tools.h contains()*/) + bool contains(const Container& c, const ValueType& val, int dummy = 0 /*overload string_tools.h contains()*/) { - return c.find(val) != c.end(); + return c.find(val) != c.end(); } //--------------------------------------------------------------------------------------- diff --git a/zen/string_tools.h b/zen/string_tools.h index 7f9a07ff..47271bc7 100644 --- a/zen/string_tools.h +++ b/zen/string_tools.h @@ -34,19 +34,19 @@ template Char asciiToUpper(Char c); //both S and T can be strings or char/wchar_t arrays or single char/wchar_t template >> bool contains(const S& str, const T& term); -template bool startsWith (const S& str, const T& prefix); -template bool startsWithAsciiNoCase(const S& str, const T& prefix); + template bool startsWith (const S& str, const T& prefix); + template bool startsWithAsciiNoCase(const S& str, const T& prefix); -template bool endsWith (const S& str, const T& postfix); -template bool endsWithAsciiNoCase(const S& str, const T& postfix); + template bool endsWith (const S& str, const T& postfix); + template bool endsWithAsciiNoCase(const S& str, const T& postfix); -template bool equalString (const S& lhs, const T& rhs); -template bool equalAsciiNoCase(const S& lhs, const T& rhs); + template bool equalString (const S& lhs, const T& rhs); + template bool equalAsciiNoCase(const S& lhs, const T& rhs); -template int compareString (const S& lhs, const T& rhs); -template int compareAsciiNoCase(const S& lhs, const T& rhs); //basic case-insensitive comparison (considering A-Z only!) + template int compareString (const S& lhs, const T& rhs); + template int compareAsciiNoCase(const S& lhs, const T& rhs); //basic case-insensitive comparison (considering A-Z only!) -struct LessAsciiNoCase //STL container predicate + struct LessAsciiNoCase //STL container predicate { template bool operator()(const S& lhs, const S& rhs) const { return compareAsciiNoCase(lhs, rhs) < 0; } }; @@ -165,21 +165,21 @@ template inline Char asciiToLower(Char c) { if (static_cast('A') <= c && c <= static_cast('Z')) - return static_cast(c - static_cast('A') + static_cast('a')); - return c; + return static_cast(c - static_cast('A') + static_cast('a')); + return c; } -template inline -Char asciiToUpper(Char c) + template inline + Char asciiToUpper(Char c) { if (static_cast('a') <= c && c <= static_cast('z')) - return static_cast(c - static_cast('a') + static_cast('A')); - return c; + return static_cast(c - static_cast('a') + static_cast('A')); + return c; } -namespace impl + namespace impl { inline int strcmpWithNulls(const char* ptr1, const char* ptr2, size_t num) { return std:: memcmp(ptr1, ptr2, num); } //support embedded 0, unlike strncmp/wcsncmp! inline int strcmpWithNulls(const wchar_t* ptr1, const wchar_t* ptr2, size_t num) { return std::wmemcmp(ptr1, ptr2, num); } // @@ -793,10 +793,10 @@ template inline S numberTo(const Num& number) { using TypeTag = std::integral_constant::value ? impl::NumberType::SIGNED_INT : - IsUnsignedInt::value ? impl::NumberType::UNSIGNED_INT : - IsFloat ::value ? impl::NumberType::FLOATING_POINT : - impl::NumberType::OTHER>; + IsSignedInt ::value ? impl::NumberType::SIGNED_INT : + IsUnsignedInt::value ? impl::NumberType::UNSIGNED_INT : + IsFloat ::value ? impl::NumberType::FLOATING_POINT : + impl::NumberType::OTHER>; return impl::numberTo(number, TypeTag()); } @@ -806,10 +806,10 @@ template inline Num stringTo(const S& str) { using TypeTag = std::integral_constant::value ? impl::NumberType::SIGNED_INT : - IsUnsignedInt::value ? impl::NumberType::UNSIGNED_INT : - IsFloat ::value ? impl::NumberType::FLOATING_POINT : - impl::NumberType::OTHER>; + IsSignedInt ::value ? impl::NumberType::SIGNED_INT : + IsUnsignedInt::value ? impl::NumberType::UNSIGNED_INT : + IsFloat ::value ? impl::NumberType::FLOATING_POINT : + impl::NumberType::OTHER>; return impl::stringTo(str, TypeTag()); } diff --git a/zen/sys_error.h b/zen/sys_error.h index f3b38250..57503732 100644 --- a/zen/sys_error.h +++ b/zen/sys_error.h @@ -85,7 +85,7 @@ std::wstring formatSystemError(const std::wstring& functionName, long long lastE inline std::wstring formatSystemError(const std::wstring& functionName, ErrorCode ec) { - const std::wstring errorDescr = formatSystemErrorRaw(ec); + const std::wstring errorDescr = formatSystemErrorRaw(ec); const std::wstring errorCode = numberTo(ec); //const std::wstring errorCode = printNumber(L"0x%08x", static_cast(ec)); -- cgit