From 1761d98a2ee1fa0482bc70c6c641b0be0cc8e6a7 Mon Sep 17 00:00:00 2001 From: Lubosz Sarnecki Date: Wed, 9 Aug 2023 13:54:47 +0200 Subject: [PATCH] t/common: Use same return type as in interface. Fixes GCC 13 warning [-Wenum-int-mismatch]. Return xrt_result_t in the implementation of xrt_instance_create in target_instance_no_comp.c, as declared in xrt_instance.h and already done in target_instance.c. Return proper xrt_result_t instead of plain ints. --- src/xrt/targets/common/target_instance_no_comp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xrt/targets/common/target_instance_no_comp.c b/src/xrt/targets/common/target_instance_no_comp.c index cf4b0eaeb..86cf4b1df 100644 --- a/src/xrt/targets/common/target_instance_no_comp.c +++ b/src/xrt/targets/common/target_instance_no_comp.c @@ -56,7 +56,7 @@ t_instance_create_system(struct xrt_instance *xinst, * */ -int +xrt_result_t xrt_instance_create(struct xrt_instance_info *ii, struct xrt_instance **out_xinst) { XRT_TRACE_MARKER(); @@ -65,7 +65,7 @@ xrt_instance_create(struct xrt_instance_info *ii, struct xrt_instance **out_xins int ret = xrt_prober_create_with_lists(&xp, &target_lists); if (ret < 0) { - return ret; + return XRT_ERROR_PROBER_CREATION_FAILED; } struct t_instance *tinst = U_TYPED_CALLOC(struct t_instance); @@ -76,5 +76,5 @@ xrt_instance_create(struct xrt_instance_info *ii, struct xrt_instance **out_xins *out_xinst = &tinst->base; - return 0; + return XRT_SUCCESS; }