Skip to content

Commit

Permalink
#116 replace move with std::move to fix R CMD check warning on recent…
Browse files Browse the repository at this point in the history
… versions of clang compilers
  • Loading branch information
jwijffels committed Jan 4, 2023
1 parent 46346a1 commit 6a974c5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: udpipe
Type: Package
Title: Tokenization, Parts of Speech Tagging, Lemmatization and Dependency
Parsing with the 'UDPipe' 'NLP' Toolkit
Version: 0.8.10
Version: 0.8.11
Maintainer: Jan Wijffels <[email protected]>
Authors@R: c(
person('Jan', 'Wijffels', role = c('aut', 'cre', 'cph'), email = '[email protected]'),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## CHANGES IN udpipe VERSION 0.8.11

- replace move with std::move to fix R CMD check warning on recent versions of clang compilers

## CHANGES IN udpipe VERSION 0.8.10

- use snprintf instead of sprintf to handle the R CMD check deprecating note on M1mac
Expand Down
12 changes: 6 additions & 6 deletions src/udpipe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10966,7 +10966,7 @@ void tagset_converter_unique_generated(vector<tagged_lemma_forms>& forms) {
if (forms[j].lemma == forms[i].lemma) {
// Same lemma was found. Merge form-tag pairs
for (auto&& tagged_form : forms[j].forms)
forms[i].forms.emplace_back(move(tagged_form));
forms[i].forms.emplace_back(std::move(tagged_form));

// Remove lemma j by moving it to end and deleting
if (j < forms.size() - 1) {
Expand Down Expand Up @@ -17681,7 +17681,7 @@ unique_ptr<transition_oracle::tree_oracle> transition_system_swap_oracle_static:
create_projective_component(t, node, projective_components, node);
}

return unique_ptr<transition_oracle::tree_oracle>(new tree_oracle_static(labels, root_label, gold, move(projective_order), move(projective_components)));
return unique_ptr<transition_oracle::tree_oracle>(new tree_oracle_static(labels, root_label, gold, std::move(projective_order), std::move(projective_components)));
}

void transition_system_swap_oracle_static::create_projective_order(const tree& gold, int node, vector<int>& projective_order, int& projective_index) const {
Expand Down Expand Up @@ -18662,21 +18662,21 @@ bool input_format_presegmented_tokenizer::next_sentence(sentence& s, string& err
// Append words
size_t words = s.words.size() - 1;
for (size_t i = 1; i < partial.words.size(); i++) {
s.words.push_back(move(partial.words[i]));
s.words.push_back(std::move(partial.words[i]));
s.words.back().id += words;
if (s.words.back().head > 0) s.words.back().head += words;
}

// Append multiword_tokens
for (auto&& multiword_token : partial.multiword_tokens) {
s.multiword_tokens.push_back(move(multiword_token));
s.multiword_tokens.push_back(std::move(multiword_token));
s.multiword_tokens.back().id_first += words;
s.multiword_tokens.back().id_last += words;
}

// Append empty nodes
for (auto&& empty_node : partial.empty_nodes) {
s.empty_nodes.push_back(move(empty_node));
s.empty_nodes.push_back(std::move(empty_node));
s.empty_nodes.back().id += words;
}
}
Expand Down Expand Up @@ -19429,7 +19429,7 @@ void sentence::set_comment(string_piece name, string_piece value) {
for (size_t i = 0; i < value.len; i++)
comment.push_back(value.str[i] == '\r' || value.str[i] == '\n' ? ' ' : value.str[i]);
}
comments.push_back(move(comment));
comments.push_back(std::move(comment));
}

/////////
Expand Down

0 comments on commit 6a974c5

Please sign in to comment.