mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-03 06:30:24 +01:00
util/blob: Fix const correctness warning in blob_read_string
Fix compiler error: ../src/util/blob.c:344:8: error: assigning to 'uint8_t *' from 'const void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers] glibc now provides C23-style type-generic string functions. memchr returns const void * when passed a const void * argument. Update nul declaration to const since it's only used to find the null terminator position and calculate a size. Fixes:1c9877327e("glsl: Add blob.c---a simple interface for serializing data") Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> (cherry picked from commitb40850b24a) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39462>
This commit is contained in:
parent
35251391c8
commit
a96da583fa
2 changed files with 2 additions and 2 deletions
|
|
@ -964,7 +964,7 @@
|
|||
"description": "util/blob: Fix const correctness warning in blob_read_string",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "1c9877327ead37b7dd5a0ca3a8c7912e924328e5",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -330,7 +330,7 @@ blob_read_string(struct blob_reader *blob)
|
|||
{
|
||||
int size;
|
||||
char *ret;
|
||||
uint8_t *nul;
|
||||
const uint8_t *nul;
|
||||
|
||||
/* If we're already at the end, then this is an overrun. */
|
||||
if (blob->current >= blob->end) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue