Mesa (main): util: use correct type in sysctl argument
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Feb 28 14:52:12 UTC 2022
Module: Mesa
Branch: main
Commit: 6250a3bc18d06b6f609dc1eff8599432edbfc3c8
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6250a3bc18d06b6f609dc1eff8599432edbfc3c8
Author: Jonathan Gray <jsg at jsg.id.au>
Date: Mon Aug 31 13:00:53 2020 +1000
util: use correct type in sysctl argument
Fixes build on OpenBSD/macppc powerpc
error: incompatible pointer types passing 'int *' to parameter of type 'size_t *'
(aka 'unsigned long *') [-Werror,-Wincompatible-pointer-types]
Fixes: 01bd21eef8f ("gallium: Import Dennis Smit cpu detection code.")
Signed-off-by: Jonathan Gray <jsg at jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6511>
---
src/util/u_cpu_detect.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/u_cpu_detect.c b/src/util/u_cpu_detect.c
index 87f47cda931..4faaf52703a 100644
--- a/src/util/u_cpu_detect.c
+++ b/src/util/u_cpu_detect.c
@@ -136,7 +136,7 @@ check_os_altivec_support(void)
int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC};
#endif
int has_vu = 0;
- int len = sizeof (has_vu);
+ size_t len = sizeof (has_vu);
int err;
err = sysctl(sels, 2, &has_vu, &len, NULL, 0);
More information about the mesa-commit
mailing list