inspect: Ensure to initialise out variables
authorPhilip Withnall <philip@tecnocode.co.uk>
Tue, 16 Aug 2011 20:41:47 +0000 (21:41 +0100)
committerPhilip Withnall <philip@tecnocode.co.uk>
Tue, 16 Aug 2011 20:41:47 +0000 (21:41 +0100)
This fixes a few compiler warnings.

tools/inspect/command-signals.vala
tools/inspect/inspect.vala
tools/inspect/signal-manager.vala

index 2de96a8..6f57dfc 100644 (file)
@@ -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;
index f76d80c..cec3b19 100644 (file)
@@ -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)
index 746e02e..3d819a3 100644 (file)
@@ -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);