Global: replaces NULL to nullptr

This commit is contained in:
李通洲
2026-07-10 18:08:04 +08:00
parent 873454191f
commit ba18705d2e
387 changed files with 2411 additions and 2411 deletions
+2 -2
View File
@@ -19,13 +19,13 @@ static const char* cglHandleContext(FFOpenGLResult* result, CGLContextObj contex
CGLGetVersion(&major, &minor);
ffStrbufSetF(&result->library, "CGL %d.%d", major, minor);
return NULL;
return nullptr;
}
static const char* cglHandlePixelFormat(FFOpenGLResult* result, CGLPixelFormatObj pixelFormat) {
CGLContextObj context;
if (CGLCreateContext(pixelFormat, NULL, &context) != kCGLNoError) {
if (CGLCreateContext(pixelFormat, nullptr, &context) != kCGLNoError) {
return "CGLCreateContext() failed";
}
+1 -1
View File
@@ -20,7 +20,7 @@ static const char* oglDetectOpenGL(FFOpenGLResult* result) {
}
ffOpenGLHandleResult(result, ffglGetString);
ffStrbufSetStatic(&result->library, "OpenGLKit");
return NULL;
return nullptr;
}
const char* ffDetectOpenGL(FFOpenGLOptions* options, FFOpenGLResult* result) {
+13 -13
View File
@@ -61,13 +61,13 @@ static const char* glxHandleContext(FFOpenGLResult* result, GLXData* data) {
ffStrbufSetStatic(&result->library, "GLX");
}
return NULL;
return nullptr;
}
static const char* glxHandleGLXPixmap(FFOpenGLResult* result, GLXData* data) {
data->context = data->ffglXCreateContext(data->display, data->visualInfo, NULL, True);
if (data->context == NULL) {
return "glXCreateContext returned NULL";
data->context = data->ffglXCreateContext(data->display, data->visualInfo, nullptr, True);
if (data->context == nullptr) {
return "glXCreateContext returned nullptr";
}
const char* error = glxHandleContext(result, data);
@@ -99,8 +99,8 @@ static const char* glxHandleVisualInfo(FFOpenGLResult* result, GLXData* data) {
static const char* glxHandleDisplay(FFOpenGLResult* result, GLXData* data) {
data->visualInfo = data->ffglXChooseVisual(data->display, DefaultScreen(data->display), (int[]) { None });
if (data->visualInfo == NULL) {
return "glXChooseVisual returned NULL";
if (data->visualInfo == nullptr) {
return "glXChooseVisual returned nullptr";
}
const char* error = glxHandleVisualInfo(result, data);
@@ -110,13 +110,13 @@ static const char* glxHandleDisplay(FFOpenGLResult* result, GLXData* data) {
static const char* glxHandleData(FFOpenGLResult* result, GLXData* data) {
data->ffglGetString = (__typeof__(data->ffglGetString)) data->ffglXGetProcAddress((const GLubyte*) "glGetString");
if (data->ffglGetString == NULL) {
return "glXGetProcAddress(glGetString) returned NULL";
if (data->ffglGetString == nullptr) {
return "glXGetProcAddress(glGetString) returned nullptr";
}
data->display = data->ffXOpenDisplay(NULL);
if (data->display == NULL) {
return "XOpenDisplay returned NULL";
data->display = data->ffXOpenDisplay(nullptr);
if (data->display == nullptr) {
return "XOpenDisplay returned nullptr";
}
const char* error = glxHandleDisplay(result, data);
@@ -176,7 +176,7 @@ const char* ffDetectOpenGL(FFOpenGLOptions* options, FFOpenGLResult* result) {
#endif
}
const char* error = ""; // not NULL dummy value
const char* error = ""; // not nullptr dummy value
#ifdef FF_HAVE_EGL
const char* ffOpenGLDetectByEGL(FFOpenGLResult * result);
@@ -184,7 +184,7 @@ const char* ffDetectOpenGL(FFOpenGLOptions* options, FFOpenGLResult* result) {
#endif
#ifdef FF_HAVE_GLX
if (error != NULL) {
if (error != nullptr) {
error = detectByGlx(result);
}
#endif
+4 -4
View File
@@ -67,7 +67,7 @@ static const char* eglHandleContext(FFOpenGLResult* result, EGLData* data) {
result->vendor.chars,
result->slv.chars,
result->library.chars);
return NULL;
return nullptr;
}
static const char* eglHandleSurface(FFOpenGLResult* result, EGLData* data, bool gles) {
@@ -168,8 +168,8 @@ const char* ffOpenGLDetectByEGL(FFOpenGLResult* result) {
FF_DEBUG("Resolving glGetString via eglGetProcAddress()");
eglData.ffglGetString = (__typeof__(&glGetString)) ffeglGetProcAddress("glGetString");
if (!eglData.ffglGetString) {
FF_DEBUG("eglGetProcAddress('glGetString') returned NULL");
return "eglGetProcAddress(glGetString) returned NULL";
FF_DEBUG("eglGetProcAddress('glGetString') returned nullptr");
return "eglGetProcAddress(glGetString) returned nullptr";
}
FF_DEBUG("Loaded EGL library and required symbols");
@@ -184,7 +184,7 @@ const char* ffOpenGLDetectByEGL(FFOpenGLResult* result) {
}
if (ffeglGetPlatformDisplay) {
FF_DEBUG("Trying eglGetPlatformDisplay(EGL_PLATFORM_SURFACELESS_MESA)");
display = ffeglGetPlatformDisplay(EGL_PLATFORM_SURFACELESS_MESA, EGL_DEFAULT_DISPLAY, NULL);
display = ffeglGetPlatformDisplay(EGL_PLATFORM_SURFACELESS_MESA, EGL_DEFAULT_DISPLAY, nullptr);
FF_DEBUG("eglGetPlatformDisplay() %s", display == EGL_NO_DISPLAY ? "failed" : "succeeded");
} else {
FF_DEBUG("eglGetPlatformDisplay is unavailable, falling back to eglGetDisplay");
+6 -6
View File
@@ -21,16 +21,16 @@ static const char* wglHandleContext(WGLData* wglData, FFOpenGLResult* result, HD
}
ffOpenGLHandleResult(result, wglData->ffglGetString);
ffStrbufSetStatic(&result->library, "WGL 1.0");
if (wglData->ffwglMakeCurrent(NULL, NULL) == FALSE) {
return "wglMakeCurrent(NULL, NULL) failed";
if (wglData->ffwglMakeCurrent(nullptr, nullptr) == FALSE) {
return "wglMakeCurrent(nullptr, nullptr) failed";
}
return NULL;
return nullptr;
}
static const char* wglHandlePixelFormat(WGLData* wglData, FFOpenGLResult* result, HWND hWnd) {
HDC hdc = GetDC(hWnd);
if (hdc == NULL) {
if (hdc == nullptr) {
return "GetDC() failed";
}
@@ -55,7 +55,7 @@ static const char* wglHandlePixelFormat(WGLData* wglData, FFOpenGLResult* result
}
HGLRC context = wglData->ffwglCreateContext(hdc);
if (context == NULL) {
if (context == nullptr) {
ReleaseDC(hWnd, hdc);
return "wglCreateContext() failed";
}
@@ -91,7 +91,7 @@ static const char* wglDetectOpenGL(FFOpenGLResult* result) {
return "RegisterClassW() failed";
}
HWND hWnd = CreateWindowW(wc.lpszClassName, L"ogl_version_check", 0, 0, 0, FF_OPENGL_BUFFER_WIDTH, FF_OPENGL_BUFFER_HEIGHT, NULL, NULL, hInstance, NULL);
HWND hWnd = CreateWindowW(wc.lpszClassName, L"ogl_version_check", 0, 0, 0, FF_OPENGL_BUFFER_WIDTH, FF_OPENGL_BUFFER_HEIGHT, nullptr, nullptr, hInstance, nullptr);
if (!hWnd) {
return "CreateWindowW() failed";
}