projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
util: Make process_test path compatible with mingw native toolchains
[mesa.git]
/
src
/
util
/
u_debug.c
diff --git
a/src/util/u_debug.c
b/src/util/u_debug.c
index 9e547f508ca3bbc80653e92a9fc1169e70f27a7a..e1c8265965fd3d9e9f470e947a781fea1cb9b009 100644
(file)
--- a/
src/util/u_debug.c
+++ b/
src/util/u_debug.c
@@
-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 "pipe/p_format.h"
#include "pipe/p_state.h"
#include "util/u_debug.h"
#include "pipe/p_format.h"
#include "pipe/p_state.h"
@@
-51,16
+50,16
@@
void
_debug_vprintf(const char *format, va_list ap)
{
static char buf[4096] = {'\0'};
_debug_vprintf(const char *format, va_list ap)
{
static char buf[4096] = {'\0'};
-#if
defined(PIPE_OS_WINDOWS) || defined(PIPE_SUBSYSTEM_EMBEDDED
)
+#if
DETECT_OS_WINDOWS || defined(EMBEDDED_DEVICE
)
/* We buffer until we find a newline. */
size_t len = strlen(buf);
/* We buffer until we find a newline. */
size_t len = strlen(buf);
- int ret =
util_
vsnprintf(buf + len, sizeof(buf) - len, format, ap);
+ int ret = vsnprintf(buf + len, sizeof(buf) - len, format, ap);
if (ret > (int)(sizeof(buf) - len - 1) || strchr(buf + len, '\n')) {
os_log_message(buf);
buf[0] = '\0';
}
#else
if (ret > (int)(sizeof(buf) - len - 1) || strchr(buf + len, '\n')) {
os_log_message(buf);
buf[0] = '\0';
}
#else
-
util_
vsnprintf(buf, sizeof(buf), format, ap);
+ vsnprintf(buf, sizeof(buf), format, ap);
os_log_message(buf);
#endif
}
os_log_message(buf);
#endif
}
@@
-123,11
+122,11
@@
debug_print_blob(const char *name, const void *blob, unsigned size)
#endif
#endif
-static bool
ean
+static bool
debug_get_option_should_print(void)
{
debug_get_option_should_print(void)
{
- static bool
ean first = TRUE
;
- static bool
ean value = FALSE
;
+ static bool
first = true
;
+ static bool
value = false
;
if (!first)
return value;
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
*/
/* 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;
}
/* XXX should we print this option? Currently it wont */
return value;
}
@@
-159,30
+158,30
@@
debug_get_option(const char *name, const char *dfault)
}
}
-bool
ean
-debug_get_bool_option(const char *name, bool
ean
dfault)
+bool
+debug_get_bool_option(const char *name, bool dfault)
{
const char *str = os_get_option(name);
{
const char *str = os_get_option(name);
- bool
ean
result;
+ bool result;
if (str == NULL)
result = dfault;
else if (!strcmp(str, "n"))
if (str == NULL)
result = dfault;
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())
debug_printf("%s: %s = %s\n", __FUNCTION__, name,
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 bool
ean
+static bool
str_has_option(const char *str, const char *name)
{
/* Empty string. */
if (!*str) {
str_has_option(const char *str, const char *name)
{
/* Empty string. */
if (!*str) {
- return
FALSE
;
+ return
false
;
}
/* OPTION=all */
if (!strcmp(str, "all")) {
}
/* OPTION=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-start == name_len &&
!memcmp(start, name, name_len)) {
if (!*str || !(isalnum(*str) || *str == '_')) {
if (str-start == 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
;
}
}