(trivial) silence a few -Wold-style-cast warnings

This commit is contained in:
Jordan Lee 2015-12-06 17:39:18 +00:00
parent 9dca9f175f
commit 9f74cf2273
5 changed files with 6 additions and 6 deletions

View File

@ -50,7 +50,7 @@ AddData::set (const QString& key)
void * raw = tr_base64_decode (key.toUtf8().constData(), key.toUtf8().size(), &len);
if (raw)
{
metainfo.append (static_cast<const char*> (raw), (int) len);
metainfo.append (static_cast<const char*> (raw), int(len));
tr_free (raw);
type = METAINFO;
}
@ -72,7 +72,7 @@ AddData::toBase64 () const
{
size_t len;
void * b64 = tr_base64_encode (metainfo.constData(), metainfo.size(), &len);
ret = QByteArray (static_cast<const char*> (b64), (int) len);
ret = QByteArray (static_cast<const char*> (b64), int(len));
tr_free (b64);
}

View File

@ -913,7 +913,7 @@ DetailsDialog::refresh ()
item->setText (COL_UP, peer.rateToPeer.isZero () ? QString () : Formatter::speedToString (peer.rateToPeer));
item->setText (COL_DOWN, peer.rateToClient.isZero () ? QString () : Formatter::speedToString (peer.rateToClient));
item->setText (COL_PERCENT, peer.progress > 0 ? QString::fromLatin1 ("%1%").arg ( (int) (peer.progress * 100.0)) : QString ());
item->setText (COL_PERCENT, peer.progress > 0 ? QString::fromLatin1 ("%1%").arg(int(peer.progress * 100.0)) : QString ());
item->setText (COL_STATUS, code);
item->setToolTip (COL_STATUS, codeTip);

View File

@ -64,7 +64,7 @@ FileTreeDelegate::paint (QPainter * painter,
p.maximum = 100;
p.textAlignment = Qt::AlignCenter;
p.textVisible = true;
p.progress = (int)(100.0*index.data().toDouble());
p.progress = int(100.0*index.data().toDouble());
p.text = QString::fromLatin1 ("%1%").arg (p.progress);
style->drawControl(QStyle::CE_ProgressBar, &p, painter);
}

View File

@ -185,7 +185,7 @@ FileTreeItem::progress () const
getSubtreeWantedSize (have, total);
if (total)
d = have / (double)total;
d = have / double(total);
return d;
}

View File

@ -167,7 +167,7 @@ FileTreeModel::flags (const QModelIndex& index) const
if(index.column() == COL_WANTED)
i |= Qt::ItemIsUserCheckable | Qt::ItemIsTristate;
return (Qt::ItemFlags)i;
return Qt::ItemFlags(i);
}
bool