From c3f87ad62223f8f46a62edd2b0484ae0edb843e5 Mon Sep 17 00:00:00 2001 From: thisiskeithb <13375512+thisiskeithb@users.noreply.github.com> Date: Sat, 27 Apr 2024 19:05:11 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20bool=20evalution=20of=20XY?= =?UTF-8?q?val=20and=20similar=20types=20[2.1.x]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes Input Shaping bootloop among other issues. See https://github.com/MarlinFirmware/Marlin/pull/26936 for more information. Co-authored-by: sjasonsmith <20053467+sjasonsmith@users.noreply.github.com> --- Marlin/src/core/types.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/core/types.h b/Marlin/src/core/types.h index 6ec0771d8484..75dcce4e3cbd 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -451,7 +451,7 @@ struct XYval { // Length reduced to one dimension FI constexpr T magnitude() const { return (T)sqrtf(x*x + y*y); } // Pointer to the data as a simple array - FI operator T* () { return pos; } + explicit FI operator T* () { return pos; } // If any element is true then it's true FI constexpr operator bool() const { return x || y; } // Smallest element @@ -601,7 +601,7 @@ struct XYZval { // Length reduced to one dimension FI constexpr T magnitude() const { return (T)TERN(HAS_X_AXIS, sqrtf(NUM_AXIS_GANG(x*x, + y*y, + z*z, + i*i, + j*j, + k*k, + u*u, + v*v, + w*w)), 0); } // Pointer to the data as a simple array - FI operator T* () { return pos; } + explicit FI operator T* () { return pos; } // If any element is true then it's true FI constexpr operator bool() const { return 0 NUM_AXIS_GANG(|| x, || y, || z, || i, || j, || k, || u, || v, || w); } // Smallest element @@ -749,7 +749,7 @@ struct XYZEval { // Length reduced to one dimension FI constexpr T magnitude() const { return (T)sqrtf(LOGICAL_AXIS_GANG(+ e*e, + x*x, + y*y, + z*z, + i*i, + j*j, + k*k, + u*u, + v*v, + w*w)); } // Pointer to the data as a simple array - FI operator T* () { return pos; } + explicit FI operator T* () { return pos; } // If any element is true then it's true FI constexpr operator bool() const { return 0 LOGICAL_AXIS_GANG(|| e, || x, || y, || z, || i, || j, || k, || u, || v, || w); } // Smallest element