[folks] inspect: Ensure to initialise out variables



commit 0cac5985a3092f29f44491bced0da0569cb7a814
Author: Philip Withnall <philip tecnocode co uk>
Date:   Tue Aug 16 21:41:47 2011 +0100

    inspect: Ensure to initialise out variables
    
    This fixes a few compiler warnings.

 tools/inspect/command-signals.vala |    6 ++++++
 tools/inspect/inspect.vala         |    4 ++++
 tools/inspect/signal-manager.vala  |    5 ++++-
 3 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/tools/inspect/command-signals.vala b/tools/inspect/command-signals.vala
index 2de96a8..6f57dfc 100644
--- a/tools/inspect/command-signals.vala
+++ b/tools/inspect/command-signals.vala
@@ -209,6 +209,12 @@ private class Folks.Inspect.Commands.Signals : Folks.Inspect.Command
        */
       assert (input != null && input != "");
 
+      /* Default output */
+      class_type = Type.INVALID;
+      class_instance = null;
+      signal_name = null;
+      detail_string = null;
+
       string[] parts = input.split ("::", 3);
       string class_name_or_instance = parts[0];
       string signal_name_inner = (parts.length > 1) ? parts[1] : null;
diff --git a/tools/inspect/inspect.vala b/tools/inspect/inspect.vala
index f76d80c..cec3b19 100644
--- a/tools/inspect/inspect.vala
+++ b/tools/inspect/inspect.vala
@@ -152,6 +152,10 @@ public class Folks.Inspect.Client : Object
       out string command_name,
       out string? subcommand)
     {
+      /* Default output */
+      command_name = "";
+      subcommand = null;
+
       string[] parts = command_line.split (" ", 2);
 
       if (parts.length < 1)
diff --git a/tools/inspect/signal-manager.vala b/tools/inspect/signal-manager.vala
index 746e02e..3d819a3 100644
--- a/tools/inspect/signal-manager.vala
+++ b/tools/inspect/signal-manager.vala
@@ -386,13 +386,16 @@ public class Folks.Inspect.SignalManager : Object
     }
 
   private static void signal_meta_marshaller (Closure closure,
-      out Value return_value,
+      out Value? return_value,
       Value[] param_values,
       void *invocation_hint,
       void *marshal_data)
     {
       SignalInvocationHint* hint = (SignalInvocationHint*) invocation_hint;
 
+      /* Default output */
+      return_value = null;
+
       SignalQuery query_info;
       Signal.query (hint->signal_id, out query_info);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]