xf86drm: fix warning in drmGetFormatModifierNameFromVivante()

Fixes the following warning:

    ../xf86drm.c: In function ‘drmGetFormatModifierNameFromVivante’:
    ../xf86drm.c:614:14: warning: passing argument 1 of ‘asprintf’ from incompatible pointer type [-Wincompatible-pointer-types]
      614 |     asprintf(&mod_vivante, "%s%s%s", color_tiling, tile_status, compression);
          |              ^~~~~~~~~~~~
          |              |
          |              const char **
    In file included from ../xf86drm.c:34:
    /usr/include/stdio.h:396:40: note: expected ‘char ** restrict’ but argument is of type ‘const char **’
      396 | extern int asprintf (char **__restrict __ptr,
          |                      ~~~~~~~~~~~~~~~~~~^~~~~
    ../xf86drm.c:615:12: warning: return discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
      615 |     return mod_vivante;
          |            ^~~~~~~~~~~

Signed-off-by: Simon Ser <contact@emersion.fr>
main
Simon Ser 2022-12-21 16:42:44 +01:00
parent 874af99463
commit 64d6fabaa1
1 changed files with 1 additions and 1 deletions

View File

@ -555,7 +555,7 @@ static char *
drmGetFormatModifierNameFromVivante(uint64_t modifier) drmGetFormatModifierNameFromVivante(uint64_t modifier)
{ {
const char *color_tiling, *tile_status, *compression; const char *color_tiling, *tile_status, *compression;
const char *mod_vivante = NULL; char *mod_vivante = NULL;
switch (modifier & VIVANTE_MOD_TS_MASK) { switch (modifier & VIVANTE_MOD_TS_MASK) {
case 0: case 0: