Some cosmetic changes

This commit is contained in:
kamel5 2019-03-22 13:21:18 +01:00
parent a8ca6f19da
commit f7e5ac3208
5 changed files with 243 additions and 253 deletions

View File

@ -22,18 +22,6 @@ cSwitchTimer::cSwitchTimer(const cEvent* Event) {
}
}
#if VDRVERSNUM >= 20305
cSwitchTimer& cSwitchTimer::operator= (const cSwitchTimer &SwitchTimer)
{
this->eventID = SwitchTimer.eventID;
this->startTime = SwitchTimer.startTime;
this->channelID = SwitchTimer.channelID;
this->switchMinsBefore = SwitchTimer.switchMinsBefore;
this->announceOnly = SwitchTimer.announceOnly;
return *this;
}
#endif
bool cSwitchTimer::Parse(const char *s) {
char *line;
char *pos;

View File

@ -12,7 +12,15 @@ public:
int announceOnly;
#if VDRVERSNUM >= 20305
cSwitchTimer(const cSwitchTimer &SwitchTimer) { *this = SwitchTimer; };
cSwitchTimer& operator= (const cSwitchTimer &SwitchTimer);
cSwitchTimer& operator= (const cSwitchTimer &SwitchTimer)
{
this->eventID = SwitchTimer.eventID;
this->startTime = SwitchTimer.startTime;
this->channelID = SwitchTimer.channelID;
this->switchMinsBefore = SwitchTimer.switchMinsBefore;
this->announceOnly = SwitchTimer.announceOnly;
return *this;
};
#endif
cSwitchTimer(void);
cSwitchTimer(const cEvent* Event);

View File

@ -71,7 +71,7 @@ void cTVGuideTimerConflicts::AddConflict(std::string epgSearchConflictLine) {
splitstring s3(flds2[2].c_str());
std::vector<std::string> flds3 = s3.split('#');
std::vector<int> timerIDs;
for (int k = 0; k < flds3.size(); k++) {
for (int k = 0; k < (int)flds3.size(); k++) {
timerIDs.push_back(atoi(flds3[k].c_str()) - 1);
}
conflict->timerIDs = timerIDs;
@ -80,18 +80,17 @@ void cTVGuideTimerConflicts::AddConflict(std::string epgSearchConflictLine) {
void cTVGuideTimerConflicts::CalculateConflicts(void) {
numConflicts = conflicts.size();
// time_t startTime = 0;
// time_t endTime = 0;
for (int i=0; i < numConflicts; i++) {
cTimeInterval *unionSet = NULL;
int numTimers = conflicts[i]->timerIDs.size();
for (int j=0; j < numTimers; j++) {
#if VDRVERSNUM >= 20301
LOCK_TIMERS_READ;
const cTimer *timer = Timers->Get(conflicts[i]->timerIDs[j]);
const cTimers* timers = Timers;
#else
const cTimer *timer = Timers.Get(conflicts[i]->timerIDs[j]);
const cTimers* timers = &Timers;
#endif
for (int j=0; j < numTimers; j++) {
const cTimer *timer = timers->Get(conflicts[i]->timerIDs[j]);
if (timer) {
if (!unionSet) {
unionSet = new cTimeInterval(timer->StartTime(), timer->StopTime());
@ -110,12 +109,7 @@ void cTVGuideTimerConflicts::CalculateConflicts(void) {
cTimeInterval *intersect = NULL;
for (int j=0; j < numTimers; j++) {
#if VDRVERSNUM >= 20301
LOCK_TIMERS_READ;
const cTimer *timer = Timers->Get(conflicts[i]->timerIDs[j]);
#else
const cTimer *timer = Timers.Get(conflicts[i]->timerIDs[j]);
#endif
const cTimer *timer = timers->Get(conflicts[i]->timerIDs[j]);
if (timer) {
if (!intersect) {
intersect = new cTimeInterval(timer->StartTime(), timer->StopTime());

View File

@ -144,7 +144,7 @@ std::vector<std::string>& splitstring::split(char delim, int rep) {
std::string work = data();
std::string buf = "";
int i = 0;
while (i < work.length()) {
while (i < (int)work.length()) {
if (work[i] != delim)
buf += work[i];
else if (rep == 1) {