diff --git a/cockatrice/src/carditem.cpp b/cockatrice/src/carditem.cpp index 99d59478..dd10e90a 100644 --- a/cockatrice/src/carditem.cpp +++ b/cockatrice/src/carditem.cpp @@ -307,7 +307,7 @@ void CardItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) QList sel = scene()->selectedItems(); int j = 0; for (int i = 0; i < sel.size(); i++) { - CardItem *c = (CardItem *) sel.at(i); + CardItem *c = static_cast(sel.at(i)); if ((c == this) || (c->getZone() != zone)) continue; ++j; diff --git a/cockatrice/src/dlg_update.cpp b/cockatrice/src/dlg_update.cpp index b292d276..57a763ab 100644 --- a/cockatrice/src/dlg_update.cpp +++ b/cockatrice/src/dlg_update.cpp @@ -184,7 +184,7 @@ void DlgUpdate::downloadSuccessful(QUrl filepath) { //Try to open the installer. If it opens, quit Cockatrice if (QDesktopServices::openUrl(filepath)) { - QMetaObject::invokeMethod((MainWindow*) parent(), "close", Qt::QueuedConnection); + QMetaObject::invokeMethod(static_cast(parent()), "close", Qt::QueuedConnection); qDebug() << "Opened downloaded update file successfully - closing Cockatrice"; close(); } else { diff --git a/cockatrice/src/filtertree.cpp b/cockatrice/src/filtertree.cpp index 311855cd..b02564bd 100644 --- a/cockatrice/src/filtertree.cpp +++ b/cockatrice/src/filtertree.cpp @@ -25,9 +25,7 @@ int FilterTreeBranch::childIndex(const FilterTreeNode *node) const FilterTreeNode *unconst; T downcasted; - /* to do the dynamic cast to T we will lose const'ness, but we can - * trust QList::indexOf */ - unconst = (FilterTreeNode *) node; + unconst = const_cast(node); downcasted = dynamic_cast(unconst); if (downcasted == NULL) return -1; diff --git a/cockatrice/src/handzone.cpp b/cockatrice/src/handzone.cpp index 0db67f13..a5b97548 100644 --- a/cockatrice/src/handzone.cpp +++ b/cockatrice/src/handzone.cpp @@ -43,11 +43,11 @@ void HandZone::handleDropEvent(const QList &dragItems, CardZone int x = -1; if (settingsCache->getHorizontalHand()) { for (x = 0; x < cards.size(); x++) - if (point.x() < ((CardItem *) cards.at(x))->scenePos().x()) + if (point.x() < static_cast(cards.at(x))->scenePos().x()) break; } else { for (x = 0; x < cards.size(); x++) - if (point.y() < ((CardItem *) cards.at(x))->scenePos().y()) + if (point.y() < static_cast(cards.at(x))->scenePos().y()) break; } @@ -112,7 +112,7 @@ void HandZone::reorganizeCards() for (int i = 0; i < cardCount; i++) { CardItem *c = cards.at(i); - qreal x = i % 2 ? x2 : x1; + qreal x = (i % 2) ? x2 : x1; // If the total height of the cards is smaller than the available height, // the cards do not need to overlap and are displayed in the center of the area. if (cardHeight * cardCount > totalHeight) diff --git a/cockatrice/src/stackzone.cpp b/cockatrice/src/stackzone.cpp index 4b4b6b52..bd149c1e 100644 --- a/cockatrice/src/stackzone.cpp +++ b/cockatrice/src/stackzone.cpp @@ -84,7 +84,7 @@ void StackZone::reorganizeCards() for (int i = 0; i < cardCount; i++) { CardItem *c = cards.at(i); - qreal x = i % 2 ? x2 : x1; + qreal x = (i % 2) ? x2 : x1; // If the total height of the cards is smaller than the available height, // the cards do not need to overlap and are displayed in the center of the area. if (cardHeight * cardCount > totalHeight) diff --git a/cockatrice/src/tappedout_interface.cpp b/cockatrice/src/tappedout_interface.cpp index a06b56a8..c074a5b0 100644 --- a/cockatrice/src/tappedout_interface.cpp +++ b/cockatrice/src/tappedout_interface.cpp @@ -47,13 +47,12 @@ void TappedOutInterface::queryFinished(QNetworkReply *reply) QRegExp rx("
(.*)"); rx.setMinimal(true); int found = rx.indexIn(data); - if(found >= 0) + if (found >= 0) { QString errors = rx.cap(1); QRegExp rx2("
  • (.*)
  • "); rx2.setMinimal(true); - found = rx2.indexIn(errors); int captures = rx2.captureCount(); for(int i = 1; i <= captures; i++) { diff --git a/oracle/src/zip/unzip.cpp b/oracle/src/zip/unzip.cpp index da250cee..6640e0a9 100755 --- a/oracle/src/zip/unzip.cpp +++ b/oracle/src/zip/unzip.cpp @@ -288,11 +288,8 @@ UnZip::ErrorCode UnzipPrivate::parseLocalHeaderRecord(const QString& path, const immediately following the compressed data." */ bool hasDataDescriptor = entry.hasDataDescriptor(); + bool checkFailed = entry.compMethod != getUShort(uBuffer, UNZIP_LH_OFF_CMETHOD); - bool checkFailed = false; - - if (!checkFailed) - checkFailed = entry.compMethod != getUShort(uBuffer, UNZIP_LH_OFF_CMETHOD); if (!checkFailed) checkFailed = entry.gpFlag[0] != uBuffer[UNZIP_LH_OFF_GPFLAG]; if (!checkFailed) diff --git a/servatrice/src/isl_interface.cpp b/servatrice/src/isl_interface.cpp index 0bc32f82..3d75a7e9 100644 --- a/servatrice/src/isl_interface.cpp +++ b/servatrice/src/isl_interface.cpp @@ -407,7 +407,7 @@ void IslInterface::processMessage(const IslMessage &item) break; } case IslMessage::ROOM_EVENT: { - processRoomEvent(item.room_event()); break; + processRoomEvent(item.room_event()); break; } default: ;