From d45d150aeb33238b2a558ec26542627e33aace23 Mon Sep 17 00:00:00 2001 From: Niels Dekker Date: Wed, 25 Sep 2024 18:45:03 +0200 Subject: [PATCH] STYLE: Replace `(InternalPixelType *)` with static_cast in itkPyBuffer Addressed Visual Studio 2022 Code Analysis warnings saying: > warning C26493: Don't use C-style casts (type.4). --- Modules/Bridge/NumPy/include/itkPyBuffer.hxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/Bridge/NumPy/include/itkPyBuffer.hxx b/Modules/Bridge/NumPy/include/itkPyBuffer.hxx index 0a221411c0f..03d1ec18920 100644 --- a/Modules/Bridge/NumPy/include/itkPyBuffer.hxx +++ b/Modules/Bridge/NumPy/include/itkPyBuffer.hxx @@ -150,9 +150,9 @@ PyBuffer::_GetImageViewFromArray(PyObject * arr, PyObject * shape, PyObj using InternalPixelType = typename TImage::InternalPixelType; using ImporterType = ImportImageContainer; - auto importer = ImporterType::New(); - constexpr bool importImageFilterWillOwnTheBuffer = false; - InternalPixelType * data = (InternalPixelType *)buffer; + auto importer = ImporterType::New(); + constexpr bool importImageFilterWillOwnTheBuffer = false; + auto * const data = static_cast(buffer); importer->SetImportPointer(data, numberOfPixels, importImageFilterWillOwnTheBuffer); OutputImagePointer output = TImage::New();