From 4d3f82c3ca89b27eaca8bbd9aef6ea59cea023b4 Mon Sep 17 00:00:00 2001 From: Pharap <2933055+Pharap@users.noreply.github.com> Date: Thu, 31 May 2018 19:58:14 +0100 Subject: [PATCH] Fix width of integer literal in Scale definition (#52) Previously the literal was of type `unsigned long long`. This uses a macro from the fixed-width literal API to give the literal a type of `uintmax_t`. --- src/FixedPoints/SFixed.h | 2 +- src/FixedPoints/UFixed.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FixedPoints/SFixed.h b/src/FixedPoints/SFixed.h index f734537..ba5a20a 100644 --- a/src/FixedPoints/SFixed.h +++ b/src/FixedPoints/SFixed.h @@ -41,7 +41,7 @@ public: constexpr const static uintmax_t LogicalSize = IntegerSize + FractionSize; constexpr const static uintmax_t InternalSize = FIXED_POINTS_DETAILS::BitSize::Value; - constexpr const static uintmax_t Scale = 1ULL << FractionSize; + constexpr const static uintmax_t Scale = UINTMAX_C(1) << FractionSize; public: constexpr const static ShiftType IntegerShift = FractionSize; diff --git a/src/FixedPoints/UFixed.h b/src/FixedPoints/UFixed.h index 2c8fe34..0fa610c 100644 --- a/src/FixedPoints/UFixed.h +++ b/src/FixedPoints/UFixed.h @@ -41,7 +41,7 @@ public: constexpr const static uintmax_t LogicalSize = IntegerSize + FractionSize; constexpr const static uintmax_t InternalSize = FIXED_POINTS_DETAILS::BitSize::Value; - constexpr const static uintmax_t Scale = 1ULL << FractionSize; + constexpr const static uintmax_t Scale = UINTMAX_C(1) << FractionSize; public: constexpr const static ShiftType IntegerShift = FractionSize;