Warning fix on gcc 8.3.0 (#439)
Fixes warning: assuming signed overflow does not occur when simplifying conditional to constant [-Wstrict-overflow] Signed-off-by: Michele Santullo <m.santullo@posteo.net> Co-authored-by: Michele Santullo <m.santullo@posteo.net>
This commit is contained in:
parent
ec3d11fb27
commit
ef73add05a
@ -175,11 +175,8 @@ QByteArray MoodbarBuilder::Finish(int width) {
|
|||||||
|
|
||||||
for (int i = 0; i < width; ++i) {
|
for (int i = 0; i < width; ++i) {
|
||||||
Rgb rgb;
|
Rgb rgb;
|
||||||
int start = i * frames_.count() / width;
|
const int start = i * frames_.count() / width;
|
||||||
int end = (i + 1) * frames_.count() / width;
|
const int end = std::max((i + 1) * frames_.count() / width, start + 1);
|
||||||
if (start == end) {
|
|
||||||
end = start + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int j = start; j < end; j++) {
|
for (int j = start; j < end; j++) {
|
||||||
const Rgb& frame = frames_[j];
|
const Rgb& frame = frames_[j];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user