diff --git a/ion/src/simulator/prizm/display.cpp b/ion/src/simulator/prizm/display.cpp index 339c46fef..27e896bee 100644 --- a/ion/src/simulator/prizm/display.cpp +++ b/ion/src/simulator/prizm/display.cpp @@ -1,7 +1,7 @@ #include "display.h" #include "framebuffer.h" #include -#include +#include #include #include #include diff --git a/kandinsky/include/kandinsky/postprocess_gamma_context.h b/kandinsky/include/kandinsky/postprocess_gamma_context.h index 5d27d9173..305d9cedd 100644 --- a/kandinsky/include/kandinsky/postprocess_gamma_context.h +++ b/kandinsky/include/kandinsky/postprocess_gamma_context.h @@ -1,8 +1,8 @@ #ifndef KANDINSKY_POSTPROCESS_GAMMA_CONTEXT_H #define KANDINSKY_POSTPROCESS_GAMMA_CONTEXT_H -#include #include +#include class KDPostProcessGammaContext : public KDPostProcessContext { public: diff --git a/kandinsky/src/postprocess_gamma_context.cpp b/kandinsky/src/postprocess_gamma_context.cpp index 7bd6811bb..95a89768b 100644 --- a/kandinsky/src/postprocess_gamma_context.cpp +++ b/kandinsky/src/postprocess_gamma_context.cpp @@ -1,9 +1,8 @@ #include -#include #include #include #include -#include +#include constexpr int MaxGammaStates = 7; constexpr float MaxGammaGamut = 0.75; diff --git a/poincare/include/poincare/ieee754.h b/poincare/include/poincare/ieee754.h index 1c033b4df..8427e90ee 100644 --- a/poincare/include/poincare/ieee754.h +++ b/poincare/include/poincare/ieee754.h @@ -2,9 +2,9 @@ #define POINCARE_IEEE754_H #include -#include #include #include +#include #include #include @@ -43,27 +43,18 @@ public: if (((uint64_t)mantissa >> (size()-k_mantissaNbBits-2)) & 1) { u.ui += 1; } - // Return f32.f or f64.f depending on the type of T - // Copilot did this so I don't really understand it - if constexpr (std::is_same::value) { + if (sizeof(T) == sizeof(float)) { return u.f32.f; - } else if constexpr (std::is_same::value) { - return u.f64.f; } else { - // Error and log the type at compile time - static_assert(std::is_same::value || std::is_same::value, "IEEE754::buildFloat: T must be float or double"); + return u.f64.f; } } static int exponent(T f) { uint_float u; - // u.f = f; - if constexpr (std::is_same::value) { + if (sizeof(T) == sizeof(float)) { u.f32.f = f; - } else if constexpr (std::is_same::value) { - u.f64.f = f; } else { - // Error and log the type at compile time - static_assert(std::is_same::value || std::is_same::value, "IEEE754::exponent: T must be float or double"); + u.f64.f = f; } constexpr uint16_t oneOnExponentsBits = maxExponent(); int exp = (u.ui >> k_mantissaNbBits) & oneOnExponentsBits;