[cairo] [PATCH 2/5] trace: Always emit a function name for write-to-png-stream

Andrea Canciani ranma42 at gmail.com
Fri Mar 18 10:13:20 PDT 2011


By emitting an empty function name when it it impossible to perform
the lookup, we can get rid of the warning:

trace.c:3714: warning: unused variable ‘symbol’

Additionally, this makes the syntax (or, rather, the parameter count)
for write-to-png-stream the same on every configuration.
---
 util/cairo-trace/trace.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c
index ff2bc81..9bdeb01 100644
--- a/util/cairo-trace/trace.c
+++ b/util/cairo-trace/trace.c
@@ -3715,10 +3715,11 @@ cairo_surface_write_to_png_stream (cairo_surface_t *surface,
 
 	_trace_printf ("%% s%ld ", _get_surface_id (surface));
 #if CAIRO_HAS_SYMBOL_LOOKUP
-	_emit_string_literal (lookup_symbol (symbol, sizeof (symbol),
-					     write_func),
-			      -1);
+	lookup_symbol (symbol, sizeof (symbol), write_func);
+#else
+	symbol[0] = '\0';
 #endif
+	_emit_string_literal (symbol, -1);
 	_trace_printf (" write-to-png-stream\n");
 	_write_unlock ();
     }
-- 
1.7.1



More information about the cairo mailing list