aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/complete.cpp
diff options
context:
space:
mode:
authorGravatar Kurtis Rader <krader@skepticism.us>2016-05-28 22:28:26 -0700
committerGravatar Kurtis Rader <krader@skepticism.us>2016-05-29 22:24:29 -0700
commit5bf1b0e5f500b6b99a866da32dd9002219cac6d6 (patch)
tree4622863e7f28ad7f840d6a7096057286aee4e750 /src/complete.cpp
parent3d19b549c8d9fc77597d0de95260e90f5dda2dae (diff)
fix random lint issues
This only eliminates errors reported by `make lint`. It shouldn't cause any functional changes. This change does remove several functions that are unused. It also removes the `desc_arr` variable which is both unused and out of date with reality.
Diffstat (limited to 'src/complete.cpp')
-rw-r--r--src/complete.cpp15
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;