[PATCH 03/10] rename stderr_is_a_tty to pocl_stderr_is_a_tty
authorAndreas Beckmann <anbe@debian.org>
Wed, 3 Feb 2021 22:42:33 +0000 (23:42 +0100)
committerAndreas Beckmann <anbe@debian.org>
Tue, 16 Feb 2021 10:00:57 +0000 (10:00 +0000)
Gbp-Pq: Name 0003-rename-stderr_is_a_tty-to-pocl_stderr_is_a_tty.patch

lib/CL/devices/devices.c
lib/CL/pocl_debug.c
lib/CL/pocl_debug.h

index 9bf622f464600b0d4d52c57bb3675aee9441da0b..77a1eaa516ae10bf8d478916571a83cfba8c79e3 100644 (file)
@@ -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,
index e16eaed2ba9cb76193ef0cb2fca6df106f2f4153..7ed237248372dc29bc21a20886dac290a267b7f9 100644 (file)
@@ -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
index 9b9f9058cca358d13af631c611ae8e257c97cc39..f9521591331393918f9e1afd48f9f1755bbaab0f 100644 (file)
@@ -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                                                        \