summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Neumann <fnu@yavdr.org>2017-05-21 17:45:23 (GMT)
committerFrank Neumann <fnu@yavdr.org>2017-05-21 17:45:23 (GMT)
commitb08459c154b41421bcfde5fb585738af78e59f12 (patch)
treed352b172242a376eb4ec7c0ec772f5f0976d04e5
parent263efac2686729be6077377fc4faf05307ea56a9 (diff)
downloadvdr-plugin-epgsearch-b08459c154b41421bcfde5fb585738af78e59f12.tar.gz
vdr-plugin-epgsearch-b08459c154b41421bcfde5fb585738af78e59f12.tar.bz2
Commit epgsearch_min_max_from_stl.diff (thx jasminj@vdr-portal)
-rw-r--r--HISTORY2
-rw-r--r--HISTORY.DE2
-rw-r--r--blacklist.c2
-rw-r--r--conflictcheck.c16
-rw-r--r--conflictcheck.h2
-rw-r--r--epgsearchext.c2
-rw-r--r--epgsearchtools.c6
-rw-r--r--menu_dirselect.c2
-rw-r--r--menu_whatson.c4
9 files changed, 21 insertions, 17 deletions
diff --git a/HISTORY b/HISTORY
index 70061dd..7248d70 100644
--- a/HISTORY
+++ b/HISTORY
@@ -30,6 +30,8 @@ new:
http://www.vdr-portal.de/board17-developer/board21-vdr-plugins/p1291771-epgsearch-f%C3%BCr-vdr-2-3-x/#post1291771
- Commit fixblacklist_handling.diff by TomJoad@vdr-portal.de
http://www.vdr-portal.de/board16-video-disk-recorder/board99-distributionen/board107-mld/p1292085-epgsearch-in-verbindung-mit-epgd-epg2vdr-live-absturz-unter-vdr-2-3-4/#post1292085
+- Commit epgsearch_min_max_from_stl.diff by jasminj@vdr-portal.de
+ http://www.vdr-portal.de/board17-developer/board21-vdr-plugins/p1292145-epgsearch-f%C3%BCr-vdr-2-3-x/#post1292145
2013-03-xx; Version 1.0.1 - maintenance release
new:
diff --git a/HISTORY.DE b/HISTORY.DE
index bcdc020..a5044ae 100644
--- a/HISTORY.DE
+++ b/HISTORY.DE
@@ -30,6 +30,8 @@ neu:
http://www.vdr-portal.de/board17-developer/board21-vdr-plugins/p1291771-epgsearch-f%C3%BCr-vdr-2-3-x/#post1291771
- Anwenden fixblacklist_handling.diff von TomJoad@vdr-portal.de
http://www.vdr-portal.de/board16-video-disk-recorder/board99-distributionen/board107-mld/p1292085-epgsearch-in-verbindung-mit-epgd-epg2vdr-live-absturz-unter-vdr-2-3-4/#post1292085
+- Anwenden epgsearch_min_max_from_stl.diff von jasminj@vdr-portal.de
+ http://www.vdr-portal.de/board17-developer/board21-vdr-plugins/p1292145-epgsearch-f%C3%BCr-vdr-2-3-x/#post1292145
2013-03-xx: Version 1.0.1 - Maintenance Release
neu:
diff --git a/blacklist.c b/blacklist.c
index 32e6105..324938a 100644
--- a/blacklist.c
+++ b/blacklist.c
@@ -737,7 +737,7 @@ int cBlacklists::GetNewID()
cMutexLock BlacklistLock(this);
cBlacklist *l = (cBlacklist *)First();
while (l) {
- newID = max(newID, l->ID);
+ newID = std::max(newID, l->ID);
l = (cBlacklist *)l->Next();
}
return newID+1;
diff --git a/conflictcheck.c b/conflictcheck.c
index ab88ecc..652a636 100644
--- a/conflictcheck.c
+++ b/conflictcheck.c
@@ -146,7 +146,7 @@ int cConflictCheckTimerObj::Matches(const cEvent *Event, int *Overlap) const
else if (stop <= Event->StartTime() || Event->EndTime() <= start)
overlap = 0;
else
- overlap = (min(stop, Event->EndTime()) - max(start, Event->StartTime())) * FULLMATCH / max(Event->Duration(), 1);
+ overlap = (std::min(stop, Event->EndTime()) - std::max(start, Event->StartTime())) * FULLMATCH / std::max(Event->Duration(), 1);
}
if (Overlap)
*Overlap = overlap;
@@ -260,7 +260,7 @@ cList<cConflictCheckTimerObj>* cConflictCheck::CreateCurrentTimerList()
const cTimer* ti = NULL;
for (ti = Timers->First(); ti; ti = Timers->Next(ti))
{
- tMax = max(tMax, ti->StartTime());
+ tMax = std::max(tMax, ti->StartTime());
if (ti->Remote()) continue; // TO BE DONE: remote service request CC
if (!ti->IsSingleEvent()) continue;
// already recording?
@@ -285,8 +285,8 @@ cList<cConflictCheckTimerObj>* cConflictCheck::CreateCurrentTimerList()
}
// collect repeating timers from now until the date of the timer with tMax
- time_t maxCheck = time(NULL) + min(14,EPGSearchConfig.checkMaxDays) * SECSINDAY;
- tMax = max(tMax, maxCheck);
+ time_t maxCheck = time(NULL) + std::min(14,EPGSearchConfig.checkMaxDays) * SECSINDAY;
+ tMax = std::max(tMax, maxCheck);
for (ti = Timers->First(); ti; ti = Timers->Next(ti))
{
if (ti->IsSingleEvent()) continue;
@@ -402,7 +402,7 @@ cList<cConflictCheckTime>* cConflictCheck::CreateConflictList(cList<cConflictChe
LogFile.Log(3,"create conflict list");
relevantConflicts = 0;
numConflicts = 0;
- maxCheck = time(NULL) + min(14, EPGSearchConfig.checkMaxDays) * SECSINDAY;
+ maxCheck = time(NULL) + std::min(14, EPGSearchConfig.checkMaxDays) * SECSINDAY;
// check each time
for(cConflictCheckTime* checkTime = EvalTimeList->First(); checkTime; checkTime = EvalTimeList->Next(checkTime))
@@ -439,7 +439,7 @@ cList<cConflictCheckTime>* cConflictCheck::CreateConflictList(cList<cConflictChe
if (!nextRelevantConflictDate)
nextRelevantConflictDate = checkTime->evaltime;
else
- nextRelevantConflictDate = min(nextRelevantConflictDate, checkTime->evaltime);
+ nextRelevantConflictDate = std::min(nextRelevantConflictDate, checkTime->evaltime);
relevantConflicts++;
allTimersIgnored = false;
@@ -605,9 +605,9 @@ int cConflictCheck::GetDevice(cConflictCheckTimerObj* TimerObj, bool* NeedsDetac
// avoid devices that are receiving
imp <<= 1; imp |= devices[i].Receiving();
// use the device with the lowest priority (+MAXPRIORITY to assure that values -99..99 can be used)
- imp <<= 8; imp |= min(max(devices[i].Priority() + MAXPRIORITY, 0), 0xFF);
+ imp <<= 8; imp |= std::min(std::max(devices[i].Priority() + MAXPRIORITY, 0), 0xFF);
// use the CAM slot with the lowest priority (+MAXPRIORITY to assure that values -99..99 can be used)
- imp <<= 8; imp |= min(max((NumUsableSlots ? SlotPriority[j] : 0) + MAXPRIORITY, 0), 0xFF);
+ imp <<= 8; imp |= std::min(std::max((NumUsableSlots ? SlotPriority[j] : 0) + MAXPRIORITY, 0), 0xFF);
// avoid devices if we need to detach existing receivers
imp <<= 1; imp |= ndr;
// avoid the primary device
diff --git a/conflictcheck.h b/conflictcheck.h
index 4fef372..4afc05d 100644
--- a/conflictcheck.h
+++ b/conflictcheck.h
@@ -114,7 +114,7 @@ class cConflictCheckDevice
{
int prio = -1;
for(std::set<cConflictCheckTimerObj*,TimerObjSort>::iterator it = recTimers.begin(); it != recTimers.end(); ++it)
- prio = max(prio, (*it)->timer->Priority());
+ prio = std::max(prio, (*it)->timer->Priority());
return prio;
};
int CardIndex(void) const { if (device) return device->CardIndex(); else return devicenr;}
diff --git a/epgsearchext.c b/epgsearchext.c
index 06d7c3d..4a5f7e6 100644
--- a/epgsearchext.c
+++ b/epgsearchext.c
@@ -1538,7 +1538,7 @@ int cSearchExts::GetNewID()
int newID = -1;
cSearchExt *l = (cSearchExt *)First();
while (l) {
- newID = max(newID, l->ID);
+ newID = std::max(newID, l->ID);
l = (cSearchExt *)l->Next();
}
return newID+1;
diff --git a/epgsearchtools.c b/epgsearchtools.c
index 50a6e32..b8a8c6c 100644
--- a/epgsearchtools.c
+++ b/epgsearchtools.c
@@ -483,7 +483,7 @@ double FuzzyMatch(const char* s1, const char* s2, int maxLength)
{
Distance D;
int dist = D.LD (s1, s2, maxLength);
- double fMaxLength = max(strlen(s1), strlen(s2));
+ double fMaxLength = std::max(strlen(s1), strlen(s2));
return (fMaxLength - dist)/fMaxLength;
}
@@ -498,8 +498,8 @@ bool DescriptionMatches(const char* eDescr, const char* rDescr, int matchLimit)
// partial match:
// first check the length, should only be different at match limit
- int minLength = min(l_eDescr, l_rDescr);
- int maxLength = max(l_eDescr, l_rDescr);
+ int minLength = std::min(l_eDescr, l_rDescr);
+ int maxLength = std::max(l_eDescr, l_rDescr);
if (100*double(minLength)/double(maxLength) < matchLimit)
return false;
diff --git a/menu_dirselect.c b/menu_dirselect.c
index 33f077d..50906bd 100644
--- a/menu_dirselect.c
+++ b/menu_dirselect.c
@@ -101,7 +101,7 @@ int cMenuDirSelect::Level(const char* szDir)
void cMenuDirSelect::AddDistinct(const char* szText)
{
int iLevel = Level(szText);
- MaxLevel = max(MaxLevel, iLevel);
+ MaxLevel = std::max(MaxLevel, iLevel);
if (iLevel > CurLevel) // only show Items of the specified level, except those with vars
return;
diff --git a/menu_whatson.c b/menu_whatson.c
index 6ed49b6..14ff5b6 100644
--- a/menu_whatson.c
+++ b/menu_whatson.c
@@ -106,9 +106,9 @@ bool cMenuMyScheduleItem::Update(bool Force)
frac = ((now - startTime) * 8 + (dur >> 1)) / dur;
}
if (mode == showNext)
- frac = ( ( 30*60 - min((time_t)30*60, startTime - now) ) * 8 + 15*60 ) / (30*60);
+ frac = ( ( 30*60 - std::min((time_t)30*60, startTime - now) ) * 8 + 15*60 ) / (30*60);
- frac = min(8,max(0, frac));
+ frac = std::min(8,std::max(0, frac));
szProgressPartT2S[0] = '[';
memset(szProgressPartT2S + 1,'|',frac);