[gjs: 11/12] profiler: Mark unused function parameters



commit 826d72bc5422c019ba777cb8ee19e78c754b7e49
Author: Philip Chimento <philip chimento gmail com>
Date:   Fri Aug 16 23:15:12 2019 -0700

    profiler: Mark unused function parameters
    
    There are some function parameters unused if the profiler functionality
    is #ifdef'd out. Mark these as unused in the #else case so that the
    compiler doesn't warn about them.

 gjs/profiler.cpp | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/gjs/profiler.cpp b/gjs/profiler.cpp
index 117a567f..cce5792c 100644
--- a/gjs/profiler.cpp
+++ b/gjs/profiler.cpp
@@ -685,6 +685,11 @@ void _gjs_profiler_add_mark(GjsProfiler* self, gint64 time_nsec,
         sysprof_capture_writer_add_mark(self->capture, time_nsec, -1, self->pid,
                                         duration_nsec, group, name, message);
     }
+#else
+    // Unused in the no-profiler case
+    (void)time_nsec;
+    (void)duration_nsec;
+    (void)message;
 #endif
 }
 
@@ -699,5 +704,7 @@ void gjs_profiler_set_fd(GjsProfiler* self, int fd) {
             close(self->fd);
         self->fd = fd;
     }
+#else
+    (void)fd;  // Unused in the no-profiler case
 #endif
 }


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