Skip to content

mesa/draw: fix -Wformat warning

xantares requested to merge xantares/mesa:draw into main

with mingw I get:

../src/mesa/main/draw.c: In function '_mesa_validated_drawrangeelements':
../src/mesa/main/draw.c:1642:29: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'GLsizeiptrARB' {aka 'long long int'} [-Wformat=]
 1642 |          _mesa_warning(ctx, "Invalid indices offset 0x%" PRIxPTR
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
 1645 |                             start, index_bo->Size, !!index_bo->buffer);
      |                                    ~~~~~~~~~~~~~~
      |                                            |
      |                                            GLsizeiptrARB {aka long long int}
../src/mesa/main/draw.c:1643:57: note: format string is defined here
 1643 |                             " (indices buffer size is %ld bytes)"
      |                                                       ~~^
      |                                                         |
      |                                                         long int
      |                                                       %lld

fixes: 5791826b cc @pepp @mareko

Merge request reports