Skip to content

Commit d2a63fa

Browse files
authored
Eradicate Warnings
1 parent 393acd2 commit d2a63fa

File tree

4 files changed

+18
-27
lines changed

4 files changed

+18
-27
lines changed

src/FixedPoints/Details.h

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#pragma once
22

3+
#include <Arduino.h>
34
#include <limits.h>
45
#include <stdint.h>
56

@@ -203,17 +204,17 @@ namespace FIXED_POINTS_DETAILS
203204
static inline int64_t Random() { return (static_cast<int64_t>(random()) << 32) | static_cast<int64_t>(random()); }
204205
};
205206

206-
// Here be dragons!!
207-
//
208-
//
209-
//
210-
// /\___/\ ~
211-
// ( O . O ) \\
212-
// > ^ < //
213-
// ( \ / )//
214-
// u U U u
215-
//
216-
// Or cats?
217-
// ~Mwrow~
207+
///////////////////////
208+
// Here be dragons!! //
209+
// //
210+
// /\___/\ _ //
211+
// ( O . O ) \\ //
212+
// > ^ < // //
213+
// ( \ / )// //
214+
// u U U u //
215+
// //
216+
// Or cats?... //
217+
// ~Mwrow~ //
218+
///////////////////////
218219
}
219220
FIXED_POINTS_END_NAMESPACE

src/FixedPoints/SFixedMemberFunctions.h

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ constexpr typename SFixed<Integer, Fraction>::InternalType SFixed<Integer, Fract
3535
template< unsigned Integer, unsigned Fraction >
3636
constexpr typename SFixed<Integer, Fraction>::IntegerType SFixed<Integer, Fraction>::getInteger(void) const
3737
{
38-
return static_cast<IntegerType>(this->value >> IntegerShift) & IntegerMask | ((this->value < 0) ? ~IntegerMask : 0);
38+
return (static_cast<IntegerType>(this->value >> IntegerShift) & IntegerMask) | ((this->value < 0) ? ~IntegerMask : 0);
3939
}
4040

4141
template< unsigned Integer, unsigned Fraction >
@@ -57,10 +57,6 @@ constexpr SFixed<Integer, Fraction>::operator IntegerType(void) const
5757
template< unsigned Integer, unsigned Fraction >
5858
constexpr SFixed<Integer, Fraction>::operator float(void) const
5959
{
60-
/*return (1.0f / Scale) *
61-
(this->value < 0) ?
62-
-((-this->value) & IdentityMask) :
63-
this->value & IdentityMask; */
6460
return (1.0f / Scale) *
6561
static_cast<InternalType>
6662
((this->value & IdentityMask) |
@@ -70,10 +66,6 @@ constexpr SFixed<Integer, Fraction>::operator float(void) const
7066
template< unsigned Integer, unsigned Fraction >
7167
constexpr SFixed<Integer, Fraction>::operator double(void) const
7268
{
73-
/*return (1.0 / Scale) *
74-
(this->value < 0) ?
75-
-((-this->value) & IdentityMask) :
76-
this->value & IdentityMask; */
7769
return (1.0 / Scale) *
7870
static_cast<InternalType>
7971
((this->value & IdentityMask) |
@@ -84,12 +76,11 @@ template< unsigned Integer, unsigned Fraction >
8476
template< unsigned IntegerOut, unsigned FractionOut >
8577
constexpr SFixed<Integer, Fraction>::operator SFixed<IntegerOut, FractionOut>(void) const
8678
{
87-
using OutputType = UFixed<IntegerOut, FractionOut>;
79+
using OutputType = SFixed<IntegerOut, FractionOut>;
8880
using OutputInternalType = typename OutputType::InternalType;
8981
using OutputShiftType = typename OutputType::ShiftType;
9082

91-
using InputType = UFixed<Integer, Fraction>;
92-
using InputInternalType = typename InputType::InternalType;
83+
using InputType = SFixed<Integer, Fraction>;
9384
using InputShiftType = typename InputType::ShiftType;
9485

9586
return

src/FixedPoints/UFixedMemberFunctions.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ constexpr UFixed<Integer, Fraction>::operator UFixed<IntegerOut, FractionOut>(vo
7575
using OutputShiftType = typename OutputType::ShiftType;
7676

7777
using InputType = UFixed<Integer, Fraction>;
78-
using InputInternalType = typename InputType::InternalType;
7978
using InputShiftType = typename InputType::ShiftType;
8079

8180
return

src/FixedPoints/Utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ constexpr SFixed<Integer, Fraction> roundFixed(const SFixed<Integer, Fraction> &
116116
return
117117
(
118118
((value.getInternal() & OutputType::MidpointMask) != 0) &&
119-
!signbitFixed(value) ||
120-
((value.getInternal() & OutputType::LesserMidpointMask) != 0)
119+
(!signbitFixed(value) ||
120+
((value.getInternal() & OutputType::LesserMidpointMask) != 0))
121121
)
122122
? ceilFixed(value)
123123
: floorFixed(value);

0 commit comments

Comments
 (0)