mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-10 19:43:13 +02:00
refactor: Avoid implicit-signed-integer-truncation-or-sign-change in FreedesktopImage
This commit is contained in:
@@ -112,10 +112,10 @@ FreedesktopImage::FreedesktopImage(const QImage &img):
|
|||||||
|
|
||||||
for(unsigned int ptr = 0; ptr < num_pixels; ++ptr)
|
for(unsigned int ptr = 0; ptr < num_pixels; ++ptr)
|
||||||
{
|
{
|
||||||
image[ptr*BYTES_PER_PIXEL+0] = data[ptr] >> 16; // R
|
image[ptr * BYTES_PER_PIXEL + 0] = char(data[ptr] >> 16); // R
|
||||||
image[ptr*BYTES_PER_PIXEL+1] = data[ptr] >> 8; // G
|
image[ptr * BYTES_PER_PIXEL + 1] = char(data[ptr] >> 8); // G
|
||||||
image[ptr*BYTES_PER_PIXEL+2] = data[ptr]; // B
|
image[ptr * BYTES_PER_PIXEL + 2] = char(data[ptr]); // B
|
||||||
image[ptr*BYTES_PER_PIXEL+3] = data[ptr] >> 24; // A
|
image[ptr * BYTES_PER_PIXEL + 3] = char(data[ptr] >> 24); // A
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user