Fix clang warning 'expression with side effects'

This commit is contained in:
Mathias Gumz 2015-01-03 21:36:35 +01:00
parent fb7bc7380d
commit 60e97b968b
2 changed files with 14 additions and 9 deletions

View file

@ -303,8 +303,9 @@ void ShowClientMenuCmd::execute() {
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 @@ void ClientPatternTestCmd::execute() {
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));
}
}
}

View file

@ -86,13 +86,16 @@ void WindowListCmd::execute() {
// 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);
}
}