Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianFeldmann committed Feb 21, 2023
1 parent 2b8faad commit 5129914
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 27 deletions.
4 changes: 2 additions & 2 deletions YUViewLib/src/common/FunctionsGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ QIcon functionsGui::convertIcon(QString iconPath)
// Get the active and inactive colors
QStringList colors = functions::getThemeColors(themeName);
QRgb activeColor, inActiveColor;
if (colors.count() == 4)
if (colors.size() == 4)
{
QColor active(colors[1]);
QColor inactive(colors[2]);
Expand Down Expand Up @@ -116,7 +116,7 @@ QPixmap functionsGui::convertPixmap(QString pixmapPath)
// Get the active and inactive colors
QStringList colors = functions::getThemeColors(themeName);
QRgb activeColor;
if (colors.count() == 4)
if (colors.size() == 4)
{
QColor active(colors[1]);
activeColor = active.rgb();
Expand Down
10 changes: 5 additions & 5 deletions YUViewLib/src/playlistitem/playlistItemImageFileSequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void playlistItemImageFileSequence::fillImageFileList(QStringList & imageFiles,
QString base = fi.baseName();

int lastN = 0;
for (int i = base.count() - 1; i >= 0; i--)
for (auto i = base.size() - 1; i >= 0; i--)
{
// Get the char and see if it is a number
if (base[i].isDigit())
Expand All @@ -117,7 +117,7 @@ void playlistItemImageFileSequence::fillImageFileList(QStringList & imageFiles,
}

// The base name without the indexing number at the end
QString absBaseName = base.left(base.count() - lastN);
QString absBaseName = base.left(base.size() - lastN);

// List all files in the directory and get all that have the same pattern.
QDir currentDir(fi.path());
Expand Down Expand Up @@ -171,7 +171,7 @@ InfoData playlistItemImageFileSequence::getInfo() const
if (this->video->isFormatValid())
{
auto videoSize = this->video->getFrameSize();
auto nrFrames = this->imageFiles.size();
auto nrFrames = this->imageFiles.size();
info.items.append(InfoItem("Num Frames", QString::number(nrFrames)));
info.items.append(InfoItem("Resolution",
QString("%1x%2").arg(videoSize.width).arg(videoSize.height),
Expand Down Expand Up @@ -305,7 +305,7 @@ void playlistItemImageFileSequence::setInternals(const QString &filePath)
// Open frame 0 and set the size of it
{
QImage frame0 = QImage(imageFiles[0]);
auto s = frame0.size();
auto s = frame0.size();
video->setFrameSize(Size(s.width(), s.height()));
}

Expand All @@ -316,7 +316,7 @@ void playlistItemImageFileSequence::setInternals(const QString &filePath)
QString fileName = fi.fileName();
QString base = fi.baseName();

for (int i = base.count() - 1; i >= 0; i--)
for (int i = base.size() - 1; i >= 0; i--)
{
// Get the char and see if it is a number
if (base[i].isDigit())
Expand Down
3 changes: 1 addition & 2 deletions YUViewLib/src/playlistitem/playlistItemRawFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,7 @@ bool playlistItemRawFile::parseY4MFile()
while (rawData.at(offset) != ' ' && rawData.at(offset) != 10)
{
offset++;
if (offset >= rawData.count())
// End of bufer
if (offset >= rawData.size())
break;
}

Expand Down
36 changes: 18 additions & 18 deletions YUViewUnitTest/video/rgb/ConversionRGBTest/ConversionRGBTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,31 +323,31 @@ void runTestForAllParameters(TestingFunction testingFunction)
{
for (const auto bitDepth : {8, 10, 12})
{
for (const auto alphaMode : AlphaModeMapper.entries())
for (const auto &alphaMode : AlphaModeMapper.entries())
{
for (const auto dataLayout : DataLayoutMapper.entries())
for (const auto &dataLayout : DataLayoutMapper.entries())
{
for (const auto channelOrder : ChannelOrderMapper.entries())
for (const auto &channelOrder : ChannelOrderMapper.entries())
{
const PixelFormatRGB format(
bitDepth, dataLayout.value, channelOrder.value, alphaMode.value, endianness);
const auto data = createRawRGBData(format);

for (const auto outputHasAlpha : {false, true})
{
for (const auto componentScale : {ScalingPerComponent({1, 1, 1, 1}),
ScalingPerComponent({2, 1, 1, 1}),
ScalingPerComponent({1, 2, 1, 1}),
ScalingPerComponent({1, 1, 2, 1}),
ScalingPerComponent({1, 1, 1, 2}),
ScalingPerComponent({1, 8, 1, 1})})
for (const auto &componentScale : {ScalingPerComponent({1, 1, 1, 1}),
ScalingPerComponent({2, 1, 1, 1}),
ScalingPerComponent({1, 2, 1, 1}),
ScalingPerComponent({1, 1, 2, 1}),
ScalingPerComponent({1, 1, 1, 2}),
ScalingPerComponent({1, 8, 1, 1})})
{
for (const auto inversion : {InversionPerComponent({false, false, false, false}),
InversionPerComponent({true, false, false, false}),
InversionPerComponent({false, true, false, false}),
InversionPerComponent({false, false, true, false}),
InversionPerComponent({false, false, false, true}),
InversionPerComponent({true, true, true, true})})
for (const auto &inversion : {InversionPerComponent({false, false, false, false}),
InversionPerComponent({true, false, false, false}),
InversionPerComponent({false, true, false, false}),
InversionPerComponent({false, false, true, false}),
InversionPerComponent({false, false, false, true}),
InversionPerComponent({true, true, true, true})})
{
for (const auto limitedRange : {false, true})
{
Expand Down Expand Up @@ -399,11 +399,11 @@ void ConversionRGBTest::testGetPixelValue()
{
for (auto bitDepth : {8, 10, 12})
{
for (const auto alphaMode : AlphaModeMapper.entries())
for (const auto &alphaMode : AlphaModeMapper.entries())
{
for (const auto dataLayout : DataLayoutMapper.entries())
for (const auto &dataLayout : DataLayoutMapper.entries())
{
for (const auto channelOrder : ChannelOrderMapper.entries())
for (const auto &channelOrder : ChannelOrderMapper.entries())
{
const PixelFormatRGB format(
bitDepth, dataLayout.value, channelOrder.value, alphaMode.value, endianness);
Expand Down

0 comments on commit 5129914

Please sign in to comment.