[Mesa-dev] [PATCH mesa 01/13] util: use standard name for strchrnul()
Eric Engestrom
eric.engestrom at intel.com
Tue Nov 20 13:11:01 UTC 2018
Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
---
src/amd/common/ac_debug.c | 2 +-
src/gallium/auxiliary/pipe-loader/pipe_loader.c | 2 +-
src/gallium/drivers/radeonsi/si_debug.c | 2 +-
src/gallium/drivers/radeonsi/si_shader.c | 2 +-
src/util/u_string.h | 9 +++------
5 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/src/amd/common/ac_debug.c b/src/amd/common/ac_debug.c
index 3b15398a2a294d266a60..0e0e534f63f0358af369 100644
--- a/src/amd/common/ac_debug.c
+++ b/src/amd/common/ac_debug.c
@@ -529,7 +529,7 @@ static void format_ib_output(FILE *f, char *out)
if (indent)
print_spaces(f, indent);
- char *end = util_strchrnul(out, '\n');
+ char *end = strchrnul(out, '\n');
fwrite(out, end - out, 1, f);
fputc('\n', f); /* always end with a new line */
if (!*end)
diff --git a/src/gallium/auxiliary/pipe-loader/pipe_loader.c b/src/gallium/auxiliary/pipe-loader/pipe_loader.c
index 6fd15527e53fe21cb5c4..3311a4b361859c669ece 100644
--- a/src/gallium/auxiliary/pipe-loader/pipe_loader.c
+++ b/src/gallium/auxiliary/pipe-loader/pipe_loader.c
@@ -147,7 +147,7 @@ pipe_loader_find_module(const char *driver_name,
int len, ret;
for (next = library_paths; *next; library_paths = next + 1) {
- next = util_strchrnul(library_paths, ':');
+ next = strchrnul(library_paths, ':');
len = next - library_paths;
if (len)
diff --git a/src/gallium/drivers/radeonsi/si_debug.c b/src/gallium/drivers/radeonsi/si_debug.c
index ec4bd03c9a541b393197..dcfaaa6dec82f30e6b09 100644
--- a/src/gallium/drivers/radeonsi/si_debug.c
+++ b/src/gallium/drivers/radeonsi/si_debug.c
@@ -874,7 +874,7 @@ static void si_add_split_disasm(const char *disasm,
while ((semicolon = strchr(disasm, ';'))) {
struct si_shader_inst *inst = &instructions[(*num)++];
- const char *end = util_strchrnul(semicolon, '\n');
+ const char *end = strchrnul(semicolon, '\n');
inst->text = disasm;
inst->textlen = end - disasm;
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 19522cc97b1721a11af6..aabcc81dfc0ed05c4270 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -5352,7 +5352,7 @@ static void si_shader_dump_disassembly(const struct ac_shader_binary *binary,
line = binary->disasm_string;
while (*line) {
- p = util_strchrnul(line, '\n');
+ p = strchrnul(line, '\n');
count = p - line;
if (count) {
diff --git a/src/util/u_string.h b/src/util/u_string.h
index e4081466459cb5f7902b..cb0895a71a3f50867327 100644
--- a/src/util/u_string.h
+++ b/src/util/u_string.h
@@ -50,12 +50,9 @@
extern "C" {
#endif
-#ifdef _GNU_SOURCE
-
-#define util_strchrnul strchrnul
-
-#else
+#ifndef _GNU_SOURCE
+#define strchrnul util_strchrnul
static inline char *
util_strchrnul(const char *s, char c)
{
@@ -137,7 +134,7 @@ util_vasprintf(char **ret, const char *format, va_list ap)
static inline char *
util_strchr(const char *s, char c)
{
- char *p = util_strchrnul(s, c);
+ char *p = strchrnul(s, c);
return *p ? p : NULL;
}
--
Cheers,
Eric
More information about the mesa-dev
mailing list