[Spice-devel] [PATCH v2 2/2] Quiet uninitialized variable warning.
Pavel Grunt
pgrunt at redhat.com
Mon Jan 9 09:51:34 UTC 2017
Hi Michal,
On Fri, 2017-01-06 at 14:25 +0100, Michal Suchanek wrote:
> Signed-off-by: Michal Suchanek <msuchanek at suse.de>
> ---
> src/vdagentd/vdagentd.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/src/vdagentd/vdagentd.c b/src/vdagentd/vdagentd.c
> index 991514e..60a866e 100644
> --- a/src/vdagentd/vdagentd.c
> +++ b/src/vdagentd/vdagentd.c
> @@ -334,6 +334,7 @@ static void do_client_file_xfer(struct
> vdagent_virtio_port *vport,
> id = d->id;
> break;
> }
> + default: return; /* quiet uninitialized variable warning */
I would go for 'g_return_if_reached' - it will log a warning, also it
should be on a new line. I can do the changes and push if you agree.
Pavel
> }
>
> conn = g_hash_table_lookup(active_xfers, GUINT_TO_POINTER(id));
More information about the Spice-devel
mailing list