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) { bool cSwitchTimer::Parse(const char *s) {
char *line; char *line;
char *pos; char *pos;

View File

@ -12,7 +12,15 @@ public:
int announceOnly; int announceOnly;
#if VDRVERSNUM >= 20305 #if VDRVERSNUM >= 20305
cSwitchTimer(const cSwitchTimer &SwitchTimer) { *this = SwitchTimer; }; 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 #endif
cSwitchTimer(void); cSwitchTimer(void);
cSwitchTimer(const cEvent* Event); cSwitchTimer(const cEvent* Event);

View File

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