Run clang-format on all files

The main change here is to reorder headers.
This commit is contained in:
ridiculousfish 2019-10-13 15:50:48 -07:00
parent e73e9c3e2e
commit 82eca4bc86
110 changed files with 250 additions and 171 deletions

View file

@ -4,15 +4,15 @@
#include "config.h" // IWYU pragma: keep
#include "common.h"
#include "env.h"
#include "wutil.h"
#include <cassert>
#include <memory>
#include <unordered_map>
#include <unordered_set>
#include "common.h"
#include "env.h"
#include "wutil.h"
class autoload_file_cache_t;
class environment_t;
class parser_t;

View file

@ -17,17 +17,18 @@
// 4). Use 'git add sphinx_doc_src/NAME.txt' to start tracking changes to the documentation file.
#include "config.h" // IWYU pragma: keep
#include "builtin.h"
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <cstring>
#include <cwchar>
#include <algorithm>
#include <cstring>
#include <cwchar>
#include <memory>
#include <string>
#include "builtin.h"
#include "builtin_argparse.h"
#include "builtin_bg.h"
#include "builtin_bind.h"

View file

@ -3,12 +3,14 @@
// See issue #4190 for the rationale behind the original behavior of this builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_argparse.h"
#include <errno.h>
#include <stddef.h>
#include <stdint.h>
#include <cwchar>
#include <algorithm>
#include <cwchar>
#include <memory>
#include <string>
#include <unordered_map>
@ -16,7 +18,6 @@
#include <vector>
#include "builtin.h"
#include "builtin_argparse.h"
#include "common.h"
#include "env.h"
#include "exec.h"

View file

@ -1,6 +1,8 @@
// Implementation of the bg builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_bg.h"
#include <errno.h>
#include <stdlib.h>
@ -8,7 +10,6 @@
#include <vector>
#include "builtin.h"
#include "builtin_bg.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"

View file

@ -1,6 +1,8 @@
// Implementation of the bind builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_bind.h"
#include <errno.h>
#include <stddef.h>
@ -10,7 +12,6 @@
#include <vector>
#include "builtin.h"
#include "builtin_bind.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "input.h" // IWYU pragma: keep

View file

@ -1,10 +1,11 @@
// Implementation of the bind builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_block.h"
#include <stddef.h>
#include "builtin.h"
#include "builtin_block.h"
#include "common.h"
#include "event.h"
#include "fallback.h" // IWYU pragma: keep

View file

@ -1,12 +1,13 @@
// Implementation of the builtin builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin.h"
#include <stddef.h>
#include <algorithm>
#include <string>
#include "builtin.h"
#include "builtin_builtin.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep

View file

@ -1,12 +1,13 @@
// Implementation of the cd builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_cd.h"
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "builtin.h"
#include "builtin_cd.h"
#include "common.h"
#include "env.h"
#include "fallback.h" // IWYU pragma: keep

View file

@ -1,12 +1,13 @@
// Implementation of the command builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_command.h"
#include <unistd.h>
#include <string>
#include "builtin.h"
#include "builtin_command.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"

View file

@ -4,6 +4,7 @@
#include <errno.h>
#include <stddef.h>
#include <stdlib.h>
#include <cwchar>
#include "builtin.h"

View file

@ -2,23 +2,23 @@
#include "config.h" // IWYU pragma: keep
#include <stddef.h>
#include <cwchar>
#include <cwchar>
#include <memory>
#include <string>
#include <vector>
#include "builtin.h"
#include "color.h"
#include "common.h"
#include "complete.h"
#include "env.h"
#include "fallback.h" // IWYU pragma: keep
#include "highlight.h"
#include "io.h"
#include "parse_constants.h"
#include "parse_util.h"
#include "parser.h"
#include "highlight.h"
#include "color.h"
#include "reader.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep

View file

@ -2,9 +2,8 @@
#ifndef FISH_BUILTIN_COMPLETE_H
#define FISH_BUILTIN_COMPLETE_H
#include <cwchar>
#include <cstring>
#include <cwchar>
class parser_t;

View file

@ -1,11 +1,13 @@
// Implementation of the contains builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_contains.h"
#include <unistd.h>
#include <cwchar>
#include "builtin.h"
#include "builtin_contains.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"

View file

@ -1,13 +1,14 @@
// Implementation of the disown builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_disown.h"
#include <errno.h>
#include <signal.h>
#include <set>
#include "builtin.h"
#include "builtin_disown.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"

View file

@ -1,11 +1,12 @@
// Implementation of the echo builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_echo.h"
#include <limits.h>
#include <stddef.h>
#include "builtin.h"
#include "builtin_echo.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"

View file

@ -1,8 +1,9 @@
// Implementation of the emit builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin.h"
#include "builtin_emit.h"
#include "builtin.h"
#include "common.h"
#include "event.h"
#include "fallback.h" // IWYU pragma: keep

View file

@ -1,11 +1,12 @@
// Implementation of the exit builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_exit.h"
#include <errno.h>
#include <stddef.h>
#include "builtin.h"
#include "builtin_exit.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"

View file

@ -1,13 +1,15 @@
// Implementation of the fg builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_fg.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <cwchar>
#include "builtin.h"
#include "builtin_fg.h"
#include "common.h"
#include "env.h"
#include "fallback.h" // IWYU pragma: keep

View file

@ -1,6 +1,8 @@
// Implementation of the function builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_function.h"
#include <errno.h>
#include <stddef.h>
#include <stdlib.h>
@ -11,7 +13,6 @@
#include <vector>
#include "builtin.h"
#include "builtin_function.h"
#include "common.h"
#include "complete.h"
#include "event.h"

View file

@ -1,11 +1,13 @@
// Implementation of the functions builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_functions.h"
#include <stddef.h>
#include <unistd.h>
#include <cwchar>
#include <algorithm>
#include <cwchar>
#include <map>
#include <memory>
#include <string>
@ -13,7 +15,6 @@
#include <vector>
#include "builtin.h"
#include "builtin_functions.h"
#include "common.h"
#include "complete.h"
#include "env.h"
@ -266,7 +267,8 @@ static int report_function_metadata(const wchar_t *funcname, bool verbose, io_st
append_format(comment, L"# Defined in %ls @ line %d\n", path, line_number);
if (!streams.out_is_redirected && isatty(STDOUT_FILENO)) {
std::vector<highlight_spec_t> colors;
highlight_shell_no_io(comment, colors, comment.size(), nullptr, env_stack_t::globals());
highlight_shell_no_io(comment, colors, comment.size(), nullptr,
env_stack_t::globals());
streams.out.append(str2wcstring(colorize(comment, colors)));
} else {
streams.out.append(comment);

View file

@ -1,16 +1,17 @@
// Implementation of the history builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_history.h"
#include <errno.h>
#include <stddef.h>
#include <stdint.h>
#include <cwchar>
#include <cwchar>
#include <string>
#include <vector>
#include "builtin.h"
#include "builtin_history.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "history.h"

View file

@ -2,9 +2,8 @@
#ifndef FISH_BUILTIN_JOBS_H
#define FISH_BUILTIN_JOBS_H
#include <cwchar>
#include <cstring>
#include <cwchar>
class parser_t;

View file

@ -1,22 +1,22 @@
// Implementation of the math builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_math.h"
#include <errno.h>
#include <stddef.h>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <limits>
#include <string>
#include "tinyexpr.h"
#include "builtin.h"
#include "builtin_math.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "tinyexpr.h"
#include "wgetopt.h"
#include "wutil.h" // IWYU pragma: keep

View file

@ -59,6 +59,7 @@
#include <stdlib.h>
#include <sys/types.h>
#include <wctype.h>
#include <cstring>
#include <cwchar>

View file

@ -2,9 +2,8 @@
#ifndef FISH_BUILTIN_PRINTF_H
#define FISH_BUILTIN_PRINTF_H
#include <cwchar>
#include <cstring>
#include <cwchar>
class parser_t;

View file

@ -1,10 +1,11 @@
// Implementation of the pwd builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_pwd.h"
#include <cstring>
#include "builtin.h"
#include "builtin_pwd.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"

View file

@ -1,15 +1,16 @@
// Implementation of the random builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_random.h"
#include <errno.h>
#include <stdint.h>
#include <cwchar>
#include <algorithm>
#include <cwchar>
#include <random>
#include "builtin.h"
#include "builtin_random.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"

View file

@ -1,23 +1,24 @@
// Implementation of the read builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_read.h"
#include <errno.h>
#include <limits.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <cstring>
#include <cwchar>
#include <algorithm>
#include <cstring>
#include <cwchar>
#include <memory>
#include <numeric>
#include <string>
#include <vector>
#include "builtin.h"
#include "builtin_read.h"
#include "common.h"
#include "complete.h"
#include "env.h"

View file

@ -1,13 +1,15 @@
// Implementation of the realpath builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_realpath.h"
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <cwchar>
#include "builtin.h"
#include "builtin_realpath.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"

View file

@ -1,11 +1,12 @@
// Implementation of the return builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_return.h"
#include <errno.h>
#include <stddef.h>
#include "builtin.h"
#include "builtin_return.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"

View file

@ -6,10 +6,10 @@
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
#include <cstring>
#include <cwchar>
#include <algorithm>
#include <cstring>
#include <cwchar>
#include <iterator>
#include <memory>
#include <set>

View file

@ -2,9 +2,8 @@
#ifndef FISH_BUILTIN_SET_H
#define FISH_BUILTIN_SET_H
#include <cwchar>
#include <cstring>
#include <cwchar>
class parser_t;

View file

@ -2,9 +2,8 @@
#ifndef FISH_BUILTIN_SET_COLOR_H
#define FISH_BUILTIN_SET_COLOR_H
#include <cwchar>
#include <cstring>
#include <cwchar>
class parser_t;

View file

@ -1,13 +1,15 @@
// Implementation of the source builtin.
#include "config.h" // IWYU pragma: keep
#include "builtin_source.h"
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
#include <cwchar>
#include "builtin.h"
#include "builtin_source.h"
#include "common.h"
#include "env.h"
#include "fallback.h" // IWYU pragma: keep

View file

@ -1,13 +1,14 @@
// Implementation of the status builtin.
#include "config.h" // IWYU pragma: keep
#include <stddef.h>
#include <cwchar>
#include "builtin_status.h"
#include <stddef.h>
#include <cwchar>
#include <string>
#include "builtin.h"
#include "builtin_status.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "future_feature_flags.h"

View file

@ -12,9 +12,9 @@
#include <stdint.h>
#include <stdlib.h>
#include <wctype.h>
#include <cwchar>
#include <algorithm>
#include <cwchar>
#include <cwctype>
#include <iterator>
#include <memory>

View file

@ -2,9 +2,8 @@
#ifndef FISH_BUILTIN_STRING_H
#define FISH_BUILTIN_STRING_H
#include <cwchar>
#include <cstring>
#include <cwchar>
class parser_t;

View file

@ -3,22 +3,23 @@
// Implemented from scratch (yes, really) by way of IEEE 1003.1 as reference.
#include "config.h" // IWYU pragma: keep
#include "builtin.h"
#include <errno.h>
#include <stdarg.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <wctype.h>
#include <cstring>
#include <cwchar>
#include <cmath>
#include <cstring>
#include <cwchar>
#include <memory>
#include <string>
#include <type_traits>
#include <utility>
#include "builtin.h"
#include "common.h"
#include "io.h"
#include "parser.h"

View file

@ -2,9 +2,8 @@
#ifndef FISH_BUILTIN_ULIMIT_H
#define FISH_BUILTIN_ULIMIT_H
#include <cwchar>
#include <cstring>
#include <cwchar>
class parser_t;

View file

@ -1,9 +1,12 @@
// Functions for waiting for processes completed.
#include "builtin_wait.h"
#include <sys/wait.h>
#include <algorithm>
#include <vector>
#include "builtin.h"
#include "builtin_wait.h"
#include "common.h"
#include "parser.h"
#include "proc.h"
@ -11,8 +14,6 @@
#include "wgetopt.h"
#include "wutil.h"
#include <sys/wait.h>
/// Return the job id to which the process with pid belongs.
/// If a specified process has already finished but the job hasn't, parser_t::job_get_from_pid()
/// doesn't work properly, so use this function in wait command.

View file

@ -3,6 +3,7 @@
#define FISH_BUILTIN_WAIT_H
class parser_t;
struct io_streams_t;
int builtin_wait(parser_t &parser, io_streams_t &streams, wchar_t **argv);
#endif

View file

@ -1,12 +1,14 @@
// Color class implementation.
#include "config.h" // IWYU pragma: keep
#include "color.h"
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <cwchar> // IWYU pragma: keep
#include "color.h"
#include "common.h"
#include "fallback.h" // IWYU pragma: keep

View file

@ -3,7 +3,6 @@
#define FISH_COLOR_H
#include <cstring>
#include <string>
#include "common.h"

View file

@ -19,6 +19,7 @@
#include <termios.h>
#include <unistd.h>
#include <wctype.h>
#include <cstring>
#include <cwchar>
#ifdef HAVE_EXECINFO_H

View file

@ -5,15 +5,17 @@
///
#include "config.h" // IWYU pragma: keep
#include "complete.h"
#include <pthread.h>
#include <pwd.h>
#include <stddef.h>
#include <wctype.h>
#include <cwchar>
#include <algorithm>
#include <atomic>
#include <cstddef>
#include <cwchar>
#include <functional>
#include <iterator>
#include <list>
@ -29,7 +31,6 @@
#include "autoload.h"
#include "builtin.h"
#include "common.h"
#include "complete.h"
#include "env.h"
#include "exec.h"
#include "expand.h"

View file

@ -11,7 +11,6 @@
#include <vector>
#include "common.h"
#include "enum_set.h"
struct completion_mode_t {

View file

@ -1,6 +1,8 @@
// Functions for setting and getting environment variables.
#include "config.h" // IWYU pragma: keep
#include "env.h"
#include <errno.h>
#include <pwd.h>
#include <stddef.h>
@ -18,7 +20,6 @@
#include "builtin_bind.h"
#include "common.h"
#include "env.h"
#include "env_dispatch.h"
#include "env_universal_common.h"
#include "event.h"

View file

@ -8,6 +8,7 @@
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <cstring>
#include <cwchar>
@ -25,6 +26,7 @@
#endif
#include <assert.h>
#include <algorithm>
#include <functional>
#include <memory>

View file

@ -4,11 +4,11 @@
#include "config.h" // IWYU pragma: keep
#include <memory>
#include "common.h"
#include "env_universal_common.h"
#include <memory>
/// Initialize variable dispatch.
class environment_t;
void env_dispatch_init(const environment_t &vars);

View file

@ -17,6 +17,7 @@
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <cstring>
#ifdef __CYGWIN__
#include <sys/mman.h>
@ -28,9 +29,9 @@
#include <sys/time.h> // IWYU pragma: keep
#include <sys/types.h> // IWYU pragma: keep
#include <unistd.h>
#include <cwchar>
#include <atomic>
#include <cwchar>
#include <map>
#include <string>
#include <type_traits>

View file

@ -1,6 +1,8 @@
// Functions for handling event triggers.
#include "config.h" // IWYU pragma: keep
#include "event.h"
#include <signal.h>
#include <stddef.h>
#include <unistd.h>
@ -13,7 +15,6 @@
#include <type_traits>
#include "common.h"
#include "event.h"
#include "fallback.h" // IWYU pragma: keep
#include "input_common.h"
#include "io.h"

View file

@ -16,13 +16,13 @@
#include <stdio.h>
#include <sys/wait.h>
#include <unistd.h>
#include <cstring>
#include <stack>
#include <algorithm>
#include <cstring>
#include <functional>
#include <map>
#include <memory>
#include <stack>
#include <string>
#include <type_traits>
#include <vector>

View file

@ -9,6 +9,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <wctype.h>
#include <cstring>
#include <cwchar>

View file

@ -18,6 +18,7 @@
#include <sys/types.h> // IWYU pragma: keep
#include <unistd.h>
#include <wctype.h>
#include <algorithm>
#include <cstring>
#include <cwchar>
@ -37,6 +38,7 @@
#include <ncurses/term.h>
#endif
#include <signal.h> // IWYU pragma: keep
#include <cwchar> // IWYU pragma: keep
#include "common.h" // IWYU pragma: keep

View file

@ -30,9 +30,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#include <sys/resource.h>
#include <sys/stat.h>
#include <unistd.h>
#include <cstring>
#include <cwchar>
#include <memory>
#include <string>
#include <vector>

View file

@ -24,8 +24,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#include <stdio.h>
#include <stdlib.h>
#include <wctype.h>
#include <cstring>
#include <cstring>
#include <cwchar>
#include <memory>
#include <stack>

View file

@ -16,9 +16,9 @@
#include <stdlib.h>
#include <termios.h>
#include <unistd.h>
#include <cstring>
#include <cwchar>
#include <memory>
#include <string>
#include <vector>

View file

@ -24,18 +24,18 @@
#include <time.h>
#include <unistd.h>
#include <wctype.h>
#include <cstring>
#include <cwchar>
#include <thread>
#include <algorithm>
#include <array>
#include <atomic>
#include <cmath>
#include <cstring>
#include <cwchar>
#include <functional>
#include <memory>
#include <set>
#include <string>
#include <thread>
#include <utility>
#include <vector>

View file

@ -2,15 +2,15 @@
#include "config.h"
#include "flog.h"
#include "global_safety.h"
#include <vector>
#include "common.h"
#include "enum_set.h"
#include "global_safety.h"
#include "parse_util.h"
#include "wildcard.h"
#include <vector>
namespace flog_details {
// Note we are relying on the order of global initialization within this file.

View file

@ -4,13 +4,14 @@
#include "config.h" // IWYU pragma: keep
#include "global_safety.h"
#include <stdio.h>
#include <string>
#include <type_traits>
#include <utility>
#include "global_safety.h"
using wcstring = std::wstring;
using wcstring_list_t = std::vector<wcstring>;

View file

@ -8,9 +8,9 @@
#include <dirent.h>
#include <pthread.h>
#include <stddef.h>
#include <cwchar>
#include <algorithm>
#include <cwchar>
#include <map>
#include <memory>
#include <string>

View file

@ -1,8 +1,9 @@
#include "config.h" // IWYU pragma: keep
#include <cwchar>
#include "future_feature_flags.h"
#include <cwchar>
/// The set of features applying to this instance.
static features_t global_features;

View file

@ -3,6 +3,7 @@
#define FISH_FUTURE_FEATURE_FLAGS_H
#include <assert.h>
#include <unordered_map>
#include "common.h"

View file

@ -4,11 +4,11 @@
#include "config.h" // IWYU pragma: keep
#include "common.h"
#include <atomic>
#include <cassert>
#include "common.h"
// fish is multithreaded. Global (which includes function and file-level statics) when used naively
// may therefore lead to data races. Use the following types to characterize and enforce correct
// access patterns.

View file

@ -6,9 +6,9 @@
#include <errno.h>
#include <sys/stat.h>
#include <unistd.h>
#include <cwchar>
#include <algorithm>
#include <cwchar>
#include <memory>
#include <string>
#include <type_traits>

View file

@ -8,6 +8,7 @@
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <cstdint>
#include <cstring>
// We need the sys/file.h for the flock() declaration on Linux but not OS X.

View file

@ -1,10 +1,11 @@
#include "config.h"
#include "history.h"
#include "history_file.h"
#include <cstring>
#include "history.h"
// Some forward declarations.
static history_item_t decode_item_fish_2_0(const char *base, size_t len);
static history_item_t decode_item_fish_1_x(const char *begin, size_t length);

View file

@ -3,12 +3,12 @@
#include "config.h"
#include "maybe.h"
#include <sys/mman.h>
#include <cassert>
#include <memory>
#include <sys/mman.h>
#include "maybe.h"
class history_item_t;

View file

@ -3,6 +3,7 @@
#include <errno.h>
#include <wctype.h>
#include <cwchar>
#if HAVE_TERM_H
#include <curses.h>

View file

@ -3,6 +3,7 @@
#include <errno.h>
#include <unistd.h>
#include <cstring>
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
@ -11,8 +12,8 @@
#include <stdlib.h>
#include <sys/time.h>
#include <sys/types.h>
#include <cwchar>
#include <cwchar>
#include <deque>
#include <list>
#include <memory>

View file

@ -2,12 +2,13 @@
#ifndef INPUT_COMMON_H
#define INPUT_COMMON_H
#include <stddef.h>
#include <queue>
#include "common.h"
#include "maybe.h"
#include <stddef.h>
#include <queue>
enum class readline_cmd_t {
beginning_of_line,
end_of_line,

View file

@ -1,16 +1,17 @@
// Library for pooling common strings.
#include "config.h" // IWYU pragma: keep
#include "intern.h"
#include <stddef.h>
#include <cwchar>
#include <algorithm>
#include <cwchar>
#include <memory>
#include <vector>
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "intern.h"
bool string_less_than_string(const wchar_t *a, const wchar_t *b) { return std::wcscmp(a, b) < 0; }

View file

@ -1,17 +1,19 @@
// Utilities for io redirection.
#include "config.h" // IWYU pragma: keep
#include "io.h"
#include <errno.h>
#include <stddef.h>
#include <stdio.h>
#include <unistd.h>
#include <cstring>
#include <cwchar>
#include "common.h"
#include "exec.h"
#include "fallback.h" // IWYU pragma: keep
#include "io.h"
#include "iothread.h"
#include "redirection.h"
#include "wutil.h" // IWYU pragma: keep

View file

@ -1,5 +1,7 @@
#include "config.h" // IWYU pragma: keep
#include "iothread.h"
#include <limits.h>
#include <pthread.h>
#include <signal.h>
@ -8,16 +10,15 @@
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <atomic>
#include <cstring>
#include <atomic>
#include <condition_variable>
#include <cstring>
#include <queue>
#include "common.h"
#include "flog.h"
#include "global_safety.h"
#include "iothread.h"
#include "wutil.h"
#ifdef _POSIX_THREAD_THREADS_MAX

View file

@ -3,6 +3,7 @@
#define FISH_IOTHREAD_H
#include <pthread.h>
#include <functional>
#include <type_traits>

View file

@ -5,6 +5,7 @@
#include "config.h" // IWYU pragma: keep
#include <stddef.h>
#include <algorithm>
#include <list>
#include <memory>

View file

@ -3,7 +3,6 @@
#define FISH_LRU_H
#include <cwchar>
#include <unordered_map>
#include "common.h"

View file

@ -3,6 +3,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#if HAVE_CURSES_H
#include <curses.h>
@ -17,8 +18,8 @@
#include <ncurses/term.h>
#endif
#include <limits.h>
#include <cwchar>
#include <cwchar>
#include <memory>
#include <string>
#include <vector>

View file

@ -3,9 +3,9 @@
// IWYU pragma: no_include <cstddef>
#include <stddef.h>
#include <wctype.h>
#include <cwchar>
#include <algorithm>
#include <cwchar>
#include <numeric>
#include <type_traits>
#include <unordered_map>

View file

@ -2,9 +2,10 @@
#ifndef FISH_PARSE_CONSTANTS_H
#define FISH_PARSE_CONSTANTS_H
#include "common.h"
#include "config.h"
#include "common.h"
#define PARSE_ASSERT(a) assert(a)
#define PARSER_DIE() \
do { \

View file

@ -8,6 +8,8 @@
// for the execution to finish to see them.
#include "config.h" // IWYU pragma: keep
#include "parse_execution.h"
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
@ -15,9 +17,9 @@
#include <termios.h>
#include <unistd.h>
#include <wctype.h>
#include <cwchar>
#include <algorithm>
#include <cwchar>
#include <memory>
#include <string>
#include <type_traits>
@ -36,7 +38,6 @@
#include "io.h"
#include "maybe.h"
#include "parse_constants.h"
#include "parse_execution.h"
#include "parse_util.h"
#include "parser.h"
#include "path.h"
@ -488,7 +489,8 @@ parse_execution_result_t parse_execution_context_t::run_switch_statement(
return result;
}
const wcstring &switch_value_expanded = switch_values_expanded.size() == 1 ? switch_values_expanded.at(0).completion : L"";
const wcstring &switch_value_expanded =
switch_values_expanded.size() == 1 ? switch_values_expanded.at(0).completion : L"";
block_t *sb = parser->push_block(block_t::switch_block());

View file

@ -5,6 +5,7 @@
#include <array>
#include <tuple>
#include <type_traits>
#include "parse_constants.h"
#include "tokenizer.h"

View file

@ -1,12 +1,13 @@
#include "config.h" // IWYU pragma: keep
#include "parse_productions.h"
#include <stdio.h>
#include "common.h"
#include "flog.h"
#include "parse_constants.h"
#include "parse_grammar.h"
#include "parse_productions.h"
#include "parse_tree.h"
using namespace parse_productions;

View file

@ -1,12 +1,14 @@
// Programmatic representation of fish code.
#include "config.h" // IWYU pragma: keep
#include "parse_tree.h"
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <cwchar>
#include <algorithm>
#include <cwchar>
#include <string>
#include <type_traits>
#include <vector>
@ -16,7 +18,6 @@
#include "flog.h"
#include "parse_constants.h"
#include "parse_productions.h"
#include "parse_tree.h"
#include "proc.h"
#include "tnode.h"
#include "tokenizer.h"

View file

@ -4,10 +4,12 @@
// that are somehow related to parsing the code.
#include "config.h" // IWYU pragma: keep
#include "parse_util.h"
#include <stdarg.h>
#include <stdlib.h>
#include <cwchar>
#include <cwchar>
#include <memory>
#include <string>
#include <type_traits>
@ -18,7 +20,6 @@
#include "fallback.h" // IWYU pragma: keep
#include "future_feature_flags.h"
#include "parse_constants.h"
#include "parse_util.h"
#include "parser.h"
#include "tnode.h"
#include "tokenizer.h"

View file

@ -1,11 +1,13 @@
// The fish parser. Contains functions for parsing and evaluating code.
#include "config.h" // IWYU pragma: keep
#include "parser.h"
#include <fcntl.h>
#include <stdio.h>
#include <cwchar>
#include <algorithm>
#include <cwchar>
#include <memory>
#include <utility>
@ -19,7 +21,6 @@
#include "parse_constants.h"
#include "parse_execution.h"
#include "parse_util.h"
#include "parser.h"
#include "proc.h"
#include "reader.h"
#include "sanity.h"

View file

@ -1,12 +1,13 @@
// Functions having to do with parser keywords, like testing if a function is a block command.
#include "config.h" // IWYU pragma: keep
#include "parser_keywords.h"
#include <string>
#include <unordered_set>
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "parser_keywords.h"
typedef std::unordered_set<wcstring> string_set_t;

View file

@ -3,12 +3,14 @@
// issues.
#include "config.h" // IWYU pragma: keep
#include "path.h"
#include <errno.h>
#include <sys/stat.h>
#include <unistd.h>
#include <cstring>
#include <cwchar>
#include <memory>
#include <string>
#include <type_traits>
@ -19,7 +21,6 @@
#include "expand.h"
#include "fallback.h" // IWYU pragma: keep
#include "flog.h"
#include "path.h"
#include "wutil.h" // IWYU pragma: keep
/// Unexpected error in path_get_path().

View file

@ -6,6 +6,7 @@
#include <signal.h>
#include <stdio.h>
#include <time.h>
#include <cstring>
#include <memory>
#if FISH_USE_POSIX_SPAWN

View file

@ -1,12 +1,14 @@
// Print help message for the specified command.
#include "config.h" // IWYU pragma: keep
#include "print_help.h"
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include "common.h"
#include "print_help.h"
#define CMD_LEN 1024

View file

@ -11,6 +11,7 @@
#include <stdio.h>
#include <unistd.h>
#include <wctype.h>
#include <atomic>
#include <cwchar>

View file

@ -23,6 +23,7 @@
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
@ -33,11 +34,11 @@
#include <time.h>
#include <unistd.h>
#include <wctype.h>
#include <cwchar>
#include <algorithm>
#include <atomic>
#include <csignal>
#include <cwchar>
#include <deque>
#include <functional>
#include <memory>
@ -1201,7 +1202,8 @@ wcstring completion_apply_to_command_line(const wcstring &val, complete_flags_t
// Find the last quote in the token to complete. By parsing only the string inside any
// command substitution, we prevent the tokenizer from treating the entire command
// substitution as one token.
parse_util_get_parameter_info(command_line.substr(cmdsub_offset, (cmdsub_end - cmdsub_begin)),
parse_util_get_parameter_info(
command_line.substr(cmdsub_offset, (cmdsub_end - cmdsub_begin)),
cursor_pos - cmdsub_offset, &quote, NULL, NULL);
// If the token is reported as unquoted, but ends with a (unescaped) quote, and we can

View file

@ -1,10 +1,11 @@
#include "config.h" // IWYU pragma: keep
#include "redirection.h"
#include "wutil.h"
#include <fcntl.h>
#include "wutil.h"
#define NOCLOB_ERROR _(L"The file '%ls' already exists")
#define FILE_ERROR _(L"An error occurred while redirecting file '%ls'")

View file

@ -1,12 +1,12 @@
#ifndef FISH_REDIRECTION_H
#define FISH_REDIRECTION_H
#include <vector>
#include "common.h"
#include "io.h"
#include "maybe.h"
#include <vector>
/// This file supports "applying" redirections.
/// A class representing a sequence of basic redirections.

View file

@ -1,6 +1,8 @@
// Functions for performing sanity checks on the program state.
#include "config.h" // IWYU pragma: keep
#include "sanity.h"
#include <unistd.h>
#include "common.h"
@ -11,7 +13,6 @@
#include "kill.h"
#include "proc.h"
#include "reader.h"
#include "sanity.h"
/// Status from earlier sanity checks.
static relaxed_atomic_bool_t insane{false};

View file

@ -13,6 +13,7 @@
#include <termios.h>
#include <time.h>
#include <unistd.h>
#include <cstring>
#include <cwchar>
@ -642,8 +643,7 @@ static void s_update(screen_t *scr, const wcstring &left_prompt, const wcstring
// Determine how many lines have stuff on them; we need to clear lines with stuff that we don't
// want.
const size_t lines_with_stuff = std::max(actual_lines_before_reset, scr->actual.line_count());
if (scr->desired.line_count() < lines_with_stuff)
need_clear_screen = true;
if (scr->desired.line_count() < lines_with_stuff) need_clear_screen = true;
if (left_prompt != scr->actual_left_prompt) {
s_move(scr, 0, 0);
@ -669,12 +669,11 @@ static void s_update(screen_t *scr, const wcstring &left_prompt, const wcstring
const size_t shared_prefix = line_shared_prefix(o_line, s_line);
size_t skip_prefix = shared_prefix;
if (shared_prefix < o_line.indentation) {
if (o_line.indentation > s_line.indentation
&& !has_cleared_screen && clr_eol && clr_eos) {
if (o_line.indentation > s_line.indentation && !has_cleared_screen && clr_eol &&
clr_eos) {
s_set_color(scr, vars, highlight_spec_t{});
s_move(scr, 0, (int)i);
s_write_mbs(scr,
should_clear_screen_this_line ? clr_eos : clr_eol);
s_write_mbs(scr, should_clear_screen_this_line ? clr_eos : clr_eol);
has_cleared_screen = should_clear_screen_this_line;
has_cleared_line = true;
}
@ -685,7 +684,8 @@ static void s_update(screen_t *scr, const wcstring &left_prompt, const wcstring
// over the shared prefix of what we want to output now, and what we output before, to
// avoid repeatedly outputting it.
if (skip_prefix > 0) {
size_t skip_width = shared_prefix < skip_prefix ? skip_prefix
size_t skip_width = shared_prefix < skip_prefix
? skip_prefix
: fish_wcswidth(&o_line.text.at(0), shared_prefix);
if (skip_width > skip_remaining) skip_remaining = skip_width;
}
@ -729,14 +729,13 @@ static void s_update(screen_t *scr, const wcstring &left_prompt, const wcstring
// the screen after we output into the last column, it can erase the last character due
// to the sticky right cursor. If we clear the screen too early, we can defeat soft
// wrapping.
if (should_clear_screen_this_line && !has_cleared_screen
&& (done || j + 1 == (size_t)screen_width)) {
if (should_clear_screen_this_line && !has_cleared_screen &&
(done || j + 1 == (size_t)screen_width)) {
s_move(scr, current_width, (int)i);
s_write_mbs(scr, clr_eos);
has_cleared_screen = true;
}
if (done)
break;
if (done) break;
perform_any_impending_soft_wrap(scr, current_width, (int)i);
s_move(scr, current_width, (int)i);

View file

@ -12,10 +12,10 @@
#include <stddef.h>
#include <sys/stat.h>
#include <cwchar>
#include <algorithm>
#include <cstddef>
#include <cwchar>
#include <list>
#include <memory>
#include <unordered_map>

View file

@ -24,14 +24,15 @@
// This version has been altered and ported to C++ for inclusion in fish.
#include "tinyexpr.h"
#include <ctype.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <algorithm>
#include <cstring>
#include <iterator>
#include <utility>

View file

@ -2,19 +2,20 @@
// extended to support marks, tokenizing multiple strings and disposing of unused string segments.
#include "config.h" // IWYU pragma: keep
#include "tokenizer.h"
#include <fcntl.h>
#include <limits.h>
#include <unistd.h>
#include <wctype.h>
#include <cwchar>
#include <cwchar>
#include <string>
#include <type_traits>
#include "common.h"
#include "fallback.h" // IWYU pragma: keep
#include "future_feature_flags.h"
#include "tokenizer.h"
#include "wutil.h" // IWYU pragma: keep
// _(s) is already wgettext(s).c_str(), so let's not convert back to wcstring

View file

@ -1,13 +1,14 @@
#include "config.h" // IWYU pragma: keep
#include "flog.h"
#include "iothread.h"
#include "topic_monitor.h"
#include "wutil.h"
#include <limits.h>
#include <unistd.h>
#include "flog.h"
#include "iothread.h"
#include "wutil.h"
// Whoof. Thread Sanitizer swallows signals and replays them at its leisure, at the point where
// instrumented code makes certain blocking calls. But tsan cannot interrupt a signal call, so
// if we're blocked in read() (like the topic monitor wants to be!), we'll never receive SIGCHLD

Some files were not shown because too many files have changed in this diff Show more