mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-18 20:11:15 -03:00
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.
This commit is contained in:
@@ -63,7 +63,7 @@ static bool is_autoload = false;
|
||||
/// loaded.
|
||||
static int load(const wcstring &name) {
|
||||
ASSERT_IS_MAIN_THREAD();
|
||||
scoped_lock lock(functions_lock);
|
||||
scoped_lock lock(functions_lock); //!OCLINT(has side effects)
|
||||
bool was_autoload = is_autoload;
|
||||
int res;
|
||||
|
||||
@@ -163,7 +163,7 @@ void function_add(const function_data_t &data, const parser_t &parser, int defin
|
||||
|
||||
CHECK(!data.name.empty(), );
|
||||
CHECK(data.definition, );
|
||||
scoped_lock lock(functions_lock);
|
||||
scoped_lock lock(functions_lock); //!OCLINT(has side effects)
|
||||
|
||||
// Remove the old function.
|
||||
function_remove(data.name);
|
||||
@@ -184,21 +184,21 @@ void function_add(const function_data_t &data, const parser_t &parser, int defin
|
||||
|
||||
int function_exists(const wcstring &cmd) {
|
||||
if (parser_keywords_is_reserved(cmd)) return 0;
|
||||
scoped_lock lock(functions_lock);
|
||||
scoped_lock lock(functions_lock); //!OCLINT(has side effects)
|
||||
load(cmd);
|
||||
return loaded_functions.find(cmd) != loaded_functions.end();
|
||||
}
|
||||
|
||||
void function_load(const wcstring &cmd) {
|
||||
if (!parser_keywords_is_reserved(cmd)) {
|
||||
scoped_lock lock(functions_lock);
|
||||
scoped_lock lock(functions_lock); //!OCLINT(has side effects)
|
||||
load(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
int function_exists_no_autoload(const wcstring &cmd, const env_vars_snapshot_t &vars) {
|
||||
if (parser_keywords_is_reserved(cmd)) return 0;
|
||||
scoped_lock lock(functions_lock);
|
||||
scoped_lock lock(functions_lock); //!OCLINT(has side effects)
|
||||
return loaded_functions.find(cmd) != loaded_functions.end() ||
|
||||
function_autoloader.can_load(cmd, vars);
|
||||
}
|
||||
@@ -248,25 +248,25 @@ bool function_get_definition(const wcstring &name, wcstring *out_definition) {
|
||||
}
|
||||
|
||||
wcstring_list_t function_get_named_arguments(const wcstring &name) {
|
||||
scoped_lock lock(functions_lock);
|
||||
scoped_lock lock(functions_lock); //!OCLINT(has side effects)
|
||||
const function_info_t *func = function_get(name);
|
||||
return func ? func->named_arguments : wcstring_list_t();
|
||||
}
|
||||
|
||||
std::map<wcstring, env_var_t> function_get_inherit_vars(const wcstring &name) {
|
||||
scoped_lock lock(functions_lock);
|
||||
scoped_lock lock(functions_lock); //!OCLINT(has side effects)
|
||||
const function_info_t *func = function_get(name);
|
||||
return func ? func->inherit_vars : std::map<wcstring, env_var_t>();
|
||||
}
|
||||
|
||||
int function_get_shadow_builtin(const wcstring &name) {
|
||||
scoped_lock lock(functions_lock);
|
||||
scoped_lock lock(functions_lock); //!OCLINT(has side effects)
|
||||
const function_info_t *func = function_get(name);
|
||||
return func ? func->shadow_builtin : false;
|
||||
}
|
||||
|
||||
int function_get_shadow_scope(const wcstring &name) {
|
||||
scoped_lock lock(functions_lock);
|
||||
scoped_lock lock(functions_lock); //!OCLINT(has side effects)
|
||||
const function_info_t *func = function_get(name);
|
||||
return func ? func->shadow_scope : false;
|
||||
}
|
||||
@@ -285,7 +285,7 @@ bool function_get_desc(const wcstring &name, wcstring *out_desc) {
|
||||
|
||||
void function_set_desc(const wcstring &name, const wcstring &desc) {
|
||||
load(name);
|
||||
scoped_lock lock(functions_lock);
|
||||
scoped_lock lock(functions_lock); //!OCLINT(has side effects)
|
||||
function_map_t::iterator iter = loaded_functions.find(name);
|
||||
if (iter != loaded_functions.end()) {
|
||||
iter->second.description = desc;
|
||||
@@ -309,7 +309,7 @@ bool function_copy(const wcstring &name, const wcstring &new_name) {
|
||||
|
||||
wcstring_list_t function_get_names(int get_hidden) {
|
||||
std::set<wcstring> names;
|
||||
scoped_lock lock(functions_lock);
|
||||
scoped_lock lock(functions_lock); //!OCLINT(has side effects)
|
||||
autoload_names(names, get_hidden);
|
||||
|
||||
function_map_t::const_iterator iter;
|
||||
@@ -326,13 +326,13 @@ wcstring_list_t function_get_names(int get_hidden) {
|
||||
}
|
||||
|
||||
const wchar_t *function_get_definition_file(const wcstring &name) {
|
||||
scoped_lock lock(functions_lock);
|
||||
scoped_lock lock(functions_lock); //!OCLINT(has side effects)
|
||||
const function_info_t *func = function_get(name);
|
||||
return func ? func->definition_file : NULL;
|
||||
}
|
||||
|
||||
int function_get_definition_offset(const wcstring &name) {
|
||||
scoped_lock lock(functions_lock);
|
||||
scoped_lock lock(functions_lock); //!OCLINT(has side effects)
|
||||
const function_info_t *func = function_get(name);
|
||||
return func ? func->definition_offset : -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user