[rygel] core: Use 0 for unset port value, rather than -1



commit 095d357e3c7eba35c49cceb65a6ce728ab338c57
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Sat May 8 19:03:05 2010 +0300

    core: Use 0 for unset port value, rather than -1
    
    This is a work around for a weird problem that class initialization of
    CmdlineCnfig is happening after one of it's static methods is called. It
    seems like a Vala bug at first but I failed to reproduce this with a
    simple test case.

 src/rygel/rygel-cmdline-config.vala |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/rygel/rygel-cmdline-config.vala b/src/rygel/rygel-cmdline-config.vala
index 95cc05e..17c9a83 100644
--- a/src/rygel/rygel-cmdline-config.vala
+++ b/src/rygel/rygel-cmdline-config.vala
@@ -34,7 +34,7 @@ public errordomain Rygel.CmdlineConfigError {
  */
 public class Rygel.CmdlineConfig : GLib.Object, Configuration {
     private static string iface;
-    private static int port = -1;
+    private static int port;
 
     private static bool no_transcoding;
     private static bool no_mp3_trans;
@@ -129,7 +129,7 @@ public class Rygel.CmdlineConfig : GLib.Object, Configuration {
     }
 
     public int get_port () throws GLib.Error {
-        if (this.port == -1) {
+        if (this.port <= 0) {
             throw new ConfigurationError.NO_VALUE_SET (_("No value available"));
         }
 



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