egl: fix in expected type
Function mincore expects a pointer of type char* but we use an unsigned char* instead generating signedness related warnings. v2: Made the fix FreeBSD specific because the type is unsigned char* for Linux and char* for FreeBSD. (Adam Jackson) v3: We'd rather cast the param to (void*) to avoid warnings in all systems (Adam Jackson) Signed-off-by: Eleni Maria Stea <elene.mst@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11298>
This commit is contained in:

committed by
Marge Bot

parent
7b8199e4a2
commit
b4d90b1182
@@ -147,7 +147,10 @@ _eglPointerIsDereferencable(void *p)
|
|||||||
/* align addr to page_size */
|
/* align addr to page_size */
|
||||||
addr &= ~(page_size - 1);
|
addr &= ~(page_size - 1);
|
||||||
|
|
||||||
if (mincore((void *) addr, page_size, &valid) < 0) {
|
/* mincore expects &valid to be unsigned char* on Linux but char* on BSD:
|
||||||
|
* we cast pointers to void, to fix type mismatch warnings in all systems
|
||||||
|
*/
|
||||||
|
if (mincore((void *) addr, page_size, (void*)&valid) < 0) {
|
||||||
return EGL_FALSE;
|
return EGL_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user