From 9d401398e73bd779104af083b1dcf1290e28288a Mon Sep 17 00:00:00 2001 From: Coder-Rahul-Y Date: Wed, 4 May 2022 12:57:49 +0530 Subject: [PATCH] replacing NULL with nullptr in src/window file --- src/SFML/Window/DRM/DRMContext.cpp | 42 +++++++++++++-------------- src/SFML/Window/DRM/DRMContext.hpp | 4 +-- src/SFML/Window/DRM/InputImplUDev.cpp | 4 +-- src/SFML/Window/Unix/Display.cpp | 2 +- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/SFML/Window/DRM/DRMContext.cpp b/src/SFML/Window/DRM/DRMContext.cpp index 5980fa1c..60fe0b01 100644 --- a/src/SFML/Window/DRM/DRMContext.cpp +++ b/src/SFML/Window/DRM/DRMContext.cpp @@ -43,7 +43,7 @@ namespace drm drmNode; drmEventContext drmEventCtx; pollfd pollFD; - gbm_device* gbmDevice = NULL; + gbm_device* gbmDevice = nullptr; int contextCount = 0; EGLDisplay display = EGL_NO_DISPLAY; int waitingForFlip = 0; @@ -104,7 +104,7 @@ namespace display = EGL_NO_DISPLAY; gbm_device_destroy(gbmDevice); - gbmDevice = NULL; + gbmDevice = nullptr; close(drmNode.fd); @@ -124,12 +124,12 @@ namespace if (initialized) return; - // Use environment variable "SFML_DRM_DEVICE" (or NULL if not set) + // Use environment variable "SFML_DRM_DEVICE" (or nullptr if not set) char* deviceString = std::getenv("SFML_DRM_DEVICE"); if (deviceString && !*deviceString) - deviceString = NULL; + deviceString = nullptr; - // Use environment variable "SFML_DRM_MODE" (or NULL if not set) + // Use environment variable "SFML_DRM_MODE" (or nullptr if not set) char* modeString = std::getenv("SFML_DRM_MODE"); // Use environment variable "SFML_DRM_REFRESH" (or 0 if not set) @@ -200,10 +200,10 @@ DRMContext::DRMContext(DRMContext* shared) : m_display (EGL_NO_DISPLAY), m_context (EGL_NO_CONTEXT), m_surface (EGL_NO_SURFACE), -m_config (NULL), -m_currentBO (NULL), -m_nextBO (NULL), -m_gbmSurface (NULL), +m_config (nullptr), +m_currentBO (nullptr), +m_nextBO (nullptr), +m_gbmSurface (nullptr), m_width (0), m_height (0), m_shown (false), @@ -233,10 +233,10 @@ DRMContext::DRMContext(DRMContext* shared, const ContextSettings& settings, cons m_display (EGL_NO_DISPLAY), m_context (EGL_NO_CONTEXT), m_surface (EGL_NO_SURFACE), -m_config (NULL), -m_currentBO (NULL), -m_nextBO (NULL), -m_gbmSurface (NULL), +m_config (nullptr), +m_currentBO (nullptr), +m_nextBO (nullptr), +m_gbmSurface (nullptr), m_width (0), m_height (0), m_shown (false), @@ -264,10 +264,10 @@ DRMContext::DRMContext(DRMContext* shared, const ContextSettings& settings, unsi m_display (EGL_NO_DISPLAY), m_context (EGL_NO_CONTEXT), m_surface (EGL_NO_SURFACE), -m_config (NULL), -m_currentBO (NULL), -m_nextBO (NULL), -m_gbmSurface (NULL), +m_config (nullptr), +m_currentBO (nullptr), +m_nextBO (nullptr), +m_gbmSurface (nullptr), m_width (0), m_height (0), m_shown (false), @@ -350,7 +350,7 @@ void DRMContext::display() } // Handle display of buffer to the screen - drm_fb* fb = NULL; + drm_fb* fb = nullptr; if (!waitForFlip(-1)) return; @@ -358,7 +358,7 @@ void DRMContext::display() if (m_currentBO) { gbm_surface_release_buffer(m_gbmSurface, m_currentBO); - m_currentBO = NULL; + m_currentBO = nullptr; } eglCheck(eglSwapBuffers(m_display, m_surface)); @@ -455,7 +455,7 @@ void DRMContext::createSurface(unsigned int width, unsigned int height, unsigned m_width = width; m_height = height; - m_surface = eglCheck(eglCreateWindowSurface(m_display, m_config, reinterpret_cast(m_gbmSurface), NULL)); + m_surface = eglCheck(eglCreateWindowSurface(m_display, m_config, reinterpret_cast(m_gbmSurface), nullptr)); if (m_surface == EGL_NO_SURFACE) { @@ -471,7 +471,7 @@ void DRMContext::destroySurface() m_surface = EGL_NO_SURFACE; gbm_surface_destroy(m_gbmSurface); - m_gbmSurface = NULL; + m_gbmSurface = nullptr; // Ensure that this context is no longer active since our surface is now destroyed setActive(false); diff --git a/src/SFML/Window/DRM/DRMContext.hpp b/src/SFML/Window/DRM/DRMContext.hpp index 8a5bf224..2785de65 100644 --- a/src/SFML/Window/DRM/DRMContext.hpp +++ b/src/SFML/Window/DRM/DRMContext.hpp @@ -55,7 +55,7 @@ public: //////////////////////////////////////////////////////////// /// \brief Create a new context, not associated to a window /// - /// \param shared Context to share the new one with (can be NULL) + /// \param shared Context to share the new one with (can be nullptr) /// //////////////////////////////////////////////////////////// DRMContext(DRMContext* shared); @@ -121,7 +121,7 @@ public: //////////////////////////////////////////////////////////// /// \brief Create the EGL context /// - /// \param shared Context to share the new one with (can be NULL) + /// \param shared Context to share the new one with (can be nullptr) /// \param bitsPerPixel Pixel depth, in bits per pixel /// \param settings Creation parameters /// diff --git a/src/SFML/Window/DRM/InputImplUDev.cpp b/src/SFML/Window/DRM/InputImplUDev.cpp index 64ca6a60..1f5b0e1b 100644 --- a/src/SFML/Window/DRM/InputImplUDev.cpp +++ b/src/SFML/Window/DRM/InputImplUDev.cpp @@ -504,7 +504,7 @@ namespace fd_set readFDSet; FD_ZERO(&readFDSet); FD_SET(STDIN_FILENO, &readFDSet); - int ready = select(STDIN_FILENO + 1, &readFDSet, NULL, NULL, &timeout); + int ready = select(STDIN_FILENO + 1, &readFDSet, nullptr, nullptr, &timeout); if (ready > 0 && FD_ISSET(STDIN_FILENO, &readFDSet)) bytesRead = read(STDIN_FILENO, &code, 1); @@ -516,7 +516,7 @@ namespace // Suppress ANSI escape sequences FD_ZERO(&readFDSet); FD_SET(STDIN_FILENO, &readFDSet); - ready = select(STDIN_FILENO + 1, &readFDSet, NULL, NULL, &timeout); + ready = select(STDIN_FILENO + 1, &readFDSet, nullptr, nullptr, &timeout); if (ready > 0 && FD_ISSET(STDIN_FILENO, &readFDSet)) { unsigned char tempBuffer[16]; diff --git a/src/SFML/Window/Unix/Display.cpp b/src/SFML/Window/Unix/Display.cpp index 6a0a1edd..9bd3165c 100644 --- a/src/SFML/Window/Unix/Display.cpp +++ b/src/SFML/Window/Unix/Display.cpp @@ -40,7 +40,7 @@ namespace // The shared display and its reference counter Display* sharedDisplay = nullptr; unsigned int referenceCount = 0; - XIM sharedXIM = NULL; + XIM sharedXIM = nullptr; unsigned int referenceCountXIM = 0; std::recursive_mutex mutex;