[Spice-devel] [PATCH spice-gtk 1/7] build-sys: enable -Wmissing-prototypes
Pavel Grunt
pgrunt at redhat.com
Tue May 31 08:51:58 UTC 2016
Hi,
On Mon, 2016-05-30 at 19:31 +0200, Marc-André Lureau wrote:
> Turns out it is possible to fix the warnings now.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau at gmail.com>
> ---
> configure.ac | 2 +-
> src/channel-base.c | 20 ++++++++++----------
> src/channel-playback.c | 1 +
> src/giopipe.c | 6 +++++-
> src/spice-gstaudio.c | 2 +-
> src/spice-uri.c | 4 ++--
> src/spicy.c | 13 +++++++++----
> 7 files changed, 29 insertions(+), 19 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 7f29c66..c94d41b 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -583,7 +583,7 @@ dnl check compiler flags
>
> # We want to enable these, but need to sort out the
> # decl mess with src/generated_*.c
> -dontwarn="-Wmissing-prototypes -Wmissing-declarations"
> +dontwarn="-Wmissing-declarations"
>
> # We want to enable these, but Gtk+2.0 has a bad decl
> # gtk-2.0/gtk/gtkitemfactory.h:47:1: error: function declaration
> diff --git a/src/channel-base.c b/src/channel-base.c
> index de04b89..20bb0cc 100644
> --- a/src/channel-base.c
> +++ b/src/channel-base.c
> @@ -24,8 +24,8 @@
> #include "spice-channel-priv.h"
>
> /* coroutine context */
> -G_GNUC_INTERNAL
> -void spice_channel_handle_set_ack(SpiceChannel *channel, SpiceMsgIn *in)
> +static void
> +spice_channel_handle_set_ack(SpiceChannel *channel, SpiceMsgIn *in)
> {
> SpiceChannelPrivate *c = channel->priv;
> SpiceMsgSetAck* ack = spice_msg_in_parsed(in);
> @@ -40,8 +40,8 @@ void spice_channel_handle_set_ack(SpiceChannel *channel,
> SpiceMsgIn *in)
> }
>
> /* coroutine context */
> -G_GNUC_INTERNAL
> -void spice_channel_handle_ping(SpiceChannel *channel, SpiceMsgIn *in)
> +static void
> +spice_channel_handle_ping(SpiceChannel *channel, SpiceMsgIn *in)
> {
> SpiceChannelPrivate *c = channel->priv;
> SpiceMsgPing *ping = spice_msg_in_parsed(in);
> @@ -52,8 +52,8 @@ void spice_channel_handle_ping(SpiceChannel *channel,
> SpiceMsgIn *in)
> }
>
> /* coroutine context */
> -G_GNUC_INTERNAL
> -void spice_channel_handle_notify(SpiceChannel *channel, SpiceMsgIn *in)
> +static void
> +spice_channel_handle_notify(SpiceChannel *channel, SpiceMsgIn *in)
> {
> static const char* severity_strings[] = {"info", "warn", "error"};
> static const char* visibility_strings[] = {"!", "!!", "!!!"};
> @@ -82,8 +82,8 @@ void spice_channel_handle_notify(SpiceChannel *channel,
> SpiceMsgIn *in)
> }
>
> /* coroutine context */
> -G_GNUC_INTERNAL
> -void spice_channel_handle_disconnect(SpiceChannel *channel, SpiceMsgIn *in)
> +static void
> +spice_channel_handle_disconnect(SpiceChannel *channel, SpiceMsgIn *in)
> {
> SpiceMsgDisconnect *disconnect = spice_msg_in_parsed(in);
>
> @@ -148,8 +148,8 @@ get_msg_handler(SpiceChannel *channel, SpiceMsgIn *in,
> gpointer data)
> }
>
> /* coroutine context */
> -G_GNUC_INTERNAL
> -void spice_channel_handle_migrate(SpiceChannel *channel, SpiceMsgIn *in)
> +static void
> +spice_channel_handle_migrate(SpiceChannel *channel, SpiceMsgIn *in)
> {
> SpiceMsgOut *out;
> SpiceMsgIn *data = NULL;
> diff --git a/src/channel-playback.c b/src/channel-playback.c
> index e931727..8edcb22 100644
> --- a/src/channel-playback.c
> +++ b/src/channel-playback.c
> @@ -25,6 +25,7 @@
> #include "spice-marshal.h"
>
> #include "common/snd_codec.h"
> +#include "channel-playback-priv.h"
>
> /**
> * SECTION:channel-playback
> diff --git a/src/giopipe.c b/src/giopipe.c
> index d91c4d9..e76090c 100644
> --- a/src/giopipe.c
> +++ b/src/giopipe.c
> @@ -81,6 +81,8 @@ static void pipe_input_stream_pollable_iface_init
> (GPollableInputStreamInterface
> static void pipe_input_stream_check_source (PipeInputStream *self);
> static void pipe_output_stream_check_source (PipeOutputStream *self);
>
> +static GType pipe_input_stream_get_type(void);
> +
> G_DEFINE_TYPE_WITH_CODE (PipeInputStream, pipe_input_stream,
> G_TYPE_INPUT_STREAM,
> G_IMPLEMENT_INTERFACE (G_TYPE_POLLABLE_INPUT_STREAM,
> pipe_input_stream_pollable_if
> ace_init))
> @@ -267,6 +269,8 @@ pipe_input_stream_pollable_iface_init
> (GPollableInputStreamInterface *iface)
>
> static void pipe_output_stream_pollable_iface_init
> (GPollableOutputStreamInterface *iface);
>
> +static GType pipe_output_stream_get_type(void);
> +
> G_DEFINE_TYPE_WITH_CODE (PipeOutputStream, pipe_output_stream,
> G_TYPE_OUTPUT_STREAM,
> G_IMPLEMENT_INTERFACE
> (G_TYPE_POLLABLE_OUTPUT_STREAM,
> pipe_output_stream_pollable_i
> face_init))
> @@ -438,7 +442,7 @@ pipe_output_stream_pollable_iface_init
> (GPollableOutputStreamInterface *iface)
> iface->create_source = pipe_output_stream_create_source;
> }
>
> -G_GNUC_INTERNAL void
> +static void
> make_gio_pipe(GInputStream **input, GOutputStream **output)
> {
> PipeInputStream *in;
> diff --git a/src/spice-gstaudio.c b/src/spice-gstaudio.c
> index 9a92452..12e6d66 100644
> --- a/src/spice-gstaudio.c
> +++ b/src/spice-gstaudio.c
> @@ -66,7 +66,7 @@ static void spice_gstaudio_finalize(GObject *obj)
> G_OBJECT_CLASS(spice_gstaudio_parent_class)->finalize(obj);
> }
>
> -void stream_dispose(struct stream *s)
> +static void stream_dispose(struct stream *s)
> {
> if (s->pipe) {
> gst_element_set_state(s->pipe, GST_STATE_NULL);
> diff --git a/src/spice-uri.c b/src/spice-uri.c
> index e1317bd..61361e5 100644
> --- a/src/spice-uri.c
> +++ b/src/spice-uri.c
> @@ -22,6 +22,7 @@
>
> #include "spice-client.h"
> #include "spice-uri.h"
> +#include "spice-uri-priv.h"
>
> /**
> * SECTION:spice-uri
> @@ -88,8 +89,7 @@ static char *strtok_r(char *s, const char *delim, char
> **save_ptr)
> }
> #endif
>
> -G_GNUC_INTERNAL
> -SpiceURI* spice_uri_new(void)
> + SpiceURI* spice_uri_new(void)
Why removing G_GNUC_INTERNAL ? It is declared the -priv header and used only
internally. (Also an extra space was added)
Pavel
> {
> SpiceURI * self = NULL;
> self = (SpiceURI*)g_object_new(SPICE_TYPE_URI, NULL);
> diff --git a/src/spicy.c b/src/spicy.c
> index cbd8e8b..d984f62 100644
> --- a/src/spicy.c
> +++ b/src/spicy.c
> @@ -84,6 +84,8 @@ struct _SpiceWindowClass
> GObjectClass parent_class;
> };
>
> +static GType spice_window_get_type(void);
> +
> G_DEFINE_TYPE (SpiceWindow, spice_window, G_TYPE_OBJECT);
>
> #define CHANNELID_MAX 4
> @@ -1501,14 +1503,16 @@ static void dialog_response_cb(GtkDialog *dialog,
> }
> }
>
> -void task_cancel_cb(GtkButton *button,
> - gpointer user_data)
> +static void
> +task_cancel_cb(GtkButton *button,
> + gpointer user_data)
> {
> SpiceFileTransferTask *task = SPICE_FILE_TRANSFER_TASK(user_data);
> spice_file_transfer_task_cancel(task);
> }
>
> -TransferTaskWidgets *transfer_task_widgets_new(SpiceFileTransferTask *task)
> +static TransferTaskWidgets *
> +transfer_task_widgets_new(SpiceFileTransferTask *task)
> {
> TransferTaskWidgets *widgets = g_new0(TransferTaskWidgets, 1);
>
> @@ -1544,7 +1548,8 @@ TransferTaskWidgets
> *transfer_task_widgets_new(SpiceFileTransferTask *task)
> return widgets;
> }
>
> -void transfer_task_widgets_free(TransferTaskWidgets *widgets)
> +static void
> +transfer_task_widgets_free(TransferTaskWidgets *widgets)
> {
> /* child widgets will be destroyed automatically */
> gtk_widget_destroy(widgets->vbox);
More information about the Spice-devel
mailing list