summaryrefslogtreecommitdiff
path: root/splash
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2019-11-29 17:50:28 +0100
committerAlbert Astals Cid <aacid@kde.org>2019-12-03 12:40:12 +0100
commit5e3e46ecd7df3ee75cac7ee8216ee2d6d87d2665 (patch)
tree9d22bc08b6373d6df240a981aa297687ee74228c /splash
parentf6071f61e433c333e2b34458314a263921ad5fa7 (diff)
Enable modernize-loop-convert
Diffstat (limited to 'splash')
-rw-r--r--splash/Splash.cc16
-rw-r--r--splash/SplashBitmap.cc4
-rw-r--r--splash/SplashState.cc11
3 files changed, 17 insertions, 14 deletions
diff --git a/splash/Splash.cc b/splash/Splash.cc
index d66a9c16..38fd5a7a 100644
--- a/splash/Splash.cc
+++ b/splash/Splash.cc
@@ -4520,8 +4520,8 @@ void Splash::scaleImageYdXu(SplashImageSource src, void *srcData,
break;
case splashModeDeviceN8:
for (i = 0; i < xStep; ++i) {
- for (int cp = 0; cp < SPOT_NCOMPS+4; cp++)
- *destPtr++ = (unsigned char)pix[cp];
+ for (unsigned int cp : pix)
+ *destPtr++ = (unsigned char)cp;
}
break;
}
@@ -4672,8 +4672,8 @@ void Splash::scaleImageYuXd(SplashImageSource src, void *srcData,
case splashModeDeviceN8:
for (i = 0; i < yStep; ++i) {
destPtr = destPtr0 + (i * scaledWidth + x) * nComps;
- for (int cp = 0; cp < SPOT_NCOMPS+4; cp++)
- *destPtr++ = (unsigned char)pix[cp];
+ for (unsigned int cp : pix)
+ *destPtr++ = (unsigned char)cp;
}
break;
}
@@ -4826,8 +4826,8 @@ void Splash::scaleImageYuXu(SplashImageSource src, void *srcData,
for (i = 0; i < yStep; ++i) {
for (j = 0; j < xStep; ++j) {
destPtr = destPtr0 + (i * scaledWidth + xx + j) * nComps;
- for (int cp = 0; cp < SPOT_NCOMPS+4; cp++)
- *destPtr++ = (unsigned char)pix[cp];
+ for (unsigned int cp : pix)
+ *destPtr++ = (unsigned char)cp;
}
}
break;
@@ -4977,8 +4977,8 @@ void Splash::scaleImageYuXuBilinear(SplashImageSource src, void *srcData,
*destPtr++ = (unsigned char)pix[3];
break;
case splashModeDeviceN8:
- for (int cp = 0; cp < SPOT_NCOMPS+4; cp++)
- *destPtr++ = (unsigned char)pix[cp];
+ for (unsigned int cp : pix)
+ *destPtr++ = (unsigned char)cp;
break;
}
diff --git a/splash/SplashBitmap.cc b/splash/SplashBitmap.cc
index 1dc158b4..e4522f62 100644
--- a/splash/SplashBitmap.cc
+++ b/splash/SplashBitmap.cc
@@ -124,8 +124,8 @@ SplashBitmap::SplashBitmap(int widthA, int heightA, int rowPadA,
}
separationList = new std::vector<GfxSeparationColorSpace*>();
if (separationListA != nullptr)
- for (std::size_t i = 0; i < separationListA->size(); i++)
- separationList->push_back((GfxSeparationColorSpace*)( (*separationListA)[i])->copy());
+ for (GfxSeparationColorSpace *separation : *separationListA)
+ separationList->push_back((GfxSeparationColorSpace*)separation->copy());
}
SplashBitmap *SplashBitmap::copy(SplashBitmap *src) {
diff --git a/splash/SplashState.cc b/splash/SplashState.cc
index 9bdb099b..bb734481 100644
--- a/splash/SplashState.cc
+++ b/splash/SplashState.cc
@@ -13,6 +13,7 @@
//
// Copyright (C) 2009, 2011, 2012, 2015 Thomas Freitag <Thomas.Freitag@alfa.de>
// Copyright (C) 2017 Adrian Johnson <ajohnson@redneon.com>
+// Copyright (C) 2019 Albert Astals Cid <aacid@kde.org>
//
// To see a description of the changes please see the Changelog file that
// came with your tarball or type make ChangeLog if you are building from git
@@ -81,8 +82,9 @@ SplashState::SplashState(int width, int height, bool vectorAntialias,
cmykTransferM[i] = (unsigned char)i;
cmykTransferY[i] = (unsigned char)i;
cmykTransferK[i] = (unsigned char)i;
- for (int cp = 0; cp < SPOT_NCOMPS+4; cp++)
- deviceNTransfer[cp][i] = (unsigned char)i;
+ for (auto &cp : deviceNTransfer) {
+ cp[i] = (unsigned char)i;
+ }
}
overprintMask = 0xffffffff;
overprintAdditive = false;
@@ -132,8 +134,9 @@ SplashState::SplashState(int width, int height, bool vectorAntialias,
cmykTransferM[i] = (unsigned char)i;
cmykTransferY[i] = (unsigned char)i;
cmykTransferK[i] = (unsigned char)i;
- for (int cp = 0; cp < SPOT_NCOMPS+4; cp++)
- deviceNTransfer[cp][i] = (unsigned char)i;
+ for (auto &cp : deviceNTransfer) {
+ cp[i] = (unsigned char)i;
+ }
}
overprintMask = 0xffffffff;
overprintAdditive = false;