diff options
author | Lionel Landwerlin <[email protected]> | 2019-08-09 16:14:38 +0300 |
---|---|---|
committer | Lionel Landwerlin <[email protected]> | 2019-08-09 22:59:43 +0300 |
commit | e2d761de0377391c34c3c2fcc098292066dc0581 (patch) | |
tree | 8e76aea765ea8acccde3206e37a548f21302228e /src/util/u_debug.c | |
parent | 85bf1dc2dec53bb7808c1627991102277e60a2ca (diff) |
util: drop final reference to p_compiler.h
Signed-off-by: Lionel Landwerlin <[email protected]>
Acked-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src/util/u_debug.c')
-rw-r--r-- | src/util/u_debug.c | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/src/util/u_debug.c b/src/util/u_debug.c index cd31ca6e130..e1c8265965f 100644 --- a/src/util/u_debug.c +++ b/src/util/u_debug.c @@ -29,7 +29,6 @@ #include "pipe/p_config.h" -#include "pipe/p_compiler.h" #include "util/u_debug.h" #include "pipe/p_format.h" #include "pipe/p_state.h" @@ -123,11 +122,11 @@ debug_print_blob(const char *name, const void *blob, unsigned size) #endif -static boolean +static bool debug_get_option_should_print(void) { - static boolean first = TRUE; - static boolean value = FALSE; + static bool first = true; + static bool value = false; if (!first) return value; @@ -135,8 +134,8 @@ debug_get_option_should_print(void) /* Oh hey this will call into this function, * but its cool since we set first to false */ - first = FALSE; - value = debug_get_bool_option("GALLIUM_PRINT_OPTIONS", FALSE); + first = false; + value = debug_get_bool_option("GALLIUM_PRINT_OPTIONS", false); /* XXX should we print this option? Currently it wont */ return value; } @@ -159,30 +158,30 @@ debug_get_option(const char *name, const char *dfault) } -boolean -debug_get_bool_option(const char *name, boolean dfault) +bool +debug_get_bool_option(const char *name, bool dfault) { const char *str = os_get_option(name); - boolean result; + bool result; if (str == NULL) result = dfault; else if (!strcmp(str, "n")) - result = FALSE; + result = false; else if (!strcmp(str, "no")) - result = FALSE; + result = false; else if (!strcmp(str, "0")) - result = FALSE; + result = false; else if (!strcmp(str, "f")) - result = FALSE; + result = false; else if (!strcmp(str, "F")) - result = FALSE; + result = false; else if (!strcmp(str, "false")) - result = FALSE; + result = false; else if (!strcmp(str, "FALSE")) - result = FALSE; + result = false; else - result = TRUE; + result = true; if (debug_get_option_should_print()) debug_printf("%s: %s = %s\n", __FUNCTION__, name, @@ -218,17 +217,17 @@ debug_get_num_option(const char *name, long dfault) } -static boolean +static bool str_has_option(const char *str, const char *name) { /* Empty string. */ if (!*str) { - return FALSE; + return false; } /* OPTION=all */ if (!strcmp(str, "all")) { - return TRUE; + return true; } /* Find 'name' in 'str' surrounded by non-alphanumeric characters. */ @@ -245,11 +244,11 @@ str_has_option(const char *str, const char *name) if (!*str || !(isalnum(*str) || *str == '_')) { if (str-start == name_len && !memcmp(start, name, name_len)) { - return TRUE; + return true; } if (!*str) { - return FALSE; + return false; } start = str+1; @@ -259,7 +258,7 @@ str_has_option(const char *str, const char *name) } } - return FALSE; + return false; } |