From 0fc31e5d5dddc7d7c03e14c2d6314760f91646c6 Mon Sep 17 00:00:00 2001 From: Jake Staahl Date: Tue, 6 Apr 2021 13:29:47 -0700 Subject: [PATCH 1/3] constexpr uint128_wrapper --- include/fmt/format.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index f7d7efb084bd..a30286837120 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -901,14 +901,14 @@ struct FMT_EXTERN_TEMPLATE_API uint128_wrapper { #if FMT_USE_INT128 uint128_t internal_; - uint128_wrapper(uint64_t high, uint64_t low) FMT_NOEXCEPT + FMT_CONSTEXPR uint128_wrapper(uint64_t high, uint64_t low) FMT_NOEXCEPT : internal_{static_cast(low) | (static_cast(high) << 64)} {} - uint128_wrapper(uint128_t u) : internal_{u} {} + FMT_CONSTEXPR uint128_wrapper(uint128_t u) : internal_{u} {} - uint64_t high() const FMT_NOEXCEPT { return uint64_t(internal_ >> 64); } - uint64_t low() const FMT_NOEXCEPT { return uint64_t(internal_); } + FMT_CONSTEXPR uint64_t high() const FMT_NOEXCEPT { return uint64_t(internal_ >> 64); } + FMT_CONSTEXPR uint64_t low() const FMT_NOEXCEPT { return uint64_t(internal_); } uint128_wrapper& operator+=(uint64_t n) FMT_NOEXCEPT { internal_ += n; @@ -918,11 +918,11 @@ struct FMT_EXTERN_TEMPLATE_API uint128_wrapper { uint64_t high_; uint64_t low_; - uint128_wrapper(uint64_t high, uint64_t low) FMT_NOEXCEPT : high_{high}, + FMT_CONSTEXPR uint128_wrapper(uint64_t high, uint64_t low) FMT_NOEXCEPT : high_{high}, low_{low} {} - uint64_t high() const FMT_NOEXCEPT { return high_; } - uint64_t low() const FMT_NOEXCEPT { return low_; } + FMT_CONSTEXPR uint64_t high() const FMT_NOEXCEPT { return high_; } + FMT_CONSTEXPR uint64_t low() const FMT_NOEXCEPT { return low_; } uint128_wrapper& operator+=(uint64_t n) FMT_NOEXCEPT { # if defined(_MSC_VER) && defined(_M_X64) From 196208eb059a179446a97483a92d0c746c96583a Mon Sep 17 00:00:00 2001 From: Jake Staahl Date: Tue, 6 Apr 2021 17:48:44 -0700 Subject: [PATCH 2/3] change FMT_CONSTEXPR to constexpr --- include/fmt/format.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index a30286837120..768d728b23aa 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -901,14 +901,14 @@ struct FMT_EXTERN_TEMPLATE_API uint128_wrapper { #if FMT_USE_INT128 uint128_t internal_; - FMT_CONSTEXPR uint128_wrapper(uint64_t high, uint64_t low) FMT_NOEXCEPT + constexpr uint128_wrapper(uint64_t high, uint64_t low) FMT_NOEXCEPT : internal_{static_cast(low) | (static_cast(high) << 64)} {} - FMT_CONSTEXPR uint128_wrapper(uint128_t u) : internal_{u} {} + constexpr uint128_wrapper(uint128_t u) : internal_{u} {} - FMT_CONSTEXPR uint64_t high() const FMT_NOEXCEPT { return uint64_t(internal_ >> 64); } - FMT_CONSTEXPR uint64_t low() const FMT_NOEXCEPT { return uint64_t(internal_); } + constexpr uint64_t high() const FMT_NOEXCEPT { return uint64_t(internal_ >> 64); } + constexpr uint64_t low() const FMT_NOEXCEPT { return uint64_t(internal_); } uint128_wrapper& operator+=(uint64_t n) FMT_NOEXCEPT { internal_ += n; @@ -918,11 +918,11 @@ struct FMT_EXTERN_TEMPLATE_API uint128_wrapper { uint64_t high_; uint64_t low_; - FMT_CONSTEXPR uint128_wrapper(uint64_t high, uint64_t low) FMT_NOEXCEPT : high_{high}, + constexpr uint128_wrapper(uint64_t high, uint64_t low) FMT_NOEXCEPT : high_{high}, low_{low} {} - FMT_CONSTEXPR uint64_t high() const FMT_NOEXCEPT { return high_; } - FMT_CONSTEXPR uint64_t low() const FMT_NOEXCEPT { return low_; } + constexpr uint64_t high() const FMT_NOEXCEPT { return high_; } + constexpr uint64_t low() const FMT_NOEXCEPT { return low_; } uint128_wrapper& operator+=(uint64_t n) FMT_NOEXCEPT { # if defined(_MSC_VER) && defined(_M_X64) From d0b8ded41c4036d0d1008358d30962ad21ab1853 Mon Sep 17 00:00:00 2001 From: Jake Staahl Date: Tue, 6 Apr 2021 20:12:40 -0700 Subject: [PATCH 3/3] clang format --- include/fmt/format.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 768d728b23aa..3e687e425757 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -907,7 +907,9 @@ struct FMT_EXTERN_TEMPLATE_API uint128_wrapper { constexpr uint128_wrapper(uint128_t u) : internal_{u} {} - constexpr uint64_t high() const FMT_NOEXCEPT { return uint64_t(internal_ >> 64); } + constexpr uint64_t high() const FMT_NOEXCEPT { + return uint64_t(internal_ >> 64); + } constexpr uint64_t low() const FMT_NOEXCEPT { return uint64_t(internal_); } uint128_wrapper& operator+=(uint64_t n) FMT_NOEXCEPT { @@ -918,8 +920,9 @@ struct FMT_EXTERN_TEMPLATE_API uint128_wrapper { uint64_t high_; uint64_t low_; - constexpr uint128_wrapper(uint64_t high, uint64_t low) FMT_NOEXCEPT : high_{high}, - low_{low} {} + constexpr uint128_wrapper(uint64_t high, uint64_t low) FMT_NOEXCEPT + : high_{high}, + low_{low} {} constexpr uint64_t high() const FMT_NOEXCEPT { return high_; } constexpr uint64_t low() const FMT_NOEXCEPT { return low_; }