From ac248ea05cc7aaf7e66611a06e393dbe3e4cd066 Mon Sep 17 00:00:00 2001 From: Korcan Hussein Date: Mon, 31 Mar 2025 15:35:15 +0100 Subject: [PATCH] xrt: fix compiler warning messages in android builds Part-of: --- src/xrt/auxiliary/android/CMakeLists.txt | 2 +- src/xrt/auxiliary/android/android_custom_surface.cpp | 1 + src/xrt/auxiliary/vk/vk_image_allocator.c | 2 ++ src/xrt/compositor/client/comp_gl_memobj_swapchain.c | 2 +- src/xrt/drivers/android/android_prober.c | 2 +- src/xrt/drivers/android/android_sensors.c | 2 +- src/xrt/state_trackers/oxr/oxr_session_gfx_gles_android.c | 2 +- 7 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/xrt/auxiliary/android/CMakeLists.txt b/src/xrt/auxiliary/android/CMakeLists.txt index 495ce1583..5ae745aff 100644 --- a/src/xrt/auxiliary/android/CMakeLists.txt +++ b/src/xrt/auxiliary/android/CMakeLists.txt @@ -7,7 +7,7 @@ add_library( ) target_include_directories(android_app_glue PUBLIC ${ANDROID_NDK}/sources/android/native_app_glue) # disable these warnings in external code -target_compile_options(android_app_glue PRIVATE -Wno-format-pedantic) +target_compile_options(android_app_glue PRIVATE -Wno-format-pedantic -Wno-strict-prototypes) add_library( aux_android STATIC diff --git a/src/xrt/auxiliary/android/android_custom_surface.cpp b/src/xrt/auxiliary/android/android_custom_surface.cpp index eb9d04466..a881daee6 100644 --- a/src/xrt/auxiliary/android/android_custom_surface.cpp +++ b/src/xrt/auxiliary/android/android_custom_surface.cpp @@ -230,6 +230,7 @@ android_custom_surface_get_display_metrics(struct _JavaVM *vm, .xdpi = displayMetrics.get("xdpi"), .ydpi = displayMetrics.get("ydpi"), .refresh_rate = displayRefreshRate, + .refresh_rates = {}, .refresh_rate_count = (uint32_t)supported_refresh_rates.size(), }; for (int i = 0; i < (int)metrics.refresh_rate_count; ++i) { diff --git a/src/xrt/auxiliary/vk/vk_image_allocator.c b/src/xrt/auxiliary/vk/vk_image_allocator.c index 029844b3b..abaeef070 100644 --- a/src/xrt/auxiliary/vk/vk_image_allocator.c +++ b/src/xrt/auxiliary/vk/vk_image_allocator.c @@ -266,10 +266,12 @@ create_image(struct vk_bundle *vk, const struct xrt_swapchain_create_info *info, } // In +#if !defined(XRT_GRAPHICS_BUFFER_HANDLE_IS_AHARDWAREBUFFER) VkImageMemoryRequirementsInfo2 memory_requirements_info = { .sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2, .image = image, }; +#endif // Out->pNext VkMemoryDedicatedRequirements memory_dedicated_requirements = { diff --git a/src/xrt/compositor/client/comp_gl_memobj_swapchain.c b/src/xrt/compositor/client/comp_gl_memobj_swapchain.c index 931899a53..fb278f9ae 100644 --- a/src/xrt/compositor/client/comp_gl_memobj_swapchain.c +++ b/src/xrt/compositor/client/comp_gl_memobj_swapchain.c @@ -72,7 +72,7 @@ client_gl_memobj_swapchain_destroy(struct xrt_swapchain *xsc) free(sc); } -static bool +XRT_MAYBE_UNUSED static bool client_gl_memobj_swapchain_import(GLuint memory, size_t size, xrt_graphics_buffer_handle_t handle) { #if defined(XRT_GRAPHICS_BUFFER_HANDLE_IS_FD) diff --git a/src/xrt/drivers/android/android_prober.c b/src/xrt/drivers/android/android_prober.c index 1057f8345..7b647b6fa 100644 --- a/src/xrt/drivers/android/android_prober.c +++ b/src/xrt/drivers/android/android_prober.c @@ -82,7 +82,7 @@ android_prober_autoprobe(struct xrt_auto_prober *xap, */ struct xrt_auto_prober * -android_create_auto_prober() +android_create_auto_prober(void) { struct android_prober *p = U_TYPED_CALLOC(struct android_prober); p->base.name = "Android"; diff --git a/src/xrt/drivers/android/android_sensors.c b/src/xrt/drivers/android/android_sensors.c index e246b5c1e..7f222e788 100644 --- a/src/xrt/drivers/android/android_sensors.c +++ b/src/xrt/drivers/android/android_sensors.c @@ -241,7 +241,7 @@ android_device_compute_distortion( struct android_device * -android_device_create() +android_device_create(void) { enum u_device_alloc_flags flags = (enum u_device_alloc_flags)(U_DEVICE_ALLOC_HMD | U_DEVICE_ALLOC_TRACKING_NONE); diff --git a/src/xrt/state_trackers/oxr/oxr_session_gfx_gles_android.c b/src/xrt/state_trackers/oxr/oxr_session_gfx_gles_android.c index fc4c2e549..81e85d0a4 100644 --- a/src/xrt/state_trackers/oxr/oxr_session_gfx_gles_android.c +++ b/src/xrt/state_trackers/oxr/oxr_session_gfx_gles_android.c @@ -100,7 +100,7 @@ oxr_session_populate_gles_android(struct oxr_logger *log, "XrGraphicsBindingEGLMNDX::config cannot be null when EGL_KHR_no_config_context is " "not supported by the display."); } - if (xret != XR_SUCCESS || xcgl == NULL) { + if (xret != XRT_SUCCESS || xcgl == NULL) { return oxr_error(log, XR_ERROR_INITIALIZATION_FAILED, "Failed to create an egl client compositor"); } -- 2.51.2