From 5afe88df2538274859a162ffd63ed52118e80c19 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Fri, 26 Jan 2024 16:07:54 +0100 Subject: Apply C++11 fixits modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using --- src/gui/gui.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/gui/gui.cpp') diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 64509e21..e0487d95 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -45,14 +45,14 @@ #include // Guichan stuff -Gui *gui = 0; -SDLInput *guiInput = 0; +Gui *gui = nullptr; +SDLInput *guiInput = nullptr; // Bolded font -gcn::Font *boldFont = 0; +gcn::Font *boldFont = nullptr; // Mono font -gcn::Font *monoFont = 0; +gcn::Font *monoFont = nullptr; class GuiConfigListener : public EventListener { @@ -61,7 +61,7 @@ class GuiConfigListener : public EventListener mGui(g) {} - void event(Event::Channel channel, const Event &event) + void event(Event::Channel channel, const Event &event) override { if (channel == Event::ConfigChannel) { @@ -79,7 +79,7 @@ class GuiConfigListener : public EventListener Gui::Gui(Graphics *graphics): mCustomCursor(false), - mMouseCursors(NULL), + mMouseCursors(nullptr), mMouseCursorAlpha(1.0f), mMouseInactivityTimer(0), mCursorType(CURSOR_POINTER) @@ -97,7 +97,7 @@ Gui::Gui(Graphics *graphics): mFocusHandler = new FocusHandler; // Initialize top GUI widget - WindowContainer *guiTop = new WindowContainer; + auto *guiTop = new WindowContainer; guiTop->setFocusable(true); guiTop->setSize(graphics->getWidth(), graphics->getHeight()); guiTop->setOpaque(false); @@ -225,7 +225,7 @@ void Gui::draw() void Gui::videoResized() { - WindowContainer *top = static_cast(getTop()); + auto *top = static_cast(getTop()); int oldWidth = top->getWidth(); int oldHeight = top->getHeight(); @@ -260,7 +260,7 @@ void Gui::setUseCustomCursor(bool customCursor) if (mMouseCursors) { mMouseCursors->decRef(); - mMouseCursors = NULL; + mMouseCursors = nullptr; } } } -- cgit v1.2.3-70-g09d2