Commit 7faa5d38 by Jeremy White Committed by GitHub

Merge pull request #2 from xerus/master

Make it compile on the latest Fedora
parents 6fdb23d2 6c882bf7
......@@ -8,7 +8,8 @@ PKG_CHECK_MODULES(SHM, xcb-shm)
PKG_CHECK_MODULES(UTIL, xcb-util)
PKG_CHECK_MODULES(XKB, xcb-xkb)
PKG_CHECK_MODULES(XFIXES, xcb-xfixes)
PKG_CHECK_MODULES(GTK2, gtk+-2.0)
PKG_CHECK_EXISTS(gtk+-2.0, GTK_VERSION=2.0, GTK_VERSION=3.0)
PKG_CHECK_MODULES(GTK, gtk+-$GTK_VERSION)
PKG_CHECK_MODULES(SPICE, spice-server)
PKG_CHECK_MODULES(SPICE_PROTOCOL, spice-protocol)
PKG_CHECK_MODULES(GLIB2, glib-2.0)
......
......@@ -6,8 +6,8 @@ bin_PROGRAMS = x11spice
ALL_XCB_CFLAGS=$(XCB_CFLAGS) $(DAMAGE_CFLAGS) $(XTEST_CFLAGS) $(SHM_CFLAGS) $(UTIL_CFLAGS) $(XKB_CFLAGS) $(XFIXES_CFLAGS)
ALL_XCB_LIBS=$(XCB_LIBS) $(DAMAGE_LIBS) $(XTEST_LIBS) $(SHM_LIBS) $(UTIL_LIBS) $(XKB_LIBS) $(XFIXES_LIBS)
CUSTOM_CFLAGS=-Wall -Wno-deprecated-declarations -Werror
AM_CFLAGS = $(CUSTOM_CFLAGS) $(ALL_XCB_CFLAGS) $(GTK2_CFLAGS) $(SPICE_CFLAGS) $(SPICE_PROTOCOL_CFLAGS) $(GLIB2_CFLAGS) $(PIXMAN_CFLAGS) $(CODE_COVERAGE_CFLAGS)
x11spice_LDADD = $(ALL_XCB_LIBS) $(GTK2_LIBS) $(SPICE_LIBS) $(GLIB2_LIBS) $(PIXMAN_LIBS) $(CODE_COVERAGE_LDFLAGS)
AM_CFLAGS = $(CUSTOM_CFLAGS) $(ALL_XCB_CFLAGS) $(GTK_CFLAGS) $(SPICE_CFLAGS) $(SPICE_PROTOCOL_CFLAGS) $(GLIB2_CFLAGS) $(PIXMAN_CFLAGS) $(CODE_COVERAGE_CFLAGS)
x11spice_LDADD = $(ALL_XCB_LIBS) $(GTK_LIBS) $(SPICE_LIBS) $(GLIB2_LIBS) $(PIXMAN_LIBS) $(CODE_COVERAGE_LDFLAGS)
x11spice_SOURCES = \
agent.c \
agent.h \
......
......@@ -31,6 +31,7 @@
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <spice/macros.h>
#include "x11spice.h"
#include "agent.h"
......@@ -92,7 +93,7 @@ static void uinput_handle_absolute(agent_t *agent, struct input_event *ev)
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;
struct input_event *ev;
......@@ -109,7 +110,7 @@ static void uinput_read_cb(int fd, int event, void *opaque)
agent->uinput_offset += rc;
while (agent->uinput_offset >= sizeof(*ev)) {
while ((uint) agent->uinput_offset >= sizeof(*ev)) {
ev = (struct input_event *) agent->uinput_buffer;
agent->uinput_offset -= sizeof(*ev);
if (agent->uinput_offset > 0)
......@@ -227,7 +228,7 @@ static int agent_char_read(SpiceCharDeviceInstance *sin, uint8_t *buf, int len)
}
#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);
}
......@@ -240,7 +241,7 @@ static void agent_char_state(SpiceCharDeviceInstance *sin, int 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;
if (agent->virtio_client_fd == -1) {
......@@ -249,7 +250,7 @@ static void on_read_available(int fd, int event, void *opaque)
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;
struct sockaddr_un address;
......@@ -325,7 +326,7 @@ int agent_start(spice_t *spice, options_t *options, agent_t *agent)
{
int rc;
const static SpiceCharDeviceInterface agent_sif = {
static const SpiceCharDeviceInterface agent_sif = {
.base = {
.type = SPICE_INTERFACE_CHAR_DEVICE,
.description = "x11spice vdagent",
......
......@@ -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_reply_t *ir;
......
......@@ -54,13 +54,13 @@ void gui_remote_disconnected(gui_t *gui)
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;
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.");
gtk_main_quit();
......
......@@ -39,7 +39,7 @@
#include "session.h"
static void sigterm_handler(int arg)
static void sigterm_handler(int arg G_GNUC_UNUSED)
{
gui_sigterm();
}
......
......@@ -126,7 +126,7 @@ static gboolean bool_option(GKeyFile *u, GKeyFile *s, const gchar *section, cons
return ret;
}
static void usage(options_t *options, char *argv0)
static void usage(char *argv0)
{
char indent[256];
......@@ -313,7 +313,7 @@ int options_parse_arguments(int argc, char *argv[], options_t *options)
break;
default:
usage(options, argv[0]);
usage(argv[0]);
return X11SPICE_ERR_BADARGS;
}
}
......
......@@ -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);
}
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 i;
......
......@@ -138,7 +138,8 @@ void session_handle_key(session_t *session, uint8_t keycode, int is_press)
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)
return;
......
......@@ -31,6 +31,7 @@
#include <string.h>
#include <sys/socket.h>
#include <netdb.h>
#include <spice/macros.h>
#include "local_spice.h"
#include "x11spice.h"
......@@ -193,7 +194,7 @@ static void channel_event(int event, SpiceChannelEventInfo *info)
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;
......@@ -224,11 +225,11 @@ static void set_compression_level(QXLInstance *qin, int level)
/* Newer spice servers no longer transmit this information,
* 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));
info->num_memslots = 1;
......@@ -269,7 +270,8 @@ static int req_cmd_notification(QXLInstance *qin)
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);
}
......@@ -302,33 +304,36 @@ static int req_cursor_notification(QXLInstance *qin)
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__);
}
static int flush_resources(QXLInstance *qin)
static int flush_resources(QXLInstance *qin G_GNUC_UNUSED)
{
g_debug("TODO: %s UNIMPLEMENTEDs", __func__);
// Return 0 to direct the server to flush resources
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);
spice_free_release((spice_release_t *) cookie);
}
static void update_area_complete(QXLInstance *qin, uint32_t surface_id,
struct QXLRect *updated_rects, uint32_t num_updated_rects)
static void update_area_complete(QXLInstance *qin G_GNUC_UNUSED,
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__);
}
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) {
/* a NULL is used as a test to see if we support this function */
g_debug("%s: NULL monitors_config", __func__);
......@@ -419,7 +424,7 @@ static uint8_t kbd_get_leds(SpiceKbdInstance *sin)
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);
}
......@@ -516,7 +521,7 @@ void initialize_spice_instance(spice_t *s)
.channel_event = channel_event
};
const static QXLInterface display_sif = {
static const QXLInterface display_sif = {
.base = {
.type = SPICE_INTERFACE_QXL,
.description = "x11spice qxl",
......
TESTS = x11spice_test
ALL_XCB_CFLAGS=$(XCB_CFLAGS) $(DAMAGE_CFLAGS) $(XTEST_CFLAGS) $(SHM_CFLAGS) $(UTIL_CFLAGS)
ALL_XCB_LIBS=$(XCB_LIBS) $(DAMAGE_LIBS) $(XTEST_LIBS) $(SHM_LIBS) $(UTIL_LIBS)
AM_CFLAGS = -Wall $(ALL_XCB_CFLAGS) $(GTK2_CFLAGS) $(SPICE_CFLAGS) $(SPICE_PROTOCOL_CFLAGS) $(GLIB2_CFLAGS) $(PIXMAN_CFLAGS)
AM_LDFLAGS = $(ALL_XCB_LIBS) $(GTK2_LIBS) $(SPICE_LIBS) $(GLIB2_LIBS) $(PIXMAN_LIBS)
AM_CFLAGS = -Wall $(ALL_XCB_CFLAGS) $(GTK_CFLAGS) $(SPICE_CFLAGS) $(SPICE_PROTOCOL_CFLAGS) $(GLIB2_CFLAGS) $(PIXMAN_CFLAGS)
AM_LDFLAGS = $(ALL_XCB_LIBS) $(GTK_LIBS) $(SPICE_LIBS) $(GLIB2_LIBS) $(PIXMAN_LIBS)
x11spice_test_SOURCES = \
tests.c \
......
......@@ -61,7 +61,7 @@ static int test_common_start(test_t * test, x11spice_server_t * server,
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);
}
......@@ -154,7 +154,7 @@ void test_resize(xdummy_t *xdummy, gconstpointer user_data)
x11spice_server_t server;
int rc;
char buf[4096];
int i;
uint i;
static char *modes[] = { "640x480", "800x600", "1024x768", "1280x1024", "1920x1080" };
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)
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;
char fdbuf[100];
......@@ -243,7 +243,7 @@ void start_server(xdummy_t *server, gconstpointer user_data)
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);
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