[Mesa-dev] [PATCH mesa 06/13] util: use standard name for strncmp()

Eric Engestrom eric.engestrom at intel.com
Tue Nov 20 13:11:06 UTC 2018


Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
---
 src/gallium/auxiliary/hud/hud_context.c | 2 +-
 src/util/u_string.h                     | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c
index 9f9db850a71dbdbfe6eb..e7e99944993ad8ffaf32 100644
--- a/src/gallium/auxiliary/hud/hud_context.c
+++ b/src/gallium/auxiliary/hud/hud_context.c
@@ -1195,7 +1195,7 @@ hud_parse_env_var(struct hud_context *hud, struct pipe_screen *screen,
    boolean sort_items = false;
    const char *period_env;
 
-   if (util_strncmp(env, "simple,", 7) == 0) {
+   if (strncmp(env, "simple,", 7) == 0) {
       hud->simple = true;
       env += 7;
    }
diff --git a/src/util/u_string.h b/src/util/u_string.h
index 82c340663b757fcfb3d8..d730412e3b287a38686f 100644
--- a/src/util/u_string.h
+++ b/src/util/u_string.h
@@ -170,6 +170,7 @@ util_strcmp(const char *s1, const char *s2)
    return 0;
 }
 
+#define strncmp util_strncmp
 static inline int
 util_strncmp(const char *s1, const char *s2, size_t n)
 {
@@ -194,7 +195,7 @@ util_strstr(const char *haystack, const char *needle)
    size_t len = strlen(needle);
 
    for (; (p = util_strchr(p, *needle)) != 0; p++) {
-      if (util_strncmp(p, needle, len) == 0) {
+      if (strncmp(p, needle, len) == 0) {
 	 return (char *)p;
       }
    }
@@ -214,7 +215,6 @@ util_strstr(const char *haystack, const char *needle)
 #define util_sprintf sprintf
 #define util_strchr strchr
 #define util_strcmp strcmp
-#define util_strncmp strncmp
 
 #endif
 
-- 
Cheers,
  Eric



More information about the mesa-dev mailing list