From 4aca034e26e3b48c9949a538334533cf79bb67ce Mon Sep 17 00:00:00 2001 From: mingodad Date: Thu, 22 Jun 2023 14:34:33 +0200 Subject: [PATCH] Add 'std::' in several places as suggested by clang --- src/lalr/Grammar.cpp | 8 ++++---- src/lalr/GrammarCompiler.cpp | 8 ++++---- src/lalr/RegexCompiler.cpp | 8 ++++---- src/lalr/RegexGenerator.cpp | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/lalr/Grammar.cpp b/src/lalr/Grammar.cpp index 1156ad8..7adc17a 100644 --- a/src/lalr/Grammar.cpp +++ b/src/lalr/Grammar.cpp @@ -369,7 +369,7 @@ GrammarSymbol* Grammar::add_symbol( const char* lexeme, int line, LexemeType lex symbol->set_line( line ); symbol->set_lexeme_type( lexeme_type ); symbol->set_symbol_type( symbol_type ); - symbols_.push_back( move(symbol) ); + symbols_.push_back( std::move(symbol) ); return symbols_.back().get(); } @@ -389,12 +389,12 @@ GrammarProduction* Grammar::add_production( GrammarSymbol* symbol, int line ) unique_ptr production( new GrammarProduction(int(productions_.size()), start_symbol_, 0, 0, NULL) ); production->append_symbol( symbol ); start_symbol_->append_production( production.get() ); - productions_.push_back( move(production) ); + productions_.push_back( std::move(production) ); } unique_ptr production( new GrammarProduction(int(productions_.size()), symbol, line, -1, nullptr) ); symbol->append_production( production.get() ); - productions_.push_back( move(production) ); + productions_.push_back( std::move(production) ); return productions_.back().get(); } @@ -410,7 +410,7 @@ GrammarAction* Grammar::add_action( const char* identifier ) { int index = int(actions_.size()); unique_ptr action( new GrammarAction(index, identifier) ); - actions_.push_back( move(action) ); + actions_.push_back( std::move(action) ); return actions_.back().get(); } return i->get(); diff --git a/src/lalr/GrammarCompiler.cpp b/src/lalr/GrammarCompiler.cpp index 29b0065..db53e95 100644 --- a/src/lalr/GrammarCompiler.cpp +++ b/src/lalr/GrammarCompiler.cpp @@ -149,7 +149,7 @@ void GrammarCompiler::set_actions( std::unique_ptr& actions, int LALR_ASSERT( parser_state_machine_ ); LALR_ASSERT( actions || actions_size == 0 ); LALR_ASSERT( actions_size >= 0 ); - actions_ = move( actions ); + actions_ = std::move( actions ); parser_state_machine_->actions_size = actions_size; parser_state_machine_->actions = actions_.get(); } @@ -159,7 +159,7 @@ void GrammarCompiler::set_symbols( std::unique_ptr& symbols, int LALR_ASSERT( parser_state_machine_ ); LALR_ASSERT( symbols ); LALR_ASSERT( symbols_size >= 3 ); - symbols_ = move( symbols ); + symbols_ = std::move( symbols ); parser_state_machine_->symbols_size = symbols_size; parser_state_machine_->symbols = symbols_.get(); parser_state_machine_->start_symbol = &symbols_[0]; @@ -172,7 +172,7 @@ void GrammarCompiler::set_transitions( std::unique_ptr& tran { LALR_ASSERT( transitions ); LALR_ASSERT( transitions_size >= 0 ); - transitions_ = move( transitions ); + transitions_ = std::move( transitions ); parser_state_machine_->transitions_size = transitions_size; parser_state_machine_->transitions = transitions_.get(); } @@ -182,7 +182,7 @@ void GrammarCompiler::set_states( std::unique_ptr& states, int st LALR_ASSERT( states ); LALR_ASSERT( states_size >= 0 ); LALR_ASSERT( start_state ); - states_ = move( states ); + states_ = std::move( states ); parser_state_machine_->states_size = states_size; parser_state_machine_->states = states_.get(); parser_state_machine_->start_state = start_state; diff --git a/src/lalr/RegexCompiler.cpp b/src/lalr/RegexCompiler.cpp index 5db6a13..34fa977 100644 --- a/src/lalr/RegexCompiler.cpp +++ b/src/lalr/RegexCompiler.cpp @@ -21,7 +21,7 @@ RegexCompiler::RegexCompiler() , actions_() , transitions_() , states_() -, state_machine_() +, state_machine_() { } @@ -64,21 +64,21 @@ const char* RegexCompiler::add_string( const std::string& string ) void RegexCompiler::set_actions( std::unique_ptr& actions, int actions_size ) { - actions_ = move( actions ); + actions_ = std::move( actions ); state_machine_->actions_size = actions_size; state_machine_->actions = actions_.get(); } void RegexCompiler::set_transitions( std::unique_ptr& transitions, int transitions_size ) { - transitions_ = move( transitions ); + transitions_ = std::move( transitions ); state_machine_->transitions_size = transitions_size; state_machine_->transitions = transitions_.get(); } void RegexCompiler::set_states( std::unique_ptr& states, int states_size, const LexerState* start_state ) { - states_ = move( states ); + states_ = std::move( states ); state_machine_->states_size = states_size; state_machine_->states = states_.get(); state_machine_->start_state = start_state; diff --git a/src/lalr/RegexGenerator.cpp b/src/lalr/RegexGenerator.cpp index d2b9999..a64e15f 100644 --- a/src/lalr/RegexGenerator.cpp +++ b/src/lalr/RegexGenerator.cpp @@ -143,7 +143,7 @@ const RegexAction* RegexGenerator::add_lexer_action( const std::string& identifi if ( i == actions_.end() ) { unique_ptr action( new RegexAction(int(actions_.size()), identifier) ); - actions_.push_back( move(action) ); + actions_.push_back( std::move(action) ); i = actions_.end() - 1; } return i->get(); @@ -241,7 +241,7 @@ void RegexGenerator::generate_states( const RegexSyntaxTree& syntax_tree ) state->add_item( syntax_tree.node()->get_first_positions() ); generate_symbol_for_state( state.get() ); start_state_ = state.get(); - states_.insert( move(state) ); + states_.insert( std::move(state) ); vector next_states; vector states; @@ -287,7 +287,7 @@ void RegexGenerator::generate_states( const RegexSyntaxTree& syntax_tree ) state->add_transition( begin, end, goto_state.get() ); generate_symbol_for_state( goto_state.get() ); next_states.push_back(goto_state.get() ); - states_.insert( move(goto_state) ); + states_.insert( std::move(goto_state) ); } else {