diff --git a/src/common.h b/src/common.h index c30ac2c0a..8997be79e 100644 --- a/src/common.h +++ b/src/common.h @@ -87,9 +87,9 @@ struct termsize_t; // Make sure the ranges defined above don't exceed the range for non-characters. // This is to make sure we didn't do something stupid in subdividing the // Unicode range for our needs. -//#if WILDCARD_RESERVED_END > RESERVED_CHAR_END -//#error -//#endif +// #if WILDCARD_RESERVED_END > RESERVED_CHAR_END +// #error +// #endif // These are in the Unicode private-use range. We really shouldn't use this // range but have little choice in the matter given how our lexer/parser works. diff --git a/src/complete.h b/src/complete.h index 0cf2d1811..80042c0a5 100644 --- a/src/complete.h +++ b/src/complete.h @@ -13,7 +13,7 @@ #include #include -//#include "expand.h" +// #include "expand.h" #include "common.h" #include "wcstringutil.h" diff --git a/src/expand.cpp b/src/expand.cpp index 6dc045c60..7cac8a311 100644 --- a/src/expand.cpp +++ b/src/expand.cpp @@ -952,9 +952,11 @@ expand_result_t expander_t::stage_cmdsubst(wcstring input, completion_receiver_t } return expand_result_t::ok; case 1: - append_cmdsub_error(errors, start, end, L"command substitutions not allowed here"); + append_cmdsub_error(errors, start, end, + L"command substitutions not allowed here"); // clang-format off __fallthrough__ case -1: + // clang-format on default: return expand_result_t::make_error(STATUS_EXPAND_ERROR); } diff --git a/src/fallback.cpp b/src/fallback.cpp index 8a3a467ba..966bb28aa 100644 --- a/src/fallback.cpp +++ b/src/fallback.cpp @@ -12,8 +12,8 @@ #include // IWYU pragma: keep #include -#include #include +#include #if HAVE_GETTEXT #include #endif @@ -57,9 +57,9 @@ int fish_mkstemp_cloexec(char *name_template) { return result_fd; } -/// Fallback implementations of wcsncasecmp and wcscasecmp. On systems where these are not needed (e.g. -/// building on Linux) these should end up just being stripped, as they are static functions that -/// are not referenced in this file. +/// Fallback implementations of wcsncasecmp and wcscasecmp. On systems where these are not needed +/// (e.g. building on Linux) these should end up just being stripped, as they are static functions +/// that are not referenced in this file. // cppcheck-suppress unusedFunction [[gnu::unused]] static int wcscasecmp_fallback(const wchar_t *a, const wchar_t *b) { if (*a == 0) { diff --git a/src/fish_key_reader.cpp b/src/fish_key_reader.cpp index 1e1cb79ba..51a554409 100644 --- a/src/fish_key_reader.cpp +++ b/src/fish_key_reader.cpp @@ -38,9 +38,9 @@ struct config_paths_t determine_config_directory_paths(const char *argv0); static const wchar_t *ctrl_symbolic_names[] = { - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - L"\\b", L"\\t", L"\\n", nullptr, nullptr, L"\\r", nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + L"\\b", L"\\t", L"\\n", nullptr, nullptr, L"\\r", nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, L"\\e", L"\\x1c", nullptr, nullptr, nullptr}; /// Return true if the recent sequence of characters indicates the user wants to exit the program. diff --git a/src/fish_tests.cpp b/src/fish_tests.cpp index a84a7cfeb..024a743c3 100644 --- a/src/fish_tests.cpp +++ b/src/fish_tests.cpp @@ -41,6 +41,7 @@ #include #include #include + #include "fds.rs.h" #include "parse_constants.rs.h" @@ -836,14 +837,16 @@ static void test_fd_monitor() { } static void trampoline(autoclose_fd_t2 &fd, item_wake_reason_t reason, uint8_t *param) { - auto &instance = *(item_maker_t*)(param); + auto &instance = *(item_maker_t *)(param); instance.callback(fd, reason); } explicit item_maker_t(uint64_t timeout_usec) { auto pipes = make_autoclose_pipes().acquire(); writer = std::move(pipes.write); - item = std::make_unique>(make_fd_monitor_item_t(pipes.read.acquire(), timeout_usec, (uint8_t *)item_maker_t::trampoline, (uint8_t*)this)); + item = std::make_unique>( + make_fd_monitor_item_t(pipes.read.acquire(), timeout_usec, + (uint8_t *)item_maker_t::trampoline, (uint8_t *)this)); } // Write 42 bytes to our write end. diff --git a/src/io.cpp b/src/io.cpp index 866a7588a..2cbf32197 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -120,8 +120,8 @@ void io_buffer_t::begin_filling(autoclose_fd_t fd) { args->instance = this; args->promise = std::move(promise); - item_id_ = - fd_monitor().add_item(fd.acquire(), kNoTimeout, (uint8_t *)item_callback_trampoline, (uint8_t *)args); + item_id_ = fd_monitor().add_item(fd.acquire(), kNoTimeout, (uint8_t *)item_callback_trampoline, + (uint8_t *)args); } /// This is a hack to work around the difficulties in passing a capturing lambda across FFI diff --git a/src/parse_execution.h b/src/parse_execution.h index 34553c8f5..63cdb3c0d 100644 --- a/src/parse_execution.h +++ b/src/parse_execution.h @@ -135,7 +135,8 @@ class parse_execution_context_t : noncopyable_t { end_execution_reason_t determine_redirections(const ast::argument_or_redirection_list_t &list, redirection_spec_list_t *out_redirections); - end_execution_reason_t run_1_job(const ast::job_pipeline_t &job, const block_t *associated_block); + end_execution_reason_t run_1_job(const ast::job_pipeline_t &job, + const block_t *associated_block); end_execution_reason_t test_and_run_1_job_conjunction(const ast::job_conjunction_t &jc, const block_t *associated_block); end_execution_reason_t run_job_conjunction(const ast::job_conjunction_t &job_expr, diff --git a/src/parser.cpp b/src/parser.cpp index e67f89120..c92b3b7d1 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -674,7 +674,7 @@ RustFFIJobList parser_t::ffi_jobs() const { bool parser_t::ffi_has_funtion_block() const { for (const auto &b : blocks()) { if (b.is_function_call()) { - return true; + return true; } } return false; diff --git a/src/screen.cpp b/src/screen.cpp index ef8fbf16f..365e27328 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -77,9 +77,7 @@ static size_t try_sequence(const char *seq, const wchar_t *str) { static bool midnight_commander_hack = false; -void screen_set_midnight_commander_hack() { - midnight_commander_hack = true; -} +void screen_set_midnight_commander_hack() { midnight_commander_hack = true; } /// Returns the number of columns left until the next tab stop, given the current cursor position. static size_t next_tab_stop(size_t current_line_width) { diff --git a/src/wildcard.cpp b/src/wildcard.cpp index 21d1282bb..70ee7b4e1 100644 --- a/src/wildcard.cpp +++ b/src/wildcard.cpp @@ -954,7 +954,8 @@ void wildcard_expander_t::expand(const wcstring &base_dir, const wchar_t *wc, } // return "." and ".." entries if we're doing completions - dir_iter_t dir = open_dir(base_dir, /* return . and .. */ flags & expand_flag::for_completions); + dir_iter_t dir = + open_dir(base_dir, /* return . and .. */ flags & expand_flag::for_completions); if (dir.valid()) { if (is_last_segment) { // Last wildcard segment, nonempty wildcard.