Clean-up: filter: fix variable shadowing in visit_node_load_expression
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 31 Mar 2021 14:45:01 +0000 (10:45 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 13 Apr 2021 20:21:23 +0000 (16:21 -0400)
It seems safe to just re-use the `ret` variable at the function-level
scope.

Change-Id: I7826edf2b8bb41f9c202af75a8b5e7dff9cbbcc8
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/filter/filter-visitor-generate-bytecode.c

index e0ba9fd0a43d342ca3540cc6785dddb57f1b898a..8bf87d7c6661e84dc4b920c16eb9c8851b393168 100644 (file)
@@ -240,7 +240,7 @@ int visit_node_load_expression(struct filter_parser_ctx *ctx,
                switch (op->type) {
                case IR_LOAD_EXPRESSION_GET_CONTEXT_ROOT:
                {
-                       const int ret = bytecode_push_get_context_root(&ctx->bytecode);
+                       ret = bytecode_push_get_context_root(&ctx->bytecode);
 
                        if (ret) {
                                return ret;
@@ -250,7 +250,8 @@ int visit_node_load_expression(struct filter_parser_ctx *ctx,
                }
                case IR_LOAD_EXPRESSION_GET_APP_CONTEXT_ROOT:
                {
-                       const int ret = bytecode_push_get_app_context_root(&ctx->bytecode);
+                       ret = bytecode_push_get_app_context_root(
+                                       &ctx->bytecode);
 
                        if (ret) {
                                return ret;
@@ -260,7 +261,7 @@ int visit_node_load_expression(struct filter_parser_ctx *ctx,
                }
                case IR_LOAD_EXPRESSION_GET_PAYLOAD_ROOT:
                {
-                       const int ret = bytecode_push_get_payload_root(&ctx->bytecode);
+                       ret = bytecode_push_get_payload_root(&ctx->bytecode);
 
                        if (ret) {
                                return ret;
@@ -270,10 +271,8 @@ int visit_node_load_expression(struct filter_parser_ctx *ctx,
                }
                case IR_LOAD_EXPRESSION_GET_SYMBOL:
                {
-                       const int ret = bytecode_push_get_symbol(
-                                       &ctx->bytecode,
-                                       &ctx->bytecode_reloc,
-                                       op->u.symbol);
+                       ret = bytecode_push_get_symbol(&ctx->bytecode,
+                                       &ctx->bytecode_reloc, op->u.symbol);
 
                        if (ret) {
                                return ret;
@@ -283,7 +282,8 @@ int visit_node_load_expression(struct filter_parser_ctx *ctx,
                }
                case IR_LOAD_EXPRESSION_GET_INDEX:
                {
-                       const int ret = bytecode_push_get_index_u64(&ctx->bytecode, op->u.index);
+                       ret = bytecode_push_get_index_u64(
+                                       &ctx->bytecode, op->u.index);
 
                        if (ret) {
                                return ret;
@@ -295,7 +295,6 @@ int visit_node_load_expression(struct filter_parser_ctx *ctx,
                {
                        struct load_op *insn;
                        uint32_t insn_len = sizeof(struct load_op);
-                       int ret;
 
                        insn = calloc(insn_len, 1);
                        if (!insn)
This page took 0.026402 seconds and 4 git commands to generate.