Patchwork main-loop/win32: Fix use of uninitialised variable

login
register
mail settings
Submitter Kevin Wolf
Date Feb. 18, 2013, 2:06 p.m.
Message ID <1361196388-31411-1-git-send-email-kwolf@redhat.com>
Download mbox | patch
Permalink /patch/221612/
State New
Headers show

Comments

Kevin Wolf - Feb. 18, 2013, 2:06 p.m.
The F18 mingw cross compiler warns on this one. Probably a good idea to
fix it.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 main-loop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Stefan Hajnoczi - Feb. 20, 2013, 3:18 p.m.
On Mon, Feb 18, 2013 at 03:06:28PM +0100, Kevin Wolf wrote:
> The F18 mingw cross compiler warns on this one. Probably a good idea to
> fix it.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  main-loop.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/main-loop.c b/main-loop.c
> index 6f52ac3..c9fd77a 100644
> --- a/main-loop.c
> +++ b/main-loop.c
> @@ -330,7 +330,7 @@ void qemu_fd_register(int fd)
>  static int os_host_main_loop_wait(uint32_t timeout)
>  {
>      GMainContext *context = g_main_context_default();
> -    int select_ret, g_poll_ret, ret, i;
> +    int select_ret = 0, g_poll_ret, ret, i;
>      PollingEntry *pe;
>      WaitObjects *w = &wait_objects;
>      gint poll_timeout;
> -- 
> 1.8.1.2

Already fixed in my g_poll() series, but feel free to apply this patch.
I don't mind.

http://patchwork.ozlabs.org/patch/222038/

Stefan

Patch

diff --git a/main-loop.c b/main-loop.c
index 6f52ac3..c9fd77a 100644
--- a/main-loop.c
+++ b/main-loop.c
@@ -330,7 +330,7 @@  void qemu_fd_register(int fd)
 static int os_host_main_loop_wait(uint32_t timeout)
 {
     GMainContext *context = g_main_context_default();
-    int select_ret, g_poll_ret, ret, i;
+    int select_ret = 0, g_poll_ret, ret, i;
     PollingEntry *pe;
     WaitObjects *w = &wait_objects;
     gint poll_timeout;