Skip to content

Commit

Permalink
fix some platform specific typecast issues
Browse files Browse the repository at this point in the history
  • Loading branch information
szabolcsdombi committed Mar 4, 2023
1 parent 001178a commit 8a69183
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion glcontext/egl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ GLContext * meth_create_context(PyObject * self, PyObject * args, PyObject * kwa
return NULL;
}

EGLDeviceEXT* devices = malloc(sizeof(EGLDeviceEXT) * num_devices);
EGLDeviceEXT * devices = (EGLDeviceEXT *)malloc(sizeof(EGLDeviceEXT) * num_devices);
if (!res->m_eglQueryDevicesEXT(num_devices, devices, &num_devices)) {
PyErr_Format(PyExc_Exception, "eglQueryDevicesEXT failed (0x%x)", res->m_eglGetError());
free(devices);
Expand Down
2 changes: 1 addition & 1 deletion glcontext/empty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ PyMethodDef GLContext_methods[] = {

PyType_Slot GLContext_slots[] = {
{Py_tp_methods, GLContext_methods},
{Py_tp_dealloc, GLContext_dealloc},
{Py_tp_dealloc, (void *)GLContext_dealloc},
{},
};

Expand Down
2 changes: 1 addition & 1 deletion glcontext/windowed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ PyObject * meth_load_opengl_function(PyObject * self, PyObject * arg) {
return NULL;
}
const char * name = PyUnicode_AsUTF8(arg);
return PyLong_FromVoidPtr(glXGetProcAddress((unsigned char *)name));
return PyLong_FromVoidPtr((void *)glXGetProcAddress((unsigned char *)name));
}

#endif
Expand Down

0 comments on commit 8a69183

Please sign in to comment.