mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-01 17:29:29 +08:00
Remove is_whitespace and whitespace character string declarations
I don't doubt such functions and character arrays could be useful, to keep things consistent, but they are not actually being used.
This commit is contained in:
parent
21ef9f5150
commit
4e555aebec
|
@ -78,7 +78,6 @@ const wchar_t *program_name;
|
||||||
int debug_level = 1; // default maximum debug output level (errors and warnings)
|
int debug_level = 1; // default maximum debug output level (errors and warnings)
|
||||||
int debug_stack_frames = 0; // default number of stack frames to show on debug() calls
|
int debug_stack_frames = 0; // default number of stack frames to show on debug() calls
|
||||||
|
|
||||||
|
|
||||||
/// Be able to restore the term's foreground process group.
|
/// Be able to restore the term's foreground process group.
|
||||||
/// This is set during startup and not modified after.
|
/// This is set during startup and not modified after.
|
||||||
static pid_t initial_fg_process_group = -1;
|
static pid_t initial_fg_process_group = -1;
|
||||||
|
@ -93,24 +92,6 @@ static volatile bool termsize_valid = false;
|
||||||
static char *wcs2str_internal(const wchar_t *in, char *out);
|
static char *wcs2str_internal(const wchar_t *in, char *out);
|
||||||
static void debug_shared(const wchar_t msg_level, const wcstring &msg);
|
static void debug_shared(const wchar_t msg_level, const wcstring &msg);
|
||||||
|
|
||||||
bool is_whitespace(wchar_t c) {
|
|
||||||
switch (c) {
|
|
||||||
case ' ':
|
|
||||||
case '\t':
|
|
||||||
case '\r':
|
|
||||||
case '\n':
|
|
||||||
case '\v':
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool is_whitespace(const wcstring &input) {
|
|
||||||
bool (*pred)(wchar_t c) = is_whitespace;
|
|
||||||
return std::all_of(input.begin(), input.end(), pred);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(OS_IS_CYGWIN) || defined(WSL)
|
#if defined(OS_IS_CYGWIN) || defined(WSL)
|
||||||
// MS Windows tty devices do not currently have either a read or write timestamp. Those
|
// MS Windows tty devices do not currently have either a read or write timestamp. Those
|
||||||
// respective fields of `struct stat` are always the current time. Which means we can't
|
// respective fields of `struct stat` are always the current time. Which means we can't
|
||||||
|
|
|
@ -217,14 +217,6 @@ extern const wchar_t *program_name;
|
||||||
/// Set to false if it's been determined we can't trust the last modified timestamp on the tty.
|
/// Set to false if it's been determined we can't trust the last modified timestamp on the tty.
|
||||||
extern const bool has_working_tty_timestamps;
|
extern const bool has_working_tty_timestamps;
|
||||||
|
|
||||||
/// A list of all whitespace characters
|
|
||||||
extern const wcstring whitespace;
|
|
||||||
extern const char *whitespace_narrow;
|
|
||||||
|
|
||||||
bool is_whitespace(const wchar_t input);
|
|
||||||
bool is_whitespace(const wcstring &input);
|
|
||||||
inline bool is_whitespace(const wchar_t *input) { return is_whitespace(wcstring(input)); }
|
|
||||||
|
|
||||||
/// This macro is used to check that an argument is true. It is a bit like a non-fatal form of
|
/// This macro is used to check that an argument is true. It is a bit like a non-fatal form of
|
||||||
/// assert. Instead of exiting on failure, the current function is ended at once. The second
|
/// assert. Instead of exiting on failure, the current function is ended at once. The second
|
||||||
/// parameter is the return value of the current function on failure.
|
/// parameter is the return value of the current function on failure.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user