mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-27 14:45:13 +08:00
[clang-tidy] Remove const from strings
Found with readability-const-return-type
This commit is contained in:
parent
668f73c0d6
commit
f2e7def667
@ -205,8 +205,7 @@ bool is_windows_subsystem_for_linux() {
|
|||||||
#ifdef HAVE_BACKTRACE_SYMBOLS
|
#ifdef HAVE_BACKTRACE_SYMBOLS
|
||||||
// This function produces a stack backtrace with demangled function & method names. It is based on
|
// This function produces a stack backtrace with demangled function & method names. It is based on
|
||||||
// https://gist.github.com/fmela/591333 but adapted to the style of the fish project.
|
// https://gist.github.com/fmela/591333 but adapted to the style of the fish project.
|
||||||
[[gnu::noinline]] static const wcstring_list_t demangled_backtrace(int max_frames,
|
[[gnu::noinline]] static wcstring_list_t demangled_backtrace(int max_frames, int skip_levels) {
|
||||||
int skip_levels) {
|
|
||||||
void *callstack[128];
|
void *callstack[128];
|
||||||
const int n_max_frames = sizeof(callstack) / sizeof(callstack[0]);
|
const int n_max_frames = sizeof(callstack) / sizeof(callstack[0]);
|
||||||
int n_frames = backtrace(callstack, n_max_frames);
|
int n_frames = backtrace(callstack, n_max_frames);
|
||||||
|
@ -104,7 +104,7 @@ typedef struct complete_entry_opt {
|
|||||||
// Completion flags.
|
// Completion flags.
|
||||||
complete_flags_t flags;
|
complete_flags_t flags;
|
||||||
|
|
||||||
const wcstring localized_desc() const { return C_(desc); }
|
wcstring localized_desc() const { return C_(desc); }
|
||||||
|
|
||||||
size_t expected_dash_count() const {
|
size_t expected_dash_count() const {
|
||||||
switch (this->type) {
|
switch (this->type) {
|
||||||
|
@ -130,7 +130,7 @@ bool wreaddir_for_dirs(DIR *dir, wcstring *out_name) {
|
|||||||
return result != nullptr;
|
return result != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
const wcstring wgetcwd() {
|
wcstring wgetcwd() {
|
||||||
char cwd[PATH_MAX];
|
char cwd[PATH_MAX];
|
||||||
char *res = getcwd(cwd, sizeof(cwd));
|
char *res = getcwd(cwd, sizeof(cwd));
|
||||||
if (res) {
|
if (res) {
|
||||||
|
@ -71,7 +71,7 @@ void safe_perror(const char *message);
|
|||||||
const char *safe_strerror(int err);
|
const char *safe_strerror(int err);
|
||||||
|
|
||||||
/// Wide character version of getcwd().
|
/// Wide character version of getcwd().
|
||||||
const wcstring wgetcwd();
|
wcstring wgetcwd();
|
||||||
|
|
||||||
/// Wide character version of realpath function.
|
/// Wide character version of realpath function.
|
||||||
/// \returns the canonicalized path, or none if the path is invalid.
|
/// \returns the canonicalized path, or none if the path is invalid.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user