Skip to content

Commit

Permalink
STYLE: Replace (InternalPixelType *) with static_cast in itkPyBuffer
Browse files Browse the repository at this point in the history
Addressed Visual Studio 2022 Code Analysis warnings saying:

> warning C26493: Don't use C-style casts (type.4).
  • Loading branch information
N-Dekker committed Sep 25, 2024
1 parent 60f2edb commit d45d150
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Modules/Bridge/NumPy/include/itkPyBuffer.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ PyBuffer<TImage>::_GetImageViewFromArray(PyObject * arr, PyObject * shape, PyObj

using InternalPixelType = typename TImage::InternalPixelType;
using ImporterType = ImportImageContainer<SizeValueType, InternalPixelType>;
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<InternalPixelType *>(buffer);
importer->SetImportPointer(data, numberOfPixels, importImageFilterWillOwnTheBuffer);

OutputImagePointer output = TImage::New();
Expand Down

0 comments on commit d45d150

Please sign in to comment.