]> git.lttng.org Git - lttng-tools.git/commitdiff
Clean-up: apply suggested clang-tidy auto-fixes
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 17 Jan 2025 21:37:32 +0000 (21:37 +0000)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 17 Jan 2025 21:44:39 +0000 (21:44 +0000)
Change-Id: Ib5634578258b91c7a640566d4e50e891b11e4d8d
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/notification-thread-events.cpp
src/bin/lttng/commands/start.cpp
src/bin/lttng/loglevel.cpp
src/common/config/session-config.cpp
src/common/consumer/consumer.cpp
src/common/filter/filter-visitor-generate-bytecode.cpp
src/common/filter/filter-visitor-generate-ir.cpp
src/common/filter/filter-visitor-ir-normalize-glob-patterns.cpp
src/common/filter/filter-visitor-ir-validate-string.cpp
src/common/utils.cpp

index 8933475cb979f87ec664b008b27bf5c5ee3fc2db..f3a456f08d0da14acef037e9e8c2d9df2270aaca 100644 (file)
@@ -217,8 +217,8 @@ static int match_channel_trigger_list(struct cds_lfht_node *node, const void *ke
        trigger_list =
                caa_container_of(node, struct lttng_channel_trigger_list, channel_triggers_ht_node);
 
-       return !((channel_key->key != trigger_list->channel_key.key) ||
-                (channel_key->domain != trigger_list->channel_key.domain));
+       return (channel_key->key == trigger_list->channel_key.key) &&
+               (channel_key->domain == trigger_list->channel_key.domain);
 }
 
 static int match_session_trigger_list(struct cds_lfht_node *node, const void *key)
@@ -239,8 +239,7 @@ static int match_channel_state_sample(struct cds_lfht_node *node, const void *ke
 
        sample = caa_container_of(node, struct channel_state_sample, channel_state_ht_node);
 
-       return !((channel_key->key != sample->key.key) ||
-                (channel_key->domain != sample->key.domain));
+       return (channel_key->key == sample->key.key) && (channel_key->domain == sample->key.domain);
 }
 
 static int match_channel_info(struct cds_lfht_node *node, const void *key)
@@ -250,8 +249,8 @@ static int match_channel_info(struct cds_lfht_node *node, const void *key)
 
        channel_info = caa_container_of(node, struct channel_info, channels_ht_node);
 
-       return !((channel_key->key != channel_info->key.key) ||
-                (channel_key->domain != channel_info->key.domain));
+       return (channel_key->key == channel_info->key.key) &&
+               (channel_key->domain == channel_info->key.domain);
 }
 
 static int match_trigger(struct cds_lfht_node *node, const void *key)
index c4d5d4ee3646c1560dad7c29bfaa6cc2d100979f..897a112926f2c9a877d337ca84edc9ccbc4b6242 100644 (file)
@@ -197,7 +197,7 @@ void warn_on_small_client_shm(const char *session_name)
                 * into it.
                 */
                auto fd = [CLIENT_SHM_TEST_PATH]() {
-                       int raw_fd = shm_open(CLIENT_SHM_TEST_PATH, O_RDWR | O_CREAT, 0700);
+                       const auto raw_fd = shm_open(CLIENT_SHM_TEST_PATH, O_RDWR | O_CREAT, 0700);
                        if (raw_fd < 0) {
                                LTTNG_THROW_POSIX(
                                        lttng::format("Failed to open shared memory at path '%s'",
index 1ffd13c982b0b0ed1d750e211624c2e227765bfe..0f41e20e4ad0131e5ccff7a8e6c9387e6b49263b 100644 (file)
@@ -337,12 +337,12 @@ bool loglevel_log4j2_parse_range_string(const char *str,
                                        enum lttng_loglevel_log4j2 *most_severe)
 {
        int least_severe_int, most_severe_int;
-       bool ret = loglevel_parse_range_string_common(str,
-                                                     loglevel_log4j2_values,
-                                                     ARRAY_SIZE(loglevel_log4j2_values),
-                                                     LTTNG_LOGLEVEL_LOG4J2_FATAL,
-                                                     &least_severe_int,
-                                                     &most_severe_int);
+       const auto ret = loglevel_parse_range_string_common(str,
+                                                           loglevel_log4j2_values,
+                                                           ARRAY_SIZE(loglevel_log4j2_values),
+                                                           LTTNG_LOGLEVEL_LOG4J2_FATAL,
+                                                           &least_severe_int,
+                                                           &most_severe_int);
 
        *least_severe = (lttng_loglevel_log4j2) least_severe_int;
        *most_severe = (lttng_loglevel_log4j2) most_severe_int;
index 043b4de07e6db09a09050d54d9f5da42c022076c..de491e66f3d05676f0ae7bc149a2de617cfb3c89 100644 (file)
@@ -2780,7 +2780,7 @@ end:
 static int process_domain_node(xmlNodePtr domain_node, const char *session_name)
 {
        int ret;
-       struct lttng_domain domain{};
+       struct lttng_domain domain {};
        struct lttng_handle *handle = nullptr;
        struct lttng_channel *channel = nullptr;
        xmlNodePtr channels_node = nullptr;
index c4a0ef364e23bd96f4ab572353a73c6875d168d1..a98af6a7b767f54c95eb45681408e3135f9176f2 100644 (file)
@@ -5043,7 +5043,7 @@ end:
 
 enum lttcomm_return_code lttng_consumer_open_channel_packets(struct lttng_consumer_channel *channel)
 {
-       enum lttcomm_return_code ret = LTTCOMM_CONSUMERD_SUCCESS;
+       const auto ret = LTTCOMM_CONSUMERD_SUCCESS;
 
        if (channel->metadata_stream) {
                ERR("Open channel packets command attempted on a metadata channel");
index 81822137f13ae2122359ef9b3a9a581a5049cb5e..1b8f5166a87b90d089b40457e0a7facaea52d368 100644 (file)
@@ -122,16 +122,15 @@ end:
  * < 0: error
  */
 static int visit_node_load_expression_legacy(struct filter_parser_ctx *ctx,
-                                            const struct ir_load_expression *exp,
-                                            const struct ir_load_expression_op *op)
+                                            const struct ir_load_expression *exp)
 {
-       struct load_op *insn = NULL;
-       uint32_t insn_len = sizeof(struct load_op) + sizeof(struct field_ref);
+       struct load_op *insn = nullptr;
+       const auto insn_len = sizeof(struct load_op) + sizeof(struct field_ref);
        struct field_ref ref_offset;
        uint32_t reloc_offset_u32;
        uint16_t reloc_offset;
        enum bytecode_op op_type;
-       char *symbol = NULL;
+       char *symbol = nullptr;
        int ret;
 
        ret = load_expression_legacy_match(exp, &op_type, &symbol);
@@ -192,7 +191,7 @@ static int visit_node_load_expression(struct filter_parser_ctx *ctx, const struc
         * TODO: if we remove legacy load for application contexts, we
         * need to update session bytecode parser as well.
         */
-       ret = visit_node_load_expression_legacy(ctx, exp, op);
+       ret = visit_node_load_expression_legacy(ctx, exp);
        if (ret < 0) {
                return ret;
        }
@@ -200,7 +199,7 @@ static int visit_node_load_expression(struct filter_parser_ctx *ctx, const struc
                return 0; /* legacy */
        }
 
-       for (; op != NULL; op = op->next) {
+       for (; op != nullptr; op = op->next) {
                switch (op->type) {
                case IR_LOAD_EXPRESSION_GET_CONTEXT_ROOT:
                {
@@ -256,7 +255,7 @@ static int visit_node_load_expression(struct filter_parser_ctx *ctx, const struc
                case IR_LOAD_EXPRESSION_LOAD_FIELD:
                {
                        struct load_op *insn;
-                       uint32_t insn_len = sizeof(struct load_op);
+                       const auto insn_len = sizeof(struct load_op);
 
                        insn = (load_op *) calloc(insn_len, 1);
                        if (!insn)
@@ -287,7 +286,7 @@ static int visit_node_load(struct filter_parser_ctx *ctx, struct ir_op *node)
        case IR_DATA_STRING:
        {
                struct load_op *insn;
-               uint32_t insn_len =
+               const auto insn_len =
                        sizeof(struct load_op) + strlen(node->u.load.u.string.value) + 1;
 
                insn = (load_op *) calloc(insn_len, 1);
@@ -327,7 +326,7 @@ static int visit_node_load(struct filter_parser_ctx *ctx, struct ir_op *node)
        case IR_DATA_NUMERIC:
        {
                struct load_op *insn;
-               uint32_t insn_len = sizeof(struct load_op) + sizeof(struct literal_numeric);
+               const auto insn_len = sizeof(struct load_op) + sizeof(struct literal_numeric);
 
                insn = (load_op *) calloc(insn_len, 1);
                if (!insn)
@@ -341,7 +340,7 @@ static int visit_node_load(struct filter_parser_ctx *ctx, struct ir_op *node)
        case IR_DATA_FLOAT:
        {
                struct load_op *insn;
-               uint32_t insn_len = sizeof(struct load_op) + sizeof(struct literal_double);
+               const auto insn_len = sizeof(struct load_op) + sizeof(struct literal_double);
 
                insn = (load_op *) calloc(insn_len, 1);
                if (!insn)
@@ -581,12 +580,12 @@ void filter_bytecode_free(struct filter_parser_ctx *ctx)
 
        if (ctx->bytecode) {
                free(ctx->bytecode);
-               ctx->bytecode = NULL;
+               ctx->bytecode = nullptr;
        }
 
        if (ctx->bytecode_reloc) {
                free(ctx->bytecode_reloc);
-               ctx->bytecode_reloc = NULL;
+               ctx->bytecode_reloc = nullptr;
        }
 }
 
index 9283fc3d1bfd973d8faefc12d8a833555800d3d2..055ab5fbf061a3b2f6fabc4617a2480ecea55032 100644 (file)
@@ -32,17 +32,17 @@ static struct ir_op *make_op_root(struct ir_op *child, enum ir_side side)
 
        op = zmalloc<ir_op>();
        if (!op)
-               return NULL;
+               return nullptr;
        switch (child->data_type) {
        case IR_DATA_UNKNOWN:
        default:
                fprintf(stderr, "[error] Unknown root child data type\n");
                free(op);
-               return NULL;
+               return nullptr;
        case IR_DATA_STRING:
                fprintf(stderr, "[error] String cannot be root data type\n");
                free(op);
-               return NULL;
+               return nullptr;
        case IR_DATA_NUMERIC:
        case IR_DATA_FIELD_REF:
        case IR_DATA_GET_CONTEXT_REF:
@@ -79,7 +79,7 @@ static struct ir_op *make_op_load_string(const char *string, enum ir_side side)
 
        op = zmalloc<ir_op>();
        if (!op)
-               return NULL;
+               return nullptr;
        op->op = IR_OP_LOAD;
        op->data_type = IR_DATA_STRING;
        op->signedness = IR_SIGN_UNKNOWN;
@@ -88,7 +88,7 @@ static struct ir_op *make_op_load_string(const char *string, enum ir_side side)
        op->u.load.u.string.value = strdup(string);
        if (!op->u.load.u.string.value) {
                free(op);
-               return NULL;
+               return nullptr;
        }
        return op;
 }
@@ -99,7 +99,7 @@ static struct ir_op *make_op_load_numeric(int64_t v, enum ir_side side)
 
        op = zmalloc<ir_op>();
        if (!op)
-               return NULL;
+               return nullptr;
        op->op = IR_OP_LOAD;
        op->data_type = IR_DATA_NUMERIC;
        /* TODO: for now, all numeric values are signed */
@@ -115,7 +115,7 @@ static struct ir_op *make_op_load_float(double v, enum ir_side side)
 
        op = zmalloc<ir_op>();
        if (!op)
-               return NULL;
+               return nullptr;
        op->op = IR_OP_LOAD;
        op->data_type = IR_DATA_FLOAT;
        op->signedness = IR_SIGN_UNKNOWN;
@@ -183,10 +183,10 @@ static struct ir_load_expression *create_load_expression(struct filter_node *nod
        /* Get forward chain. */
        node = load_expression_get_forward_chain(node);
        if (!node)
-               return NULL;
+               return nullptr;
        load_exp = zmalloc<ir_load_expression>();
        if (!load_exp)
-               return NULL;
+               return nullptr;
 
        /* Root */
        load_exp_op = zmalloc<ir_load_expression_op>();
@@ -231,7 +231,7 @@ static struct ir_load_expression *create_load_expression(struct filter_node *nod
                        goto error;
 
                /* Explore brackets from current node. */
-               for (bracket_node = node->u.expression.next_bracket; bracket_node != NULL;
+               for (bracket_node = node->u.expression.next_bracket; bracket_node != nullptr;
                     bracket_node = bracket_node->u.expression.next_bracket) {
                        prev_op = load_exp_op;
                        if (bracket_node->type != NODE_EXPRESSION ||
@@ -264,7 +264,7 @@ static struct ir_load_expression *create_load_expression(struct filter_node *nod
 
 error:
        free_load_expression(load_exp);
-       return NULL;
+       return nullptr;
 }
 
 static struct ir_op *make_op_load_expression(struct filter_node *node, enum ir_side side)
@@ -273,7 +273,7 @@ static struct ir_op *make_op_load_expression(struct filter_node *node, enum ir_s
 
        op = zmalloc<ir_op>();
        if (!op)
-               return NULL;
+               return nullptr;
        op->op = IR_OP_LOAD;
        op->data_type = IR_DATA_EXPRESSION;
        op->signedness = IR_SIGN_DYN;
@@ -287,7 +287,7 @@ static struct ir_op *make_op_load_expression(struct filter_node *node, enum ir_s
 error:
        free_load_expression(op->u.load.u.expression);
        free(op);
-       return NULL;
+       return nullptr;
 }
 
 static struct ir_op *make_op_unary(enum unary_op_type unary_op_type,
@@ -296,7 +296,7 @@ static struct ir_op *make_op_unary(enum unary_op_type unary_op_type,
                                   struct ir_op *child,
                                   enum ir_side side)
 {
-       struct ir_op *op = NULL;
+       struct ir_op *op = nullptr;
 
        if (child->data_type == IR_DATA_STRING) {
                fprintf(stderr,
@@ -307,7 +307,7 @@ static struct ir_op *make_op_unary(enum unary_op_type unary_op_type,
 
        op = zmalloc<ir_op>();
        if (!op)
-               return NULL;
+               return nullptr;
        op->op = IR_OP_UNARY;
        op->data_type = child->data_type;
        op->signedness = signedness;
@@ -318,7 +318,7 @@ static struct ir_op *make_op_unary(enum unary_op_type unary_op_type,
 
 error:
        free(op);
-       return NULL;
+       return nullptr;
 }
 
 /*
@@ -350,7 +350,7 @@ static struct ir_op *make_op_binary_compare(enum op_type bin_op_type,
                                            struct ir_op *right,
                                            enum ir_side side)
 {
-       struct ir_op *op = NULL;
+       struct ir_op *op = nullptr;
 
        if (left->data_type == IR_DATA_UNKNOWN || right->data_type == IR_DATA_UNKNOWN) {
                fprintf(stderr, "[error] binary operation '%s' has unknown operand type\n", op_str);
@@ -366,7 +366,7 @@ static struct ir_op *make_op_binary_compare(enum op_type bin_op_type,
 
        op = zmalloc<ir_op>();
        if (!op)
-               return NULL;
+               return nullptr;
        op->op = IR_OP_BINARY;
        op->u.binary.type = bin_op_type;
        op->u.binary.left = left;
@@ -381,7 +381,7 @@ static struct ir_op *make_op_binary_compare(enum op_type bin_op_type,
 
 error:
        free(op);
-       return NULL;
+       return nullptr;
 }
 
 static struct ir_op *make_op_binary_eq(struct ir_op *left, struct ir_op *right, enum ir_side side)
@@ -420,7 +420,7 @@ static struct ir_op *make_op_binary_logical(enum op_type bin_op_type,
                                            struct ir_op *right,
                                            enum ir_side side)
 {
-       struct ir_op *op = NULL;
+       struct ir_op *op = nullptr;
 
        if (left->data_type == IR_DATA_UNKNOWN || right->data_type == IR_DATA_UNKNOWN) {
                fprintf(stderr, "[error] binary operation '%s' has unknown operand type\n", op_str);
@@ -435,7 +435,7 @@ static struct ir_op *make_op_binary_logical(enum op_type bin_op_type,
 
        op = zmalloc<ir_op>();
        if (!op)
-               return NULL;
+               return nullptr;
        op->op = IR_OP_LOGICAL;
        op->u.binary.type = bin_op_type;
        op->u.binary.left = left;
@@ -450,7 +450,7 @@ static struct ir_op *make_op_binary_logical(enum op_type bin_op_type,
 
 error:
        free(op);
-       return NULL;
+       return nullptr;
 }
 
 static struct ir_op *make_op_binary_bitwise(enum op_type bin_op_type,
@@ -459,7 +459,7 @@ static struct ir_op *make_op_binary_bitwise(enum op_type bin_op_type,
                                            struct ir_op *right,
                                            enum ir_side side)
 {
-       struct ir_op *op = NULL;
+       struct ir_op *op = nullptr;
 
        if (left->data_type == IR_DATA_UNKNOWN || right->data_type == IR_DATA_UNKNOWN) {
                fprintf(stderr,
@@ -482,7 +482,7 @@ static struct ir_op *make_op_binary_bitwise(enum op_type bin_op_type,
 
        op = zmalloc<ir_op>();
        if (!op)
-               return NULL;
+               return nullptr;
        op->op = IR_OP_BINARY;
        op->u.binary.type = bin_op_type;
        op->u.binary.left = left;
@@ -497,7 +497,7 @@ static struct ir_op *make_op_binary_bitwise(enum op_type bin_op_type,
 
 error:
        free(op);
-       return NULL;
+       return nullptr;
 }
 
 static struct ir_op *
@@ -591,7 +591,7 @@ make_expression(struct filter_parser_ctx *ctx, struct filter_node *node, enum ir
        case AST_EXP_UNKNOWN:
        default:
                fprintf(stderr, "[error] %s: unknown expression type\n", __func__);
-               return NULL;
+               return nullptr;
 
        case AST_EXP_STRING:
                return make_op_load_string(node->u.expression.u.string, side);
@@ -610,14 +610,14 @@ make_expression(struct filter_parser_ctx *ctx, struct filter_node *node, enum ir
 static struct ir_op *
 make_op(struct filter_parser_ctx *ctx, struct filter_node *node, enum ir_side side)
 {
-       struct ir_op *op = NULL, *lchild, *rchild;
+       struct ir_op *op = nullptr, *lchild, *rchild;
        const char *op_str = "?";
 
        switch (node->u.op.type) {
        case AST_OP_UNKNOWN:
        default:
                fprintf(stderr, "[error] %s: unknown binary op type\n", __func__);
-               return NULL;
+               return nullptr;
 
        /*
         * The following binary operators other than comparators and
@@ -646,11 +646,11 @@ make_op(struct filter_parser_ctx *ctx, struct filter_node *node, enum ir_side si
        case AST_OP_BIT_XOR:
                lchild = generate_ir_recursive(ctx, node->u.op.lchild, IR_LEFT);
                if (!lchild)
-                       return NULL;
+                       return nullptr;
                rchild = generate_ir_recursive(ctx, node->u.op.rchild, IR_RIGHT);
                if (!rchild) {
                        filter_free_ir_recursive(lchild);
-                       return NULL;
+                       return nullptr;
                }
                break;
 
@@ -662,11 +662,11 @@ make_op(struct filter_parser_ctx *ctx, struct filter_node *node, enum ir_side si
        case AST_OP_LE:
                lchild = generate_ir_recursive(ctx, node->u.op.lchild, IR_LEFT);
                if (!lchild)
-                       return NULL;
+                       return nullptr;
                rchild = generate_ir_recursive(ctx, node->u.op.rchild, IR_RIGHT);
                if (!rchild) {
                        filter_free_ir_recursive(lchild);
-                       return NULL;
+                       return nullptr;
                }
                break;
 
@@ -678,11 +678,11 @@ make_op(struct filter_parser_ctx *ctx, struct filter_node *node, enum ir_side si
                 */
                lchild = generate_ir_recursive(ctx, node->u.op.lchild, IR_LEFT);
                if (!lchild)
-                       return NULL;
+                       return nullptr;
                rchild = generate_ir_recursive(ctx, node->u.op.rchild, IR_LEFT);
                if (!rchild) {
                        filter_free_ir_recursive(lchild);
-                       return NULL;
+                       return nullptr;
                }
                break;
        }
@@ -739,7 +739,7 @@ make_op(struct filter_parser_ctx *ctx, struct filter_node *node, enum ir_side si
 
 error_not_supported:
        fprintf(stderr, "[error] %s: binary operation '%s' not supported\n", __func__, op_str);
-       return NULL;
+       return nullptr;
 }
 
 static struct ir_op *
@@ -749,7 +749,7 @@ make_unary_op(struct filter_parser_ctx *ctx, struct filter_node *node, enum ir_s
        case AST_UNARY_UNKNOWN:
        default:
                fprintf(stderr, "[error] %s: unknown unary op type\n", __func__);
-               return NULL;
+               return nullptr;
 
        case AST_UNARY_PLUS:
        {
@@ -757,11 +757,11 @@ make_unary_op(struct filter_parser_ctx *ctx, struct filter_node *node, enum ir_s
 
                child = generate_ir_recursive(ctx, node->u.unary_op.child, side);
                if (!child)
-                       return NULL;
+                       return nullptr;
                op = make_op_unary_plus(child, side);
                if (!op) {
                        filter_free_ir_recursive(child);
-                       return NULL;
+                       return nullptr;
                }
                return op;
        }
@@ -771,11 +771,11 @@ make_unary_op(struct filter_parser_ctx *ctx, struct filter_node *node, enum ir_s
 
                child = generate_ir_recursive(ctx, node->u.unary_op.child, side);
                if (!child)
-                       return NULL;
+                       return nullptr;
                op = make_op_unary_minus(child, side);
                if (!op) {
                        filter_free_ir_recursive(child);
-                       return NULL;
+                       return nullptr;
                }
                return op;
        }
@@ -785,11 +785,11 @@ make_unary_op(struct filter_parser_ctx *ctx, struct filter_node *node, enum ir_s
 
                child = generate_ir_recursive(ctx, node->u.unary_op.child, side);
                if (!child)
-                       return NULL;
+                       return nullptr;
                op = make_op_unary_not(child, side);
                if (!op) {
                        filter_free_ir_recursive(child);
-                       return NULL;
+                       return nullptr;
                }
                return op;
        }
@@ -799,17 +799,17 @@ make_unary_op(struct filter_parser_ctx *ctx, struct filter_node *node, enum ir_s
 
                child = generate_ir_recursive(ctx, node->u.unary_op.child, side);
                if (!child)
-                       return NULL;
+                       return nullptr;
                op = make_op_unary_bit_not(child, side);
                if (!op) {
                        filter_free_ir_recursive(child);
-                       return NULL;
+                       return nullptr;
                }
                return op;
        }
        }
 
-       return NULL;
+       return nullptr;
 }
 
 static struct ir_op *
@@ -819,7 +819,7 @@ generate_ir_recursive(struct filter_parser_ctx *ctx, struct filter_node *node, e
        case NODE_UNKNOWN:
        default:
                fprintf(stderr, "[error] %s: unknown node type\n", __func__);
-               return NULL;
+               return nullptr;
 
        case NODE_ROOT:
        {
@@ -827,11 +827,11 @@ generate_ir_recursive(struct filter_parser_ctx *ctx, struct filter_node *node, e
 
                child = generate_ir_recursive(ctx, node->u.root.child, side);
                if (!child)
-                       return NULL;
+                       return nullptr;
                op = make_op_root(child, side);
                if (!op) {
                        filter_free_ir_recursive(child);
-                       return NULL;
+                       return nullptr;
                }
                return op;
        }
@@ -842,13 +842,13 @@ generate_ir_recursive(struct filter_parser_ctx *ctx, struct filter_node *node, e
        case NODE_UNARY_OP:
                return make_unary_op(ctx, node, side);
        }
-       return 0;
+       return nullptr;
 }
 
 void filter_ir_free(struct filter_parser_ctx *ctx)
 {
        filter_free_ir_recursive(ctx->ir_root);
-       ctx->ir_root = NULL;
+       ctx->ir_root = nullptr;
 }
 
 int filter_visitor_ir_generate(struct filter_parser_ctx *ctx)
index 517bd5128c9f4d3d6449cd3b876d24fc9e58991b..beccd2f7ff9a9a7420f2d1bb253d55a214206093 100644 (file)
@@ -36,7 +36,7 @@ static int normalize_glob_patterns(struct ir_op *node)
        case IR_OP_LOAD:
        {
                if (node->data_type == IR_DATA_STRING) {
-                       enum ir_load_string_type type = node->u.load.u.string.type;
+                       const auto type = node->u.load.u.string.type;
                        if (type == IR_LOAD_STRING_TYPE_GLOB_STAR_END ||
                            type == IR_LOAD_STRING_TYPE_GLOB_STAR) {
                                LTTNG_ASSERT(node->u.load.u.string.value);
@@ -50,7 +50,7 @@ static int normalize_glob_patterns(struct ir_op *node)
                return normalize_glob_patterns(node->u.unary.child);
        case IR_OP_BINARY:
        {
-               int ret = normalize_glob_patterns(node->u.binary.left);
+               const auto ret = normalize_glob_patterns(node->u.binary.left);
 
                if (ret)
                        return ret;
index fd1feeed6cfcce6fed8c56158e69c90003277644..d976a15e5d31033dae0f51cc93129b727b70df26 100644 (file)
@@ -95,7 +95,7 @@ static int validate_string(struct ir_op *node)
                return validate_string(node->u.unary.child);
        case IR_OP_BINARY:
        {
-               int ret = validate_string(node->u.binary.left);
+               const auto ret = validate_string(node->u.binary.left);
 
                if (ret)
                        return ret;
index 2888404454ee5e960931aeff53cb6b636958459c..c3c8b58741194b1d779b913a8f4a355233990f86 100644 (file)
@@ -1408,7 +1408,7 @@ unsigned int get_max_possible_cpu_id() LTTNG_MAY_THROW
        }
 
        auto possible_cpu_mask_fd = [] {
-               int raw_handle = open(DEFAULT_LINUX_POSSIBLE_CPU_PATH, O_RDONLY);
+               const auto raw_handle = open(DEFAULT_LINUX_POSSIBLE_CPU_PATH, O_RDONLY);
                if (raw_handle < 0) {
                        LTTNG_THROW_POSIX(
                                lttng::format("Failed to open possible CPU file, path='{}'",
This page took 0.043217 seconds and 4 git commands to generate.