mirror of
https://github.com/glfw/glfw
synced 2026-09-26 16:18:21 +03:00
Add casts (egl_context.c, glx_context.c, linux_joystick.c, x11_monitor.c, and x11_window.c)
This commit is contained in:
parent
eadcf6afd8
commit
3e9367403d
5 changed files with 14 additions and 14 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue