summaryrefslogtreecommitdiff
path: root/splash/SplashTypes.h
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2019-09-27 18:03:30 +0200
committerAlbert Astals Cid <aacid@kde.org>2019-09-27 22:08:28 +0200
commit120cfc0de67501988edc9ded58d2a534d0b5a70e (patch)
treebf7c7428279f9ba525bae21db535de260ab34bc0 /splash/SplashTypes.h
parentcec2397fc0542516cac16615f63ab89032806a2e (diff)
Add some const
Suggested by clang-tidy readability-non-const-parameter check
Diffstat (limited to 'splash/SplashTypes.h')
-rw-r--r--splash/SplashTypes.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/splash/SplashTypes.h b/splash/SplashTypes.h
index b00693fe..0e41ade8 100644
--- a/splash/SplashTypes.h
+++ b/splash/SplashTypes.h
@@ -85,6 +85,7 @@ constexpr std::size_t splashMaxColorComps = SPOT_NCOMPS+4;
typedef unsigned char SplashColor[splashMaxColorComps];
typedef unsigned char *SplashColorPtr;
+typedef const unsigned char *SplashColorConstPtr;
// RGB8
static inline unsigned char splashRGB8R(SplashColorPtr rgb8) { return rgb8[0]; }
@@ -118,7 +119,7 @@ static inline void splashClearColor(SplashColorPtr dest) {
dest[i] = 0;
}
-static inline void splashColorCopy(SplashColorPtr dest, SplashColorPtr src) {
+static inline void splashColorCopy(SplashColorPtr dest, SplashColorConstPtr src) {
dest[0] = src[0];
dest[1] = src[1];
dest[2] = src[2];
@@ -127,7 +128,7 @@ static inline void splashColorCopy(SplashColorPtr dest, SplashColorPtr src) {
dest[i] = src[i];
}
-static inline void splashColorXor(SplashColorPtr dest, SplashColorPtr src) {
+static inline void splashColorXor(SplashColorPtr dest, SplashColorConstPtr src) {
dest[0] ^= src[0];
dest[1] ^= src[1];
dest[2] ^= src[2];