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:
Antonio Ospite 2022-03-09 12:46:43 +01:00
parent 17e9e06de7
commit 14a1ced0e4
2 changed files with 3 additions and 1 deletions

View file

@ -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;
}
}

View file

@ -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;
}
}