[pango/matthiasc/for-main: 1/3] tracing: Fix the defines




commit 08b4e6279c64bc694292199c1806d8af349bbd28
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Dec 25 00:16:29 2021 -0500

    tracing: Fix the defines
    
    We want to define pango_trace_mark to nothing.
    
    This reveals that we've never compiled these
    calls out before, and there are some warnings
    to be fixed in that case.

 pango/pango-trace-private.h |  4 ++--
 pango/pangofc-fontmap.c     | 24 ++++++++++++++++++------
 2 files changed, 20 insertions(+), 8 deletions(-)
---
diff --git a/pango/pango-trace-private.h b/pango/pango-trace-private.h
index 5d2a4fdf..8d5ebf51 100644
--- a/pango/pango-trace-private.h
+++ b/pango/pango-trace-private.h
@@ -42,9 +42,9 @@ void pango_trace_mark (gint64       begin_time,
 #ifndef HAVE_SYSPROF
 /* Optimise the whole call out */
 #if defined(G_HAVE_ISO_VARARGS)
-#define g_trace_mark(b, n, m, ...)
+#define pango_trace_mark(b, n, m, ...) G_STMT_START { } G_STMT_END
 #elif defined(G_HAVE_GNUC_VARARGS)
-#define g_trace_mark(b, n, m...)
+#define pango_trace_mark(b, n, m...) G_STMT_START { } G_STMT_END
 #else
 /* no varargs macro support; the call will have to be optimised out by the compiler */
 #endif
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index d198df45..5b0c4999 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -835,7 +835,9 @@ match_in_thread (gpointer task_data)
   ThreadData *td = task_data;
   FcResult result;
   FcPattern *match;
-  gint64 before = PANGO_TRACE_CURRENT_TIME;
+  gint64 before G_GNUC_UNUSED;
+
+  before = PANGO_TRACE_CURRENT_TIME;
 
   match = FcFontSetMatch (td->config,
                           &td->fonts, 1,
@@ -860,7 +862,9 @@ sort_in_thread (gpointer task_data)
   ThreadData *td = task_data;
   FcResult result;
   FcFontSet *fontset;
-  gint64 before = PANGO_TRACE_CURRENT_TIME;
+  gint64 before G_GNUC_UNUSED;
+
+  before = PANGO_TRACE_CURRENT_TIME;
 
   fontset = FcFontSetSort (td->config,
                            &td->fonts, 1,
@@ -1023,9 +1027,11 @@ pango_fc_patterns_get_font_pattern (PangoFcPatterns *pats, int i, gboolean *prep
 
   if (i == 0)
     {
-      gint64 before = PANGO_TRACE_CURRENT_TIME;
+      gint64 before G_GNUC_UNUSED;
       gboolean waited = FALSE;
 
+      before = PANGO_TRACE_CURRENT_TIME;
+
       g_mutex_lock (&pats->mutex);
 
       while (!pats->match && !pats->fontset)
@@ -1050,9 +1056,11 @@ pango_fc_patterns_get_font_pattern (PangoFcPatterns *pats, int i, gboolean *prep
     }
   else
     {
-      gint64 before = PANGO_TRACE_CURRENT_TIME;
+      gint64 before G_GNUC_UNUSED;
       gboolean waited = FALSE;
 
+      before = PANGO_TRACE_CURRENT_TIME;
+
       g_mutex_lock (&pats->mutex);
 
       while (!pats->fontset)
@@ -1354,7 +1362,9 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (PangoFcFontMap, pango_fc_font_map, PANGO_TYPE_
 static gpointer
 init_in_thread (gpointer task_data)
 {
-  gint64 before = PANGO_TRACE_CURRENT_TIME;
+  gint64 before G_GNUC_UNUSED;
+
+  before = PANGO_TRACE_CURRENT_TIME;
 
   FcInit ();
 
@@ -1388,9 +1398,11 @@ start_init_in_thread (PangoFcFontMap *fcfontmap)
 static void
 wait_for_fc_init (void)
 {
-  gint64 before = PANGO_TRACE_CURRENT_TIME;
+  gint64 before G_GNUC_UNUSED;
   gboolean waited = FALSE;
 
+  before = PANGO_TRACE_CURRENT_TIME;
+
   g_mutex_lock (&fc_init_mutex);
   while (fc_initialized < DEFAULT_CONFIG_INITIALIZED)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]