From: Andreas Beckmann Date: Wed, 3 Feb 2021 22:42:33 +0000 (+0100) Subject: [PATCH 03/10] rename stderr_is_a_tty to pocl_stderr_is_a_tty X-Git-Tag: archive/raspbian/1.6-5+rpi1^2~23 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7c7adf80e2d58efef52bfbd2e1df7a0576703429;p=pocl.git [PATCH 03/10] rename stderr_is_a_tty to pocl_stderr_is_a_tty Gbp-Pq: Name 0003-rename-stderr_is_a_tty-to-pocl_stderr_is_a_tty.patch --- diff --git a/lib/CL/devices/devices.c b/lib/CL/devices/devices.c index 9bf622f..77a1eaa 100644 --- a/lib/CL/devices/devices.c +++ b/lib/CL/devices/devices.c @@ -531,7 +531,7 @@ pocl_init_devices () #ifdef POCL_DEBUG_MESSAGES const char* debug = pocl_get_string_option ("POCL_DEBUG", "0"); pocl_debug_messages_setup (debug); - stderr_is_a_tty = isatty(fileno(stderr)); + pocl_stderr_is_a_tty = isatty(fileno(stderr)); #endif POCL_GOTO_ERROR_ON ((pocl_cache_init_topdir ()), CL_DEVICE_NOT_FOUND, diff --git a/lib/CL/pocl_debug.c b/lib/CL/pocl_debug.c index e16eaed..7ed2372 100644 --- a/lib/CL/pocl_debug.c +++ b/lib/CL/pocl_debug.c @@ -11,7 +11,7 @@ #ifdef POCL_DEBUG_MESSAGES uint64_t pocl_debug_messages_filter; /* Bitfield */ -int stderr_is_a_tty; +int pocl_stderr_is_a_tty; static pthread_mutex_t console_mutex = PTHREAD_MUTEX_INITIALIZER; @@ -100,15 +100,15 @@ static pthread_mutex_t console_mutex = PTHREAD_MUTEX_INITIALIZER; const char *formatstring; if (filter_type == POCL_FILTER_TYPE_ERR) - filter_type_str = (stderr_is_a_tty ? POCL_COLOR_RED : " *** ERROR *** "); + filter_type_str = (pocl_stderr_is_a_tty ? POCL_COLOR_RED : " *** ERROR *** "); else if (filter_type == POCL_FILTER_TYPE_WARN) - filter_type_str = (stderr_is_a_tty ? POCL_COLOR_YELLOW : " *** WARNING *** "); + filter_type_str = (pocl_stderr_is_a_tty ? POCL_COLOR_YELLOW : " *** WARNING *** "); else if (filter_type == POCL_FILTER_TYPE_INFO) - filter_type_str = (stderr_is_a_tty ? POCL_COLOR_GREEN : " *** INFO *** "); + filter_type_str = (pocl_stderr_is_a_tty ? POCL_COLOR_GREEN : " *** INFO *** "); else - filter_type_str = (stderr_is_a_tty ? POCL_COLOR_GREEN : " *** UNKNOWN *** "); + filter_type_str = (pocl_stderr_is_a_tty ? POCL_COLOR_GREEN : " *** UNKNOWN *** "); - if (stderr_is_a_tty) + if (pocl_stderr_is_a_tty) formatstring = POCL_COLOR_BLUE "[%04i-%02i-%02i %02i:%02i:%02i.%09li]" POCL_COLOR_RESET "POCL: in fn %s " @@ -143,7 +143,7 @@ static pthread_mutex_t console_mutex = PTHREAD_MUTEX_INITIALIZER; if (!(pocl_debug_messages_filter & POCL_DEBUG_FLAG_TIMING)) return; const char* formatstring; - if (stderr_is_a_tty) + if (pocl_stderr_is_a_tty) formatstring = " >>> " POCL_COLOR_MAGENTA " %3" PRIu64 ".%03" PRIu64 " " POCL_COLOR_RESET " %s %s\n"; else @@ -157,7 +157,7 @@ static pthread_mutex_t console_mutex = PTHREAD_MUTEX_INITIALIZER; if ((sec == 0) && (nsec < 1000)) { b = nsec % 1000; - if (stderr_is_a_tty) + if (pocl_stderr_is_a_tty) formatstring = " >>> " POCL_COLOR_MAGENTA " %3" PRIu64 " " POCL_COLOR_RESET " ns %s\n"; else @@ -178,7 +178,7 @@ static pthread_mutex_t console_mutex = PTHREAD_MUTEX_INITIALIZER; } else { - if (stderr_is_a_tty) + if (pocl_stderr_is_a_tty) formatstring = " >>> " POCL_COLOR_MAGENTA " %3" PRIu64 ".%09" PRIu64 " " POCL_COLOR_RESET " %s %s\n"; else diff --git a/lib/CL/pocl_debug.h b/lib/CL/pocl_debug.h index 9b9f905..f952159 100644 --- a/lib/CL/pocl_debug.h +++ b/lib/CL/pocl_debug.h @@ -110,7 +110,7 @@ extern "C" { #ifdef POCL_DEBUG_MESSAGES extern uint64_t pocl_debug_messages_filter; - extern int stderr_is_a_tty; + extern int pocl_stderr_is_a_tty; #define POCL_DEBUGGING_ON (pocl_debug_messages_filter) @@ -148,7 +148,7 @@ extern "C" { if (pocl_debug_messages_filter & POCL_DEBUG_FLAG_ ## FILTER) { \ pocl_debug_output_lock (); \ POCL_DEBUG_HEADER(FILTER, POCL_FILTER_TYPE_ ## TYPE) \ - if (stderr_is_a_tty) \ + if (pocl_stderr_is_a_tty) \ fprintf (stderr, "%s", POCL_COLOR_BOLDRED \ ERRCODE " " POCL_COLOR_RESET); \ else \