From 518ed6f524ee3930ba5f7a28fc48c031e05668ea Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Fri, 21 Jul 2017 21:17:55 -0300 Subject: [PATCH] Small code style cleanup --HG-- branch : minor --- src/modules/filesystem/physfs/File.cpp | 2 +- src/modules/window/sdl/Window.cpp | 8 +++----- src/modules/window/sdl/Window.h | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/modules/filesystem/physfs/File.cpp b/src/modules/filesystem/physfs/File.cpp index 0717bed60..5d7670b73 100644 --- a/src/modules/filesystem/physfs/File.cpp +++ b/src/modules/filesystem/physfs/File.cpp @@ -65,7 +65,7 @@ bool File::open(Mode mode) throw love::Exception("Could not open file %s. Does not exist.", filename.c_str()); // Check whether the write directory is set. - if ((mode == MODE_APPEND || mode == MODE_WRITE) && (PHYSFS_getWriteDir() == 0) && !hack_setupWriteDirectory()) + if ((mode == MODE_APPEND || mode == MODE_WRITE) && (PHYSFS_getWriteDir() == nullptr) && !hack_setupWriteDirectory()) throw love::Exception("Could not set write directory."); // File already open? diff --git a/src/modules/window/sdl/Window.cpp b/src/modules/window/sdl/Window.cpp index e759fbb0b..4abc9ea84 100644 --- a/src/modules/window/sdl/Window.cpp +++ b/src/modules/window/sdl/Window.cpp @@ -448,7 +448,7 @@ bool Window::setWindow(int width, int height, WindowSettings *settings) else { sdlflags |= SDL_WINDOW_FULLSCREEN; - SDL_DisplayMode mode = {0, width, height, 0, 0}; + SDL_DisplayMode mode = {0, width, height, 0, nullptr}; // Fullscreen window creation will bug out if no mode can be used. if (SDL_GetClosestDisplayMode(f.display, &mode, &mode) == nullptr) @@ -738,9 +738,7 @@ const char *Window::getDisplayName(int displayindex) const return name; } -typedef Window::WindowSize WindowSize; - -std::vector Window::getFullscreenSizes(int displayindex) const +std::vector Window::getFullscreenSizes(int displayindex) const { std::vector sizes; @@ -866,7 +864,7 @@ bool Window::setIcon(love::image::ImageData *imgd) int h = imgd->getHeight(); int pitch = imgd->getWidth() * 4; - SDL_Surface *sdlicon = 0; + SDL_Surface *sdlicon = nullptr; { // We don't want another thread modifying the ImageData mid-copy. diff --git a/src/modules/window/sdl/Window.h b/src/modules/window/sdl/Window.h index ebf9e660a..f734deee2 100644 --- a/src/modules/window/sdl/Window.h +++ b/src/modules/window/sdl/Window.h @@ -34,7 +34,7 @@ namespace window namespace sdl { -class Window : public love::window::Window +class Window final : public love::window::Window { public: