From 05fc05ca0bd897747ca27375e1dc67daa9975ea5 Mon Sep 17 00:00:00 2001 From: Korcan Hussein Date: Tue, 12 Aug 2025 13:47:16 +0100 Subject: [PATCH] xrt: add new xrt_result_t error codes * adds generic and future specific error codes Part-of: --- src/xrt/auxiliary/util/u_pretty_print.c | 4 ++++ src/xrt/include/xrt/xrt_results.h | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/xrt/auxiliary/util/u_pretty_print.c b/src/xrt/auxiliary/util/u_pretty_print.c index 4a084d0f7..5bb4d084c 100644 --- a/src/xrt/auxiliary/util/u_pretty_print.c +++ b/src/xrt/auxiliary/util/u_pretty_print.c @@ -228,6 +228,10 @@ u_pp_xrt_result(struct u_pp_delegate dg, xrt_result_t xret) case XRT_ERROR_SYNC_PRIMITIVE_CREATION_FAILED: DG("XRT_ERROR_SYNC_PRIMITIVE_CREATION_FAILED"); return; case XRT_ERROR_IPC_SERVICE_ALREADY_RUNNING: DG("XRT_ERROR_IPC_SERVICE_ALREADY_RUNNING"); return; case XRT_ERROR_IPC_MAINLOOP_FAILED_TO_INIT: DG("XRT_ERROR_IPC_MAINLOOP_FAILED_TO_INIT"); return; + case XRT_ERROR_INVALID_ARGUMENT: DG("XRT_ERROR_INVALID_ARGUMENT"); return; + case XRT_OPERATION_CANCELLED: DG("XRT_OPERATION_CANCELLED"); return; + case XRT_ERROR_FUTURE_RESULT_NOT_READY: DG("XRT_ERROR_FUTURE_RESULT_NOT_READY"); return; + case XRT_ERROR_FUTURE_ALREADY_COMPLETE: DG("XRT_ERROR_FUTURE_ALREADY_COMPLETE"); return; } // clang-format on diff --git a/src/xrt/include/xrt/xrt_results.h b/src/xrt/include/xrt/xrt_results.h index d46568a6d..c39085733 100644 --- a/src/xrt/include/xrt/xrt_results.h +++ b/src/xrt/include/xrt/xrt_results.h @@ -38,6 +38,11 @@ typedef enum xrt_result */ XRT_SPACE_BOUNDS_UNAVAILABLE = 3, + /*! + * An (asynchronous) operation has been cancelled. + */ + XRT_OPERATION_CANCELLED = 4, + /*! * A problem occurred either with the IPC transport itself, with invalid commands from the client, or with * invalid responses from the server. @@ -231,4 +236,19 @@ typedef enum xrt_result * The IPC server couldn't starts it mainloop. */ XRT_ERROR_IPC_MAINLOOP_FAILED_TO_INIT = -38, + + /*! + * Invalid function arguments passed in, e.g. null or out-of-range values. + */ + XRT_ERROR_INVALID_ARGUMENT = -39, + + /*! + * Querying result of a future before it is ready. + */ + XRT_ERROR_FUTURE_RESULT_NOT_READY = -40, + + /*! + * Invoking complete on an already completed future + */ + XRT_ERROR_FUTURE_ALREADY_COMPLETE = -41, } xrt_result_t;