More of that weird reflowing that clang-format loves to do
This commit is contained in:
Fabian Homborg
2020-04-21 19:24:33 +02:00
parent c7c10c8b10
commit 02baa321ae
9 changed files with 25 additions and 21 deletions

View File

@@ -1147,7 +1147,7 @@ static int string_split_maybe0(parser_t &parser, io_streams_t &streams, int argc
if (retval != STATUS_CMD_OK) return retval;
if (opts.fields.size() < 1 && opts.allow_empty) {
streams.err.append_format(BUILTIN_ERR_COMBO2, cmd,
streams.err.append_format(BUILTIN_ERR_COMBO2, cmd,
_(L"--allow-empty is only valid with --fields"));
return STATUS_INVALID_ARGS;
}

View File

@@ -87,9 +87,8 @@ pgroup_provenance_t get_pgroup_provenance(const shared_ptr<job_t> &j,
/// This function is executed by the child process created by a call to fork(). It should be called
/// after \c child_setup_process. It calls execve to replace the fish process image with the command
/// specified in \c p. It never returns. Called in a forked child! Do not allocate memory, etc.
[[noreturn]]
static void safe_launch_process(process_t *p, const char *actual_cmd, const char *const *cargv,
const char *const *cenvv) {
[[noreturn]] static void safe_launch_process(process_t *p, const char *actual_cmd,
const char *const *cargv, const char *const *cenvv) {
UNUSED(p);
int err;
@@ -133,8 +132,7 @@ static void safe_launch_process(process_t *p, const char *actual_cmd, const char
/// This function is similar to launch_process, except it is not called after a fork (i.e. it only
/// calls exec) and therefore it can allocate memory.
[[noreturn]]
static void launch_process_nofork(env_stack_t &vars, process_t *p) {
[[noreturn]] static void launch_process_nofork(env_stack_t &vars, process_t *p) {
ASSERT_IS_MAIN_THREAD();
ASSERT_IS_NOT_FORKED_CHILD();
@@ -349,7 +347,8 @@ static bool fork_child_for_process(const std::shared_ptr<job_t> &job, process_t
maybe_t<pid_t> new_termowner{};
p->pid = getpid();
child_set_group(job.get(), p);
child_setup_process(job->should_claim_terminal() ? job->pgid : INVALID_PID, *job, true, dup2s);
child_setup_process(job->should_claim_terminal() ? job->pgid : INVALID_PID, *job, true,
dup2s);
child_action();
DIE("Child process returned control to fork_child lambda!");
}

View File

@@ -242,8 +242,7 @@ static void process_input(bool continuous_mode) {
}
/// Setup our environment (e.g., tty modes), process key strokes, then reset the environment.
[[noreturn]]
static void setup_and_process_keys(bool continuous_mode) {
[[noreturn]] static void setup_and_process_keys(bool continuous_mode) {
set_interactive_session(session_interactivity_t::implied);
set_main_thread();
setup_fork_guards();

View File

@@ -77,8 +77,9 @@ static void print_blocked_signals() {
exit(EXIT_FAILURE);
}
// There is no obviously portable way to get the maximum number of signals.
// Here we limit it to 64 because strsignal on Linux returns "Unknown signal" for anything above.
for (int sig=1; sig < 65; sig++) {
// Here we limit it to 64 because strsignal on Linux returns "Unknown signal" for anything
// above.
for (int sig = 1; sig < 65; sig++) {
if (sigismember(&sigs, sig)) {
if (const char *s = strsignal(sig)) {
fprintf(stderr, "%s", s);
@@ -115,7 +116,8 @@ static fth_command_t s_commands[] = {
{"print_pid_then_sleep", print_pid_then_sleep, "Print our pid, then sleep for .5 seconds"},
{"print_pgrp", print_pgrp, "Print our pgroup to stdout"},
{"print_fds", print_fds, "Print the list of active FDs to stdout"},
{"print_blocked_signals", print_blocked_signals, "Print to stdout the name(s) of blocked signals"},
{"print_blocked_signals", print_blocked_signals,
"Print to stdout the name(s) of blocked signals"},
{"help", show_help, "Print list of fish_test_helper commands"},
};

View File

@@ -3229,8 +3229,10 @@ static void test_autosuggest_suggest_special() {
// Don't crash on ~ (issue #2696). Note this is cwd dependent.
if (system("mkdir -p '~absolutelynosuchuser/path1/path2/'")) err(L"mkdir failed");
perform_one_autosuggestion_cd_test(L"cd ~absolutelynosuchus", L"er/path1/path2/", vars, __LINE__);
perform_one_autosuggestion_cd_test(L"cd ~absolutelynosuchuser/", L"path1/path2/", vars, __LINE__);
perform_one_autosuggestion_cd_test(L"cd ~absolutelynosuchus", L"er/path1/path2/", vars,
__LINE__);
perform_one_autosuggestion_cd_test(L"cd ~absolutelynosuchuser/", L"path1/path2/", vars,
__LINE__);
perform_one_completion_cd_test(L"cd ~absolutelynosuchus", L"er/", vars, __LINE__);
perform_one_completion_cd_test(L"cd ~absolutelynosuchuser/", L"path1/", vars, __LINE__);

View File

@@ -135,7 +135,8 @@ bool set_child_group(job_t *j, pid_t child_pid) {
return true;
}
int child_setup_process(pid_t new_termowner, const job_t &job, bool is_forked, const dup2_list_t &dup2s) {
int child_setup_process(pid_t new_termowner, const job_t &job, bool is_forked,
const dup2_list_t &dup2s) {
// Note we are called in a forked child.
for (const auto &act : dup2s.get_actions()) {
int err;

View File

@@ -31,7 +31,8 @@ bool child_set_group(job_t *j, process_t *p); // called by child
///
/// \return 0 on success, -1 on failure. When this function returns, signals are always unblocked.
/// On failure, signal handlers, io redirections and process group of the process is undefined.
int child_setup_process(pid_t new_termowner, const job_t &job, bool is_forked, const dup2_list_t &dup2s);
int child_setup_process(pid_t new_termowner, const job_t &job, bool is_forked,
const dup2_list_t &dup2s);
/// Call fork(), retrying on failure a few times.
pid_t execute_fork();

View File

@@ -436,9 +436,9 @@ static void process_mark_finished_children(parser_t &parser, bool block_ok) {
proc->argv0(), pid, proc->status.status_value());
} else {
assert(proc->status.stopped() || proc->status.continued());
FLOGF(proc_reap_external,
"External process '%ls' (pid %d, %s)",
proc->argv0(), pid, proc->status.stopped() ? "stopped" : "continued");
FLOGF(proc_reap_external, "External process '%ls' (pid %d, %s)",
proc->argv0(), pid,
proc->status.stopped() ? "stopped" : "continued");
}
}
} else {

View File

@@ -2735,8 +2735,8 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
cycle_cursor_pos = token_end - buff;
bool cont_after_prefix_insertion = (c == rl::complete_and_search);
rls.complete_did_insert = handle_completions(rls.comp, token_begin - buff, token_end - buff,
cont_after_prefix_insertion);
rls.complete_did_insert = handle_completions(
rls.comp, token_begin - buff, token_end - buff, cont_after_prefix_insertion);
// Show the search field if requested and if we printed a list of completions.
if (c == rl::complete_and_search && !rls.complete_did_insert && !pager.empty()) {