[mutter] cogl-trace: Include cogl-trace.h even when not tracing
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] cogl-trace: Include cogl-trace.h even when not tracing
- Date: Wed, 26 Jun 2019 16:43:01 +0000 (UTC)
commit d7d75dd8e757351bdcc57fa878a353019b62a742
Author: Daniel van Vugt <daniel van vugt canonical com>
Date: Wed Jun 26 11:03:46 2019 +0800
cogl-trace: Include cogl-trace.h even when not tracing
Public functions in C should be declared before they are defined, and
often compilers warn you if you haven't:
```
../cogl/cogl/cogl-trace.c:237:1: warning: no previous prototype for
‘cogl_set_tracing_enabled_on_thread_with_fd’ [-Wmissing-prototypes]
cogl_set_tracing_enabled_on_thread_with_fd (void *data,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../cogl/cogl/cogl-trace.c:245:1: warning: no previous prototype for
‘cogl_set_tracing_enabled_on_thread’ [-Wmissing-prototypes]
cogl_set_tracing_enabled_on_thread (void *data,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../cogl/cogl/cogl-trace.c:253:1: warning: no previous prototype for
‘cogl_set_tracing_disabled_on_thread’ [-Wmissing-prototypes]
cogl_set_tracing_disabled_on_thread (void *data)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
In this case the function declarations were not included because
`HAVE_TRACING` isn't defined. But we should still include `cogl-trace.h`
because it handles the case of `HAVE_TRACING` not being defined and
correctly still declares the functions defined in `cogl-trace.c`.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/650
cogl/cogl/cogl-trace.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/cogl/cogl/cogl-trace.c b/cogl/cogl/cogl-trace.c
index 9e52ec572..983b7d4bb 100644
--- a/cogl/cogl/cogl-trace.c
+++ b/cogl/cogl/cogl-trace.c
@@ -18,10 +18,10 @@
#include "cogl-config.h"
-#ifdef HAVE_TRACING
-
#include "cogl/cogl-trace.h"
+#ifdef HAVE_TRACING
+
#include <sysprof-capture.h>
#include <syscall.h>
#include <sys/types.h>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]