diff options
author | Ryan Pavlik <rpavlik@iastate.edu> | 2011-11-02 17:33:38 (GMT) |
---|---|---|
committer | Mathias Gumz <akira at fluxbox dot org> | 2012-01-04 06:53:54 (GMT) |
commit | 5ae8bdf49db36b2691ce545e3285f9ee64f92148 (patch) | |
tree | 5ef8285a7f6c54a35544903c05018fd0445aee30 /src/WorkspaceCmd.cc | |
parent | f859e78cb24cf69cc06e4395c58d804537f301c7 (diff) | |
download | fluxbox_pavel-5ae8bdf49db36b2691ce545e3285f9ee64f92148.zip fluxbox_pavel-5ae8bdf49db36b2691ce545e3285f9ee64f92148.tar.bz2 |
Pre-increment non-primitive types.
Found with cppcheck:
"Prefix ++/-- operators should be preferred for non-primitive
types. Pre-increment/decrement can be more efficient than
post-increment/decrement. Post-increment/decrement usually
involves keeping a copy of the previous value around and adds
a little extra code."
Diffstat (limited to 'src/WorkspaceCmd.cc')
-rw-r--r-- | src/WorkspaceCmd.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc index 34c8f9a..42cc05e 100644 --- a/src/WorkspaceCmd.cc +++ b/src/WorkspaceCmd.cc | |||
@@ -393,7 +393,7 @@ void ArrangeWindowsCmd::execute() { | |||
393 | 393 | ||
394 | Workspace::Windows normal_windows; | 394 | Workspace::Windows normal_windows; |
395 | Workspace::Windows shaded_windows; | 395 | Workspace::Windows shaded_windows; |
396 | for(win = space->windowList().begin(); win != space->windowList().end(); win++) { | 396 | for(win = space->windowList().begin(); win != space->windowList().end(); ++win) { |
397 | int winhead = screen->getHead((*win)->fbWindow()); | 397 | int winhead = screen->getHead((*win)->fbWindow()); |
398 | if ((winhead == head || winhead == 0) && m_pat.match(**win)) { | 398 | if ((winhead == head || winhead == 0) && m_pat.match(**win)) { |
399 | if ((*win)->isShaded()) | 399 | if ((*win)->isShaded()) |
@@ -430,7 +430,7 @@ void ArrangeWindowsCmd::execute() { | |||
430 | // TODO: until i resolve the shadedwindow->moveResize() issue to place | 430 | // TODO: until i resolve the shadedwindow->moveResize() issue to place |
431 | // them in the same columns as the normal windows i just place the shaded | 431 | // them in the same columns as the normal windows i just place the shaded |
432 | // windows unchanged ontop of the current head | 432 | // windows unchanged ontop of the current head |
433 | for (i = 0, win = shaded_windows.begin(); win != shaded_windows.end(); win++, i++) { | 433 | for (i = 0, win = shaded_windows.begin(); win != shaded_windows.end(); ++win, ++i) { |
434 | if (i & 1) | 434 | if (i & 1) |
435 | (*win)->move(x_offs, y_offs); | 435 | (*win)->move(x_offs, y_offs); |
436 | else | 436 | else |
@@ -449,7 +449,7 @@ void ArrangeWindowsCmd::execute() { | |||
449 | // Resizes and sets windows positions in columns and rows. | 449 | // Resizes and sets windows positions in columns and rows. |
450 | for (i = 0; i < rows; ++i) { | 450 | for (i = 0; i < rows; ++i) { |
451 | x_offs = screen->maxLeft(head); | 451 | x_offs = screen->maxLeft(head); |
452 | for (j = 0; j < cols && normal_windows.size() > 0; ++j) { | 452 | for (j = 0; j < cols && !normal_windows.empty(); ++j) { |
453 | 453 | ||
454 | 454 | ||
455 | int cell_center_x = x_offs + (x_offs + cal_width) / 2; | 455 | int cell_center_x = x_offs + (x_offs + cal_width) / 2; |
@@ -457,7 +457,7 @@ void ArrangeWindowsCmd::execute() { | |||
457 | unsigned int closest_dist = ~0; | 457 | unsigned int closest_dist = ~0; |
458 | 458 | ||
459 | Workspace::Windows::iterator closest = normal_windows.end(); | 459 | Workspace::Windows::iterator closest = normal_windows.end(); |
460 | for (win = normal_windows.begin(); win != normal_windows.end(); win++) { | 460 | for (win = normal_windows.begin(); win != normal_windows.end(); ++win) { |
461 | 461 | ||
462 | int win_center_x = (*win)->frame().x() + ((*win)->frame().x() + (*win)->frame().width() / 2); | 462 | int win_center_x = (*win)->frame().x() + ((*win)->frame().x() + (*win)->frame().width() / 2); |
463 | int win_center_y = (*win)->frame().y() + ((*win)->frame().y() + (*win)->frame().height() / 2); | 463 | int win_center_y = (*win)->frame().y() + ((*win)->frame().y() + (*win)->frame().height() / 2); |
@@ -519,7 +519,7 @@ void ShowDesktopCmd::execute() { | |||
519 | BScreen::Icons icon_list = screen->iconList(); | 519 | BScreen::Icons icon_list = screen->iconList(); |
520 | BScreen::Icons::reverse_iterator iconit = icon_list.rbegin(); | 520 | BScreen::Icons::reverse_iterator iconit = icon_list.rbegin(); |
521 | BScreen::Icons::reverse_iterator itend= icon_list.rend(); | 521 | BScreen::Icons::reverse_iterator itend= icon_list.rend(); |
522 | for(; iconit != itend; iconit++) { | 522 | for(; iconit != itend; ++iconit) { |
523 | if ((*iconit)->workspaceNumber() == space || (*iconit)->isStuck()) | 523 | if ((*iconit)->workspaceNumber() == space || (*iconit)->isStuck()) |
524 | (*iconit)->deiconify(false); | 524 | (*iconit)->deiconify(false); |
525 | } | 525 | } |