Embrace nullptr over NULL and 0

This commit is contained in:
get
2023-04-14 23:55:53 -05:00
parent ae18aa0639
commit a5d06fde4b
16 changed files with 36 additions and 33 deletions

View File

@ -75,7 +75,7 @@ QLayoutItem* FlowLayout::takeAt(int index)
if (index >= 0 && index < m_item_list.size())
return m_item_list.takeAt(index);
else
return 0;
return nullptr;
}
Qt::Orientations FlowLayout::expandingDirections() const
@ -167,7 +167,7 @@ int FlowLayout::smartSpacing(QStyle::PixelMetric pm) const
else if (parent->isWidgetType())
{
QWidget* pw = static_cast<QWidget*>(parent);
return pw->style()->pixelMetric(pm, 0, pw);
return pw->style()->pixelMetric(pm, nullptr, pw);
}
else
{

View File

@ -42,7 +42,7 @@ static QPixmap PixmapFromHICON(HICON icon)
const int h = iconinfo.yHotspot * 2;
BITMAPINFO bitmapInfo = GetBMI(w, h, false);
DWORD* bits;
HBITMAP winBitmap = CreateDIBSection(hdc, &bitmapInfo, DIB_RGB_COLORS, (VOID**)&bits, NULL, 0);
HBITMAP winBitmap = CreateDIBSection(hdc, &bitmapInfo, DIB_RGB_COLORS, (VOID**)&bits, nullptr, 0);
HGDIOBJ oldhdc = reinterpret_cast<HBITMAP>(SelectObject(hdc, winBitmap));
DrawIconEx(hdc, 0, 0, icon, iconinfo.xHotspot * 2, iconinfo.yHotspot * 2, 0, 0, DI_NORMAL);

View File

@ -410,7 +410,7 @@ void GameCubePane::BrowseMemcard(ExpansionInterface::Slot slot)
const QString filename = DolphinFileDialog::getSaveFileName(
this, tr("Choose a file to open or create"),
QString::fromStdString(File::GetUserPath(D_GCUSER_IDX)),
tr("GameCube Memory Cards (*.raw *.gcp)"), 0, QFileDialog::DontConfirmOverwrite);
tr("GameCube Memory Cards (*.raw *.gcp)"), nullptr, QFileDialog::DontConfirmOverwrite);
if (!filename.isEmpty())
SetMemcard(slot, filename);
@ -618,7 +618,7 @@ void GameCubePane::BrowseAGPRom(ExpansionInterface::Slot slot)
QString filename = DolphinFileDialog::getSaveFileName(
this, tr("Choose a file to open"), QString::fromStdString(File::GetUserPath(D_GCUSER_IDX)),
tr("Game Boy Advance Carts (*.gba)"), 0, QFileDialog::DontConfirmOverwrite);
tr("Game Boy Advance Carts (*.gba)"), nullptr, QFileDialog::DontConfirmOverwrite);
if (!filename.isEmpty())
SetAGPRom(slot, filename);

View File

@ -154,14 +154,14 @@ void ToolBar::UpdatePausePlayButtonState(const bool playing_state)
{
if (playing_state)
{
disconnect(m_pause_play_action, 0, 0, 0);
disconnect(m_pause_play_action, nullptr, nullptr, nullptr);
m_pause_play_action->setText(tr("Pause"));
m_pause_play_action->setIcon(Resources::GetScaledThemeIcon("pause"));
connect(m_pause_play_action, &QAction::triggered, this, &ToolBar::PausePressed);
}
else
{
disconnect(m_pause_play_action, 0, 0, 0);
disconnect(m_pause_play_action, nullptr, nullptr, nullptr);
m_pause_play_action->setText(tr("Play"));
m_pause_play_action->setIcon(Resources::GetScaledThemeIcon("play"));
connect(m_pause_play_action, &QAction::triggered, this, &ToolBar::PlayPressed);