From a08de507f6a7e13902605cbe46df7de37a6ebc20 Mon Sep 17 00:00:00 2001 From: James Lee-Jones Date: Thu, 11 Jul 2024 10:24:10 +0100 Subject: [PATCH] use const initialization --- src/libdredd/src/mutate_ast_consumer.cc | 2 +- src/libdredd/src/mutation_replace_binary_operator.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libdredd/src/mutate_ast_consumer.cc b/src/libdredd/src/mutate_ast_consumer.cc index c144633d..3fa777a6 100644 --- a/src/libdredd/src/mutate_ast_consumer.cc +++ b/src/libdredd/src/mutate_ast_consumer.cc @@ -146,7 +146,7 @@ void MutateAstConsumer::HandleTranslationUnit(clang::ASTContext& ast_context) { if (semantics_preserving_mutation_) { // TODO(JLJ): This should probably be moved to the prelude function. - bool rewriter_result = rewriter_.InsertTextBefore( + const bool rewriter_result = rewriter_.InsertTextBefore( start_location_of_first_function_in_source_file, "static thread_local unsigned long long int no_op = 0;\n\n"); (void)rewriter_result; // Keep release-mode compilers happy. diff --git a/src/libdredd/src/mutation_replace_binary_operator.cc b/src/libdredd/src/mutation_replace_binary_operator.cc index 6698c7a1..51cbe135 100644 --- a/src/libdredd/src/mutation_replace_binary_operator.cc +++ b/src/libdredd/src/mutation_replace_binary_operator.cc @@ -843,7 +843,7 @@ std::string MutationReplaceBinaryOperator::GenerateMutatorFunction( // updated. // TODO(JLJ): The knowledge that the last char of the type of an // assignment will always be & or * is duplicated. - std::string non_reference_type = + const std::string non_reference_type = lhs_type.substr(0, lhs_type.size() - 1); new_function << " " << non_reference_type << " arg1_original = " << arg1_evaluated << ";\n";