From fbe05890e0aed2b5de97340753ed30cee2edece9 Mon Sep 17 00:00:00 2001 From: Mihir Lad Date: Wed, 29 Jul 2020 21:34:19 -0400 Subject: [PATCH] dwm: Don't use trailing return types Keep it consistent with the rest of the code. --- include/modules/dwm.hpp | 26 +++++++++++++------------- src/modules/dwm.cpp | 24 ++++++++++++------------ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/include/modules/dwm.hpp b/include/modules/dwm.hpp index b73081fd..324db9a5 100644 --- a/include/modules/dwm.hpp +++ b/include/modules/dwm.hpp @@ -47,13 +47,13 @@ namespace modules { label_t label; }; - auto stop() -> void override; - auto has_event() -> bool; - auto update() -> bool; - auto build(builder* builder, const string& tag) const -> bool; + void stop() override; + bool has_event(); + bool update(); + bool build(builder* builder, const string& tag) const; protected: - auto input(string&& cmd) -> bool override; + bool input(string&& cmd) override; private: static constexpr const char* DEFAULT_FORMAT_TAGS{" "}; @@ -199,17 +199,17 @@ namespace modules { * * @return state_t enum value representing the state of the tag */ - auto get_state(tag_mask_t bit_mask) const -> state_t; + state_t get_state(tag_mask_t bit_mask) const; /** * Get the address to the layout represented by the symbol. */ - auto find_layout(const string& sym) const -> const dwmipc::Layout*; + const dwmipc::Layout* find_layout(const string& sym) const; /** * Get the address to the layout represented by the address. */ - auto find_layout(uintptr_t addr) const -> const dwmipc::Layout*; + const dwmipc::Layout* find_layout(uintptr_t addr) const; /** * Get the address of the next layout in m_layouts. @@ -218,7 +218,7 @@ namespace modules { * @param wrap True to wrap around the array, false to return the same * layout if the next layout does not exist. */ - auto next_layout(const dwmipc::Layout& layout, bool wrap) const -> const dwmipc::Layout*; + const dwmipc::Layout* next_layout(const dwmipc::Layout& layout, bool wrap) const; /** * Get the address of the previous layout in m_layouts. @@ -227,7 +227,7 @@ namespace modules { * @param wrap True to wrap around the array, false to return the same * layout if the next layout does not exist. */ - auto prev_layout(const dwmipc::Layout& layout, bool wrap) const -> const dwmipc::Layout*; + const dwmipc::Layout* prev_layout(const dwmipc::Layout& layout, bool wrap) const; /** * Check if the command matches the specified IPC command name and if so, @@ -239,7 +239,7 @@ namespace modules { * @return true if the command matched, was succesfully parsed, and sent to * dwm, false otherwise */ - auto check_send_cmd(string cmd, const string& ipc_cmd) -> bool; + bool check_send_cmd(string cmd, const string& ipc_cmd); /** * Helper function to build cmd string @@ -247,12 +247,12 @@ namespace modules { * @param ipc_cmd The dwm IPC command name * @param arg The argument to the dwm command */ - auto static build_cmd(const char* ipc_cmd, const string& arg) -> string; + static string build_cmd(const char* ipc_cmd, const string& arg); /** * Attempt to connect to any disconnected dwm sockets. Catch errors. */ - auto reconnect_dwm() -> bool; + bool reconnect_dwm(); /** * If true, enables the click handlers for the tags diff --git a/src/modules/dwm.cpp b/src/modules/dwm.cpp index 0af27534..89c151bb 100644 --- a/src/modules/dwm.cpp +++ b/src/modules/dwm.cpp @@ -155,7 +155,7 @@ namespace modules { event_module::stop(); } - auto dwm_module::has_event() -> bool { + bool dwm_module::has_event() { try { return m_ipc->handle_event(); } catch (const dwmipc::SocketClosedError& err) { @@ -168,16 +168,16 @@ namespace modules { return false; } - auto dwm_module::update() -> bool { + bool dwm_module::update() { // All updates are handled in has_event return true; } - auto dwm_module::build_cmd(const char* ipc_cmd, const string& arg) -> string { + string dwm_module::build_cmd(const char* ipc_cmd, const string& arg) { return EVENT_PREFIX + string(ipc_cmd) + "-" + arg; } - auto dwm_module::build(builder* builder, const string& tag) const -> bool { + bool dwm_module::build(builder* builder, const string& tag) const { m_log.info("%s: Building module", name()); if (tag == TAG_LABEL_TITLE) { m_log.info("%s: Building title", name()); @@ -242,7 +242,7 @@ namespace modules { return true; } - auto dwm_module::check_send_cmd(string cmd, const string& ipc_cmd) -> bool { + bool dwm_module::check_send_cmd(string cmd, const string& ipc_cmd) { // cmd = - cmd.erase(0, strlen(EVENT_PREFIX)); @@ -266,7 +266,7 @@ namespace modules { return false; } - auto dwm_module::input(string&& cmd) -> bool { + bool dwm_module::input(string&& cmd) { if (cmd.find(EVENT_PREFIX) != 0) { return false; } @@ -275,7 +275,7 @@ namespace modules { check_send_cmd(cmd, CMD_LAYOUT_SET); } - auto dwm_module::get_state(tag_mask_t bit_mask) const -> state_t { + dwm_module::state_t dwm_module::get_state(tag_mask_t bit_mask) const { /** * --------------------------------------------------------------- * | Tag | | | @@ -330,7 +330,7 @@ namespace modules { } } - auto dwm_module::find_layout(const string& sym) const -> const dwmipc::Layout* { + const dwmipc::Layout* dwm_module::find_layout(const string& sym) const { for (const auto& lt : *m_layouts) { if (lt.symbol == sym) { return < @@ -339,7 +339,7 @@ namespace modules { return nullptr; } - auto dwm_module::find_layout(const uintptr_t addr) const -> const dwmipc::Layout* { + const dwmipc::Layout* dwm_module::find_layout(const uintptr_t addr) const { for (const auto& lt : *m_layouts) { if (lt.address == addr) { return < @@ -348,7 +348,7 @@ namespace modules { return nullptr; } - auto dwm_module::next_layout(const dwmipc::Layout& layout, bool wrap) const -> const dwmipc::Layout* { + const dwmipc::Layout* dwm_module::next_layout(const dwmipc::Layout& layout, bool wrap) const { const auto* next = &layout + 1; const auto* first = m_layouts->begin().base(); if (next < m_layouts->end().base()) { @@ -360,7 +360,7 @@ namespace modules { } } - auto dwm_module::prev_layout(const dwmipc::Layout& layout, bool wrap) const -> const dwmipc::Layout* { + const dwmipc::Layout* dwm_module::prev_layout(const dwmipc::Layout& layout, bool wrap) const { const auto* prev = &layout - 1; const auto* last = m_layouts->end().base() - 1; if (prev >= m_layouts->begin().base()) { @@ -423,7 +423,7 @@ namespace modules { m_layout_label->replace_token("%symbol%", symbol); } - auto dwm_module::reconnect_dwm() -> bool { + bool dwm_module::reconnect_dwm() { try { if (!m_ipc->is_main_socket_connected()) { m_log.notice("%s: Attempting to reconnect to main socket", name());