Skip to content

Commit fe9e890

Browse files
🐛 Fix bool operator for XYval, etc. (MarlinFirmware#27026)
Co-authored-by: sjasonsmith <[email protected]>
1 parent 1289141 commit fe9e890

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Marlin/src/core/types.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ struct XYval {
451451
// Length reduced to one dimension
452452
FI constexpr T magnitude() const { return (T)sqrtf(x*x + y*y); }
453453
// Pointer to the data as a simple array
454-
FI operator T* () { return pos; }
454+
explicit FI operator T* () { return pos; }
455455
// If any element is true then it's true
456456
FI constexpr operator bool() const { return x || y; }
457457
// Smallest element
@@ -601,7 +601,7 @@ struct XYZval {
601601
// Length reduced to one dimension
602602
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); }
603603
// Pointer to the data as a simple array
604-
FI operator T* () { return pos; }
604+
explicit FI operator T* () { return pos; }
605605
// If any element is true then it's true
606606
FI constexpr operator bool() const { return 0 NUM_AXIS_GANG(|| x, || y, || z, || i, || j, || k, || u, || v, || w); }
607607
// Smallest element
@@ -749,7 +749,7 @@ struct XYZEval {
749749
// Length reduced to one dimension
750750
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)); }
751751
// Pointer to the data as a simple array
752-
FI operator T* () { return pos; }
752+
explicit FI operator T* () { return pos; }
753753
// If any element is true then it's true
754754
FI constexpr operator bool() const { return 0 LOGICAL_AXIS_GANG(|| e, || x, || y, || z, || i, || j, || k, || u, || v, || w); }
755755
// Smallest element

0 commit comments

Comments
 (0)