clang-tidy: apply suggested fixes
[lttng-tools.git] / src / common / hashtable / hashtable.cpp
index be7e77342df8b6d7c297f135c87194c9921cf47d..a410fc41cb59c7d66af239546c96e92401af8a10 100644 (file)
@@ -273,7 +273,7 @@ void lttng_ht_add_unique_str(struct lttng_ht *ht, struct lttng_ht_node_str *node
        LTTNG_ASSERT(node);
 
        /* RCU read lock protects from ABA. */
-       lttng::urcu::read_lock_guard read_lock;
+       const lttng::urcu::read_lock_guard read_lock;
        node_ptr = cds_lfht_add_unique(ht->ht,
                                       ht->hash_fct(node->key, lttng_ht_seed),
                                       ht->match_fct,
@@ -292,7 +292,7 @@ void lttng_ht_add_str(struct lttng_ht *ht, struct lttng_ht_node_str *node)
        LTTNG_ASSERT(node);
 
        /* RCU read lock protects from ABA. */
-       lttng::urcu::read_lock_guard read_lock;
+       const lttng::urcu::read_lock_guard read_lock;
        cds_lfht_add(ht->ht, ht->hash_fct(node->key, lttng_ht_seed), &node->node);
 }
 
@@ -306,7 +306,7 @@ void lttng_ht_add_ulong(struct lttng_ht *ht, struct lttng_ht_node_ulong *node)
        LTTNG_ASSERT(node);
 
        /* RCU read lock protects from ABA. */
-       lttng::urcu::read_lock_guard read_lock;
+       const lttng::urcu::read_lock_guard read_lock;
        cds_lfht_add(ht->ht, ht->hash_fct((void *) node->key, lttng_ht_seed), &node->node);
 }
 
@@ -320,7 +320,7 @@ void lttng_ht_add_u64(struct lttng_ht *ht, struct lttng_ht_node_u64 *node)
        LTTNG_ASSERT(node);
 
        /* RCU read lock protects from ABA. */
-       lttng::urcu::read_lock_guard read_lock;
+       const lttng::urcu::read_lock_guard read_lock;
        cds_lfht_add(ht->ht, ht->hash_fct(&node->key, lttng_ht_seed), &node->node);
 }
 
@@ -335,7 +335,7 @@ void lttng_ht_add_unique_ulong(struct lttng_ht *ht, struct lttng_ht_node_ulong *
        LTTNG_ASSERT(node);
 
        /* RCU read lock protects from ABA. */
-       lttng::urcu::read_lock_guard read_lock;
+       const lttng::urcu::read_lock_guard read_lock;
        node_ptr = cds_lfht_add_unique(ht->ht,
                                       ht->hash_fct((void *) node->key, lttng_ht_seed),
                                       ht->match_fct,
@@ -355,7 +355,7 @@ void lttng_ht_add_unique_u64(struct lttng_ht *ht, struct lttng_ht_node_u64 *node
        LTTNG_ASSERT(node);
 
        /* RCU read lock protects from ABA. */
-       lttng::urcu::read_lock_guard read_lock;
+       const lttng::urcu::read_lock_guard read_lock;
        node_ptr = cds_lfht_add_unique(ht->ht,
                                       ht->hash_fct(&node->key, lttng_ht_seed),
                                       ht->match_fct,
@@ -375,7 +375,7 @@ void lttng_ht_add_unique_two_u64(struct lttng_ht *ht, struct lttng_ht_node_two_u
        LTTNG_ASSERT(node);
 
        /* RCU read lock protects from ABA. */
-       lttng::urcu::read_lock_guard read_lock;
+       const lttng::urcu::read_lock_guard read_lock;
        node_ptr = cds_lfht_add_unique(ht->ht,
                                       ht->hash_fct((void *) &node->key, lttng_ht_seed),
                                       ht->match_fct,
@@ -396,7 +396,7 @@ struct lttng_ht_node_ulong *lttng_ht_add_replace_ulong(struct lttng_ht *ht,
        LTTNG_ASSERT(node);
 
        /* RCU read lock protects from ABA. */
-       lttng::urcu::read_lock_guard read_lock;
+       const lttng::urcu::read_lock_guard read_lock;
        node_ptr = cds_lfht_add_replace(ht->ht,
                                        ht->hash_fct((void *) node->key, lttng_ht_seed),
                                        ht->match_fct,
@@ -421,7 +421,7 @@ struct lttng_ht_node_u64 *lttng_ht_add_replace_u64(struct lttng_ht *ht,
        LTTNG_ASSERT(node);
 
        /* RCU read lock protects from ABA. */
-       lttng::urcu::read_lock_guard read_lock;
+       const lttng::urcu::read_lock_guard read_lock;
        node_ptr = cds_lfht_add_replace(ht->ht,
                                        ht->hash_fct(&node->key, lttng_ht_seed),
                                        ht->match_fct,
@@ -447,7 +447,7 @@ int lttng_ht_del(struct lttng_ht *ht, struct lttng_ht_iter *iter)
        LTTNG_ASSERT(iter);
 
        /* RCU read lock protects from ABA. */
-       lttng::urcu::read_lock_guard read_lock;
+       const lttng::urcu::read_lock_guard read_lock;
        ret = cds_lfht_del(ht->ht, iter->iter.node);
        return ret;
 }
@@ -488,7 +488,7 @@ unsigned long lttng_ht_get_count(struct lttng_ht *ht)
        LTTNG_ASSERT(ht->ht);
 
        /* RCU read lock protects from ABA and allows RCU traversal. */
-       lttng::urcu::read_lock_guard read_lock;
+       const lttng::urcu::read_lock_guard read_lock;
        cds_lfht_count_nodes(ht->ht, &scb, &count, &sca);
 
        return count;
This page took 0.024849 seconds and 4 git commands to generate.