From f11eb219ad99711374d09fa6811f68520c93ecc6 Mon Sep 17 00:00:00 2001 From: Julian Schuler <31921487+julianschuler@users.noreply.github.com> Date: Thu, 9 Dec 2021 22:52:07 +0100 Subject: [PATCH] Format code using 'make clang-format' --- src/core.cc | 11 ++++------- src/pulseaudio.cc | 39 ++++++++++++++++++++------------------- src/top.cc | 4 +--- 3 files changed, 25 insertions(+), 29 deletions(-) diff --git a/src/core.cc b/src/core.cc index 9424d77b..cabd0327 100644 --- a/src/core.cc +++ b/src/core.cc @@ -660,12 +660,8 @@ struct text_object *construct_text_object(char *s, const char *arg, long line, EQUAL) { obj->data.i = PB_BATT_STATUS; } - else if (strcmp(arg, "percent") == EQUAL) { - obj->data.i = PB_BATT_PERCENT; - } - else if (strcmp(arg, "time") == EQUAL) { - obj->data.i = PB_BATT_TIME; - } + else if (strcmp(arg, "percent") == EQUAL) { obj->data.i = PB_BATT_PERCENT; } + else if (strcmp(arg, "time") == EQUAL) { obj->data.i = PB_BATT_TIME; } else { NORM_ERR("pb_battery: illegal argument '%s', defaulting to status", arg); obj->data.i = PB_BATT_STATUS; @@ -2013,7 +2009,8 @@ struct text_object *construct_text_object(char *s, const char *arg, long line, END OBJ(pa_card_name, 0) obj->callbacks.print = &print_puau_card_name; obj->callbacks.free = &free_pulseaudio; init_pulseaudio(obj); - END OBJ_IF(if_pa_source_running, 0) obj->callbacks.iftest = &puau_source_running; + END OBJ_IF(if_pa_source_running, 0) obj->callbacks.iftest = + &puau_source_running; obj->callbacks.free = &free_pulseaudio; init_pulseaudio(obj); END OBJ_IF(if_pa_source_muted, 0) obj->callbacks.iftest = &puau_source_muted; diff --git a/src/pulseaudio.cc b/src/pulseaudio.cc index 457e0ec3..0869ed0a 100644 --- a/src/pulseaudio.cc +++ b/src/pulseaudio.cc @@ -40,20 +40,21 @@ struct pulseaudio_default_results get_result_copy(); -const struct pulseaudio_default_results pulseaudio_result0 = {std::string(), - std::string(), - std::string(), - std::string(), - 0, - 0, - 0, - 0, - std::string(), - PA_SOURCE_SUSPENDED, - 0, - std::string(), - std::string(), - 0}; +const struct pulseaudio_default_results pulseaudio_result0 = { + std::string(), + std::string(), + std::string(), + std::string(), + 0, + 0, + 0, + 0, + std::string(), + PA_SOURCE_SUSPENDED, + 0, + std::string(), + std::string(), + 0}; pulseaudio_c *pulseaudio = nullptr; void pa_sink_info_callback(pa_context *c, const pa_sink_info *i, int eol, @@ -80,9 +81,8 @@ void pa_sink_info_callback(pa_context *c, const pa_sink_info *i, int eol, ++eol; } - void pa_source_info_callback(pa_context *c, const pa_source_info *i, int eol, - void *data) { + void *data) { if (i != nullptr && data) { struct pulseaudio_default_results *pdr = (struct pulseaudio_default_results *)data; @@ -186,9 +186,10 @@ void subscribe_cb(pa_context *c, pa_subscription_event_type_t t, uint32_t index, case PA_SUBSCRIPTION_EVENT_SOURCE: { if (res->source_name.empty()) return; pa_operation *op; - PULSEAUDIO_OP(pa_context_get_source_info_by_name( - c, res->source_name.c_str(), pa_source_info_callback, res), - "pa_context_get_source_info_by_name failed"); + PULSEAUDIO_OP( + pa_context_get_source_info_by_name(c, res->source_name.c_str(), + pa_source_info_callback, res), + "pa_context_get_source_info_by_name failed"); } break; case PA_SUBSCRIPTION_EVENT_CARD: diff --git a/src/top.cc b/src/top.cc index 3c2f1d82..493e8b15 100644 --- a/src/top.cc +++ b/src/top.cc @@ -99,9 +99,7 @@ static void unhash_all_processes() { } } -struct process *get_first_process() { - return first_process; -} +struct process *get_first_process() { return first_process; } void free_all_processes() { struct process *next = nullptr, *pr = first_process;