Skip to content

Commit 321f105

Browse files
author
MarcoFalke
committed
refactor: Avoid implicit-signed-integer-truncation-or-sign-change in FreedesktopImage
1 parent 6d8eecd commit 321f105

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/qt/notificator.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ FreedesktopImage::FreedesktopImage(const QImage &img):
112112

113113
for(unsigned int ptr = 0; ptr < num_pixels; ++ptr)
114114
{
115-
image[ptr*BYTES_PER_PIXEL+0] = data[ptr] >> 16; // R
116-
image[ptr*BYTES_PER_PIXEL+1] = data[ptr] >> 8; // G
117-
image[ptr*BYTES_PER_PIXEL+2] = data[ptr]; // B
118-
image[ptr*BYTES_PER_PIXEL+3] = data[ptr] >> 24; // A
115+
image[ptr * BYTES_PER_PIXEL + 0] = char(data[ptr] >> 16); // R
116+
image[ptr * BYTES_PER_PIXEL + 1] = char(data[ptr] >> 8); // G
117+
image[ptr * BYTES_PER_PIXEL + 2] = char(data[ptr]); // B
118+
image[ptr * BYTES_PER_PIXEL + 3] = char(data[ptr] >> 24); // A
119119
}
120120
}
121121

0 commit comments

Comments
 (0)