diff --git a/src/Mod/Image/App/ImageBase.cpp b/src/Mod/Image/App/ImageBase.cpp index fa43004d1e..c5ad775146 100644 --- a/src/Mod/Image/App/ImageBase.cpp +++ b/src/Mod/Image/App/ImageBase.cpp @@ -201,7 +201,7 @@ int ImageBase::_setColorFormat(int format, unsigned short numSigBitsPerSample) int ImageBase::_allocate() { // Check that pixel data pointer is null - if (_pPixelData != nullptr) + if (_pPixelData) return -1; // Allocate the space needed to store the pixel data @@ -296,7 +296,7 @@ int ImageBase::pointTo(void* pSrcPixelData, unsigned long width, unsigned long h // if there is no image data int ImageBase::getSample(int x, int y, unsigned short sampleIndex, double &value) { - if ((_pPixelData == nullptr) || + if ((!_pPixelData) || (sampleIndex >= _numSamples) || (x < 0) || (x >= (int)_width) || (y < 0) || (y >= (int)_height)) diff --git a/src/Mod/Image/Gui/OpenGLImageBox.cpp b/src/Mod/Image/Gui/OpenGLImageBox.cpp index 0ce37dcf5f..0d9231b6af 100644 --- a/src/Mod/Image/Gui/OpenGLImageBox.cpp +++ b/src/Mod/Image/Gui/OpenGLImageBox.cpp @@ -243,7 +243,7 @@ void GLImageBox::drawImage() glPixelTransferf(GL_BLUE_SCALE, (float)scale); // Load the color map if present - if (_pColorMap != nullptr) + if (_pColorMap) { if (!haveMesa) glPixelTransferf(GL_MAP_COLOR, 1.0); glPixelMapfv(GL_PIXEL_MAP_R_TO_R, _numMapEntries, _pColorMap); @@ -851,7 +851,7 @@ int GLImageBox::setColorMapAlphaValue(int index, float value) // Helper function to convert a pixel's value (of a sample) to the color map index (i.e. the map index that will be used for that pixel value) unsigned int GLImageBox::pixValToMapIndex(double PixVal) { - if (_pColorMap != nullptr) + if (_pColorMap) { double MaxVal = pow(2.0, _image.getNumBitsPerSample()) - 1.0; double Scale = (pow(2.0, _image.getNumBitsPerSample()) - 1.0) / (pow(2.0, _image.getNumSigBitsPerSample()) - 1.0); diff --git a/src/Mod/Import/App/AppImportPy.cpp b/src/Mod/Import/App/AppImportPy.cpp index 772d29ad2f..5be4ba8372 100644 --- a/src/Mod/Import/App/AppImportPy.cpp +++ b/src/Mod/Import/App/AppImportPy.cpp @@ -478,7 +478,7 @@ private: if (usePolyline == Py_True) { polyOverride = true; } - if (optionSource != nullptr) { + if (optionSource) { defaultOptions = optionSource; } @@ -527,7 +527,7 @@ private: if (usePolyline == Py_True) { polyOverride = true; } - if (optionSource != nullptr) { + if (optionSource) { defaultOptions = optionSource; } @@ -587,7 +587,7 @@ private: polyOverride = true; } - if (optionSource != nullptr) { + if (optionSource) { defaultOptions = optionSource; } @@ -641,7 +641,7 @@ private: polyOverride = true; } - if (optionSource != nullptr) { + if (optionSource) { defaultOptions = optionSource; } diff --git a/src/Mod/Inspection/Gui/ViewProviderInspection.cpp b/src/Mod/Inspection/Gui/ViewProviderInspection.cpp index 5581059b28..761b7e6da7 100644 --- a/src/Mod/Inspection/Gui/ViewProviderInspection.cpp +++ b/src/Mod/Inspection/Gui/ViewProviderInspection.cpp @@ -479,7 +479,7 @@ void ViewProviderInspection::inspectCallback(void * ud, SoEventCallback * n) } else if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::UP) { const SoPickedPoint * point = n->getPickedPoint(); - if (point == nullptr) { + if (!point) { Base::Console().Message("No point picked.\n"); return; }