From 3e9367403daf19bd330efb137d1809e8a15551fa Mon Sep 17 00:00:00 2001 From: M374LX Date: Sun, 23 Aug 2026 20:49:13 -0300 Subject: [PATCH] Add casts (egl_context.c, glx_context.c, linux_joystick.c, x11_monitor.c, and x11_window.c) --- src/egl_context.c | 2 +- src/glx_context.c | 4 ++-- src/linux_joystick.c | 4 ++-- src/x11_monitor.c | 6 +++--- src/x11_window.c | 12 ++++++------ 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/egl_context.c b/src/egl_context.c index 65142c0a..ffd931cc 100644 --- a/src/egl_context.c +++ b/src/egl_context.c @@ -343,7 +343,7 @@ static GLFWglproc _glfwGetProcAddressEGL(const char* procname) if (!_glfw.egl.KHR_get_all_proc_addresses) { - _GLFWwindow* window = _glfwPlatformGetTls(&_glfw.contextSlot); + _GLFWwindow* window = (_GLFWwindow*) _glfwPlatformGetTls(&_glfw.contextSlot); assert(window != NULL); return _glfwPlatformGetModuleSymbol(window->context.egl.client, procname); diff --git a/src/glx_context.c b/src/glx_context.c index 6fb7bfdc..5c3eedb5 100644 --- a/src/glx_context.c +++ b/src/glx_context.c @@ -73,7 +73,7 @@ static GLFWbool _glfwChooseConfigGLX(const _GLFWfbconfig* desired, return GLFW_FALSE; } - usableConfigs = _glfw_calloc(nativeCount, sizeof(_GLFWfbconfig)); + usableConfigs = (_GLFWfbconfig*) _glfw_calloc(nativeCount, sizeof(_GLFWfbconfig)); usableCount = 0; for (int i = 0; i < nativeCount; i++) @@ -187,7 +187,7 @@ static void _glfwSwapBuffersGLX(_GLFWwindow* window) static void _glfwSwapIntervalGLX(int interval) { - _GLFWwindow* window = _glfwPlatformGetTls(&_glfw.contextSlot); + _GLFWwindow* window = (_GLFWwindow*) _glfwPlatformGetTls(&_glfw.contextSlot); assert(window != NULL); if (_glfw.glx.EXT_swap_control) diff --git a/src/linux_joystick.c b/src/linux_joystick.c index a3af7032..9428ad3f 100644 --- a/src/linux_joystick.c +++ b/src/linux_joystick.c @@ -255,8 +255,8 @@ static void _glfwCloseJoystickLinux(_GLFWjoystick* js) // static int _glfwCompareJoysticksLinux(const void* fp, const void* sp) { - const _GLFWjoystick* fj = fp; - const _GLFWjoystick* sj = sp; + const _GLFWjoystick* fj = (_GLFWjoystick*) fp; + const _GLFWjoystick* sj = (_GLFWjoystick*) sp; return strcmp(fj->linjs.path, sj->linjs.path); } diff --git a/src/x11_monitor.c b/src/x11_monitor.c index 1b73a0ee..7ada77e4 100644 --- a/src/x11_monitor.c +++ b/src/x11_monitor.c @@ -117,7 +117,7 @@ void _glfwPollMonitorsX11(void) disconnectedCount = _glfw.monitorCount; if (disconnectedCount) { - disconnected = _glfw_calloc(_glfw.monitorCount, sizeof(_GLFWmonitor*)); + disconnected = (_GLFWmonitor**) _glfw_calloc(_glfw.monitorCount, sizeof(_GLFWmonitor*)); memcpy(disconnected, _glfw.monitors, _glfw.monitorCount * sizeof(_GLFWmonitor*)); @@ -459,7 +459,7 @@ GLFWvidmode* _glfwGetVideoModesX11(_GLFWmonitor* monitor, int* count) XRRCrtcInfo* ci = XRRGetCrtcInfo(_glfw.x11.display, sr, monitor->x11.crtc); XRROutputInfo* oi = XRRGetOutputInfo(_glfw.x11.display, sr, monitor->x11.output); - result = _glfw_calloc(oi->nmode, sizeof(GLFWvidmode)); + result = (GLFWvidmode*) _glfw_calloc(oi->nmode, sizeof(GLFWvidmode)); for (int i = 0; i < oi->nmode; i++) { @@ -491,7 +491,7 @@ GLFWvidmode* _glfwGetVideoModesX11(_GLFWmonitor* monitor, int* count) else { *count = 1; - result = _glfw_calloc(1, sizeof(GLFWvidmode)); + result = (GLFWvidmode*) _glfw_calloc(1, sizeof(GLFWvidmode)); _glfwGetVideoModeX11(monitor, result); } diff --git a/src/x11_window.c b/src/x11_window.c index 4316116c..2f2674c1 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -443,7 +443,7 @@ static char* _glfwConvertLatin1toUTF8X11(const char* source) for (sp = source; *sp; sp++) size += (*sp & 0x80) ? 2 : 1; - char* target = _glfw_calloc(size, 1); + char* target = (char*) _glfw_calloc(size, 1); char* tp = target; for (sp = source; *sp; sp++) @@ -1038,7 +1038,7 @@ static const char* _glfwGetSelectionStringX11(Atom selection) if (itemCount) { size += itemCount; - string = _glfw_realloc(string, size); + string = (char*) _glfw_realloc(string, size); string[size - itemCount - 1] = '\0'; strcat(string, data); } @@ -1194,7 +1194,7 @@ static void _glfwProcessEventX11(XEvent *event) XGetEventData(_glfw.x11.display, &event->xcookie) && event->xcookie.evtype == XI_RawMotion) { - XIRawEvent* re = event->xcookie.data; + XIRawEvent* re = (XIRawEvent*) event->xcookie.data; if (re->valuators.mask_len) { const double* values = re->raw_values; @@ -1282,7 +1282,7 @@ static void _glfwProcessEventX11(XEvent *event) if (status == XBufferOverflow) { - chars = _glfw_calloc(count + 1, 1); + chars = (char*) _glfw_calloc(count + 1, 1); count = Xutf8LookupString(window->x11.ic, &event->xkey, chars, count, @@ -2115,7 +2115,7 @@ void _glfwSetWindowIconX11(_GLFWwindow* window, int count, const GLFWimage* imag for (int i = 0; i < count; i++) longCount += 2 + images[i].width * images[i].height; - unsigned long* icon = _glfw_calloc(longCount, sizeof(unsigned long)); + unsigned long* icon = (unsigned long*) _glfw_calloc(longCount, sizeof(unsigned long)); unsigned long* target = icon; for (int i = 0; i < count; i++) @@ -3130,7 +3130,7 @@ EGLenum _glfwGetEGLPlatformX11(EGLint** attribs) if (type) { - *attribs = _glfw_calloc(5, sizeof(EGLint)); + *attribs = (EGLint*) _glfw_calloc(5, sizeof(EGLint)); (*attribs)[0] = EGL_PLATFORM_ANGLE_TYPE_ANGLE; (*attribs)[1] = type; (*attribs)[2] = EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE;