diff options
Diffstat (limited to 'src/complete.cpp')
-rw-r--r-- | src/complete.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/complete.cpp b/src/complete.cpp index 59da5a94..6062a055 100644 --- a/src/complete.cpp +++ b/src/complete.cpp @@ -425,7 +425,7 @@ static completion_entry_t &complete_get_exact_entry(const wcstring &cmd, bool cm void complete_set_authoritative(const wchar_t *cmd, bool cmd_is_path, bool authoritative) { CHECK(cmd, ); - scoped_lock lock(completion_lock); + scoped_lock lock(completion_lock); //!OCLINT(has side effects) completion_entry_t &c = complete_get_exact_entry(cmd, cmd_is_path); c.authoritative = authoritative; @@ -439,7 +439,7 @@ void complete_add(const wchar_t *cmd, bool cmd_is_path, const wcstring &option, assert(option.empty() == (option_type == option_type_args_only)); // Lock the lock that allows us to edit the completion entry list. - scoped_lock lock(completion_lock); + scoped_lock lock(completion_lock); //!OCLINT(has side effects) completion_entry_t &c = complete_get_exact_entry(cmd, cmd_is_path); @@ -476,7 +476,7 @@ bool completion_entry_t::remove_option(const wcstring &option, complete_option_t void complete_remove(const wcstring &cmd, bool cmd_is_path, const wcstring &option, complete_option_type_t type) { - scoped_lock lock(completion_lock); + scoped_lock lock(completion_lock); //!OCLINT(has side effects) completion_entry_t tmp_entry(cmd, cmd_is_path, false); completion_entry_set_t::iterator iter = completion_set.find(tmp_entry); @@ -493,7 +493,7 @@ void complete_remove(const wcstring &cmd, bool cmd_is_path, const wcstring &opti } void complete_remove_all(const wcstring &cmd, bool cmd_is_path) { - scoped_lock lock(completion_lock); + scoped_lock lock(completion_lock); //!OCLINT(has side effects) completion_entry_t tmp_entry(cmd, cmd_is_path, false); completion_set.erase(tmp_entry); @@ -1340,6 +1340,7 @@ void complete(const wcstring &cmd_with_subcmds, std::vector<completion_t> *out_c } } + // cppcheck-suppress nullPointerRedundantCheck if (cmd_node && cmd_node->location_in_or_at_end_of_source_range(pos)) { // Complete command filename. completer.complete_cmd(current_token, use_function, use_builtin, use_command, @@ -1478,7 +1479,7 @@ static void append_switch(wcstring &out, const wcstring &opt, const wcstring &ar wcstring complete_print() { wcstring out; - scoped_lock locker(completion_lock); + scoped_lock locker(completion_lock); //!OCLINT(side-effect) // Get a list of all completions in a vector, then sort it by order. std::vector<const completion_entry_t *> all_completions; @@ -1595,7 +1596,7 @@ wcstring_list_t complete_get_wrap_chain(const wcstring &command) { if (command.empty()) { return wcstring_list_t(); } - scoped_lock locker(wrapper_lock); + scoped_lock locker(wrapper_lock); //!OCLINT(side-effect) const wrapper_map_t &wraps = wrap_map(); wcstring_list_t result; @@ -1631,7 +1632,7 @@ wcstring_list_t complete_get_wrap_chain(const wcstring &command) { wcstring_list_t complete_get_wrap_pairs() { wcstring_list_t result; - scoped_lock locker(wrapper_lock); + scoped_lock locker(wrapper_lock); //!OCLINT(side-effect) const wrapper_map_t &wraps = wrap_map(); for (wrapper_map_t::const_iterator outer = wraps.begin(); outer != wraps.end(); ++outer) { const wcstring &cmd = outer->first; |