Replace 'const float &' with 'const_float_t' (#21505)

This commit is contained in:
Scott Lahteine
2021-04-01 17:59:57 -05:00
committed by GitHub
parent 600ef1e47c
commit 62f37669dc
79 changed files with 376 additions and 366 deletions

View File

@@ -21,7 +21,8 @@
*/
#pragma once
#include <stdint.h>
#include "../inc/MarlinConfigPre.h"
#include "../core/types.h"
// Format uint8_t (0-100) as rj string with 123% / _12% / __1% format
const char* pcttostrpctrj(const uint8_t i);
@@ -62,70 +63,66 @@ const char* i16tostr3left(const int16_t xx);
const char* i16tostr4signrj(const int16_t x);
// Convert unsigned float to string with 1.2 format
const char* ftostr11ns(const float &x);
const char* ftostr11ns(const_float_t x);
// Convert unsigned float to string with 1.23 format
const char* ftostr12ns(const float &x);
const char* ftostr12ns(const_float_t x);
// Convert unsigned float to string with 12.3 format
const char* ftostr31ns(const float &x);
const char* ftostr31ns(const_float_t x);
// Convert unsigned float to string with 123.4 format
const char* ftostr41ns(const float &x);
const char* ftostr41ns(const_float_t x);
// Convert signed float to fixed-length string with 12.34 / _2.34 / -2.34 or -23.45 / 123.45 format
const char* ftostr42_52(const float &x);
const char* ftostr42_52(const_float_t x);
// Convert signed float to fixed-length string with 023.45 / -23.45 format
const char* ftostr52(const float &x);
const char* ftostr52(const_float_t x);
// Convert signed float to fixed-length string with 12.345 / -2.345 or 023.456 / -23.456 format
const char* ftostr53_63(const float &x);
const char* ftostr53_63(const_float_t x);
// Convert signed float to fixed-length string with 023.456 / -23.456 format
const char* ftostr63(const float &x);
const char* ftostr63(const_float_t x);
// Convert float to fixed-length string with +12.3 / -12.3 format
const char* ftostr31sign(const float &x);
const char* ftostr31sign(const_float_t x);
// Convert float to fixed-length string with +123.4 / -123.4 format
const char* ftostr41sign(const float &x);
const char* ftostr41sign(const_float_t x);
// Convert signed float to string (6 digit) with -1.234 / _0.000 / +1.234 format
const char* ftostr43sign(const float &x, char plus=' ');
const char* ftostr43sign(const_float_t x, char plus=' ');
// Convert signed float to string (5 digit) with -1.2345 / _0.0000 / +1.2345 format
const char* ftostr54sign(const float &x, char plus=' ');
const char* ftostr54sign(const_float_t x, char plus=' ');
// Convert unsigned float to rj string with 12345 format
const char* ftostr5rj(const float &x);
const char* ftostr5rj(const_float_t x);
// Convert signed float to string with +1234.5 format
const char* ftostr51sign(const float &x);
const char* ftostr51sign(const_float_t x);
// Convert signed float to space-padded string with -_23.4_ format
const char* ftostr52sp(const float &x);
const char* ftostr52sp(const_float_t x);
// Convert signed float to string with +123.45 format
const char* ftostr52sign(const float &x);
const char* ftostr52sign(const_float_t x);
// Convert signed float to string with +12.345 format
const char* ftostr53sign(const float &f);
const char* ftostr53sign(const_float_t f);
// Convert unsigned float to string with 1234.5 format omitting trailing zeros
const char* ftostr51rj(const float &x);
#include "../core/macros.h"
const char* ftostr51rj(const_float_t x);
// Convert float to rj string with 123 or -12 format
FORCE_INLINE const char* ftostr3(const float &x) { return i16tostr3rj(int16_t(x + (x < 0 ? -0.5f : 0.5f))); }
#include "../inc/MarlinConfigPre.h"
FORCE_INLINE const char* ftostr3(const_float_t x) { return i16tostr3rj(int16_t(x + (x < 0 ? -0.5f : 0.5f))); }
#if ENABLED(LCD_DECIMAL_SMALL_XY)
// Convert float to rj string with 1234, _123, 12.3, _1.2, -123, _-12, or -1.2 format
const char* ftostr4sign(const float &fx);
const char* ftostr4sign(const_float_t fx);
#else
// Convert float to rj string with 1234, _123, -123, __12, _-12, ___1, or __-1 format
FORCE_INLINE const char* ftostr4sign(const float &x) { return i16tostr4signrj(int16_t(x + (x < 0 ? -0.5f : 0.5f))); }
FORCE_INLINE const char* ftostr4sign(const_float_t x) { return i16tostr4signrj(int16_t(x + (x < 0 ? -0.5f : 0.5f))); }
#endif