freedreno/decode: Fix const correctness in get_tex_count

Fix compiler error:

../src/freedreno/decode/cffdec.c:580:7: error: assigning to 'char *'
from 'const char *' discards qualifiers
[-Werror,-Wincompatible-pointer-types-discards-qualifiers]
  580 |    p = strstr(name, "CONST");
      |      ^ ~~~~~~~~~~~~~~~~~~~~~

glibc now provides C23-style type-generic string functions. strstr
returns const char * when passed a const char * argument. Update p
declaration to const since it's only used for offset calculation.

Fixes: 1ea4ef0d3b ("freedreno: slurp in decode tools")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
(cherry picked from commit bc34a122f3)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39969>
This commit is contained in:
Vinson Lee 2026-02-08 21:28:14 -08:00 committed by Dylan Baker
parent c930daf705
commit c13d68d2dc
2 changed files with 2 additions and 2 deletions

View file

@ -1064,7 +1064,7 @@
"description": "freedreno/decode: Fix const correctness in get_tex_count",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "1ea4ef0d3be829e392922f5d26fbc89bf69a8a67",
"notes": null

View file

@ -536,7 +536,7 @@ static int
get_tex_count(const char *name)
{
char count_reg[strlen(name) + 5];
char *p;
const char *p;
p = strstr(name, "CONST");
if (!p)