diff --git a/.clang-tidy b/.clang-tidy index 780876b7c..59cd60a81 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -15,7 +15,6 @@ Checks: > -bugprone-exception-escape, -bugprone-implicit-widening-of-multiplication-result, -bugprone-integer-division, - -bugprone-misplaced-widening-cast, -bugprone-narrowing-conversions, -bugprone-signed-char-misuse, -bugprone-string-integer-assignment, diff --git a/src/SFML/Graphics/Image.cpp b/src/SFML/Graphics/Image.cpp index a09b2cdf8..5cd1a748a 100644 --- a/src/SFML/Graphics/Image.cpp +++ b/src/SFML/Graphics/Image.cpp @@ -541,7 +541,7 @@ void Image::flipVertically() { if (!m_pixels.empty()) { - const auto rowSize = static_cast::iterator::difference_type>(m_size.x * 4); + const auto rowSize = static_cast::iterator::difference_type>(m_size.x) * 4; auto top = m_pixels.begin(); auto bottom = m_pixels.end() - rowSize; diff --git a/src/SFML/Graphics/Texture.cpp b/src/SFML/Graphics/Texture.cpp index 76174c2c1..275588c19 100644 --- a/src/SFML/Graphics/Texture.cpp +++ b/src/SFML/Graphics/Texture.cpp @@ -412,10 +412,10 @@ Image Texture::copyToImage() const if (m_pixelsFlipped) { // Flip the texture vertically - const auto stride = static_cast(m_size.x * 4); + const auto stride = static_cast(m_size.x) * 4; auto currentRowIterator = pixels.begin(); auto nextRowIterator = pixels.begin() + stride; - auto reverseRowIterator = pixels.begin() + (stride * static_cast(m_size.y - 1)); + auto reverseRowIterator = pixels.begin() + (stride * (static_cast(m_size.y) - 1)); for (unsigned int i = 0; i < m_size.y / 2; ++i) { std::swap_ranges(currentRowIterator, nextRowIterator, reverseRowIterator); diff --git a/src/SFML/Window/DRM/InputImpl.cpp b/src/SFML/Window/DRM/InputImpl.cpp index 028437859..15718bfcb 100644 --- a/src/SFML/Window/DRM/InputImpl.cpp +++ b/src/SFML/Window/DRM/InputImpl.cpp @@ -317,7 +317,7 @@ void pushEvent(const sf::Event& event) TouchSlot& atSlot(int idx) { if (idx >= static_cast(touchSlots.size())) - touchSlots.resize(static_cast(idx + 1)); + touchSlots.resize(static_cast(idx) + 1); return touchSlots.at(static_cast(idx)); }