Set of fixes for issues identified by cppcheck

This commit is contained in:
ridiculousfish
2014-10-30 22:40:35 -07:00
parent 173a6a71c0
commit a529fc9d83
13 changed files with 9 additions and 139 deletions

View File

@@ -97,14 +97,6 @@ void env_universal_common_init(void (*cb)(fish_message_type_t type, const wchar_
callback = cb;
}
/**
Remove variable with specified name
*/
bool env_universal_common_remove(const wcstring &name)
{
return default_universal_vars().remove(name);
}
/**
Test if the message msg contains the command cmd
*/
@@ -120,19 +112,6 @@ static bool match(const wchar_t *msg, const wchar_t *cmd)
return true;
}
void env_universal_common_set(const wchar_t *key, const wchar_t *val, bool exportv)
{
CHECK(key,);
CHECK(val,);
default_universal_vars().set(key, val, exportv);
if (callback)
{
callback(exportv?SET_EXPORT:SET, key, val);
}
}
static void report_error(int err_code, const wchar_t *err_format, ...)
{
va_list va;
@@ -252,23 +231,6 @@ static bool append_file_entry(fish_message_type_t type, const wcstring &key_in,
return success;
}
wcstring_list_t env_universal_get_names(bool show_exported, bool show_unexported)
{
return default_universal_vars().get_names(show_exported, show_unexported);
}
env_var_t env_universal_get(const wcstring &name)
{
return default_universal_vars().get(name);
}
bool env_universal_common_get_export(const wcstring &name)
{
return default_universal_vars().get_export(name);
}
env_universal_t::env_universal_t(const wcstring &path) : explicit_vars_path(path), tried_renaming(false), last_read_file(kInvalidFileID)
{
VOMIT_ON_FAILURE(pthread_mutex_init(&lock, NULL));