gui: fix build against gcc-14 (-Werror=calloc-transposed-args)

src/gui/painting/qpaintengine_raster.cpp:3811:42: error: ‘void* calloc(size_t, size_t)’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
     3811 |         m_clipLines = (ClipLine *)calloc(sizeof(ClipLine), clipSpanHeight);
          |                                          ^~~~~~~~~~~~~~~~
    src/gui/painting/qpaintengine_raster.cpp:3811:42: note: earlier argument should specify number of elements, later size of each element

Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: I41ec3dd5c439e5cd51dd917741125ce50659500e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This commit is contained in:
Liang Qi 2024-03-21 14:18:54 +01:00
parent 0f77aff05f
commit 12a432c80f

View File

@ -3808,7 +3808,7 @@ void QClipData::initialize()
return;
if (!m_clipLines)
m_clipLines = (ClipLine *)calloc(sizeof(ClipLine), clipSpanHeight);
m_clipLines = (ClipLine *)calloc(clipSpanHeight, sizeof(ClipLine));
Q_CHECK_PTR(m_clipLines);
QT_TRY {