[gnome-dvb-daemon] Fix "static consts" warnings by valac



commit f411d72f1e265192037558c5c4ec76ac7397571f
Author: Sebastian Pölsterl <sebp k-d-w org>
Date:   Sun Jun 19 18:55:59 2016 +0100

    Fix "static consts" warnings by valac

 src/Constants.vala                               |   18 +++---
 src/Device.vala                                  |    2 +-
 src/EPGScanner.vala                              |    4 +-
 src/Event.vala                                   |   10 ++--
 src/Logging.vala                                 |    4 +-
 src/Manager.vala                                 |    2 +-
 src/Scanner.vala                                 |    4 +-
 src/Schedule.vala                                |    4 +-
 src/Settings.vala                                |   24 ++++----
 src/database/sqlite/SqliteConfigTimersStore.vala |   62 +++++++++++-----------
 src/database/sqlite/SqliteEPGStore.vala          |   24 ++++----
 src/io/RecordingReader.vala                      |    2 +-
 src/rygel/Services2.vala                         |    8 ++--
 vapi/config.vapi                                 |    4 +-
 14 files changed, 86 insertions(+), 86 deletions(-)
---
diff --git a/src/Constants.vala b/src/Constants.vala
index a010048..2840fe2 100644
--- a/src/Constants.vala
+++ b/src/Constants.vala
@@ -21,14 +21,14 @@ using GLib;
 
 namespace DVB.Constants {
 
-    public static const string DBUS_SERVICE = "org.gnome.DVB";
+    public const string DBUS_SERVICE = "org.gnome.DVB";
 
-    public static const string DBUS_MANAGER_PATH = "/org/gnome/DVB/Manager";
-    public static const string DBUS_DEVICE_GROUP_PATH = "/org/gnome/DVB/DeviceGroup/%u";
-    public static const string DBUS_RECORDINGS_STORE_PATH = "/org/gnome/DVB/RecordingsStore";
-    public static const string DBUS_SCANNER_PATH = "/org/gnome/DVB/Scanner/%d/%d";
-    public static const string DBUS_RECORDER_PATH = "/org/gnome/DVB/DeviceGroup/%u/Recorder";
-    public static const string DBUS_CHANNEL_LIST_PATH = "/org/gnome/DVB/DeviceGroup/%u/ChannelList";
-    public static const string DBUS_SCHEDULE_PATH = "/org/gnome/DVB/DeviceGroup/%u/Schedule/%u";
-    public static const string DVB_DEVICE_PATH = "/dev/dvb/adapter%u/frontend%u";
+    public const string DBUS_MANAGER_PATH = "/org/gnome/DVB/Manager";
+    public const string DBUS_DEVICE_GROUP_PATH = "/org/gnome/DVB/DeviceGroup/%u";
+    public const string DBUS_RECORDINGS_STORE_PATH = "/org/gnome/DVB/RecordingsStore";
+    public const string DBUS_SCANNER_PATH = "/org/gnome/DVB/Scanner/%d/%d";
+    public const string DBUS_RECORDER_PATH = "/org/gnome/DVB/DeviceGroup/%u/Recorder";
+    public const string DBUS_CHANNEL_LIST_PATH = "/org/gnome/DVB/DeviceGroup/%u/ChannelList";
+    public const string DBUS_SCHEDULE_PATH = "/org/gnome/DVB/DeviceGroup/%u/Schedule/%u";
+    public const string DVB_DEVICE_PATH = "/dev/dvb/adapter%u/frontend%u";
 }
diff --git a/src/Device.vala b/src/Device.vala
index abec7e1..ca5bd63 100644
--- a/src/Device.vala
+++ b/src/Device.vala
@@ -39,7 +39,7 @@ namespace DVB {
 
         private static Logger log = LogManager.getLogManager().getDefaultLogger();
 
-        private static const int PRIME = 31;
+        private const int PRIME = 31;
 
         public uint Adapter { get; construct; }
         public uint Frontend { get; construct; }
diff --git a/src/EPGScanner.vala b/src/EPGScanner.vala
index b844dc6..f1d8e60 100644
--- a/src/EPGScanner.vala
+++ b/src/EPGScanner.vala
@@ -32,9 +32,9 @@ namespace DVB {
         // before the next iteration is started
         private static int CHECK_EIT_INTERVAL = -1;
         // how long to wait for EIT data for each channel in seconds
-        private static const int WAIT_FOR_EIT_DURATION = 10;
+        private const int WAIT_FOR_EIT_DURATION = 10;
         // pids: 0=pat, 16=nit, 17=sdt, 18=eit
-        private static const string PIPELINE_TEMPLATE =
+        private const string PIPELINE_TEMPLATE =
         "dvbsrc name=dvbsrc adapter=%u frontend=%u pids=0:16:17:18 stats-reporting-interval=0 ! tsparse ! 
fakesink silent=true";
 
         private DVB.DeviceGroup DeviceGroup;
diff --git a/src/Event.vala b/src/Event.vala
index 3273d8c..6a15d86 100644
--- a/src/Event.vala
+++ b/src/Event.vala
@@ -27,11 +27,11 @@ namespace DVB {
     public class Event {
 
         // See EN 300 486 Table 6
-        public static const uint RUNNING_STATUS_UNDEFINED = 0;
-        public static const uint RUNNING_STATUS_NOT_RUNNING = 1;
-        public static const uint RUNNING_STATUS_STARTS_SOON = 2;
-        public static const uint RUNNING_STATUS_PAUSING = 3;
-        public static const uint RUNNING_STATUS_RUNNING = 4;
+        public const uint RUNNING_STATUS_UNDEFINED = 0;
+        public const uint RUNNING_STATUS_NOT_RUNNING = 1;
+        public const uint RUNNING_STATUS_STARTS_SOON = 2;
+        public const uint RUNNING_STATUS_PAUSING = 3;
+        public const uint RUNNING_STATUS_RUNNING = 4;
 
         public uint id;
         /* Time is stored in UTC */
diff --git a/src/Logging.vala b/src/Logging.vala
index 8a2e134..3441908 100644
--- a/src/Logging.vala
+++ b/src/Logging.vala
@@ -78,7 +78,7 @@ public class ColorFormatter : DefaultFormatter {
       "\033[33;01m",                /* WARNING */
       "\033[31;01m"                 /* ERROR */
     };
-    static const string clear = "\033[00m";
+    const string clear = "\033[00m";
 
     protected override string get_level_name (LogLevel level) {
         string lvlstr = base.get_level_name (level);
@@ -268,7 +268,7 @@ public class Logger : GLib.Object {
 
 public class LogManager : GLib.Object {
 
-    private static const string DEFAULT_NAME = "default";
+    private const string DEFAULT_NAME = "default";
 
     private static LogManager instance;
     private static RecMutex instance_mutex = RecMutex ();
diff --git a/src/Manager.vala b/src/Manager.vala
index 9602ee0..5808a56 100644
--- a/src/Manager.vala
+++ b/src/Manager.vala
@@ -58,7 +58,7 @@ namespace DVB {
 
         private static Manager instance;
         private static RecMutex instance_mutex = RecMutex ();
-        private static const string[] UDEV_SUBSYSTEMS = {"dvb", null};
+        private const string[] UDEV_SUBSYSTEMS = {"dvb", null};
 
         construct {
             this.scanners = new HashMap<string, ScannerData> (
diff --git a/src/Scanner.vala b/src/Scanner.vala
index 5ba8ff6..0db2eab 100644
--- a/src/Scanner.vala
+++ b/src/Scanner.vala
@@ -71,8 +71,8 @@ namespace DVB {
          */
         private Gee.HashSet<Parameter> scanned_scanning_params;
 
-        private static const string BASE_PIDS = "16:17"; // NIT, SDT
-        private static const string PIPELINE_TEMPLATE = "dvbsrc name=dvbsrc adapter=%u frontend=%u 
stats-reporting-interval=100 ! tsparse ! fakesink silent=true";
+        private const string BASE_PIDS = "16:17"; // NIT, SDT
+        private const string PIPELINE_TEMPLATE = "dvbsrc name=dvbsrc adapter=%u frontend=%u 
stats-reporting-interval=100 ! tsparse ! fakesink silent=true";
 
         // Contains SIDs
         private ArrayList<uint> new_channels;
diff --git a/src/Schedule.vala b/src/Schedule.vala
index 0aa16f0..ec31ddc 100644
--- a/src/Schedule.vala
+++ b/src/Schedule.vala
@@ -31,8 +31,8 @@ namespace DVB {
 
         private static Logger log = LogManager.getLogManager().getDefaultLogger();
 
-        private static const int MATCH_THRESHOLD = 100;
-        private static const double MIN_EVENT_OVERLAP = 0.5;
+        private const int MATCH_THRESHOLD = 100;
+        private const double MIN_EVENT_OVERLAP = 0.5;
 
         // Use weak to avoid ref cycle
         public weak Channel channel {get; construct;}
diff --git a/src/Settings.vala b/src/Settings.vala
index 7227fc5..9caad56 100644
--- a/src/Settings.vala
+++ b/src/Settings.vala
@@ -26,22 +26,22 @@ namespace DVB {
 
         private static Logger log = LogManager.getLogManager().getDefaultLogger();
 
-        private static const string TIMERS_SECTION = "timers";
-        private static const string MARGIN_START = "margin_start";
-        private static const string MARGIN_END = "margin_end";
+        private const string TIMERS_SECTION = "timers";
+        private const string MARGIN_START = "margin_start";
+        private const string MARGIN_END = "margin_end";
 
-        private static const string EPG_SECTION = "epg";
-        private static const string SCAN_INTERVAL = "scan_interval";
+        private const string EPG_SECTION = "epg";
+        private const string SCAN_INTERVAL = "scan_interval";
 
-        private static const string STREAMING_SECTION = "streaming";
-        private static const string INTERFACE = "interface";
+        private const string STREAMING_SECTION = "streaming";
+        private const string INTERFACE = "interface";
 
-        private static const int DEFAULT_MARGIN_START = 5;
-        private static const int DEFAULT_MARGIN_END = 5;
-        private static const int DEFAULT_SCAN_INTERVAL = 30;
-        private static const string DEFAULT_INTERFACE = "lo";
+        private const int DEFAULT_MARGIN_START = 5;
+        private const int DEFAULT_MARGIN_END = 5;
+        private const int DEFAULT_SCAN_INTERVAL = 30;
+        private const string DEFAULT_INTERFACE = "lo";
 
-        private static const string DEFAULT_SETTINGS =
+        private const string DEFAULT_SETTINGS =
         """[timers]
         margin_start=5
         margin_end=5
diff --git a/src/database/sqlite/SqliteConfigTimersStore.vala 
b/src/database/sqlite/SqliteConfigTimersStore.vala
index 8e29e6c..0a700de 100644
--- a/src/database/sqlite/SqliteConfigTimersStore.vala
+++ b/src/database/sqlite/SqliteConfigTimersStore.vala
@@ -28,9 +28,9 @@ namespace DVB.database.sqlite {
 
         private static Logger log = LogManager.getLogManager().getDefaultLogger();
 
-        private static const int VERSION = 2;
+        private const int VERSION = 2;
 
-        private static const string CREATE_DEVICE_GROUPS =
+        private const string CREATE_DEVICE_GROUPS =
         """CREATE TABLE device_groups (
         group_id INTEGER,
         adapter_type INTEGER(1),
@@ -39,14 +39,14 @@ namespace DVB.database.sqlite {
         name VARCHAR(255),
         PRIMARY KEY(group_id))""";
 
-        private static const string CREATE_DEVICES =
+        private const string CREATE_DEVICES =
         """CREATE TABLE devices (
         group_id INTEGER,
         adapter INTEGER,
         frontend INTEGER,
         PRIMARY KEY(group_id, adapter, frontend))""";
 
-        private static const string CREATE_TIMERS =
+        private const string CREATE_TIMERS =
         """CREATE TABLE timers (
         timer_id INTEGER,
         group_id INTEGER,
@@ -60,93 +60,93 @@ namespace DVB.database.sqlite {
         event_id INTEGER,
         PRIMARY KEY(timer_id))""";
 
-        private static const string UPDATE_TIMER  =
+        private const string UPDATE_TIMER  =
         """UPDATE timers SET
         year=?, month=?, day=?, hour=?, minute=?, duration=?
         WHERE timer_id=? AND group_id=?""";
 
-        private static const string CREATE_GROUPS =
+        private const string CREATE_GROUPS =
         """CREATE TABLE channel_groups (
         channel_group_id INTEGER PRIMARY KEY AUTOINCREMENT,
         name VARCHAR(255))""";
 
-        private static const string CREATE_CHANNELS =
+        private const string CREATE_CHANNELS =
         """CREATE TABLE channels (
         sid INTEGER,
         group_id INTEGER,
         channel_group_id INTEGER,
         PRIMARY KEY(sid, group_id, channel_group_id))""";
 
-        private static const string SELECT_GROUP =
+        private const string SELECT_GROUP =
         "SELECT * FROM device_groups WHERE group_id=?";
 
-        private static const string SELECT_ALL_GROUPS =
+        private const string SELECT_ALL_GROUPS =
         "SELECT * FROM device_groups";
 
-        private static const string SELECT_DEVICES =
+        private const string SELECT_DEVICES =
         "SELECT * FROM devices WHERE group_id=?";
 
-        private static const string SELECT_DEVICE =
+        private const string SELECT_DEVICE =
         "SELECT * FROM devices WHERE group_id=? AND adapter=? AND frontend=?";
 
-        private static const string DELETE_GROUP =
+        private const string DELETE_GROUP =
         "DELETE FROM device_groups WHERE group_id=?";
 
-        private static const string INSERT_GROUP =
+        private const string INSERT_GROUP =
         "INSERT INTO device_groups VALUES (?, ?, ?, ?, ?)";
 
-        private static const string CONTAINS_GROUP =
+        private const string CONTAINS_GROUP =
         "SELECT 1 FROM device_groups WHERE group_id=?";
 
-        private static const string UPDATE_GROUP =
+        private const string UPDATE_GROUP =
         "UPDATE device_groups SET adapter_type=?, channels_file=?, recordings_dir=?, name=? WHERE 
group_id=?";
 
-        private static const string DELETE_DEVICE =
+        private const string DELETE_DEVICE =
         "DELETE FROM devices WHERE adapter=? AND frontend=?";
 
-        private static const string DELETE_GROUP_DEVICES =
+        private const string DELETE_GROUP_DEVICES =
         "DELETE FROM devices WHERE group_id=?";
 
-        private static const string INSERT_DEVICE =
+        private const string INSERT_DEVICE =
         "INSERT INTO devices VALUES (?, ?, ?)";
 
-        private static const string SELECT_GROUP_OF_DEVICE =
+        private const string SELECT_GROUP_OF_DEVICE =
         "SELECT group_id FROM devices WHERE adapter=? AND frontend=?";
 
-        private static const string SELECT_TIMERS =
+        private const string SELECT_TIMERS =
         "SELECT * FROM timers WHERE group_id=?";
 
-        private static const string DELETE_TIMER =
+        private const string DELETE_TIMER =
         "DELETE FROM timers WHERE timer_id=?";
 
-        private static const string DELETE_GROUP_TIMERS =
+        private const string DELETE_GROUP_TIMERS =
         "DELETE FROM timers WHERE group_id=?";
 
-        private static const string INSERT_TIMER =
+        private const string INSERT_TIMER =
         "INSERT INTO timers VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
 
-        private static const string CONTAINS_TIMER =
+        private const string CONTAINS_TIMER =
         "SELECT 1 FROM timers WHERE timer_id=?";
 
-        private static const string INSERT_CHANNEL_GROUP =
+        private const string INSERT_CHANNEL_GROUP =
         "INSERT INTO channel_groups (name) VALUES (?)";
 
-        private static const string DELETE_CHANNEL_GROUP =
+        private const string DELETE_CHANNEL_GROUP =
         "DELETE FROM channel_groups WHERE channel_group_id=?";
 
-        private static const string REMOVE_ALL_CHANNEL_GROUP =
+        private const string REMOVE_ALL_CHANNEL_GROUP =
         "DELETE FROM channels WHERE channel_group_id=?";
 
-        private static const string SELECT_CHANNEL_GROUPS =
+        private const string SELECT_CHANNEL_GROUPS =
         "SELECT * FROM channel_groups";
 
-        private static const string ADD_CHANNEL_GROUP =
+        private const string ADD_CHANNEL_GROUP =
         "INSERT INTO channels VALUES (?, ?, ?)";
 
-        private static const string REMOVE_CHANNEL_GROUP =
+        private const string REMOVE_CHANNEL_GROUP =
         "DELETE FROM channels WHERE sid=? AND group_id=? AND channel_group_id=?";
 
-        private static const string SELECT_CHANNELS =
+        private const string SELECT_CHANNELS =
         "SELECT sid FROM channels WHERE group_id=? AND channel_group_id=?";
 
         private Statement select_devices_statement;
diff --git a/src/database/sqlite/SqliteEPGStore.vala b/src/database/sqlite/SqliteEPGStore.vala
index b718190..c1e0078 100644
--- a/src/database/sqlite/SqliteEPGStore.vala
+++ b/src/database/sqlite/SqliteEPGStore.vala
@@ -28,9 +28,9 @@ namespace DVB.database.sqlite {
 
         private static Logger log = LogManager.getLogManager().getDefaultLogger();
 
-        private static const int VERSION = 2;
+        private const int VERSION = 2;
 
-        private static const string CREATE_EVENTS_TABLE_STATEMENT =
+        private const string CREATE_EVENTS_TABLE_STATEMENT =
             """CREATE TABLE events (group_id INTEGER,
             sid INTEGER,
             event_id INTEGER,
@@ -43,44 +43,44 @@ namespace DVB.database.sqlite {
             extended_description TEXT,
             PRIMARY KEY (group_id, sid, event_id))""";
 
-        private static const string INSERT_EVENT_SQL =
+        private const string INSERT_EVENT_SQL =
             "INSERT INTO events VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
 
-        private static const string DELETE_EVENT_STATEMENT =
+        private const string DELETE_EVENT_STATEMENT =
             "DELETE FROM events WHERE group_id=? AND sid=? AND event_id=?";
 
-        private static const string SELECT_ALL_EVENTS_STATEMENT =
+        private const string SELECT_ALL_EVENTS_STATEMENT =
             """SELECT event_id, datetime(starttime),
             duration, running_status, free_ca_mode, name,
             description, extended_description
             FROM events WHERE group_id='%u' AND sid='%u'""";
 
-        private static const string SELECT_MINIMAL_EVENTS_STATEMENT =
+        private const string SELECT_MINIMAL_EVENTS_STATEMENT =
             """SELECT event_id, datetime(starttime),
             duration FROM events WHERE group_id='%u' AND sid='%u'
             ORDER BY starttime ASC""";
 
-        private static const string HAS_EVENT_STATEMENT =
+        private const string HAS_EVENT_STATEMENT =
             "SELECT 1 FROM events WHERE group_id=? AND sid=? AND event_id=? LIMIT 1";
 
-        private static const string UPDATE_EVENT_SQL =
+        private const string UPDATE_EVENT_SQL =
             """UPDATE events SET starttime=?, duration=?, running_status=?,
             free_ca_mode=?, name=?, description=?,
             extended_description=? WHERE group_id=? AND sid=? AND event_id=?""";
 
-        private static const string TO_JULIAN_SQL =
+        private const string TO_JULIAN_SQL =
             "SELECT julianday(?)";
 
-        private static const string SELECT_EVENT_SQL =
+        private const string SELECT_EVENT_SQL =
             """SELECT event_id, datetime(starttime),
             duration, running_status, free_ca_mode, name,
             description, extended_description
             FROM events WHERE group_id=? AND sid=? AND event_id=?""";
 
-        private static const string DELETE_EVENTS_GROUP =
+        private const string DELETE_EVENTS_GROUP =
         "DELETE FROM events WHERE group_id=?";
 
-        private static const string DELETE_EXPIRED_EVENTS =
+        private const string DELETE_EXPIRED_EVENTS =
         """DELETE FROM events WHERE starttime <= julianday(?, 'unixepoch')
         AND sid=? AND group_id=?""";
 
diff --git a/src/io/RecordingReader.vala b/src/io/RecordingReader.vala
index 16d7938..279ff84 100644
--- a/src/io/RecordingReader.vala
+++ b/src/io/RecordingReader.vala
@@ -30,7 +30,7 @@ namespace DVB.io {
         public RecordingsStore store {get; construct;}
         public int max_recursion {get; set; default = 3;}
 
-        private static const string ATTRS = FileAttribute.STANDARD_TYPE
+        private const string ATTRS = FileAttribute.STANDARD_TYPE
             + "," + FileAttribute.ACCESS_CAN_READ
             + "," + FileAttribute.STANDARD_NAME
             + "," + FileAttribute.STANDARD_IS_HIDDEN;
diff --git a/src/rygel/Services2.vala b/src/rygel/Services2.vala
index ac1e49c..e8d902f 100644
--- a/src/rygel/Services2.vala
+++ b/src/rygel/Services2.vala
@@ -24,11 +24,11 @@ namespace DVB.MediaServer2 {
 
     private static Logger log;
 
-    private static const string SERVICE_NAME = "org.gnome.UPnP.MediaServer2.DVBDaemon";
-    private static const string ROOT_PATH = "/org/gnome/UPnP/MediaServer2/DVBDaemon";
+    private const string SERVICE_NAME = "org.gnome.UPnP.MediaServer2.DVBDaemon";
+    private const string ROOT_PATH = "/org/gnome/UPnP/MediaServer2/DVBDaemon";
 
-    private static const string GROUP_PATH = "/org/gnome/UPnP/MediaServer2/DVBDaemon/Group%u";
-    private static const string CHANNEL_PATH = GROUP_PATH + "/Channel%u";
+    private const string GROUP_PATH = "/org/gnome/UPnP/MediaServer2/DVBDaemon/Group%u";
+    private const string CHANNEL_PATH = GROUP_PATH + "/Channel%u";
 
     /**
      * Holds all device groups
diff --git a/vapi/config.vapi b/vapi/config.vapi
index 3b0f3d9..9e2846c 100644
--- a/vapi/config.vapi
+++ b/vapi/config.vapi
@@ -2,9 +2,9 @@
 namespace Config {
     
     [CCode (cname = "PACKAGE_NAME")]
-    public static const string PACKAGE_NAME;
+    public const string PACKAGE_NAME;
     
     [CCode (cname = "PACKAGE_VERSION")]
-    public static const string PACKAGE_VERSION;
+    public const string PACKAGE_VERSION;
 
 }


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