Blame SOURCES/0026-Fix-Wunused-parameter.patch

e2c81d
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
fce154
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio@redhat.com>
fce154
Date: Mon, 1 Sep 2014 13:24:55 +0200
fce154
Subject: [PATCH] Fix -Wunused-parameter
fce154
fce154
(cherry picked from commit 5ea7de3bccafa21963548abcb5b7061de4c59910)
fce154
---
fce154
 server/tests/test_display_base.c               | 37 +++++++++++++++++---------
fce154
 server/tests/test_display_base.h               |  1 +
fce154
 server/tests/test_display_no_ssl.c             |  2 +-
fce154
 server/tests/test_display_resolution_changes.c |  3 ++-
fce154
 server/tests/test_display_width_stride.c       |  9 ++++---
fce154
 server/tests/test_empty_success.c              | 24 +++++++++++------
fce154
 server/tests/test_playback.c                   |  2 +-
fce154
 server/tests/test_vdagent.c                    | 13 ++++++---
fce154
 8 files changed, 60 insertions(+), 31 deletions(-)
fce154
fce154
diff --git a/server/tests/test_display_base.c b/server/tests/test_display_base.c
fce154
index 20c0e47..602691b 100644
fce154
--- a/server/tests/test_display_base.c
fce154
+++ b/server/tests/test_display_base.c
fce154
@@ -64,7 +64,7 @@ static int rects = 16; //number of rects that will be draw
fce154
 static int has_automated_tests = 0; //automated test flag
fce154
 
fce154
 __attribute__((noreturn))
fce154
-static void sigchld_handler(int signal_num) // wait for the child process and exit
fce154
+static void sigchld_handler(SPICE_GNUC_UNUSED int signal_num) // wait for the child process and exit
fce154
 {
fce154
     int status;
fce154
     wait(&status);
fce154
@@ -412,19 +412,22 @@ static void attache_worker(QXLInstance *qin, QXLWorker *_qxl_worker)
fce154
     test->qxl_worker->start(test->qxl_worker);
fce154
 }
fce154
 
fce154
-static void set_compression_level(QXLInstance *qin, int level)
fce154
+static void set_compression_level(SPICE_GNUC_UNUSED QXLInstance *qin,
fce154
+                                  SPICE_GNUC_UNUSED int level)
fce154
 {
fce154
     printf("%s\n", __func__);
fce154
 }
fce154
 
fce154
-static void set_mm_time(QXLInstance *qin, uint32_t mm_time)
fce154
+static void set_mm_time(SPICE_GNUC_UNUSED QXLInstance *qin,
fce154
+                        SPICE_GNUC_UNUSED uint32_t mm_time)
fce154
 {
fce154
 }
fce154
 
fce154
 // we now have a secondary surface
fce154
 #define MAX_SURFACE_NUM 2
fce154
 
fce154
-static void get_init_info(QXLInstance *qin, QXLDevInitInfo *info)
fce154
+static void get_init_info(SPICE_GNUC_UNUSED QXLInstance *qin,
fce154
+                          QXLDevInitInfo *info)
fce154
 {
fce154
     memset(info, 0, sizeof(*info));
fce154
     info->num_memslots = 1;
fce154
@@ -467,7 +470,8 @@ static int get_num_commands(void)
fce154
 }
fce154
 
fce154
 // called from spice_server thread (i.e. red_worker thread)
fce154
-static int get_command(QXLInstance *qin, struct QXLCommandExt *ext)
fce154
+static int get_command(SPICE_GNUC_UNUSED QXLInstance *qin,
fce154
+                       struct QXLCommandExt *ext)
fce154
 {
fce154
     if (get_num_commands() == 0) {
fce154
         return FALSE;
fce154
@@ -617,7 +621,8 @@ static void do_wakeup(void *opaque)
fce154
     test->qxl_worker->wakeup(test->qxl_worker);
fce154
 }
fce154
 
fce154
-static void release_resource(QXLInstance *qin, struct QXLReleaseInfoExt release_info)
fce154
+static void release_resource(SPICE_GNUC_UNUSED QXLInstance *qin,
fce154
+                             struct QXLReleaseInfoExt release_info)
fce154
 {
fce154
     QXLCommandExt *ext = (QXLCommandExt*)(unsigned long)release_info.info->id;
fce154
     //printf("%s\n", __func__);
fce154
@@ -713,24 +718,25 @@ static int get_cursor_command(QXLInstance *qin, struct QXLCommandExt *ext)
fce154
     return TRUE;
fce154
 }
fce154
 
fce154
-static int req_cursor_notification(QXLInstance *qin)
fce154
+static int req_cursor_notification(SPICE_GNUC_UNUSED QXLInstance *qin)
fce154
 {
fce154
     printf("%s\n", __func__);
fce154
     return TRUE;
fce154
 }
fce154
 
fce154
-static void notify_update(QXLInstance *qin, uint32_t update_id)
fce154
+static void notify_update(SPICE_GNUC_UNUSED QXLInstance *qin,
fce154
+                          SPICE_GNUC_UNUSED uint32_t update_id)
fce154
 {
fce154
     printf("%s\n", __func__);
fce154
 }
fce154
 
fce154
-static int flush_resources(QXLInstance *qin)
fce154
+static int flush_resources(SPICE_GNUC_UNUSED QXLInstance *qin)
fce154
 {
fce154
     printf("%s\n", __func__);
fce154
     return TRUE;
fce154
 }
fce154
 
fce154
-static int client_monitors_config(QXLInstance *qin,
fce154
+static int client_monitors_config(SPICE_GNUC_UNUSED QXLInstance *qin,
fce154
                                   VDAgentMonitorsConfig *monitors_config)
fce154
 {
fce154
     if (!monitors_config) {
fce154
@@ -786,19 +792,24 @@ void test_add_display_interface(Test* test)
fce154
     spice_server_add_interface(test->server, &test->qxl_instance.base);
fce154
 }
fce154
 
fce154
-static int vmc_write(SpiceCharDeviceInstance *sin, const uint8_t *buf, int len)
fce154
+static int vmc_write(SPICE_GNUC_UNUSED SpiceCharDeviceInstance *sin,
fce154
+                     SPICE_GNUC_UNUSED const uint8_t *buf,
fce154
+                     int len)
fce154
 {
fce154
     printf("%s: %d\n", __func__, len);
fce154
     return len;
fce154
 }
fce154
 
fce154
-static int vmc_read(SpiceCharDeviceInstance *sin, uint8_t *buf, int len)
fce154
+static int vmc_read(SPICE_GNUC_UNUSED SpiceCharDeviceInstance *sin,
fce154
+                    SPICE_GNUC_UNUSED uint8_t *buf,
fce154
+                    int len)
fce154
 {
fce154
     printf("%s: %d\n", __func__, len);
fce154
     return 0;
fce154
 }
fce154
 
fce154
-static void vmc_state(SpiceCharDeviceInstance *sin, int connected)
fce154
+static void vmc_state(SPICE_GNUC_UNUSED SpiceCharDeviceInstance *sin,
fce154
+                      int connected)
fce154
 {
fce154
     printf("%s: %d\n", __func__, connected);
fce154
 }
fce154
diff --git a/server/tests/test_display_base.h b/server/tests/test_display_base.h
fce154
index d2823a7..0a58186 100644
fce154
--- a/server/tests/test_display_base.h
fce154
+++ b/server/tests/test_display_base.h
fce154
@@ -2,6 +2,7 @@
fce154
 #define __TEST_DISPLAY_BASE_H__
fce154
 
fce154
 #include <spice.h>
fce154
+#include <spice/macros.h>
fce154
 #include "basic_event_loop.h"
fce154
 
fce154
 #define COUNT(x) ((sizeof(x)/sizeof(x[0])))
fce154
diff --git a/server/tests/test_display_no_ssl.c b/server/tests/test_display_no_ssl.c
fce154
index 83ab3dc..89b4796 100644
fce154
--- a/server/tests/test_display_no_ssl.c
fce154
+++ b/server/tests/test_display_no_ssl.c
fce154
@@ -17,7 +17,7 @@ void show_channels(SpiceServer *server);
fce154
 
fce154
 int ping_ms = 100;
fce154
 
fce154
-void pinger(void *opaque)
fce154
+void pinger(SPICE_GNUC_UNUSED void *opaque)
fce154
 {
fce154
     // show_channels is not thread safe - fails if disconnections / connections occur
fce154
     //show_channels(server);
fce154
diff --git a/server/tests/test_display_resolution_changes.c b/server/tests/test_display_resolution_changes.c
fce154
index 4767ea9..c492653 100644
fce154
--- a/server/tests/test_display_resolution_changes.c
fce154
+++ b/server/tests/test_display_resolution_changes.c
fce154
@@ -22,7 +22,8 @@ void pinger(void *opaque)
fce154
     test->core->timer_start(ping_timer, ping_ms);
fce154
 }
fce154
 
fce154
-void set_primary_params(Test *test, Command *command)
fce154
+void set_primary_params(SPICE_GNUC_UNUSED Test *test,
fce154
+                        Command *command)
fce154
 {
fce154
 #if 0
fce154
     static int toggle = 0;
fce154
diff --git a/server/tests/test_display_width_stride.c b/server/tests/test_display_width_stride.c
fce154
index f938373..a071e74 100644
fce154
--- a/server/tests/test_display_width_stride.c
fce154
+++ b/server/tests/test_display_width_stride.c
fce154
@@ -25,7 +25,8 @@ void pinger(void *opaque)
fce154
 static int g_surface_id = 1;
fce154
 static uint8_t *g_surface_data;
fce154
 
fce154
-void set_draw_parameters(Test *test, Command *command)
fce154
+void set_draw_parameters(SPICE_GNUC_UNUSED Test *test,
fce154
+                         Command *command)
fce154
 {
fce154
     static int count = 17;
fce154
     CommandDrawSolid *solid = &command->solid;
fce154
@@ -38,7 +39,8 @@ void set_draw_parameters(Test *test, Command *command)
fce154
     count++;
fce154
 }
fce154
 
fce154
-void set_surface_params(Test *test, Command *command)
fce154
+void set_surface_params(SPICE_GNUC_UNUSED Test *test,
fce154
+                        Command *command)
fce154
 {
fce154
     CommandCreateSurface *create = &command->create_surface;
fce154
 
fce154
@@ -54,7 +56,8 @@ void set_surface_params(Test *test, Command *command)
fce154
     create->data = g_surface_data;
fce154
 }
fce154
 
fce154
-void set_destroy_parameters(Test *test, Command *command)
fce154
+void set_destroy_parameters(SPICE_GNUC_UNUSED Test *test,
fce154
+                            SPICE_GNUC_UNUSED Command *command)
fce154
 {
fce154
     if (g_surface_data) {
fce154
         free(g_surface_data);
fce154
diff --git a/server/tests/test_empty_success.c b/server/tests/test_empty_success.c
fce154
index 0176a52..6a3bb55 100644
fce154
--- a/server/tests/test_empty_success.c
fce154
+++ b/server/tests/test_empty_success.c
fce154
@@ -3,44 +3,52 @@
fce154
 #include <string.h>
fce154
 
fce154
 #include <spice.h>
fce154
+#include <spice/macros.h>
fce154
 
fce154
 struct SpiceTimer {
fce154
     int a,b;
fce154
 };
fce154
 
fce154
-SpiceTimer* timer_add(SpiceTimerFunc func, void *opaque)
fce154
+SpiceTimer* timer_add(SPICE_GNUC_UNUSED SpiceTimerFunc func,
fce154
+                      SPICE_GNUC_UNUSED void *opaque)
fce154
 {
fce154
     static struct SpiceTimer t = {0,};
fce154
 
fce154
     return &t;
fce154
 }
fce154
 
fce154
-void timer_start(SpiceTimer *timer, uint32_t ms)
fce154
+void timer_start(SPICE_GNUC_UNUSED SpiceTimer *timer,
fce154
+                 SPICE_GNUC_UNUSED uint32_t ms)
fce154
 {
fce154
 }
fce154
 
fce154
-void timer_cancel(SpiceTimer *timer)
fce154
+void timer_cancel(SPICE_GNUC_UNUSED SpiceTimer *timer)
fce154
 {
fce154
 }
fce154
 
fce154
-void timer_remove(SpiceTimer *timer)
fce154
+void timer_remove(SPICE_GNUC_UNUSED SpiceTimer *timer)
fce154
 {
fce154
 }
fce154
 
fce154
-SpiceWatch *watch_add(int fd, int event_mask, SpiceWatchFunc func, void *opaque)
fce154
+SpiceWatch *watch_add(SPICE_GNUC_UNUSED int fd,
fce154
+                      SPICE_GNUC_UNUSED int event_mask,
fce154
+                      SPICE_GNUC_UNUSED SpiceWatchFunc func,
fce154
+                      SPICE_GNUC_UNUSED void *opaque)
fce154
 {
fce154
     return NULL;
fce154
 }
fce154
 
fce154
-void watch_update_mask(SpiceWatch *watch, int event_mask)
fce154
+void watch_update_mask(SPICE_GNUC_UNUSED SpiceWatch *watch,
fce154
+                       SPICE_GNUC_UNUSED int event_mask)
fce154
 {
fce154
 }
fce154
 
fce154
-void watch_remove(SpiceWatch *watch)
fce154
+void watch_remove(SPICE_GNUC_UNUSED SpiceWatch *watch)
fce154
 {
fce154
 }
fce154
 
fce154
-void channel_event(int event, SpiceChannelEventInfo *info)
fce154
+void channel_event(SPICE_GNUC_UNUSED int event,
fce154
+                   SPICE_GNUC_UNUSED SpiceChannelEventInfo *info)
fce154
 {
fce154
 }
fce154
 
fce154
diff --git a/server/tests/test_playback.c b/server/tests/test_playback.c
fce154
index ed1b766..1e82c43 100644
fce154
--- a/server/tests/test_playback.c
fce154
+++ b/server/tests/test_playback.c
fce154
@@ -45,7 +45,7 @@ static void get_frame(void)
fce154
                         : 100;
fce154
 }
fce154
 
fce154
-void playback_timer_cb(void *opaque)
fce154
+void playback_timer_cb(SPICE_GNUC_UNUSED void *opaque)
fce154
 {
fce154
     static int t = 0;
fce154
     static uint64_t last_sent_usec = 0;
fce154
diff --git a/server/tests/test_vdagent.c b/server/tests/test_vdagent.c
fce154
index af33145..7a56c2a 100644
fce154
--- a/server/tests/test_vdagent.c
fce154
+++ b/server/tests/test_vdagent.c
fce154
@@ -20,7 +20,7 @@ int ping_ms = 100;
fce154
 #define MIN(a, b) ((a) > (b) ? (b) : (a))
fce154
 #endif
fce154
 
fce154
-void pinger(void *opaque)
fce154
+void pinger(SPICE_GNUC_UNUSED void *opaque)
fce154
 {
fce154
     // show_channels is not thread safe - fails if disconnections / connections occur
fce154
     //show_channels(server);
fce154
@@ -29,12 +29,16 @@ void pinger(void *opaque)
fce154
 }
fce154
 
fce154
 
fce154
-static int vmc_write(SpiceCharDeviceInstance *sin, const uint8_t *buf, int len)
fce154
+static int vmc_write(SPICE_GNUC_UNUSED SpiceCharDeviceInstance *sin,
fce154
+                     SPICE_GNUC_UNUSED const uint8_t *buf,
fce154
+                     int len)
fce154
 {
fce154
     return len;
fce154
 }
fce154
 
fce154
-static int vmc_read(SpiceCharDeviceInstance *sin, uint8_t *buf, int len)
fce154
+static int vmc_read(SPICE_GNUC_UNUSED SpiceCharDeviceInstance *sin,
fce154
+                    uint8_t *buf,
fce154
+                    int len)
fce154
 {
fce154
     static uint8_t c = 0;
fce154
     static uint8_t message[2048];
fce154
@@ -70,7 +74,8 @@ static int vmc_read(SpiceCharDeviceInstance *sin, uint8_t *buf, int len)
fce154
     return ret;
fce154
 }
fce154
 
fce154
-static void vmc_state(SpiceCharDeviceInstance *sin, int connected)
fce154
+static void vmc_state(SPICE_GNUC_UNUSED SpiceCharDeviceInstance *sin,
fce154
+                      SPICE_GNUC_UNUSED int connected)
fce154
 {
fce154
 }
fce154