From eb5672014df56deceef84c01d576a2339e2bd7d0 Mon Sep 17 00:00:00 2001 From: AI-scor <354880559+AI-scor@users.noreply.github.com> Date: Tue, 10 Nov 2026 20:48:18 +0100 Subject: [PATCH] Apply nullptr across the tree (#7890) --- cockatrice/src/filters/filter_tree_model.cpp | 8 ++++---- .../src/game_graphics/board/abstract_card_drag_item.h | 2 +- cockatrice/src/game_graphics/board/card_drag_item.cpp | 8 ++++---- cockatrice/src/game_graphics/board/card_drag_item.h | 2 +- cockatrice/src/game_graphics/deckview/deck_view.cpp | 11 ++++++----- cockatrice/src/game_graphics/deckview/deck_view.h | 2 +- cockatrice/src/game_graphics/game_view.cpp | 2 +- cockatrice/src/game_graphics/zones/card_zone.cpp | 2 +- cockatrice/src/game_graphics/zones/card_zone.h | 2 +- cockatrice/src/game_graphics/zones/table_zone.cpp | 2 +- .../src/game_graphics/zones/view_zone_widget.cpp | 4 ++-- .../widgets/general/display/dynamic_font_size_label.h | 2 +- .../general/display/dynamic_font_size_push_button.h | 2 +- .../server/remote/remote_decklist_tree_widget.cpp | 2 +- .../server/remote/remote_replay_list_tree_widget.cpp | 2 +- .../interface/widgets/server/user/user_context_menu.h | 2 +- cockatrice/src/interface/widgets/tabs/tab.cpp | 4 ++-- cockatrice/src/interface/widgets/tabs/tab_message.cpp | 6 +++--- .../models/database/card_set/card_sets_model.cpp | 2 +- .../network/server/remote/game/server_card.cpp | 4 ++-- .../network/server/remote/game/server_game.cpp | 2 +- .../network/server/remote/game/server_game.h | 2 +- .../network/server/remote/server_database_interface.h | 2 +- .../network/server/remote/server_protocolhandler.h | 2 +- .../server/remote/server_response_containers.cpp | 4 ++-- .../network/server/remote/server_room.cpp | 2 +- 26 files changed, 43 insertions(+), 42 deletions(-) diff --git a/cockatrice/src/filters/filter_tree_model.cpp b/cockatrice/src/filters/filter_tree_model.cpp index 66fe39821..1f39c8b32 100644 --- a/cockatrice/src/filters/filter_tree_model.cpp +++ b/cockatrice/src/filters/filter_tree_model.cpp @@ -104,7 +104,7 @@ FilterTreeNode *FilterTreeModel::indexToNode(const QModelIndex &idx) const } ip = idx.internalPointer(); - if (ip == NULL) { + if (ip == nullptr) { return fTree; } @@ -203,7 +203,7 @@ QVariant FilterTreeModel::data(const QModelIndex &index, int role) const } node = indexToNode(index); - if (node == NULL) { + if (node == nullptr) { return QVariant(); } @@ -250,7 +250,7 @@ bool FilterTreeModel::setData(const QModelIndex &index, const QVariant &value, i } node = indexToNode(index); - if (node == NULL || node == fTree) { + if (node == nullptr || node == fTree) { return false; } @@ -357,7 +357,7 @@ bool FilterTreeModel::removeRows(int row, int count, const QModelIndex &parent) } node = indexToNode(parent); - if (node == NULL || last >= node->childCount()) { + if (node == nullptr || last >= node->childCount()) { return false; } diff --git a/cockatrice/src/game_graphics/board/abstract_card_drag_item.h b/cockatrice/src/game_graphics/board/abstract_card_drag_item.h index 80e40ff1d..bd88eae39 100644 --- a/cockatrice/src/game_graphics/board/abstract_card_drag_item.h +++ b/cockatrice/src/game_graphics/board/abstract_card_drag_item.h @@ -39,7 +39,7 @@ public: { return Type; } - AbstractCardDragItem(AbstractCardItem *_item, const QPointF &_hotSpot, AbstractCardDragItem *parentDrag = 0); + AbstractCardDragItem(AbstractCardItem *_item, const QPointF &_hotSpot, AbstractCardDragItem *parentDrag = nullptr); [[nodiscard]] QRectF boundingRect() const override { return QRectF(0, 0, CardDimensions::WIDTH_F, CardDimensions::HEIGHT_F); diff --git a/cockatrice/src/game_graphics/board/card_drag_item.cpp b/cockatrice/src/game_graphics/board/card_drag_item.cpp index b263e8c92..3a62643c8 100644 --- a/cockatrice/src/game_graphics/board/card_drag_item.cpp +++ b/cockatrice/src/game_graphics/board/card_drag_item.cpp @@ -27,7 +27,7 @@ CardDragItem::CardDragItem(CardItem *_item, bool _forceFaceDown, AbstractCardDragItem *parentDrag) : AbstractCardDragItem(_item, _hotSpot, parentDrag), id(_id), forceFaceDown(_forceFaceDown), occupied(false), - currentZone(0) + currentZone(nullptr) { } @@ -46,8 +46,8 @@ void CardDragItem::updatePosition(const QPointF &cursorScenePos) scene()->items(cursorScenePos, Qt::IntersectsItemBoundingRect, Qt::DescendingOrder, static_cast(scene())->getViewTransform()); - CardZone *cardZone = 0; - ZoneViewZone *zoneViewZone = 0; + CardZone *cardZone = nullptr; + ZoneViewZone *zoneViewZone = nullptr; for (int i = colliding.size() - 1; i >= 0; i--) { CardZone *temp = qgraphicsitem_cast(colliding.at(i)); if (!cardZone) { @@ -57,7 +57,7 @@ void CardDragItem::updatePosition(const QPointF &cursorScenePos) zoneViewZone = qobject_cast(temp); } } - CardZone *cursorZone = 0; + CardZone *cursorZone = nullptr; if (zoneViewZone) { cursorZone = zoneViewZone; } else if (cardZone) { diff --git a/cockatrice/src/game_graphics/board/card_drag_item.h b/cockatrice/src/game_graphics/board/card_drag_item.h index d5e9a9e83..eba750f86 100644 --- a/cockatrice/src/game_graphics/board/card_drag_item.h +++ b/cockatrice/src/game_graphics/board/card_drag_item.h @@ -29,7 +29,7 @@ public: int _id, const QPointF &_hotSpot, bool _forceFaceDown, - AbstractCardDragItem *parentDrag = 0); + AbstractCardDragItem *parentDrag = nullptr); int getId() const { return id; diff --git a/cockatrice/src/game_graphics/deckview/deck_view.cpp b/cockatrice/src/game_graphics/deckview/deck_view.cpp index f62d33335..633d3eca7 100644 --- a/cockatrice/src/game_graphics/deckview/deck_view.cpp +++ b/cockatrice/src/game_graphics/deckview/deck_view.cpp @@ -47,7 +47,7 @@ struct CardRef; DeckViewCardDragItem::DeckViewCardDragItem(DeckViewCard *_item, const QPointF &_hotSpot, AbstractCardDragItem *parentDrag) - : AbstractCardDragItem(_item, _hotSpot, parentDrag), currentZone(0) + : AbstractCardDragItem(_item, _hotSpot, parentDrag), currentZone(nullptr) { } @@ -55,7 +55,7 @@ void DeckViewCardDragItem::updatePosition(const QPointF &cursorScenePos) { QList colliding = scene()->items(cursorScenePos); - DeckViewCardContainer *cursorZone = 0; + DeckViewCardContainer *cursorZone = nullptr; for (int i = colliding.size() - 1; i >= 0; i--) { if ((cursorZone = qgraphicsitem_cast(colliding.at(i)))) { break; @@ -105,7 +105,7 @@ void DeckViewCardDragItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) } DeckViewCard::DeckViewCard(QGraphicsItem *parent, const CardRef &cardRef, const QString &_originZone) - : AbstractCardItem(parent, cardRef, 0, -1), originZone(_originZone), dragItem(0) + : AbstractCardItem(parent, cardRef, nullptr, -1), originZone(_originZone), dragItem(0) { setAcceptHoverEvents(true); @@ -364,7 +364,8 @@ void DeckViewCardContainer::setWidth(qreal _width) update(); } -DeckViewScene::DeckViewScene(QObject *parent) : QGraphicsScene(parent), locked(true), deck(0), optimalAspectRatio(1.0) +DeckViewScene::DeckViewScene(QObject *parent) + : QGraphicsScene(parent), locked(true), deck(nullptr), optimalAspectRatio(1.0) { // Zone headers read the DeckList role at paint time and cache their // rendering, so touch every item to invalidate the caches and pick up the @@ -453,7 +454,7 @@ void DeckViewScene::applySideboardPlan(const QList &plan) continue; } - DeckViewCard *card = 0; + DeckViewCard *card = nullptr; const QList &cardList = start->getCards(); for (int j = 0; j < cardList.size(); ++j) { if (cardList[j]->getName() == QString::fromStdString(m.card_name())) { diff --git a/cockatrice/src/game_graphics/deckview/deck_view.h b/cockatrice/src/game_graphics/deckview/deck_view.h index 31cb0f87f..3d03f46bb 100644 --- a/cockatrice/src/game_graphics/deckview/deck_view.h +++ b/cockatrice/src/game_graphics/deckview/deck_view.h @@ -66,7 +66,7 @@ private: void handleDrop(DeckViewCardContainer *target); public: - DeckViewCardDragItem(DeckViewCard *_item, const QPointF &_hotSpot, AbstractCardDragItem *parentDrag = 0); + DeckViewCardDragItem(DeckViewCard *_item, const QPointF &_hotSpot, AbstractCardDragItem *parentDrag = nullptr); void updatePosition(const QPointF &cursorScenePos) override; protected: diff --git a/cockatrice/src/game_graphics/game_view.cpp b/cockatrice/src/game_graphics/game_view.cpp index 59f374435..edfb8c66b 100644 --- a/cockatrice/src/game_graphics/game_view.cpp +++ b/cockatrice/src/game_graphics/game_view.cpp @@ -63,7 +63,7 @@ protected: } }; -GameView::GameView(GameScene *scene, QWidget *parent) : QGraphicsView(scene, parent), rubberBand(0) +GameView::GameView(GameScene *scene, QWidget *parent) : QGraphicsView(scene, parent), rubberBand(nullptr) { setObjectName("gameView"); setBackgroundBrush(QBrush(QColor(0, 0, 0))); diff --git a/cockatrice/src/game_graphics/zones/card_zone.cpp b/cockatrice/src/game_graphics/zones/card_zone.cpp index fd3b5849f..dfe1b8947 100644 --- a/cockatrice/src/game_graphics/zones/card_zone.cpp +++ b/cockatrice/src/game_graphics/zones/card_zone.cpp @@ -15,7 +15,7 @@ class QPoint; class QPointF; CardZone::CardZone(CardZoneLogic *_logic, QGraphicsItem *parent) - : AbstractGraphicsItem(parent), menu(nullptr), doubleClickAction(0), logic(_logic) + : AbstractGraphicsItem(parent), menu(nullptr), doubleClickAction(nullptr), logic(_logic) { connect(logic, &CardZoneLogic::retranslateUi, this, &CardZone::retranslateUi); // Invalidation is connected before any consumer so a handler that reads cardItems() diff --git a/cockatrice/src/game_graphics/zones/card_zone.h b/cockatrice/src/game_graphics/zones/card_zone.h index ea77cb057..8b3bdd17b 100644 --- a/cockatrice/src/game_graphics/zones/card_zone.h +++ b/cockatrice/src/game_graphics/zones/card_zone.h @@ -91,7 +91,7 @@ public: */ [[nodiscard]] const QList &cardItems() const; - void setMenu(QMenu *_menu, QAction *_doubleClickAction = 0) + void setMenu(QMenu *_menu, QAction *_doubleClickAction = nullptr) { menu = _menu; doubleClickAction = _doubleClickAction; diff --git a/cockatrice/src/game_graphics/zones/table_zone.cpp b/cockatrice/src/game_graphics/zones/table_zone.cpp index 60740d1ff..c72967fe1 100644 --- a/cockatrice/src/game_graphics/zones/table_zone.cpp +++ b/cockatrice/src/game_graphics/zones/table_zone.cpp @@ -364,7 +364,7 @@ CardItem *TableZone::getCardFromGrid(const QPoint &gridPoint) const return cardItems().at(i); } } - return 0; + return nullptr; } CardItem *TableZone::getCardFromCoords(const QPointF &point) const diff --git a/cockatrice/src/game_graphics/zones/view_zone_widget.cpp b/cockatrice/src/game_graphics/zones/view_zone_widget.cpp index bd8da9407..7e34d92d4 100644 --- a/cockatrice/src/game_graphics/zones/view_zone_widget.cpp +++ b/cockatrice/src/game_graphics/zones/view_zone_widget.cpp @@ -78,7 +78,7 @@ ZoneViewWidget::ZoneViewWidget(PlayerLogic *_player, bool _writeableRevealZone, const QList &cardList, bool _isReversed) - : QGraphicsWidget(0, Qt::Window), canBeShuffled(_origZone->getIsShufflable()), player(_player) + : QGraphicsWidget(nullptr, Qt::Window), canBeShuffled(_origZone->getIsShufflable()), player(_player) { setAcceptHoverEvents(true); setAttribute(Qt::WA_DeleteOnClose); @@ -570,7 +570,7 @@ void ZoneViewWidget::handleScrollBarChange(int value) void ZoneViewWidget::closeEvent(QCloseEvent *event) { stopWindowDrag(); - disconnect(zone, &ZoneViewZone::closed, this, 0); + disconnect(zone, &ZoneViewZone::closed, this, nullptr); // manually call zone->close in order to remove it from the origZones views zone->close(); if (shuffleCheckBox.isChecked()) { diff --git a/cockatrice/src/interface/widgets/general/display/dynamic_font_size_label.h b/cockatrice/src/interface/widgets/general/display/dynamic_font_size_label.h index cd029902a..189ca4324 100644 --- a/cockatrice/src/interface/widgets/general/display/dynamic_font_size_label.h +++ b/cockatrice/src/interface/widgets/general/display/dynamic_font_size_label.h @@ -21,7 +21,7 @@ class DynamicFontSizeLabel : public QLabel Q_OBJECT public: - explicit DynamicFontSizeLabel(QWidget *parent = NULL, Qt::WindowFlags f = Qt::WindowFlags()); + explicit DynamicFontSizeLabel(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); ~DynamicFontSizeLabel() { diff --git a/cockatrice/src/interface/widgets/general/display/dynamic_font_size_push_button.h b/cockatrice/src/interface/widgets/general/display/dynamic_font_size_push_button.h index dfbb03d20..b8b8e51bb 100644 --- a/cockatrice/src/interface/widgets/general/display/dynamic_font_size_push_button.h +++ b/cockatrice/src/interface/widgets/general/display/dynamic_font_size_push_button.h @@ -17,7 +17,7 @@ class QWidget; class DynamicFontSizePushButton : public QPushButton { public: - explicit DynamicFontSizePushButton(QWidget *parent = NULL); + explicit DynamicFontSizePushButton(QWidget *parent = nullptr); /* This method overwrite stylesheet */ void setTextColor(QColor color); diff --git a/cockatrice/src/interface/widgets/server/remote/remote_decklist_tree_widget.cpp b/cockatrice/src/interface/widgets/server/remote/remote_decklist_tree_widget.cpp index 74e403ea8..03f1848a2 100644 --- a/cockatrice/src/interface/widgets/server/remote/remote_decklist_tree_widget.cpp +++ b/cockatrice/src/interface/widgets/server/remote/remote_decklist_tree_widget.cpp @@ -73,7 +73,7 @@ RemoteDeckList_TreeModel::DirectoryNode *RemoteDeckList_TreeModel::DirectoryNode return node->getNodeByPath(path); } } - return 0; + return nullptr; } RemoteDeckList_TreeModel::FileNode *RemoteDeckList_TreeModel::DirectoryNode::getNodeById(int id) const diff --git a/cockatrice/src/interface/widgets/server/remote/remote_replay_list_tree_widget.cpp b/cockatrice/src/interface/widgets/server/remote/remote_replay_list_tree_widget.cpp index c1db6138d..7809af79d 100644 --- a/cockatrice/src/interface/widgets/server/remote/remote_replay_list_tree_widget.cpp +++ b/cockatrice/src/interface/widgets/server/remote/remote_replay_list_tree_widget.cpp @@ -229,7 +229,7 @@ Qt::ItemFlags RemoteReplayList_TreeModel::flags(const QModelIndex &index) const ServerInfo_Replay const *RemoteReplayList_TreeModel::getReplay(const QModelIndex &index) const { if (!index.isValid()) { - return 0; + return nullptr; } auto *node = dynamic_cast(static_cast(index.internalPointer())); diff --git a/cockatrice/src/interface/widgets/server/user/user_context_menu.h b/cockatrice/src/interface/widgets/server/user/user_context_menu.h index 86be5eff2..f43e059a5 100644 --- a/cockatrice/src/interface/widgets/server/user/user_context_menu.h +++ b/cockatrice/src/interface/widgets/server/user/user_context_menu.h @@ -71,7 +71,7 @@ private slots: void gamesOfUserReceived(const Response &resp, const CommandContainer &commandContainer); public: - UserContextMenu(TabSupervisor *_tabSupervisor, QWidget *_parent, AbstractGame *_game = 0); + UserContextMenu(TabSupervisor *_tabSupervisor, QWidget *_parent, AbstractGame *_game = nullptr); void retranslateUi(); void showContextMenu(const QPoint &pos, const QString &userName, diff --git a/cockatrice/src/interface/widgets/tabs/tab.cpp b/cockatrice/src/interface/widgets/tabs/tab.cpp index 5ef4d18b8..03d000f05 100644 --- a/cockatrice/src/interface/widgets/tabs/tab.cpp +++ b/cockatrice/src/interface/widgets/tabs/tab.cpp @@ -14,7 +14,7 @@ #include Tab::Tab(TabSupervisor *_tabSupervisor) - : QMainWindow(_tabSupervisor), tabSupervisor(_tabSupervisor), contentsChanged(false), infoPopup(0) + : QMainWindow(_tabSupervisor), tabSupervisor(_tabSupervisor), contentsChanged(false), infoPopup(nullptr) { setAttribute(Qt::WA_DeleteOnClose); } @@ -43,7 +43,7 @@ void Tab::deleteCardInfoPopup(const QString &cardName) if (infoPopup) { if (currentCard.name == cardName || cardName == "_") { infoPopup->deleteLater(); - infoPopup = 0; + infoPopup = nullptr; } } } diff --git a/cockatrice/src/interface/widgets/tabs/tab_message.cpp b/cockatrice/src/interface/widgets/tabs/tab_message.cpp index 65186e396..642fa7de2 100644 --- a/cockatrice/src/interface/widgets/tabs/tab_message.cpp +++ b/cockatrice/src/interface/widgets/tabs/tab_message.cpp @@ -35,7 +35,7 @@ TabMessage::TabMessage(TabSupervisor *_tabSupervisor, : Tab(_tabSupervisor), client(_client), ownUserInfo(new ServerInfo_User(_ownUserInfo)), otherUserInfo(new ServerInfo_User(_otherUserInfo)), userOnline(_userOnline) { - chatView = new ChatView(tabSupervisor, 0, true); + chatView = new ChatView(tabSupervisor, nullptr, true); connect(chatView, &ChatView::showCardInfoPopup, this, &TabMessage::showCardInfoPopup); connect(chatView, &ChatView::deleteCardInfoPopup, this, &TabMessage::deleteCardInfoPopup); connect(chatView, &ChatView::addMentionTag, this, &TabMessage::addMentionTag); @@ -184,7 +184,7 @@ void TabMessage::processUserMessageEvent(const Event_UserMessage &event) bool TabMessage::shouldShowSystemPopup(const Event_UserMessage &event) { - return (QApplication::activeWindow() == 0 || QApplication::focusWidget() == 0 || + return (QApplication::activeWindow() == nullptr || QApplication::focusWidget() == 0 || (event.sender_name() == otherUserInfo->name() && tabSupervisor->currentIndex() != tabSupervisor->indexOf(this))); } @@ -192,7 +192,7 @@ bool TabMessage::shouldShowSystemPopup(const Event_UserMessage &event) void TabMessage::showSystemPopup(const Event_UserMessage &event) { if (trayIcon) { - disconnect(trayIcon, &QSystemTrayIcon::messageClicked, 0, 0); + disconnect(trayIcon, &QSystemTrayIcon::messageClicked, nullptr, 0); trayIcon->showMessage(tr("Private message from") + " " + otherUserInfo->name().c_str(), event.message().c_str()); connect(trayIcon, &QSystemTrayIcon::messageClicked, this, &TabMessage::messageClicked); diff --git a/libcockatrice_models/libcockatrice/models/database/card_set/card_sets_model.cpp b/libcockatrice_models/libcockatrice/models/database/card_set/card_sets_model.cpp index b8bdc3466..bf8e0f260 100644 --- a/libcockatrice_models/libcockatrice/models/database/card_set/card_sets_model.cpp +++ b/libcockatrice_models/libcockatrice/models/database/card_set/card_sets_model.cpp @@ -137,7 +137,7 @@ Qt::DropActions SetsModel::supportedDropActions() const QMimeData *SetsModel::mimeData(const QModelIndexList &indexes) const { if (indexes.isEmpty()) { - return 0; + return nullptr; } SetsMimeData *result = new SetsMimeData(indexes[0].row()); diff --git a/libcockatrice_network/libcockatrice/network/server/remote/game/server_card.cpp b/libcockatrice_network/libcockatrice/network/server/remote/game/server_card.cpp index c79f13634..23f3d8b0d 100644 --- a/libcockatrice_network/libcockatrice/network/server/remote/game/server_card.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/game/server_card.cpp @@ -38,7 +38,7 @@ Server_Card::Server_Card(const CardRef &cardRef, int _id, int _coord_x, int _coord_y, Server_CardZone *_zone) : zone(_zone), id(_id), coord_x(_coord_x), coord_y(_coord_y), cardRef(cardRef), tapped(false), attacking(false), - facedown(false), destroyOnZoneChange(false), doesntUntap(false), parentCard(0), stashedCard(nullptr) + facedown(false), destroyOnZoneChange(false), doesntUntap(false), parentCard(nullptr), stashedCard(nullptr) { } @@ -46,7 +46,7 @@ Server_Card::~Server_Card() { // setParentCard(0) leads to the item being removed from our list, so we can't iterate properly while (!attachedCards.isEmpty()) { - attachedCards.first()->setParentCard(0); + attachedCards.first()->setParentCard(nullptr); } if (parentCard) { diff --git a/libcockatrice_network/libcockatrice/network/server/remote/game/server_game.cpp b/libcockatrice_network/libcockatrice/network/server/remote/game/server_game.cpp index de592d7b6..03a27949d 100644 --- a/libcockatrice_network/libcockatrice/network/server/remote/game/server_game.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/game/server_game.cpp @@ -127,7 +127,7 @@ Server_Game::~Server_Game() room->removeGame(this); delete creatorInfo; - creatorInfo = 0; + creatorInfo = nullptr; gameMutex.unlock(); room->gamesLock.unlock(); diff --git a/libcockatrice_network/libcockatrice/network/server/remote/game/server_game.h b/libcockatrice_network/libcockatrice/network/server/remote/game/server_game.h index 23ba96598..b9ed1e167 100644 --- a/libcockatrice_network/libcockatrice/network/server/remote/game/server_game.h +++ b/libcockatrice_network/libcockatrice/network/server/remote/game/server_game.h @@ -245,7 +245,7 @@ public: void createGameJoinedEvent(Server_AbstractParticipant *participant, ResponseContainer &rc, bool resuming); GameEventContainer * - prepareGameEvent(const ::google::protobuf::Message &gameEvent, int playerId, GameEventContext *context = 0); + prepareGameEvent(const ::google::protobuf::Message &gameEvent, int playerId, GameEventContext *context = nullptr); GameEventContext prepareGameEventContext(const ::google::protobuf::Message &gameEventContext); void sendGameStateToPlayers(); diff --git a/libcockatrice_network/libcockatrice/network/server/remote/server_database_interface.h b/libcockatrice_network/libcockatrice/network/server/remote/server_database_interface.h index 10bffc5f6..e22c54523 100644 --- a/libcockatrice_network/libcockatrice/network/server/remote/server_database_interface.h +++ b/libcockatrice_network/libcockatrice/network/server/remote/server_database_interface.h @@ -180,7 +180,7 @@ public: } virtual DeckList *getDeckFromDatabase(int /* deckId */, int /* userId */) { - return 0; + return nullptr; } /** @brief One folder row of a user's deck storage tree. */ struct DeckListFolderRecord diff --git a/libcockatrice_network/libcockatrice/network/server/remote/server_protocolhandler.h b/libcockatrice_network/libcockatrice/network/server/remote/server_protocolhandler.h index 8ce110354..636bb4771 100644 --- a/libcockatrice_network/libcockatrice/network/server/remote/server_protocolhandler.h +++ b/libcockatrice_network/libcockatrice/network/server/remote/server_protocolhandler.h @@ -128,7 +128,7 @@ public slots: void prepareDestroy(); public: - Server_ProtocolHandler(Server *_server, Server_DatabaseInterface *_databaseInterface, QObject *parent = 0); + Server_ProtocolHandler(Server *_server, Server_DatabaseInterface *_databaseInterface, QObject *parent = nullptr); ~Server_ProtocolHandler(); bool getAcceptsUserListChanges() const diff --git a/libcockatrice_network/libcockatrice/network/server/remote/server_response_containers.cpp b/libcockatrice_network/libcockatrice/network/server/remote/server_response_containers.cpp index 4c4f351c9..77182bf0a 100644 --- a/libcockatrice_network/libcockatrice/network/server/remote/server_response_containers.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/server_response_containers.cpp @@ -23,7 +23,7 @@ GameEventStorageItem::~GameEventStorageItem() delete event; } -GameEventStorage::GameEventStorage() : gameEventContext(0), privatePlayerId(0) +GameEventStorage::GameEventStorage() : gameEventContext(nullptr), privatePlayerId(0) { } @@ -91,7 +91,7 @@ void GameEventStorage::sendToGame(Server_Game *game) game->sendGameEventContainer(contOthers, GameEventStorageItem::SendToOthers, id); } -ResponseContainer::ResponseContainer(int _cmdId) : cmdId(_cmdId), responseExtension(0) +ResponseContainer::ResponseContainer(int _cmdId) : cmdId(_cmdId), responseExtension(nullptr) { } diff --git a/libcockatrice_network/libcockatrice/network/server/remote/server_room.cpp b/libcockatrice_network/libcockatrice/network/server/remote/server_room.cpp index 78ef2b289..71b3e47e8 100644 --- a/libcockatrice_network/libcockatrice/network/server/remote/server_room.cpp +++ b/libcockatrice_network/libcockatrice/network/server/remote/server_room.cpp @@ -522,7 +522,7 @@ void Server_Room::removeGame(Server_Game *game) // No need to lock gamesLock or gameMutex. This method is only // called from ~Server_Game, which locks both mutexes anyway beforehand. - disconnect(game, 0, this, 0); + disconnect(game, nullptr, this, 0); ServerInfo_Game gameInfo; game->getInfo(gameInfo);