all repos — fluxbox @ 60e97b968bcd712762c7ee30e350d63e4038fb63

custom fork of the fluxbox windowmanager

Fix clang warning 'expression with side effects'
Mathias Gumz akira@fluxbox.org
commit

60e97b968bcd712762c7ee30e350d63e4038fb63

parent

fb7bc7380d78f5c0313ba947f746d1c9b31bd166

2 files changed, 14 insertions(+), 9 deletions(-)

jump to
M src/FbCommands.ccsrc/FbCommands.cc

@@ -303,8 +303,9 @@ m_list.clear();

FocusControl::Focusables::const_iterator it = list->clientList().begin(), it_end = list->clientList().end(); for (; it != it_end; ++it) { - if (typeid(**it) == typeid(FluxboxWindow) && m_pat.match(**it)) - m_list.push_back(static_cast<FluxboxWindow *>(*it)); + Focusable* f = *it; + if (typeid(*f) == typeid(FluxboxWindow) && m_pat.match(*f)) + m_list.push_back(static_cast<FluxboxWindow *>(f)); } m_menu.reset(new ClientMenu(*screen, m_list,

@@ -572,8 +573,9 @@ wit = windows->clientList().begin();

wit_end = windows->clientList().end(); for ( ; wit != wit_end; wit++) { - if (typeid(**wit) == typeid(FluxboxWindow) && cp->match(**wit)) { - matches.push_back(static_cast<const FluxboxWindow*>(*wit)); + Focusable* f = *wit; + if (typeid(*f) == typeid(FluxboxWindow) && cp->match(*f)) { + matches.push_back(static_cast<const FluxboxWindow*>(f)); } } }
M src/WorkspaceCmd.ccsrc/WorkspaceCmd.cc

@@ -86,12 +86,15 @@ it_end = win_list.end();

// save old value, so we can restore it later WinClient *old = WindowCmd<void>::client(); for (; it != it_end; ++it) { - if (typeid(**it) == typeid(FluxboxWindow)) - WindowCmd<void>::setWindow((*it)->fbwindow()); - else if (typeid(**it) == typeid(WinClient)) - WindowCmd<void>::setClient(dynamic_cast<WinClient *>(*it)); - if (!m_filter || m_filter->execute()) + Focusable* wptr = *it; + if (typeid(*wptr) == typeid(FluxboxWindow)) { + WindowCmd<void>::setWindow((wptr)->fbwindow()); + } else if (typeid(*wptr) == typeid(WinClient)) { + WindowCmd<void>::setClient(dynamic_cast<WinClient *>(wptr)); + } + if (!m_filter || m_filter->execute()) { m_cmd->execute(); + } } WindowCmd<void>::setClient(old); }