Use static_cast

This commit is contained in:
Jonas Kvinge
2021-03-21 18:53:02 +01:00
parent f91a679cdf
commit 59bffed47f
80 changed files with 241 additions and 242 deletions

View File

@@ -175,7 +175,7 @@ QByteArray MoodbarBuilder::Finish(int width) {
for (int i = 0; i < width; ++i) {
Rgb rgb;
const int start = i * frames_.count() / width;
const int start = i * static_cast<int>(frames_.count()) / width;
const int end = std::max((i + 1) * static_cast<int>(frames_.count()) / width, start + 1);
for (int j = start; j < end; j++) {
@@ -187,9 +187,9 @@ QByteArray MoodbarBuilder::Finish(int width) {
const int n = end - start;
*(data++) = rgb.r / n;
*(data++) = rgb.g / n;
*(data++) = rgb.b / n;
*(data++) = char(rgb.r / n);
*(data++) = char(rgb.g / n);
*(data++) = char(rgb.b / n);
}
return ret;