Skip to content

Commit 18ab21a

Browse files
committed
Rearrange code in AddRangeList to defeat compile warnings
This should fix the warnings on the FreeBSD compile host.
1 parent 2422b6f commit 18ab21a

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

mythtv/programs/mythtranscode/mpeg2fix.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,6 +1758,7 @@ void MPEG2fixup::AddRangeList(QStringList rangelist, int type)
17581758
{
17591759
QStringList::iterator i;
17601760
frm_dir_map_t *mapPtr;
1761+
17611762
if (type == MPF_TYPE_CUTLIST)
17621763
{
17631764
mapPtr = &delMap;
@@ -1771,13 +1772,14 @@ void MPEG2fixup::AddRangeList(QStringList rangelist, int type)
17711772
for (i = rangelist.begin(); i != rangelist.end(); ++i)
17721773
{
17731774
QStringList tmp = (*i).split(" - ");
1774-
long long start, end;
1775-
bool ok[2] = { false, false, };
1776-
if (tmp.size() >= 2)
1777-
{
1778-
start = tmp[0].toLongLong(&ok[0]);
1779-
end = tmp[1].toLongLong(&ok[1]);
1780-
}
1775+
if (tmp.size() < 2)
1776+
continue;
1777+
1778+
bool ok[2] = { false, false };
1779+
1780+
long long start = tmp[0].toLongLong(&ok[0]);
1781+
long long end = tmp[1].toLongLong(&ok[1]);
1782+
17811783
if (ok[0] && ok[1])
17821784
{
17831785
if (start == 0)
@@ -1787,9 +1789,11 @@ void MPEG2fixup::AddRangeList(QStringList rangelist, int type)
17871789
}
17881790
else
17891791
mapPtr->insert(start - 1, MARK_CUT_START);
1792+
17901793
mapPtr->insert(end, MARK_CUT_END);
17911794
}
17921795
}
1796+
17931797
if (rangelist.count())
17941798
use_secondary = true;
17951799
}

0 commit comments

Comments
 (0)