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

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


Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
---
 src/util/u_debug.c  | 18 +++++++++---------
 src/util/u_string.h |  2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/util/u_debug.c b/src/util/u_debug.c
index 787d6c255ebbd382d4c9..fde2d60406572fbcf64b 100644
--- a/src/util/u_debug.c
+++ b/src/util/u_debug.c
@@ -167,19 +167,19 @@ debug_get_bool_option(const char *name, boolean dfault)
 
    if (str == NULL)
       result = dfault;
-   else if (!util_strcmp(str, "n"))
+   else if (!strcmp(str, "n"))
       result = FALSE;
-   else if (!util_strcmp(str, "no"))
+   else if (!strcmp(str, "no"))
       result = FALSE;
-   else if (!util_strcmp(str, "0"))
+   else if (!strcmp(str, "0"))
       result = FALSE;
-   else if (!util_strcmp(str, "f"))
+   else if (!strcmp(str, "f"))
       result = FALSE;
-   else if (!util_strcmp(str, "F"))
+   else if (!strcmp(str, "F"))
       result = FALSE;
-   else if (!util_strcmp(str, "false"))
+   else if (!strcmp(str, "false"))
       result = FALSE;
-   else if (!util_strcmp(str, "FALSE"))
+   else if (!strcmp(str, "FALSE"))
       result = FALSE;
    else
       result = TRUE;
@@ -227,7 +227,7 @@ str_has_option(const char *str, const char *name)
    }
 
    /* OPTION=all */
-   if (!util_strcmp(str, "all")) {
+   if (!strcmp(str, "all")) {
       return TRUE;
    }
 
@@ -276,7 +276,7 @@ debug_get_flags_option(const char *name,
    str = os_get_option(name);
    if (!str)
       result = dfault;
-   else if (!util_strcmp(str, "help")) {
+   else if (!strcmp(str, "help")) {
       result = dfault;
       _debug_printf("%s: help for %s:\n", __FUNCTION__, name);
       for (; flags->name; ++flags)
diff --git a/src/util/u_string.h b/src/util/u_string.h
index d730412e3b287a38686f..f46a7d8e3e4307c19e51 100644
--- a/src/util/u_string.h
+++ b/src/util/u_string.h
@@ -154,6 +154,7 @@ util_strncat(char *dst, const char *src, size_t n)
    return dst;
 }
 
+#define strcmp util_strcmp
 static inline int
 util_strcmp(const char *s1, const char *s2)
 {
@@ -214,7 +215,6 @@ util_strstr(const char *haystack, const char *needle)
 #define util_vasprintf vasprintf
 #define util_sprintf sprintf
 #define util_strchr strchr
-#define util_strcmp strcmp
 
 #endif
 
-- 
Cheers,
  Eric



More information about the mesa-dev mailing list