[virt-tools-list] [PATCH 2/4] Move variable declaration to the top of the function

Eduardo Lima (Etrunko) etrunko at redhat.com
Fri Nov 27 19:23:59 UTC 2015


Signed-off-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>
---
 src/remote-viewer.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/remote-viewer.c b/src/remote-viewer.c
index 8e4754f..3f530a3 100644
--- a/src/remote-viewer.c
+++ b/src/remote-viewer.c
@@ -617,10 +617,13 @@ spice_ctrl_listen_async_cb(GObject *object,
 static gboolean
 remote_viewer_activate(VirtViewerApp *app, GError **error)
 {
-    g_return_val_if_fail(REMOTE_VIEWER_IS(app), FALSE);
-    RemoteViewer *self = REMOTE_VIEWER(app);
+    RemoteViewer *self;
     gboolean ret = FALSE;
 
+    g_return_val_if_fail(REMOTE_VIEWER_IS(app), FALSE);
+
+    self = REMOTE_VIEWER(app);
+
     if (self->priv->controller) {
         SpiceSession *session = remote_viewer_get_spice_session(self);
         ret = spice_session_connect(session);
-- 
2.5.0




More information about the virt-tools-list mailing list