1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-11 15:27:54 +00:00

Fix warning C4267.

conversion from 'size_t' to 'int', possible loss of data.
This commit is contained in:
Chocobo1 2016-12-01 15:51:54 +08:00
parent d73688bfd8
commit 11c2ee81c1
2 changed files with 3 additions and 3 deletions

View File

@ -239,7 +239,7 @@ QVector<int> TorrentInfo::fileIndicesForPiece(int pieceIndex) const
std::vector<libt::file_slice> files(
nativeInfo()->map_block(pieceIndex, 0, nativeInfo()->piece_size(pieceIndex)));
QVector<int> res;
res.reserve(files.size());
res.reserve(int(files.size()));
std::transform(files.begin(), files.end(), std::back_inserter(res),
[](const libt::file_slice &s) { return s.file_index; });

View File

@ -159,7 +159,7 @@ int SpeedPlotView::maxYValue()
if (!m_properties[static_cast<GraphID>(id)].enable)
continue;
for (int i = queue.size() - 1, j = 0; i >= 0 && j <= m_viewablePointsCount; --i, ++j)
for (int i = int(queue.size()) - 1, j = 0; i >= 0 && j <= m_viewablePointsCount; --i, ++j)
if (queue[i].y[id] > maxYValue)
maxYValue = queue[i].y[id];
}
@ -241,7 +241,7 @@ void SpeedPlotView::paintEvent(QPaintEvent *)
QVector<QPoint> points;
for (int i = queue.size() - 1, j = 0; i >= 0 && j <= m_viewablePointsCount; --i, ++j) {
for (int i = int(queue.size()) - 1, j = 0; i >= 0 && j <= m_viewablePointsCount; --i, ++j) {
int new_x = rect.right() - j * xTickSize;
int new_y = rect.bottom() - queue[i].y[id] * yMultiplier;