mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 05:17:08 +08:00
clang-format C++ files
This commit is contained in:
parent
30d40c1d49
commit
b7041ad89b
@ -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.
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
//#include "expand.h"
|
||||
// #include "expand.h"
|
||||
#include "common.h"
|
||||
#include "wcstringutil.h"
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -12,8 +12,8 @@
|
||||
#include <unistd.h> // IWYU pragma: keep
|
||||
#include <wctype.h>
|
||||
|
||||
#include <cwchar>
|
||||
#include <cstdlib>
|
||||
#include <cwchar>
|
||||
#if HAVE_GETTEXT
|
||||
#include <libintl.h>
|
||||
#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) {
|
||||
|
@ -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.
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#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<rust::Box<fd_monitor_item_t>>(make_fd_monitor_item_t(pipes.read.acquire(), timeout_usec, (uint8_t *)item_maker_t::trampoline, (uint8_t*)this));
|
||||
item = std::make_unique<rust::Box<fd_monitor_item_t>>(
|
||||
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.
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user