Skip to content

Commit ed61cdc

Browse files
committed
cppcheck: don't store unused position
1 parent 630a652 commit ed61cdc

File tree

1 file changed

+18
-22
lines changed

1 file changed

+18
-22
lines changed

mythtv/libs/libmythtv/eitfixup.cpp

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1550,11 +1550,10 @@ void EITFixUp::FixRTL(DBEventEIT &event) const
15501550
/* if we do not have an episode title by now try some guessing as last resort */
15511551
if (event.subtitle.length() == 0)
15521552
{
1553-
int position;
15541553
const uint SUBTITLE_PCT = 35; // % of description to allow subtitle up to
15551554
const uint SUBTITLE_MAX_LEN = 50; // max length of subtitle field in db
15561555

1557-
if ((position = tmpExp1.indexIn(event.description)) != -1)
1556+
if (tmpExp1.indexIn(event.description) != -1)
15581557
{
15591558
uint tmpExp1Len = tmpExp1.cap(1).length();
15601559
uint evDescLen = max(event.description.length(), 1);
@@ -1733,34 +1732,33 @@ void EITFixUp::FixNL(DBEventEIT &event) const
17331732
}
17341733

17351734
// Get stereo info
1736-
int position;
1737-
if ((position = fullinfo.indexOf(m_Stereo)) != -1)
1735+
if (fullinfo.indexOf(m_Stereo) != -1)
17381736
{
17391737
event.audioProps |= AUD_STEREO;
17401738
fullinfo = fullinfo.replace(m_Stereo, ".");
17411739
}
17421740

17431741
//Get widescreen info
1744-
if ((position = fullinfo.indexOf(m_nlWide)) != -1)
1742+
if (fullinfo.indexOf(m_nlWide) != -1)
17451743
{
17461744
fullinfo = fullinfo.replace("breedbeeld", ".");
17471745
}
17481746

17491747
// Get repeat info
1750-
if ((position = fullinfo.indexOf(m_nlRepeat)) != -1)
1748+
if (fullinfo.indexOf(m_nlRepeat) != -1)
17511749
{
17521750
fullinfo = fullinfo.replace("herh.", ".");
17531751
}
17541752

17551753
// Get teletext subtitle info
1756-
if ((position = fullinfo.indexOf(m_nlTxt)) != -1)
1754+
if (fullinfo.indexOf(m_nlTxt) != -1)
17571755
{
17581756
event.subtitleType |= SUB_NORMAL;
17591757
fullinfo = fullinfo.replace("txt", ".");
17601758
}
17611759

17621760
// Get HDTV information
1763-
if ((position = event.title.indexOf(m_nlHD)) != -1)
1761+
if (event.title.indexOf(m_nlHD) != -1)
17641762
{
17651763
event.videoProps |= VID_HDTV;
17661764
event.title = event.title.replace(m_nlHD, "");
@@ -1791,6 +1789,7 @@ void EITFixUp::FixNL(DBEventEIT &event) const
17911789

17921790
// This is trying to catch the case where the subtitle is in the main title
17931791
// but avoid cases where it isn't a subtitle e.g cd:uk
1792+
int position;
17941793
if (((position = event.title.indexOf(":")) != -1) &&
17951794
(event.title[position + 1].toUpper() == event.title[position + 1]) &&
17961795
(event.subtitle.isEmpty()))
@@ -1833,15 +1832,15 @@ void EITFixUp::FixNL(DBEventEIT &event) const
18331832
// Try to find year
18341833
QRegExp tmpYear1 = m_nlYear1;
18351834
QRegExp tmpYear2 = m_nlYear2;
1836-
if ((position = tmpYear1.indexIn(fullinfo)) != -1)
1835+
if (tmpYear1.indexIn(fullinfo) != -1)
18371836
{
18381837
bool ok;
18391838
uint y = tmpYear1.cap(0).toUInt(&ok);
18401839
if (ok)
18411840
event.originalairdate = QDate(y, 1, 1);
18421841
}
18431842

1844-
if ((position = tmpYear2.indexIn(fullinfo)) != -1)
1843+
if (tmpYear2.indexIn(fullinfo) != -1)
18451844
{
18461845
bool ok;
18471846
uint y = tmpYear2.cap(2).toUInt(&ok);
@@ -1852,26 +1851,26 @@ void EITFixUp::FixNL(DBEventEIT &event) const
18521851
// Try to find director
18531852
QRegExp tmpDirector = m_nlDirector;
18541853
QString tmpDirectorString;
1855-
if ((position = fullinfo.indexOf(m_nlDirector)) != -1)
1854+
if (fullinfo.indexOf(m_nlDirector) != -1)
18561855
{
18571856
tmpDirectorString = tmpDirector.cap(0);
18581857
event.AddPerson(DBPerson::kDirector, tmpDirectorString);
18591858
}
18601859

18611860
// Strip leftovers
1862-
if ((position = fullinfo.indexOf(m_nlRub)) != -1)
1861+
if (fullinfo.indexOf(m_nlRub) != -1)
18631862
{
18641863
fullinfo = fullinfo.replace(m_nlRub, "");
18651864
}
18661865

18671866
// Strip category info from description
1868-
if ((position = fullinfo.indexOf(m_nlCat)) != -1)
1867+
if (fullinfo.indexOf(m_nlCat) != -1)
18691868
{
18701869
fullinfo = fullinfo.replace(m_nlCat, "");
18711870
}
18721871

18731872
// Remove omroep from title
1874-
if ((position = event.title.indexOf(m_nlOmroep)) != -1)
1873+
if (event.title.indexOf(m_nlOmroep) != -1)
18751874
{
18761875
event.title = event.title.replace(m_nlOmroep, "");
18771876
}
@@ -1929,33 +1928,30 @@ void EITFixUp::FixNO(DBEventEIT &event) const
19291928
*/
19301929
void EITFixUp::FixNRK_DVBT(DBEventEIT &event) const
19311930
{
1932-
int position;
19331931
QRegExp tmpExp1;
19341932
// Check for "title (R)" in the title
1935-
position = event.title.indexOf(m_noRerun);
1936-
if (position != -1)
1933+
if (event.title.indexOf(m_noRerun) != -1)
19371934
{
19381935
event.previouslyshown = true;
19391936
event.title = event.title.replace(m_noRerun, "");
19401937
}
19411938
// Check for "(R)" in the description
1942-
position = event.description.indexOf(m_noRerun);
1943-
if (position != -1)
1939+
if (event.description.indexOf(m_noRerun) != -1)
19441940
{
19451941
event.previouslyshown = true;
19461942
}
19471943
// Move colon separated category from program-titles into description
19481944
// Have seen "NRK2s historiekveld: Film: bla-bla"
19491945
tmpExp1 = m_noNRKCategories;
1950-
while (((position = tmpExp1.indexIn(event.title)) != -1) &&
1946+
while ((tmpExp1.indexIn(event.title) != -1) &&
19511947
(tmpExp1.cap(2).length() > 1))
19521948
{
19531949
event.title = tmpExp1.cap(2);
19541950
event.description = "(" + tmpExp1.cap(1) + ") " + event.description;
19551951
}
19561952
// Remove season premiere markings
19571953
tmpExp1 = m_noPremiere;
1958-
if ((position = tmpExp1.indexIn(event.title)) >=3)
1954+
if (tmpExp1.indexIn(event.title) >= 3)
19591955
{
19601956
event.title.remove(m_noPremiere);
19611957
}
@@ -1965,7 +1961,7 @@ void EITFixUp::FixNRK_DVBT(DBEventEIT &event) const
19651961
!event.title.startsWith("CD:") &&
19661962
!event.title.startsWith("Distriktsnyheter: fra"))
19671963
{
1968-
if ((position = tmpExp1.indexIn(event.title)) != -1)
1964+
if (tmpExp1.indexIn(event.title) != -1)
19691965
{
19701966

19711967
if (event.subtitle.length() <= 0)

0 commit comments

Comments
 (0)