From b5261f0cb7545018d49bf8f4700ce1c46cd12804 Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Thu, 4 Apr 2024 15:14:24 -0700 Subject: [PATCH 1/2] Require explicit cast to get pointers from types.h --- 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 e67644e52fc6..39544d145a83 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -449,7 +449,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 @@ -599,7 +599,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 @@ -747,7 +747,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 From 15f026096f4a398e13b26c4a162304ae6319d6ba Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Fri, 5 Apr 2024 15:37:11 -0700 Subject: [PATCH 2/2] Fix whitespace --- 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 39544d145a83..44805e130a56 100644 --- a/Marlin/src/core/types.h +++ b/Marlin/src/core/types.h @@ -449,7 +449,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 - explicit 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 @@ -599,7 +599,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 - explicit 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 @@ -747,7 +747,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 - explicit 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