build: fix unused-parameter warnings

A couple changes to enable the use of -Wunused-parameter.

libmapper is built with the c compiler, which does not support omitting
the parameter name in the function definition, so use the de-facto
workaround and define an UNUSED() cpp macro.

Change-Id: I1c0d79d33097417fc3689351c4787e591fc23e9c
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/libmapper/mapper.c b/libmapper/mapper.c
index 4a1cd3b..1d00a32 100644
--- a/libmapper/mapper.c
+++ b/libmapper/mapper.c
@@ -30,6 +30,7 @@
 #include "internal.h"
 
 #define _public_ __attribute__((__visibility__("default")))
+#define _unused_ __attribute__((unused))
 
 static const char* async_wait_introspection_match =
     "type='signal',"
@@ -150,8 +151,8 @@
     return NULL;
 }
 
-static int async_wait_timeout_callback(sd_event_source* s, uint64_t usec,
-                                       void* userdata)
+static int async_wait_timeout_callback(_unused_ sd_event_source* s,
+                                       _unused_ uint64_t usec, void* userdata)
 {
     int r;
     struct async_wait_callback_data* data = userdata;
@@ -172,7 +173,7 @@
 }
 
 static int async_wait_getobject_callback(sd_bus_message* m, void* userdata,
-                                         sd_bus_error* e)
+                                         _unused_ sd_bus_error* e)
 {
     int i, r;
     struct async_wait_callback_data* data = userdata;
@@ -261,8 +262,9 @@
     return 0;
 }
 
-static int async_wait_match_introspection_complete(sd_bus_message* m, void* w,
-                                                   sd_bus_error* e)
+static int async_wait_match_introspection_complete(_unused_ sd_bus_message* m,
+                                                   void* w,
+                                                   _unused_ sd_bus_error* e)
 {
     int r;
 
@@ -389,7 +391,8 @@
     return r;
 }
 
-static int async_subtree_timeout_callback(sd_event_source* s, uint64_t usec,
+static int async_subtree_timeout_callback(_unused_ sd_event_source* s,
+                                          _unused_ uint64_t usec,
                                           void* userdata)
 {
     int r;
@@ -407,7 +410,7 @@
 }
 
 static int async_subtree_getpaths_callback(sd_bus_message* m, void* userdata,
-                                           sd_bus_error* e)
+                                           _unused_ sd_bus_error* e)
 {
     int r;
     struct mapper_async_subtree* subtree = userdata;
@@ -502,8 +505,8 @@
     return 0;
 }
 
-static int async_subtree_match_callback(sd_bus_message* m, void* t,
-                                        sd_bus_error* e)
+static int async_subtree_match_callback(_unused_ sd_bus_message* m, void* t,
+                                        _unused_ sd_bus_error* e)
 {
     int r;
 
diff --git a/src/associations.cpp b/src/associations.cpp
index 2c1cfa5..9fd72ab 100644
--- a/src/associations.cpp
+++ b/src/associations.cpp
@@ -539,7 +539,7 @@
                                   const std::string& endpointPath,
                                   const std::string& owner,
                                   AssociationMaps& assocMaps,
-                                  sdbusplus::asio::object_server& server)
+                                  sdbusplus::asio::object_server&)
 {
     auto sources = assocMaps.owners.begin();
     while (sources != assocMaps.owners.end())
diff --git a/src/main.cpp b/src/main.cpp
index 4937057..be24368 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -468,8 +468,8 @@
 
     // Construct a signal set registered for process termination.
     boost::asio::signal_set signals(io, SIGINT, SIGTERM);
-    signals.async_wait([&io](const boost::system::error_code& error,
-                             int signal_number) { io.stop(); });
+    signals.async_wait(
+        [&io](const boost::system::error_code&, int) { io.stop(); });
 
     interface_map_type interface_map;
     boost::container::flat_map<std::string, std::string> name_owners;