Module: Mesa Branch: main Commit: b4d90b1182acb3365789755a618ef14cc7e53fa6 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b4d90b1182acb3365789755a618ef14cc7e53fa6
Author: Eleni Maria Stea <[email protected]> Date: Thu Jun 10 14:09:02 2021 +0300 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 <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11298> --- src/egl/main/eglglobals.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/egl/main/eglglobals.c b/src/egl/main/eglglobals.c index dd2b07c0da4..e0e9044a924 100644 --- a/src/egl/main/eglglobals.c +++ b/src/egl/main/eglglobals.c @@ -147,7 +147,10 @@ _eglPointerIsDereferencable(void *p) /* align addr to page_size */ 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; } _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
