Make cppcheck happy wrt std::span usage

We don't gain anything using a span here, so just don't.

```
source/graphics/Font.cpp:535:35: error: Out of bounds access in 'tempDstRow[3]', if 'tempDstRow' size is 2 and '3' is 3 [containerOutOfBounds]
   const float dstAlpha{tempDstRow[3] / 255.0f};
                                  ^
source/graphics/Font.cpp:543:14: error: Out of bounds access in 'tempDstRow[2]', if 'tempDstRow' size is 2 and '2' is 2 [containerOutOfBounds]
   tempDstRow[2] = static_cast<u8>(std::round(((b * srcAlpha + tempDstRow[2] * dstAlpha * (1.0f - srcAlpha)) / outAlpha)));
             ^
source/graphics/Font.cpp:544:14: error: Out of bounds access in 'tempDstRow[3]', if 'tempDstRow' size is 2 and '3' is 3 [containerOutOfBounds]
   tempDstRow[3] = static_cast<u8>(std::round(outAlpha * 255.0f));
             ^
```

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser
2025-08-16 10:37:01 +02:00
parent 77e05ca26d
commit ceb491c599
+1 -1
View File
@@ -528,7 +528,7 @@ void CFont::BlendGlyphBitmapToTextureRGBA(const FT_Bitmap& bitmap, int targetX,
for (uint x{0}; x != bitmap.width; ++x)
{
const std::span<u8, 4> tempDstRow{dstRow + x * m_TextureFormatStride, 4};
u8* tempDstRow{dstRow + x * m_TextureFormatStride};
u8 alpha{srcRow[x]};
const float srcAlpha{m_StrokeWidth > 0 ? (*m_GammaCorrectionLUT)[alpha] : alpha/255.0f};