replacing NULL with nullptr in src/window file

This commit is contained in:
Coder-Rahul-Y 2022-05-04 12:57:49 +05:30 committed by Lukas Dürrenberger
parent 6b4c287c20
commit 9d401398e7
4 changed files with 26 additions and 26 deletions

View File

@ -43,7 +43,7 @@ namespace
drm drmNode; drm drmNode;
drmEventContext drmEventCtx; drmEventContext drmEventCtx;
pollfd pollFD; pollfd pollFD;
gbm_device* gbmDevice = NULL; gbm_device* gbmDevice = nullptr;
int contextCount = 0; int contextCount = 0;
EGLDisplay display = EGL_NO_DISPLAY; EGLDisplay display = EGL_NO_DISPLAY;
int waitingForFlip = 0; int waitingForFlip = 0;
@ -104,7 +104,7 @@ namespace
display = EGL_NO_DISPLAY; display = EGL_NO_DISPLAY;
gbm_device_destroy(gbmDevice); gbm_device_destroy(gbmDevice);
gbmDevice = NULL; gbmDevice = nullptr;
close(drmNode.fd); close(drmNode.fd);
@ -124,12 +124,12 @@ namespace
if (initialized) if (initialized)
return; 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"); char* deviceString = std::getenv("SFML_DRM_DEVICE");
if (deviceString && !*deviceString) 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"); char* modeString = std::getenv("SFML_DRM_MODE");
// Use environment variable "SFML_DRM_REFRESH" (or 0 if not set) // 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_display (EGL_NO_DISPLAY),
m_context (EGL_NO_CONTEXT), m_context (EGL_NO_CONTEXT),
m_surface (EGL_NO_SURFACE), m_surface (EGL_NO_SURFACE),
m_config (NULL), m_config (nullptr),
m_currentBO (NULL), m_currentBO (nullptr),
m_nextBO (NULL), m_nextBO (nullptr),
m_gbmSurface (NULL), m_gbmSurface (nullptr),
m_width (0), m_width (0),
m_height (0), m_height (0),
m_shown (false), m_shown (false),
@ -233,10 +233,10 @@ DRMContext::DRMContext(DRMContext* shared, const ContextSettings& settings, cons
m_display (EGL_NO_DISPLAY), m_display (EGL_NO_DISPLAY),
m_context (EGL_NO_CONTEXT), m_context (EGL_NO_CONTEXT),
m_surface (EGL_NO_SURFACE), m_surface (EGL_NO_SURFACE),
m_config (NULL), m_config (nullptr),
m_currentBO (NULL), m_currentBO (nullptr),
m_nextBO (NULL), m_nextBO (nullptr),
m_gbmSurface (NULL), m_gbmSurface (nullptr),
m_width (0), m_width (0),
m_height (0), m_height (0),
m_shown (false), m_shown (false),
@ -264,10 +264,10 @@ DRMContext::DRMContext(DRMContext* shared, const ContextSettings& settings, unsi
m_display (EGL_NO_DISPLAY), m_display (EGL_NO_DISPLAY),
m_context (EGL_NO_CONTEXT), m_context (EGL_NO_CONTEXT),
m_surface (EGL_NO_SURFACE), m_surface (EGL_NO_SURFACE),
m_config (NULL), m_config (nullptr),
m_currentBO (NULL), m_currentBO (nullptr),
m_nextBO (NULL), m_nextBO (nullptr),
m_gbmSurface (NULL), m_gbmSurface (nullptr),
m_width (0), m_width (0),
m_height (0), m_height (0),
m_shown (false), m_shown (false),
@ -350,7 +350,7 @@ void DRMContext::display()
} }
// Handle display of buffer to the screen // Handle display of buffer to the screen
drm_fb* fb = NULL; drm_fb* fb = nullptr;
if (!waitForFlip(-1)) if (!waitForFlip(-1))
return; return;
@ -358,7 +358,7 @@ void DRMContext::display()
if (m_currentBO) if (m_currentBO)
{ {
gbm_surface_release_buffer(m_gbmSurface, m_currentBO); gbm_surface_release_buffer(m_gbmSurface, m_currentBO);
m_currentBO = NULL; m_currentBO = nullptr;
} }
eglCheck(eglSwapBuffers(m_display, m_surface)); eglCheck(eglSwapBuffers(m_display, m_surface));
@ -455,7 +455,7 @@ void DRMContext::createSurface(unsigned int width, unsigned int height, unsigned
m_width = width; m_width = width;
m_height = height; m_height = height;
m_surface = eglCheck(eglCreateWindowSurface(m_display, m_config, reinterpret_cast<EGLNativeWindowType>(m_gbmSurface), NULL)); m_surface = eglCheck(eglCreateWindowSurface(m_display, m_config, reinterpret_cast<EGLNativeWindowType>(m_gbmSurface), nullptr));
if (m_surface == EGL_NO_SURFACE) if (m_surface == EGL_NO_SURFACE)
{ {
@ -471,7 +471,7 @@ void DRMContext::destroySurface()
m_surface = EGL_NO_SURFACE; m_surface = EGL_NO_SURFACE;
gbm_surface_destroy(m_gbmSurface); 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 // Ensure that this context is no longer active since our surface is now destroyed
setActive(false); setActive(false);

View File

@ -55,7 +55,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Create a new context, not associated to a window /// \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); DRMContext(DRMContext* shared);
@ -121,7 +121,7 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Create the EGL context /// \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 bitsPerPixel Pixel depth, in bits per pixel
/// \param settings Creation parameters /// \param settings Creation parameters
/// ///

View File

@ -504,7 +504,7 @@ namespace
fd_set readFDSet; fd_set readFDSet;
FD_ZERO(&readFDSet); FD_ZERO(&readFDSet);
FD_SET(STDIN_FILENO, &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)) if (ready > 0 && FD_ISSET(STDIN_FILENO, &readFDSet))
bytesRead = read(STDIN_FILENO, &code, 1); bytesRead = read(STDIN_FILENO, &code, 1);
@ -516,7 +516,7 @@ namespace
// Suppress ANSI escape sequences // Suppress ANSI escape sequences
FD_ZERO(&readFDSet); FD_ZERO(&readFDSet);
FD_SET(STDIN_FILENO, &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)) if (ready > 0 && FD_ISSET(STDIN_FILENO, &readFDSet))
{ {
unsigned char tempBuffer[16]; unsigned char tempBuffer[16];

View File

@ -40,7 +40,7 @@ namespace
// The shared display and its reference counter // The shared display and its reference counter
Display* sharedDisplay = nullptr; Display* sharedDisplay = nullptr;
unsigned int referenceCount = 0; unsigned int referenceCount = 0;
XIM sharedXIM = NULL; XIM sharedXIM = nullptr;
unsigned int referenceCountXIM = 0; unsigned int referenceCountXIM = 0;
std::recursive_mutex mutex; std::recursive_mutex mutex;