From b5b1385fa7f86f0ce998c0abc4960e46e1f36c31 Mon Sep 17 00:00:00 2001 From: "Balos, Cody, J" Date: Mon, 10 Feb 2025 22:40:19 -0800 Subject: [PATCH] use SUNCheck --- src/sundials/sundials_datanode.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/sundials/sundials_datanode.c b/src/sundials/sundials_datanode.c index 07fdd78a9c..be51702c79 100644 --- a/src/sundials/sundials_datanode.c +++ b/src/sundials/sundials_datanode.c @@ -81,19 +81,20 @@ SUNErrCode SUNDataNode_CreateList(SUNDataIOMode io_mode, SUNDIALS_MARK_FUNCTION_BEGIN(SUNCTX_->profiler); + SUNErrCode err = SUN_SUCCESS; switch (io_mode) { case (SUNDATAIOMODE_INMEM): - SUNCheckCall(SUNDataNode_CreateList_InMem(num_elements, sunctx, node_out)); + err = SUNDataNode_CreateList_InMem(num_elements, sunctx, node_out); break; - default: - SUNDIALS_MARK_FUNCTION_END(SUNCTX_->profiler); - return SUN_ERR_ARG_OUTOFRANGE; + default: err = SUN_ERR_ARG_OUTOFRANGE; } SUNDIALS_MARK_FUNCTION_END(SUNCTX_->profiler); - return SUN_SUCCESS; + SUNCheck(err); + + return err; } SUNErrCode SUNDataNode_CreateObject(SUNDataIOMode io_mode, @@ -104,19 +105,20 @@ SUNErrCode SUNDataNode_CreateObject(SUNDataIOMode io_mode, SUNDIALS_MARK_FUNCTION_BEGIN(SUNCTX_->profiler); + SUNErrCode err = SUN_SUCCESS; switch (io_mode) { case (SUNDATAIOMODE_INMEM): - SUNCheckCall(SUNDataNode_CreateObject_InMem(num_elements, sunctx, node_out)); + err = SUNDataNode_CreateObject_InMem(num_elements, sunctx, node_out); break; - default: - SUNDIALS_MARK_FUNCTION_END(SUNCTX_->profiler); - return SUN_ERR_ARG_OUTOFRANGE; + default: err = SUN_ERR_ARG_OUTOFRANGE; } SUNDIALS_MARK_FUNCTION_END(SUNCTX_->profiler); - return SUN_SUCCESS; + SUNCheck(err); + + return err; } SUNErrCode SUNDataNode_IsLeaf(const SUNDataNode self, sunbooleantype* yes_or_no)