From d22c6af7a3ba771f537d5c3af15e6ce05f77971d Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Wed, 29 Jan 2020 17:06:11 -0800 Subject: [PATCH] clang-format all C++ files --- src/common.cpp | 5 +++-- src/env_dispatch.cpp | 12 ++++++++---- src/env_universal_common.cpp | 6 ++++-- src/fish.cpp | 3 ++- src/flog.h | 6 +++--- src/postfork.cpp | 3 ++- src/proc.cpp | 3 ++- 7 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/common.cpp b/src/common.cpp index aeab343a8..330614eac 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -1779,7 +1779,7 @@ static void validate_new_termsize(struct winsize *new_termsize, const environmen if (is_main_thread() && parser_t::principal_parser().is_interactive()) { FLOGF(warning, _(L"Current terminal parameters have rows and/or columns set to zero.")); FLOGF(warning, _(L"The stty command can be used to correct this " - L"(e.g., stty rows 80 columns 24).")); + L"(e.g., stty rows 80 columns 24).")); } #endif // Fallback to the environment vars. @@ -1801,7 +1801,8 @@ static void validate_new_termsize(struct winsize *new_termsize, const environmen if (new_termsize->ws_col < MIN_TERM_COL || new_termsize->ws_row < MIN_TERM_ROW) { // Also highly hackisk. if (is_main_thread() && parser_t::principal_parser().is_interactive()) { - FLOGF(warning, _(L"Current terminal parameters set terminal size to unreasonable value.")); + FLOGF(warning, + _(L"Current terminal parameters set terminal size to unreasonable value.")); FLOGF(warning, _(L"Defaulting terminal size to 80x24.")); } new_termsize->ws_col = DFLT_TERM_COL; diff --git a/src/env_dispatch.cpp b/src/env_dispatch.cpp index 6b43dd2d8..4a44b1525 100644 --- a/src/env_dispatch.cpp +++ b/src/env_dispatch.cpp @@ -152,7 +152,8 @@ static void guess_emoji_width(const environment_t &vars) { if (auto width_str = vars.get(L"fish_emoji_width")) { int new_width = fish_wcstol(width_str->as_string().c_str()); g_fish_emoji_width = std::max(0, new_width); - FLOGF(term_support, "'fish_emoji_width' preference: %d, overwriting default", g_fish_emoji_width); + FLOGF(term_support, "'fish_emoji_width' preference: %d, overwriting default", + g_fish_emoji_width); return; } @@ -352,7 +353,8 @@ static void update_fish_color_support(const environment_t &vars) { fish_wcstod(tpv->as_string().c_str(), nullptr) > 299) { // OS X Lion is version 299+, it has 256 color support (see github Wiki) support_term256 = true; - FLOGF(term_support, L"256 color support enabled for TERM=%ls on Terminal.app", term.c_str()); + FLOGF(term_support, L"256 color support enabled for TERM=%ls on Terminal.app", + term.c_str()); } else { support_term256 = true; FLOGF(term_support, L"256 color support enabled for TERM=%ls", term.c_str()); @@ -400,7 +402,8 @@ static bool initialize_curses_using_fallback(const char *term) { int err_ret; if (setupterm(const_cast(term), STDOUT_FILENO, &err_ret) == OK) return true; if (session_interactivity() != session_interactivity_t::not_interactive) { - FLOGF(warning, _(L"Could not set up terminal using the fallback terminal type '%s'."), term); + FLOGF(warning, _(L"Could not set up terminal using the fallback terminal type '%s'."), + term); } return false; } @@ -463,7 +466,8 @@ static void init_curses(const environment_t &vars) { if (term.missing_or_empty()) { FLOGF(warning, _(L"TERM environment variable not set.")); } else { - FLOGF(warning, _(L"TERM environment variable set to '%ls'."), term->as_string().c_str()); + FLOGF(warning, _(L"TERM environment variable set to '%ls'."), + term->as_string().c_str()); FLOGF(warning, _(L"Check that this terminal type is supported on this system.")); } } diff --git a/src/env_universal_common.cpp b/src/env_universal_common.cpp index 0a107d9e8..07fba0eb1 100644 --- a/src/env_universal_common.cpp +++ b/src/env_universal_common.cpp @@ -548,7 +548,8 @@ autoclose_fd_t env_universal_t::open_temporary_file(const wcstring &directory, w static bool check_duration(double start_time) { double duration = timef() - start_time; if (duration > 0.25) { - FLOGF(warning, _(L"Locking the universal var file took too long (%.3f seconds)."), duration); + FLOGF(warning, _(L"Locking the universal var file took too long (%.3f seconds)."), + duration); return false; } return true; @@ -1248,7 +1249,8 @@ class universal_notifier_notifyd_t : public universal_notifier_t { void post_notification() { uint32_t status = notify_post(name.c_str()); if (status != NOTIFY_STATUS_OK) { - FLOGF(warning, "notify_post() failed with status %u. Uvar notifications may not be sent.", + FLOGF(warning, + "notify_post() failed with status %u. Uvar notifications may not be sent.", status); } } diff --git a/src/fish.cpp b/src/fish.cpp index f4b07f8fa..45776143f 100644 --- a/src/fish.cpp +++ b/src/fish.cpp @@ -221,7 +221,8 @@ static void source_config_in_directory(const wcstring &dir) { const wcstring escaped_dir = escape_string(dir, ESCAPE_ALL); const wcstring escaped_pathname = escaped_dir + L"/config.fish"; if (waccess(config_pathname, R_OK) != 0) { - FLOGF(config, L"not sourcing %ls (not readable or does not exist)", escaped_pathname.c_str()); + FLOGF(config, L"not sourcing %ls (not readable or does not exist)", + escaped_pathname.c_str()); return; } FLOGF(config, L"sourcing %ls", escaped_pathname.c_str()); diff --git a/src/flog.h b/src/flog.h index 358afc7be..5919e6c3a 100644 --- a/src/flog.h +++ b/src/flog.h @@ -62,7 +62,8 @@ class category_list_t { category_t exec_fork{L"exec-fork", L"Calls to fork()"}; category_t parse_productions{L"parse-productions", L"Resolving tokens"}; - category_t parse_productions_chatty{L"parse-productions-chatty", L"Resolving tokens (chatty messages)"}; + category_t parse_productions_chatty{L"parse-productions-chatty", + L"Resolving tokens (chatty messages)"}; category_t proc_job_run{L"proc-job-run", L"Jobs getting started or continued"}; @@ -195,5 +196,4 @@ void log_extra_to_flog_file(const wcstring &s); #endif -#define should_flog(wht) \ - (flog_details::category_list_t::g_instance->wht.enabled) +#define should_flog(wht) (flog_details::category_list_t::g_instance->wht.enabled) diff --git a/src/postfork.cpp b/src/postfork.cpp index 7ae3e13d7..fb08f2def 100644 --- a/src/postfork.cpp +++ b/src/postfork.cpp @@ -126,7 +126,8 @@ bool set_child_group(job_t *j, pid_t child_pid) { // ever leads to a terminal hang due if both this setpgid call AND posix_spawn's // internal setpgid calls failed), write to the debug log so a future developer // doesn't go crazy trying to track this down. - FLOGF(proc_pgroup, "Error %d while calling setpgid for child %d (probably harmless)", errno, + FLOGF(proc_pgroup, + "Error %d while calling setpgid for child %d (probably harmless)", errno, child_pid); } } diff --git a/src/proc.cpp b/src/proc.cpp index d4e501add..6073ddf3c 100644 --- a/src/proc.cpp +++ b/src/proc.cpp @@ -758,7 +758,8 @@ int terminal_maybe_give_to_job(const job_t *j, bool continuing_from_stopped) { // job/group have been started, the only way this can happen is if the very last // process in the group terminated and didn't need to access the terminal, otherwise // it would have hung waiting for terminal IO (SIGTTIN). We can safely ignore this. - FLOGF(proc_termowner, L"tcsetpgrp called but process group %d has terminated.\n", j->pgid); + FLOGF(proc_termowner, L"tcsetpgrp called but process group %d has terminated.\n", + j->pgid); return notneeded; }