mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 22:10:10 +01:00
ac/debug: use util_strchrnul() to fix android build error
Similar toe09d04cd56"radeonsi: use util_strchrnul() to fix android build error" Android Bionic does not support strchrnul() string function, gallium auxiliary util/u_string.h provides util_strchrnul() This change avoids the following warning and error: external/mesa/src/amd/common/ac_debug.c:501:15: warning: implicit declaration of function 'strchrnul' is invalid in C99 char *end = strchrnul(out, '\n'); ^ external/mesa/src/amd/common/ac_debug.c:501:9: error: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int' char *end = strchrnul(out, '\n'); ^ ~~~~~~~~~~~~~~~~~~~~ 1 warning and 1 error generated. Fixes:c2c3912410"ac/debug: annotate IB dumps with the raw values" Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Rob Herring <robh@kernel.org>
This commit is contained in:
parent
fc99cb3c9e
commit
725741f10d
1 changed files with 2 additions and 1 deletions
|
|
@ -39,6 +39,7 @@
|
||||||
#include "sid_tables.h"
|
#include "sid_tables.h"
|
||||||
#include "util/u_math.h"
|
#include "util/u_math.h"
|
||||||
#include "util/u_memory.h"
|
#include "util/u_memory.h"
|
||||||
|
#include "util/u_string.h"
|
||||||
|
|
||||||
/* Parsed IBs are difficult to read without colors. Use "less -R file" to
|
/* Parsed IBs are difficult to read without colors. Use "less -R file" to
|
||||||
* read them, or use "aha -b -f file" to convert them to html.
|
* read them, or use "aha -b -f file" to convert them to html.
|
||||||
|
|
@ -498,7 +499,7 @@ static void format_ib_output(FILE *f, char *out)
|
||||||
if (indent)
|
if (indent)
|
||||||
print_spaces(f, indent);
|
print_spaces(f, indent);
|
||||||
|
|
||||||
char *end = strchrnul(out, '\n');
|
char *end = util_strchrnul(out, '\n');
|
||||||
fwrite(out, end - out, 1, f);
|
fwrite(out, end - out, 1, f);
|
||||||
fputc('\n', f); /* always end with a new line */
|
fputc('\n', f); /* always end with a new line */
|
||||||
if (!*end)
|
if (!*end)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue