From c77be86fbad31705ad4f20ff37da6d00ec66d821 Mon Sep 17 00:00:00 2001 From: Nakidai Date: Fri, 18 Jul 2025 04:11:27 +0300 Subject: Remove gotos in executor.c Reading the code again I noticed using goto here for no good reason. Well, not a critical issue anyway this should improve readability --- executor.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'executor.c') diff --git a/executor.c b/executor.c index a528c4c..cb5e865 100644 --- a/executor.c +++ b/executor.c @@ -99,7 +99,7 @@ enum cccl_ExecutorStatus cccl_execute(struct cccl_Node *code, struct cccl_Variab { case cccl_Executor_ERROR: return res; case cccl_Executor_CONTINUE: return cccl_Executor_ERROR; - case cccl_Executor_END: goto end; + case cccl_Executor_END: return cccl_Executor_OK; } } break; case cccl_Node_PUSHZERO: @@ -252,7 +252,7 @@ enum cccl_ExecutorStatus cccl_execute(struct cccl_Node *code, struct cccl_Variab { case cccl_Executor_ERROR: return res; case cccl_Executor_CONTINUE: return cccl_Executor_ERROR; - case cccl_Executor_END: goto end; + case cccl_Executor_END: return cccl_Executor_OK; } } break; case cccl_Node_INFINITE: @@ -275,7 +275,7 @@ enum cccl_ExecutorStatus cccl_execute(struct cccl_Node *code, struct cccl_Variab { case cccl_Executor_ERROR: return res; case cccl_Executor_CONTINUE: break; - case cccl_Executor_END: goto end; + case cccl_Executor_END: return cccl_Executor_OK; } } break; case cccl_Node_REPEAT: @@ -294,7 +294,7 @@ enum cccl_ExecutorStatus cccl_execute(struct cccl_Node *code, struct cccl_Variab { case cccl_Executor_ERROR: return res; case cccl_Executor_CONTINUE: break; - case cccl_Executor_END: goto end; + case cccl_Executor_END: return cccl_Executor_OK; } } break; case cccl_Node_CONDITIONAL: @@ -322,6 +322,5 @@ enum cccl_ExecutorStatus cccl_execute(struct cccl_Node *code, struct cccl_Variab } break; } -end: - return 0; + return cccl_Executor_OK; } -- cgit 1.4.1