util: drop final reference to p_compiler.h

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
This commit is contained in:
Lionel Landwerlin 2019-08-09 16:14:38 +03:00
parent 85bf1dc2de
commit e2d761de03
3 changed files with 38 additions and 40 deletions

View File

@ -36,7 +36,6 @@
#define _UTIL_CPU_DETECT_H #define _UTIL_CPU_DETECT_H
#include "pipe/p_compiler.h"
#include "pipe/p_config.h" #include "pipe/p_config.h"

View File

@ -29,7 +29,6 @@
#include "pipe/p_config.h" #include "pipe/p_config.h"
#include "pipe/p_compiler.h"
#include "util/u_debug.h" #include "util/u_debug.h"
#include "pipe/p_format.h" #include "pipe/p_format.h"
#include "pipe/p_state.h" #include "pipe/p_state.h"
@ -123,11 +122,11 @@ debug_print_blob(const char *name, const void *blob, unsigned size)
#endif #endif
static boolean static bool
debug_get_option_should_print(void) debug_get_option_should_print(void)
{ {
static boolean first = TRUE; static bool first = true;
static boolean value = FALSE; static bool value = false;
if (!first) if (!first)
return value; return value;
@ -135,8 +134,8 @@ debug_get_option_should_print(void)
/* Oh hey this will call into this function, /* Oh hey this will call into this function,
* but its cool since we set first to false * but its cool since we set first to false
*/ */
first = FALSE; first = false;
value = debug_get_bool_option("GALLIUM_PRINT_OPTIONS", FALSE); value = debug_get_bool_option("GALLIUM_PRINT_OPTIONS", false);
/* XXX should we print this option? Currently it wont */ /* XXX should we print this option? Currently it wont */
return value; return value;
} }
@ -159,30 +158,30 @@ debug_get_option(const char *name, const char *dfault)
} }
boolean bool
debug_get_bool_option(const char *name, boolean dfault) debug_get_bool_option(const char *name, bool dfault)
{ {
const char *str = os_get_option(name); const char *str = os_get_option(name);
boolean result; bool result;
if (str == NULL) if (str == NULL)
result = dfault; result = dfault;
else if (!strcmp(str, "n")) else if (!strcmp(str, "n"))
result = FALSE; result = false;
else if (!strcmp(str, "no")) else if (!strcmp(str, "no"))
result = FALSE; result = false;
else if (!strcmp(str, "0")) else if (!strcmp(str, "0"))
result = FALSE; result = false;
else if (!strcmp(str, "f")) else if (!strcmp(str, "f"))
result = FALSE; result = false;
else if (!strcmp(str, "F")) else if (!strcmp(str, "F"))
result = FALSE; result = false;
else if (!strcmp(str, "false")) else if (!strcmp(str, "false"))
result = FALSE; result = false;
else if (!strcmp(str, "FALSE")) else if (!strcmp(str, "FALSE"))
result = FALSE; result = false;
else else
result = TRUE; result = true;
if (debug_get_option_should_print()) if (debug_get_option_should_print())
debug_printf("%s: %s = %s\n", __FUNCTION__, name, 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) str_has_option(const char *str, const char *name)
{ {
/* Empty string. */ /* Empty string. */
if (!*str) { if (!*str) {
return FALSE; return false;
} }
/* OPTION=all */ /* OPTION=all */
if (!strcmp(str, "all")) { if (!strcmp(str, "all")) {
return TRUE; return true;
} }
/* Find 'name' in 'str' surrounded by non-alphanumeric characters. */ /* 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 || !(isalnum(*str) || *str == '_')) {
if (str-start == name_len && if (str-start == name_len &&
!memcmp(start, name, name_len)) { !memcmp(start, name, name_len)) {
return TRUE; return true;
} }
if (!*str) { if (!*str) {
return FALSE; return false;
} }
start = str+1; start = str+1;
@ -259,7 +258,7 @@ str_has_option(const char *str, const char *name)
} }
} }
return FALSE; return false;
} }

View File

@ -110,9 +110,9 @@ debug_printf(const char *format, ...)
*/ */
#define debug_printf_once(args) \ #define debug_printf_once(args) \
do { \ do { \
static boolean once = TRUE; \ static bool once = true; \
if (once) { \ if (once) { \
once = FALSE; \ once = false; \
debug_printf args; \ debug_printf args; \
} \ } \
} while (0) } while (0)
@ -236,11 +236,11 @@ void _debug_assert_fail(const char *expr,
#ifdef DEBUG #ifdef DEBUG
#define debug_warn_once(__msg) \ #define debug_warn_once(__msg) \
do { \ do { \
static bool warned = FALSE; \ static bool warned = false; \
if (!warned) { \ if (!warned) { \
_debug_printf("%s:%u:%s: one time warning: %s\n", \ _debug_printf("%s:%u:%s: one time warning: %s\n", \
__FILE__, __LINE__, __FUNCTION__, __msg); \ __FILE__, __LINE__, __FUNCTION__, __msg); \
warned = TRUE; \ warned = true; \
} \ } \
} while (0) } while (0)
#else #else
@ -390,8 +390,8 @@ void debug_funclog_enter_exit(const char* f, const int line, const char* file);
const char * const char *
debug_get_option(const char *name, const char *dfault); debug_get_option(const char *name, const char *dfault);
boolean bool
debug_get_bool_option(const char *name, boolean dfault); debug_get_bool_option(const char *name, bool dfault);
long long
debug_get_num_option(const char *name, long dfault); debug_get_num_option(const char *name, long dfault);
@ -405,23 +405,23 @@ debug_get_flags_option(const char *name,
static const char * \ static const char * \
debug_get_option_ ## suffix (void) \ debug_get_option_ ## suffix (void) \
{ \ { \
static boolean first = TRUE; \ static bool first = true; \
static const char * value; \ static const char * value; \
if (first) { \ if (first) { \
first = FALSE; \ first = false; \
value = debug_get_option(name, dfault); \ value = debug_get_option(name, dfault); \
} \ } \
return value; \ return value; \
} }
#define DEBUG_GET_ONCE_BOOL_OPTION(sufix, name, dfault) \ #define DEBUG_GET_ONCE_BOOL_OPTION(sufix, name, dfault) \
static boolean \ static bool \
debug_get_option_ ## sufix (void) \ debug_get_option_ ## sufix (void) \
{ \ { \
static boolean first = TRUE; \ static bool first = true; \
static boolean value; \ static bool value; \
if (first) { \ if (first) { \
first = FALSE; \ first = false; \
value = debug_get_bool_option(name, dfault); \ value = debug_get_bool_option(name, dfault); \
} \ } \
return value; \ return value; \
@ -431,10 +431,10 @@ debug_get_option_ ## sufix (void) \
static long \ static long \
debug_get_option_ ## sufix (void) \ debug_get_option_ ## sufix (void) \
{ \ { \
static boolean first = TRUE; \ static bool first = true; \
static long value; \ static long value; \
if (first) { \ if (first) { \
first = FALSE; \ first = false; \
value = debug_get_num_option(name, dfault); \ value = debug_get_num_option(name, dfault); \
} \ } \
return value; \ return value; \
@ -444,10 +444,10 @@ debug_get_option_ ## sufix (void) \
static unsigned long \ static unsigned long \
debug_get_option_ ## sufix (void) \ debug_get_option_ ## sufix (void) \
{ \ { \
static boolean first = TRUE; \ static bool first = true; \
static unsigned long value; \ static unsigned long value; \
if (first) { \ if (first) { \
first = FALSE; \ first = false; \
value = debug_get_flags_option(name, flags, dfault); \ value = debug_get_flags_option(name, flags, dfault); \
} \ } \
return value; \ return value; \