Skip to content

Commit e7fa01f

Browse files
committed
readjust some parts for vdr < 2.3.1
1 parent 364b82c commit e7fa01f

File tree

6 files changed

+22
-27
lines changed

6 files changed

+22
-27
lines changed

channel.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,11 @@ namespace cDBusChannelsHelper
9999

100100
GVariantBuilder *array = g_variant_builder_new(G_VARIANT_TYPE("a(is)"));
101101

102-
const cChannels *channels = NULL;
103102
#if VDRVERSNUM > 20300
104103
LOCK_CHANNELS_READ;
105-
channels = Channels;
104+
const cChannels *channels = Channels;
106105
#else
107-
channels = &Channels;
106+
cChannels *channels = &Channels;
108107
#endif
109108
if ((option != NULL) && *option && !withGroupSeps) {
110109
if (isnumber(option)) {

epg.c

+8-6
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,11 @@ namespace cDBusEpgHelper
111111
tChannelID ChannelID = tChannelID::InvalidID;
112112
if (isnumber(channel)) {
113113
int o = strtol(channel, NULL, 10);
114-
const cChannels *channels = NULL;
115114
#if VDRVERSNUM > 20300
116115
LOCK_CHANNELS_READ;
117-
channels = Channels;
116+
const cChannels *channels = Channels;
118117
#else
119-
channels = &Channels;
118+
cChannels *channels = &Channels;
120119
#endif
121120
if (o >= 1 && o <= channels->MaxNumber())
122121
ChannelID = channels->GetByNumber(o)->GetChannelID();
@@ -319,7 +318,11 @@ namespace cDBusEpgHelper
319318
g_variant_builder_unref(arr);
320319
}
321320

321+
#if VDRVERSNUM > 20300
322322
static bool sGetChannel(GVariant *Arg, const char **Input, const cChannels* Channels, const cChannel **Channel)
323+
#else
324+
static bool sGetChannel(GVariant *Arg, const char **Input, cChannels* Channels, const cChannel **Channel)
325+
#endif
323326
{
324327
*Channel = NULL;
325328
*Input = NULL;
@@ -354,12 +357,11 @@ namespace cDBusEpgHelper
354357

355358
static void sGetEntries(cDBusObject *Object, GVariant *Parameters, GDBusMethodInvocation *Invocation, eMode mode)
356359
{
357-
const cChannels *channels = NULL;
358360
#if VDRVERSNUM > 20300
359361
LOCK_CHANNELS_READ;
360-
channels = Channels;
362+
const cChannels *channels = Channels;
361363
#else
362-
channels = &Channels;
364+
cChannels *channels = &Channels;
363365
#endif
364366
const cChannel *channel = NULL;
365367
guint64 atTime = 0;

recording.c

+4-6
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,15 @@ class cDBusRecordingsHelper
134134

135135
static void Get(cDBusObject *Object, GVariant *Parameters, GDBusMethodInvocation *Invocation)
136136
{
137-
const cRecordings *recs = NULL;
138137
#if VDRVERSNUM > 20300
139138
LOCK_RECORDINGS_READ;
140-
recs = Recordings;
139+
const cRecordings *recs = Recordings;
141140
#else
142141
// only update recordings list if empty
143142
// so we don't mess around with the index values returned by List
144143
if (recordings.Count() == 0)
145144
recordings.Update(true);
146-
recs = &recordings;
145+
cRecordings *recs = &recordings;
147146
#endif
148147

149148
const cRecording *recording = NULL;
@@ -211,13 +210,12 @@ class cDBusRecordingsHelper
211210
int position = -1; // default: resume
212211
const char *hmsf = NULL;
213212

214-
const cRecordings *recs = NULL;
215213
#if VDRVERSNUM > 20300
216214
LOCK_RECORDINGS_READ;
217-
recs = Recordings;
215+
const cRecordings *recs = Recordings;
218216
#else
219217
recordings.Update(true);
220-
recs = &recordings;
218+
cRecordings *recs = &recordings;
221219
#endif
222220

223221
GVariant *first = g_variant_get_child_value(Parameters, 0);

remote.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,11 @@ namespace cDBusRemoteHelper
274274
char *option = NULL;
275275
g_variant_get(Parameters, "(&s)", &option);
276276
const cChannel *channel = NULL;
277-
const cChannels *channels = NULL;
278277
#if VDRVERSNUM > 20300
279278
LOCK_CHANNELS_READ;
280-
channels = Channels;
279+
const cChannels *channels = Channels;
281280
#else
282-
channels = &Channels;
281+
cChannels *channels = &Channels;
283282
#endif
284283
if ((option != NULL) && (option[0] != 0)) {
285284
int n = -1;

shutdown.c

+4-6
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,11 @@ class cDBusShutdownHelper
4949
}
5050

5151
time_t Now = time(NULL);
52-
const cTimers *timers = NULL;
5352
#if VDRVERSNUM > 20300
5453
LOCK_TIMERS_READ;
55-
timers = Timers;
54+
const cTimers *timers = Timers;
5655
#else
57-
timers = &Timers;
56+
cTimers *timers = &Timers;
5857
#endif
5958
const cTimer *timer = timers->GetNextActiveTimer();
6059
time_t Next = timer ? timer->StartTime() : 0;
@@ -199,12 +198,11 @@ class cDBusShutdownHelper
199198
cString info = "";
200199

201200
time_t Now = time(NULL);
202-
const cTimers *timers = NULL;
203201
#if VDRVERSNUM > 20300
204202
LOCK_TIMERS_READ;
205-
timers = Timers;
203+
const cTimers *timers = Timers;
206204
#else
207-
timers = &Timers;
205+
cTimers *timers = &Timers;
208206
#endif
209207
const cTimer *timer = timers->GetNextActiveTimer();
210208
time_t Next = timer ? timer->StartTime() : 0;

timer.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,11 @@ namespace cDBusTimersHelper
160160
time_t start = 0;
161161
time_t stop = 0;
162162
const char *title = "";
163-
const cTimers *timers = NULL;
164163
#if VDRVERSNUM > 20300
165164
LOCK_TIMERS_READ;
166-
timers = Timers;
165+
const cTimers *timers = Timers;
167166
#else
168-
timers = &Timers;
167+
cTimers *timers = &Timers;
169168
#endif
170169
const cTimer *t = timers->GetNextActiveTimer();
171170
const cEvent *e;

0 commit comments

Comments
 (0)