Commit 8a74deb9 authored by Pavel Grunt's avatar Pavel Grunt

Fix compile warnings

Mostly unused parameters, make it compile with gcc version 6.3.1
parent c958ea2d
...@@ -93,7 +93,7 @@ static void uinput_handle_absolute(agent_t *agent, struct input_event *ev) ...@@ -93,7 +93,7 @@ static void uinput_handle_absolute(agent_t *agent, struct input_event *ev)
agent->uinput_buttons_state); agent->uinput_buttons_state);
} }
static void uinput_read_cb(int fd, int event, void *opaque) static void uinput_read_cb(int fd G_GNUC_UNUSED, int event G_GNUC_UNUSED, void *opaque)
{ {
agent_t *agent = (agent_t *) opaque; agent_t *agent = (agent_t *) opaque;
struct input_event *ev; struct input_event *ev;
...@@ -110,7 +110,7 @@ static void uinput_read_cb(int fd, int event, void *opaque) ...@@ -110,7 +110,7 @@ static void uinput_read_cb(int fd, int event, void *opaque)
agent->uinput_offset += rc; agent->uinput_offset += rc;
while (agent->uinput_offset >= sizeof(*ev)) { while ((uint) agent->uinput_offset >= sizeof(*ev)) {
ev = (struct input_event *) agent->uinput_buffer; ev = (struct input_event *) agent->uinput_buffer;
agent->uinput_offset -= sizeof(*ev); agent->uinput_offset -= sizeof(*ev);
if (agent->uinput_offset > 0) if (agent->uinput_offset > 0)
...@@ -228,7 +228,7 @@ static int agent_char_read(SpiceCharDeviceInstance *sin, uint8_t *buf, int len) ...@@ -228,7 +228,7 @@ static int agent_char_read(SpiceCharDeviceInstance *sin, uint8_t *buf, int len)
} }
#if SPICE_SERVER_VERSION >= 0x000c02 #if SPICE_SERVER_VERSION >= 0x000c02
static void agent_char_event(SpiceCharDeviceInstance *sin, uint8_t event) static void agent_char_event(SpiceCharDeviceInstance *sin G_GNUC_UNUSED, uint8_t event)
{ {
g_debug("agent event %d", event); g_debug("agent event %d", event);
} }
...@@ -241,7 +241,7 @@ static void agent_char_state(SpiceCharDeviceInstance *sin, int connected) ...@@ -241,7 +241,7 @@ static void agent_char_state(SpiceCharDeviceInstance *sin, int connected)
g_debug("agent state %d", connected); g_debug("agent state %d", connected);
} }
static void on_read_available(int fd, int event, void *opaque) static void on_read_available(int fd G_GNUC_UNUSED, int event G_GNUC_UNUSED, void *opaque)
{ {
agent_t *agent = (agent_t *) opaque; agent_t *agent = (agent_t *) opaque;
if (agent->virtio_client_fd == -1) { if (agent->virtio_client_fd == -1) {
...@@ -250,7 +250,7 @@ static void on_read_available(int fd, int event, void *opaque) ...@@ -250,7 +250,7 @@ static void on_read_available(int fd, int event, void *opaque)
spice_server_char_device_wakeup(&agent->base); spice_server_char_device_wakeup(&agent->base);
} }
static void on_accept(int fd, int event, void *opaque) static void on_accept(int fd, int event G_GNUC_UNUSED, void *opaque)
{ {
agent_t *agent = (agent_t *) opaque; agent_t *agent = (agent_t *) opaque;
struct sockaddr_un address; struct sockaddr_un address;
...@@ -326,7 +326,7 @@ int agent_start(spice_t *spice, options_t *options, agent_t *agent) ...@@ -326,7 +326,7 @@ int agent_start(spice_t *spice, options_t *options, agent_t *agent)
{ {
int rc; int rc;
const static SpiceCharDeviceInterface agent_sif = { static const SpiceCharDeviceInterface agent_sif = {
.base = { .base = {
.type = SPICE_INTERFACE_CHAR_DEVICE, .type = SPICE_INTERFACE_CHAR_DEVICE,
.description = "x11spice vdagent", .description = "x11spice vdagent",
......
...@@ -72,7 +72,8 @@ static int bits_per_pixel(display_t *d) ...@@ -72,7 +72,8 @@ static int bits_per_pixel(display_t *d)
} }
static void handle_cursor_notify(display_t *display, xcb_xfixes_cursor_notify_event_t *cev) static void handle_cursor_notify(display_t *display,
xcb_xfixes_cursor_notify_event_t *cev G_GNUC_UNUSED)
{ {
xcb_xfixes_get_cursor_image_cookie_t icookie; xcb_xfixes_get_cursor_image_cookie_t icookie;
xcb_xfixes_get_cursor_image_reply_t *ir; xcb_xfixes_get_cursor_image_reply_t *ir;
......
...@@ -54,13 +54,13 @@ void gui_remote_disconnected(gui_t *gui) ...@@ -54,13 +54,13 @@ void gui_remote_disconnected(gui_t *gui)
gtk_widget_set_sensitive(gui->disconnect_button, FALSE); gtk_widget_set_sensitive(gui->disconnect_button, FALSE);
} }
void gui_disconnect_clicked(GtkWidget *widget, gpointer data) void gui_disconnect_clicked(GtkWidget *widget G_GNUC_UNUSED, gpointer data)
{ {
gui_t *gui = (gui_t *)data; gui_t *gui = (gui_t *)data;
session_disconnect_client(gui->session); session_disconnect_client(gui->session);
} }
static gboolean timeout_if_no_connection(gpointer user_data) static gboolean timeout_if_no_connection(gpointer user_data G_GNUC_UNUSED)
{ {
g_debug("Timeout waiting for connection."); g_debug("Timeout waiting for connection.");
gtk_main_quit(); gtk_main_quit();
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#include "session.h" #include "session.h"
static void sigterm_handler(int arg) static void sigterm_handler(int arg G_GNUC_UNUSED)
{ {
gui_sigterm(); gui_sigterm();
} }
......
...@@ -126,7 +126,7 @@ static gboolean bool_option(GKeyFile *u, GKeyFile *s, const gchar *section, cons ...@@ -126,7 +126,7 @@ static gboolean bool_option(GKeyFile *u, GKeyFile *s, const gchar *section, cons
return ret; return ret;
} }
static void usage(options_t *options, char *argv0) static void usage(char *argv0)
{ {
char indent[256]; char indent[256];
...@@ -313,7 +313,7 @@ int options_parse_arguments(int argc, char *argv[], options_t *options) ...@@ -313,7 +313,7 @@ int options_parse_arguments(int argc, char *argv[], options_t *options)
break; break;
default: default:
usage(options, argv[0]); usage(argv[0]);
return X11SPICE_ERR_BADARGS; return X11SPICE_ERR_BADARGS;
} }
} }
......
...@@ -188,7 +188,8 @@ static void push_tiles_report(scanner_t *scanner, int start_row, int start_col, ...@@ -188,7 +188,8 @@ static void push_tiles_report(scanner_t *scanner, int start_row, int start_col,
scanner_push(scanner, SCANLINE_SCAN_REPORT, x, y, w, h); scanner_push(scanner, SCANLINE_SCAN_REPORT, x, y, w, h);
} }
static void grow_changed_tiles(scanner_t *scanner, int *tiles_changed_in_row, static void grow_changed_tiles(scanner_t *scanner G_GNUC_UNUSED,
int *tiles_changed_in_row,
int tiles_changed[][NUM_HORIZONTAL_TILES]) int tiles_changed[][NUM_HORIZONTAL_TILES])
{ {
int i; int i;
......
...@@ -138,7 +138,8 @@ void session_handle_key(session_t *session, uint8_t keycode, int is_press) ...@@ -138,7 +138,8 @@ void session_handle_key(session_t *session, uint8_t keycode, int is_press)
xcb_flush(session->display.c); xcb_flush(session->display.c);
} }
void session_handle_mouse_position(session_t *session, int x, int y, uint32_t buttons_state) void session_handle_mouse_position(session_t *session, int x, int y,
uint32_t buttons_state G_GNUC_UNUSED)
{ {
if (! session->options.allow_control) if (! session->options.allow_control)
return; return;
......
...@@ -194,7 +194,7 @@ static void channel_event(int event, SpiceChannelEventInfo *info) ...@@ -194,7 +194,7 @@ static void channel_event(int event, SpiceChannelEventInfo *info)
session_remote_disconnected(); session_remote_disconnected();
} }
static void attach_worker(QXLInstance *qin, QXLWorker *qxl_worker) static void attach_worker(QXLInstance *qin, QXLWorker *qxl_worker G_GNUC_UNUSED)
{ {
static int count = 0; static int count = 0;
...@@ -225,11 +225,11 @@ static void set_compression_level(QXLInstance *qin, int level) ...@@ -225,11 +225,11 @@ static void set_compression_level(QXLInstance *qin, int level)
/* Newer spice servers no longer transmit this information, /* Newer spice servers no longer transmit this information,
* so let's just disregard it */ * so let's just disregard it */
static void set_mm_time(QXLInstance *qin, uint32_t mm_time) static void set_mm_time(QXLInstance *qin G_GNUC_UNUSED, uint32_t mm_time G_GNUC_UNUSED)
{ {
} }
static void get_init_info(QXLInstance *qin, QXLDevInitInfo *info) static void get_init_info(QXLInstance *qin G_GNUC_UNUSED, QXLDevInitInfo *info)
{ {
memset(info, 0, sizeof(*info)); memset(info, 0, sizeof(*info));
info->num_memslots = 1; info->num_memslots = 1;
...@@ -270,7 +270,8 @@ static int req_cmd_notification(QXLInstance *qin) ...@@ -270,7 +270,8 @@ static int req_cmd_notification(QXLInstance *qin)
return 1; return 1;
} }
static void release_resource(QXLInstance *qin, struct QXLReleaseInfoExt release_info) static void release_resource(QXLInstance *qin G_GNUC_UNUSED,
struct QXLReleaseInfoExt release_info)
{ {
spice_free_release((spice_release_t *) release_info.info->id); spice_free_release((spice_release_t *) release_info.info->id);
} }
...@@ -303,33 +304,36 @@ static int req_cursor_notification(QXLInstance *qin) ...@@ -303,33 +304,36 @@ static int req_cursor_notification(QXLInstance *qin)
return 1; return 1;
} }
static void notify_update(QXLInstance *qin, uint32_t update_id) static void notify_update(QXLInstance *qin G_GNUC_UNUSED, uint32_t update_id G_GNUC_UNUSED)
{ {
g_debug("TODO: %s UNIMPLEMENTED", __func__); g_debug("TODO: %s UNIMPLEMENTED", __func__);
} }
static int flush_resources(QXLInstance *qin) static int flush_resources(QXLInstance *qin G_GNUC_UNUSED)
{ {
g_debug("TODO: %s UNIMPLEMENTEDs", __func__); g_debug("TODO: %s UNIMPLEMENTEDs", __func__);
// Return 0 to direct the server to flush resources // Return 0 to direct the server to flush resources
return 1; return 1;
} }
static void async_complete(QXLInstance *qin, uint64_t cookie) static void async_complete(QXLInstance *qin G_GNUC_UNUSED, uint64_t cookie)
{ {
g_debug("%s: cookie 0x%lx", __FUNCTION__, cookie); g_debug("%s: cookie 0x%lx", __FUNCTION__, cookie);
spice_free_release((spice_release_t *) cookie); spice_free_release((spice_release_t *) cookie);
} }
static void update_area_complete(QXLInstance *qin, uint32_t surface_id, static void update_area_complete(QXLInstance *qin G_GNUC_UNUSED,
struct QXLRect *updated_rects, uint32_t num_updated_rects) uint32_t surface_id G_GNUC_UNUSED,
struct QXLRect *updated_rects G_GNUC_UNUSED,
uint32_t num_updated_rects G_GNUC_UNUSED)
{ {
g_debug("TODO: %s UNIMPLEMENTED!", __func__); g_debug("TODO: %s UNIMPLEMENTED!", __func__);
} }
static int client_monitors_config(QXLInstance *qin, VDAgentMonitorsConfig *monitors_config) static int client_monitors_config(QXLInstance *qin G_GNUC_UNUSED,
VDAgentMonitorsConfig *monitors_config)
{ {
int i; uint i;
if (!monitors_config) { if (!monitors_config) {
/* a NULL is used as a test to see if we support this function */ /* a NULL is used as a test to see if we support this function */
g_debug("%s: NULL monitors_config", __func__); g_debug("%s: NULL monitors_config", __func__);
...@@ -420,7 +424,7 @@ static uint8_t kbd_get_leds(SpiceKbdInstance *sin) ...@@ -420,7 +424,7 @@ static uint8_t kbd_get_leds(SpiceKbdInstance *sin)
return ret; return ret;
} }
void tablet_set_logical_size(SpiceTabletInstance *tablet, int width, int height) void tablet_set_logical_size(SpiceTabletInstance *tablet G_GNUC_UNUSED, int width, int height)
{ {
g_debug("TODO: %s UNIMPLEMENTED. (width %dx%d)", __func__, width, height); g_debug("TODO: %s UNIMPLEMENTED. (width %dx%d)", __func__, width, height);
} }
...@@ -517,7 +521,7 @@ void initialize_spice_instance(spice_t *s) ...@@ -517,7 +521,7 @@ void initialize_spice_instance(spice_t *s)
.channel_event = channel_event .channel_event = channel_event
}; };
const static QXLInterface display_sif = { static const QXLInterface display_sif = {
.base = { .base = {
.type = SPICE_INTERFACE_QXL, .type = SPICE_INTERFACE_QXL,
.description = "x11spice qxl", .description = "x11spice qxl",
......
...@@ -61,7 +61,7 @@ static int test_common_start(test_t * test, x11spice_server_t * server, ...@@ -61,7 +61,7 @@ static int test_common_start(test_t * test, x11spice_server_t * server,
return 0; return 0;
} }
static void test_common_stop(test_t * test, x11spice_server_t * server) static void test_common_stop(test_t * test G_GNUC_UNUSED, x11spice_server_t * server)
{ {
x11spice_stop(server); x11spice_stop(server);
} }
...@@ -154,7 +154,7 @@ void test_resize(xdummy_t *xdummy, gconstpointer user_data) ...@@ -154,7 +154,7 @@ void test_resize(xdummy_t *xdummy, gconstpointer user_data)
x11spice_server_t server; x11spice_server_t server;
int rc; int rc;
char buf[4096]; char buf[4096];
int i; uint i;
static char *modes[] = { "640x480", "800x600", "1024x768", "1280x1024", "1920x1080" }; static char *modes[] = { "640x480", "800x600", "1024x768", "1280x1024", "1920x1080" };
if (check_binary("xrandr", xdummy->display) || check_binary("spicy-screenshot", NULL)) if (check_binary("xrandr", xdummy->display) || check_binary("spicy-screenshot", NULL))
......
...@@ -136,7 +136,7 @@ static int generate_paths(xdummy_t *server, gconstpointer user_data) ...@@ -136,7 +136,7 @@ static int generate_paths(xdummy_t *server, gconstpointer user_data)
return 0; return 0;
} }
static int exec_xorg(xdummy_t *server, gconstpointer user_data) static int exec_xorg(xdummy_t *server, gconstpointer user_data G_GNUC_UNUSED)
{ {
FILE *fp; FILE *fp;
char fdbuf[100]; char fdbuf[100];
...@@ -243,7 +243,7 @@ void start_server(xdummy_t *server, gconstpointer user_data) ...@@ -243,7 +243,7 @@ void start_server(xdummy_t *server, gconstpointer user_data)
g_message("server started; display %s", server->display); g_message("server started; display %s", server->display);
} }
void stop_server(xdummy_t *server, gconstpointer user_data) void stop_server(xdummy_t *server, gconstpointer user_data G_GNUC_UNUSED)
{ {
g_message("server stopping; display %s", server->display); g_message("server stopping; display %s", server->display);
if (server->running) { if (server->running) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment