Skip to content

Commit 4d3f82c

Browse files
authored
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`.
1 parent 529692d commit 4d3f82c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/FixedPoints/SFixed.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class SFixed
4141
constexpr const static uintmax_t LogicalSize = IntegerSize + FractionSize;
4242
constexpr const static uintmax_t InternalSize = FIXED_POINTS_DETAILS::BitSize<InternalType>::Value;
4343

44-
constexpr const static uintmax_t Scale = 1ULL << FractionSize;
44+
constexpr const static uintmax_t Scale = UINTMAX_C(1) << FractionSize;
4545

4646
public:
4747
constexpr const static ShiftType IntegerShift = FractionSize;

src/FixedPoints/UFixed.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class UFixed
4141
constexpr const static uintmax_t LogicalSize = IntegerSize + FractionSize;
4242
constexpr const static uintmax_t InternalSize = FIXED_POINTS_DETAILS::BitSize<InternalType>::Value;
4343

44-
constexpr const static uintmax_t Scale = 1ULL << FractionSize;
44+
constexpr const static uintmax_t Scale = UINTMAX_C(1) << FractionSize;
4545

4646
public:
4747
constexpr const static ShiftType IntegerShift = FractionSize;

0 commit comments

Comments
 (0)