mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 11:06:18 +00:00
xrt: fix -Wreturn-type warnings
Add some missing returns pointed out by -Wreturn-type: ----------------------------------------------------------------------- [32/315] Building C object src/xrt/auxiliary/CMakeFiles/aux_gstreamer.dir/gstreamer/gst_sink.c.o .../src/xrt/auxiliary/gstreamer/gst_sink.c:53:1: warning: non-void function does not return a value in all control paths [-Wreturn-type] } ^ 1 warning generated. [84/315] Building C object src/xrt/auxiliary/CMakeFiles/aux_vk.dir/vk/vk_compositor_flags.c.o .../src/xrt/auxiliary/vk/vk_compositor_flags.c:117:1: warning: non-void function does not return a value in all control paths [-Wreturn-type] } ^ .../src/xrt/auxiliary/vk/vk_compositor_flags.c:146:1: warning: non-void function does not return a value in all control paths [-Wreturn-type] } ^ 2 warnings generated. ----------------------------------------------------------------------- For the function returning VkImageAspectFlags return a literal 0 because the enum values VK_IMAGE_ASPECT_NONE or VK_IMAGE_ASPECT_NONE_KHR may not always be defined.
This commit is contained in:
parent
17e9e06de7
commit
14a1ced0e4
|
@ -48,7 +48,7 @@ gst_fmt_from_xf_format(enum xrt_format format_in)
|
|||
case XRT_FORMAT_R8G8B8X8: return GST_VIDEO_FORMAT_RGBx;
|
||||
case XRT_FORMAT_YUYV422: return GST_VIDEO_FORMAT_YUY2;
|
||||
case XRT_FORMAT_L8: return GST_VIDEO_FORMAT_GRAY8;
|
||||
default: assert(false);
|
||||
default: assert(false); return GST_VIDEO_FORMAT_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -113,6 +113,7 @@ vk_csci_get_barrier_optimal_layout(VkFormat format)
|
|||
return VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
|
||||
default: //
|
||||
assert(false && !"Format not supported!");
|
||||
return VK_IMAGE_LAYOUT_UNDEFINED;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -142,6 +143,7 @@ vk_csci_get_barrier_aspect_mask(VkFormat format)
|
|||
return VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
default: //
|
||||
assert(false && !"Format not supported!");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue