Merge lp:~mc-return/compiz/compiz.fix1030473-part1 into lp:compiz/0.9.8

Proposed by MC Return
Status: Merged
Approved by: Daniel van Vugt
Approved revision: 3460
Merged at revision: 3301
Proposed branch: lp:~mc-return/compiz/compiz.fix1030473-part1
Merge into: lp:compiz/0.9.8
Diff against target: 1789 lines (+192/-190)
54 files modified
cmake/src/compiz/compiz_discover_gtest_tests.cpp (+2/-2)
compizconfig/libcompizconfig/src/bindings.c (+1/-1)
compizconfig/libcompizconfig/src/compiz.cpp (+19/-17)
gtk/window-decorator/events.c (+3/-3)
kde/window-decorator-kde4/window.cpp (+1/-1)
plugins/animation/src/animation.cpp (+8/-8)
plugins/animation/src/extensionplugin.cpp (+3/-3)
plugins/animationaddon/src/burn.cpp (+1/-1)
plugins/annotate/src/annotate.cpp (+1/-2)
plugins/ccp/src/ccp.cpp (+1/-1)
plugins/clone/src/clone.cpp (+2/-2)
plugins/colorfilter/src/parser.cpp (+2/-1)
plugins/compiztoolbox/src/compiztoolbox.cpp (+2/-2)
plugins/composite/src/screen.cpp (+3/-3)
plugins/cubeaddon/src/cubeaddon.cpp (+14/-13)
plugins/dbus/src/dbus.cpp (+1/-1)
plugins/decor/src/clip-groups/tests/clip-groups/src/test-decor-clip-groups.cpp (+1/-1)
plugins/decor/src/decor.cpp (+4/-8)
plugins/extrawm/src/extrawm.cpp (+2/-2)
plugins/ezoom/src/ezoom.cpp (+2/-3)
plugins/firepaint/src/firepaint.cpp (+1/-2)
plugins/grid/src/grid.cpp (+4/-4)
plugins/group/src/group.cpp (+1/-1)
plugins/group/src/init.cpp (+4/-4)
plugins/group/src/paint.cpp (+1/-1)
plugins/group/src/selection.cpp (+4/-4)
plugins/group/src/tab.cpp (+3/-3)
plugins/loginout/src/loginout.cpp (+2/-2)
plugins/mousepoll/src/mousepoll.cpp (+2/-2)
plugins/opengl/src/fragment.cpp (+1/-1)
plugins/opengl/src/paint.cpp (+1/-1)
plugins/place/src/place.cpp (+1/-1)
plugins/place/src/screen-size-change/src/screen-size-change.cpp (+3/-3)
plugins/resize/src/resize.cpp (+11/-12)
plugins/ring/src/ring.cpp (+6/-6)
plugins/scale/src/scale.cpp (+2/-2)
plugins/session/src/session.cpp (+6/-8)
plugins/shift/src/shift.cpp (+4/-2)
plugins/snap/src/snap.cpp (+4/-4)
plugins/staticswitcher/src/staticswitcher.cpp (+4/-4)
plugins/switcher/src/switcher.cpp (+1/-1)
plugins/td/src/3d.cpp (+1/-1)
plugins/trailfocus/src/trailfocus.cpp (+2/-2)
plugins/wall/src/offset_movement/src/offset-movement.cpp (+1/-1)
plugins/wobbly/src/wobbly.cpp (+17/-13)
src/event.cpp (+1/-1)
src/match.cpp (+2/-2)
src/plugin.cpp (+3/-3)
src/screen.cpp (+15/-13)
src/stackdebugger.cpp (+6/-6)
src/timer/src/timeouthandler.cpp (+1/-1)
src/timer/src/timer.cpp (+2/-2)
src/timer/tests/callbacks/src/test-timer-callbacks.cpp (+1/-1)
src/timer/tests/while-calling/src/test-timer-set-times-while-calling.cpp (+1/-1)
To merge this branch: bzr merge lp:~mc-return/compiz/compiz.fix1030473-part1
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
MC Return Needs Resubmitting
Sam Spilsbury Approve
Review via email: mp+117182@code.launchpad.net

Commit message

Fixed various problems described in bug 1030473.
Optimized performance and style following suggestions reported by cppcheck:

1. Reduced the scope of various variables.

2. Used prefix ++ operators for non-primitive types, because those can be more efficient than post-increment. Post-increment usually keeps a copy of the previous value, adds extra code and is slower.

Description of the change

Fixes various problems described in bug 1030473.

To post a comment you must log in.
Revision history for this message
MC Return (mc-return) wrote :
Download full text (105.9 KiB)

Still a lot to do :)

[/compizconfig/compizconfig-python/compizconfig.c:619]: (style) The second of the two statements can never be executed, and so should be removed.
[/compizconfig/compizconfig-python/compizconfig.c:652]: (style) The second of the two statements can never be executed, and so should be removed.
[/compizconfig/compizconfig-python/compizconfig.c:818]: (style) The second of the two statements can never be executed, and so should be removed.
[/compizconfig/compizconfig-python/compizconfig.c:1335]: (style) The second of the two statements can never be executed, and so should be removed.
[/compizconfig/compizconfig-python/compizconfig.c:1343]: (style) The second of the two statements can never be executed, and so should be removed.
[/compizconfig/compizconfig-python/compizconfig.c:1354]: (style) The second of the two statements can never be executed, and so should be removed.
[/compizconfig/compizconfig-python/compizconfig.c:1362]: (style) The second of the two statements can never be executed, and so should be removed.
[/compizconfig/compizconfig-python/compizconfig.c:1370]: (style) The second of the two statements can never be executed, and so should be removed.
[/compizconfig/compizconfig-python/compizconfig.c:1378]: (style) The second of the two statements can never be executed, and so should be removed.
[/compizconfig/compizconfig-python/compizconfig.c:1398]: (style) The second of the two statements can never be executed, and so should be removed.
[/compizconfig/compizconfig-python/compizconfig.c:1431]: (style) The second of the two statements can never be executed, and so should be removed.
[/compizconfig/compizconfig-python/compizconfig.c:1475]: (style) The second of the two statements can never be executed, and so should be removed.
[/compizconfig/compizconfig-python/compizconfig.c:1508]: (style) The second of the two statements can never be executed, and so should be removed.
[/compizconfig/compizconfig-python/compizconfig.c:1532]: (style) The second of the two statements can never be executed, and so should be removed.
[/compizconfig/compizconfig-python/compizconfig.c:1570]: (style) The second of the two statements can never be executed, and so should be removed.
[/compizconfig/compizconfig-python/compizconfig.c:2007]: (style) The second of the two statements can never be executed, and so should be removed.
[/compizconfig/compizconfig-python/compizconfig.c:2057]: (style) The second of the two statements can never be executed, and so should be removed.
[/compizconfig/compizconfig-python/compizconfig.c:2722]: (style) The second of the two statements can never be executed, and so should be removed.
[/compizconfig/compizconfig-python/compizconfig.c:3047]: (style) The second of the two statements can never be executed, and so should be removed.
[/compizconfig/compizconfig-python/compizconfig.c:3136]: (style) The second of the two statements can never be executed, and so should be removed.
[/compizconfig/compizconfig-python/compizconfig.c:3630]: (style) The second of the two statements can never be executed, and so should be removed.
[/compizconfig/compizconfig-python/compizconfig.c:3648]: (style) The second of the two stateme...

Revision history for this message
MC Return (mc-return) wrote :
Download full text (84.3 KiB)

These warnings remain:

[../compiz.fix1030473-part1/cmake/src/compiz/compiz_discover_gtest_tests.cpp:46]: (performance) 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.
[../compiz.fix1030473-part1/cmake/src/compiz/compiz_discover_gtest_tests.cpp:49]: (performance) 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.
[../compiz.fix1030473-part1/compizconfig/gconf/src/gconf.c:479]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier:
    %s => %20s
    %i => %3i

Sample program that can crash:

#include <stdio.h>
int main()
{
    int a;
    scanf("%i", &a);
    return 0;
}

To make it crash:
perl -e 'print "5"x2100000' | ./a.out
[../compiz.fix1030473-part1/compizconfig/gconf/src/gconf.c:1930]: (error) Memory pointed to by 'pathName' is freed twice.
[../compiz.fix1030473-part1/compizconfig/gsettings/gsettings_backend_shared/gsettings_util.c:184]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier:
    %s => %20s
    %i => %3i

Sample program that can crash:

#include <stdio.h>
int main()
{
    int a;
    scanf("%i", &a);
    return 0;
}

To make it crash:
perl -e 'print "5"x2100000' | ./a.out
[../compiz.fix1030473-part1/compizconfig/gsettings/src/gsettings.c:296]: (warning) Casting between double* and float* which have an incompatible binary data representation
[../compiz.fix1030473-part1/compizconfig/libcompizconfig/backend/src/ini.c:686]: (error) Memory pointed to by 'filePath' is freed twice.
[../compiz.fix1030473-part1/compizconfig/libcompizconfig/backend/src/ini.c:187]: (error) Common realloc mistake: 'privData' nulled but not freed upon failure
[../compiz.fix1030473-part1/compizconfig/libcompizconfig/backend/src/ini.c:221]: (error) Common realloc mistake: 'privData' nulled but not freed upon failure
[../compiz.fix1030473-part1/compizconfig/libcompizconfig/src/bindings.c:380]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier:
    %s => %20s
    %i => %3i

Sample program that can crash:

#include <stdio.h>
int main()
{
    int a;
    scanf("%i", &a);
    return 0;
}

To make it crash:
perl -e 'print "5"x2100000' | ./a.out
[../compiz.fix1030473-part1/compizconfig/libcompizconfig/src/compiz.cpp:3039]: (warning) sscanf %s in format string (no. 1) does not specify a width, use %1023s to prevent overflowing destination: name[1024]
[../compiz.fix1030473-part1/compizconfig/libcompizconfig/src/compiz.cpp:3039]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier:
    %s => %20s
    %i => %3i

Sample program that can crash:

#includ...

Revision history for this message
MC Return (mc-return) wrote :
Download full text (46.5 KiB)

Those problems remain:

[../compizconfig/gconf/src/gconf.c:479]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier:
    %s => %20s
    %i => %3i

Sample program that can crash:

#include <stdio.h>
int main()
{
    int a;
    scanf("%i", &a);
    return 0;
}

To make it crash:
perl -e 'print "5"x2100000' | ./a.out
[../compizconfig/gconf/src/gconf.c:1930]: (error) Memory pointed to by 'pathName' is freed twice.
[../compizconfig/gsettings/gsettings_backend_shared/gsettings_util.c:184]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier:
    %s => %20s
    %i => %3i

Sample program that can crash:

#include <stdio.h>
int main()
{
    int a;
    scanf("%i", &a);
    return 0;
}

To make it crash:
perl -e 'print "5"x2100000' | ./a.out
[../compizconfig/gsettings/src/gsettings.c:296]: (warning) Casting between double* and float* which have an incompatible binary data representation
[../compizconfig/libcompizconfig/backend/src/ini.c:686]: (error) Memory pointed to by 'filePath' is freed twice.
[../compizconfig/libcompizconfig/backend/src/ini.c:187]: (error) Common realloc mistake: 'privData' nulled but not freed upon failure
[../compizconfig/libcompizconfig/backend/src/ini.c:221]: (error) Common realloc mistake: 'privData' nulled but not freed upon failure
[../compizconfig/libcompizconfig/src/bindings.c:380]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier:
    %s => %20s
    %i => %3i

Sample program that can crash:

#include <stdio.h>
int main()
{
    int a;
    scanf("%i", &a);
    return 0;
}

To make it crash:
perl -e 'print "5"x2100000' | ./a.out
[../compizconfig/libcompizconfig/src/compiz.cpp:3039]: (warning) sscanf %s in format string (no. 1) does not specify a width, use %1023s to prevent overflowing destination: name[1024]
[../compizconfig/libcompizconfig/src/compiz.cpp:3039]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier:
    %s => %20s
    %i => %3i

Sample program that can crash:

#include <stdio.h>
int main()
{
    int a;
    scanf("%i", &a);
    return 0;
}

To make it crash:
perl -e 'print "5"x2100000' | ./a.out
[../compizconfig/libcompizconfig/src/compiz.cpp:2705]: (error) Memory leak: pbFile
[../compizconfig/libcompizconfig/src/compiz.cpp:2771]: (error) Memory leak: pbFile
[../compizconfig/libcompizconfig/src/compiz.cpp:768]: (performance) 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.
[../compizconfig/libcompizconfig/src/filewatch.c:113]: (error) Common realloc mistake: 'fwData' nulled but not freed upon failure
[../compizconfig/libcompizconfig/src/filewatch.c:173]: (error) Common realloc mistake: 'fwData' nulled but not freed upon failure
[../compizconfig/libcompizconfig/src/ini.c:791]: (error) Common reall...

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

7 for (map <string, vector<string> >::iterator it = testCases.begin ();
8 - it != testCases.end (); it++)
9 + it != testCases.end (); ++it)
10 {
11 for (vector <string>::iterator jt = it->second.begin ();
12 - jt != it->second.end (); jt++)
13 + jt != it->second.end (); ++jt)
14 {
15 if (testfilecmake.good ())
16 {

That's fine - you just need to fix the indentation on lines 9 and 13 of the diff (make it line up with the parens)

51 + int j;
52 for (j = 0; j < num; j++)
53 {

Indentation (should be 1 tab)

68 + int j, num = option.int_desc_size ();
69 for (j = 0; j < num; j++)
70 {

ditto ... there seem to be a lot of places where the indentation isn't quite right. Compiz uses the X11 scheme (which is stupid, but we shouldn't change it)

1 indent: 4 spaces
2 indents: 1 tab (8 wide)
3 indents: 1 tab 4 spaces
4 indents: 2 tabs

etc

You might want to change these:

505 - lastX = -1000000000.0;
506 + float lastX = -1000000000.0, lastZ = 0.0;
507
508 for (i = oldVCount; i < geometry.vCount; i++)
509 {
510 @@ -728,7 +727,7 @@
511 last[0][0] = -1000000000.0;
512 last[1][0] = -1000000000.0;

to

float lastX = std::numeric_limits <float>::min (), rather than their current magic number of -1000000000.0

595 - left = 0;
596 - right = minWidth;
597 - top = 0;
598 - bottom = minHeight;
599 + int left = 0, right = minWidth, top = 0, bottom = minHeight;

Keep these on separate lines, its a bit easier to read

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Lots of indentation needs fixing. Look at the Preview Diff.

I'm not concerned about multiple declarations on one line. It makes sense when the variables are related and/or the line is not very long.

review: Needs Fixing
Revision history for this message
MC Return (mc-return) wrote :

Daniel, I am sorry about the indentation problems.

I tried to not create any new ones ;), but the diff here shows the code differently than the code editor (QTCreator) that I am currently using - it seems that QTCreator is inserting spaces automatically, when I use Tabulator and I am a bit confused about the strange looking diff here...

Also when reading the code it seemed that inconsistent indentation was already an existing problem...

How about using some specialized tool to fix all of those indentation and stylistic problems automatically ?
I've heard recommendations for the code beautifier "Artistic Style" for example: http://astyle.sourceforge.net/

Also: Are the fixes already done in this branch ok so far, except from the wrong indentation, and do you have any comments on the remaining problems cppcheck found and how to best fix those ?

review: Needs Information
3423. By MC Return

Hopefully fixed indentation

Revision history for this message
MC Return (mc-return) wrote :

The strange thing is that I did not touch the indentation at all, when I changed postfix to prefix operators for example, and it looks correct when I check it in QTCreator, but the diff here says otherwise... :(

3424. By MC Return

Hopefully fixed indentation

3425. By MC Return

Hopefully fixed indentation

3426. By MC Return

Hopefully fixed indentation

3427. By MC Return

Hopefully fixed indentation

3428. By MC Return

Hopefully fixed identation

3429. By MC Return

Hopefully fixed indentation

3430. By MC Return

Hopefully fixed indentation

3431. By MC Return

Hopefully fixed indentation (although grid.cpp does not follow the 4 spaces/tabulator style and uses other method of indentation)

3432. By MC Return

Hopefully fixed indentation

3433. By MC Return

Hopefully fixed indentation

3434. By MC Return

Hopefully fixed indentation

3435. By MC Return

Hopefully fixed indentation

3436. By MC Return

Hopefully fixed indentation

Revision history for this message
MC Return (mc-return) wrote :

Sometimes (in the for loops) Tabulator + 5 Spaces were used, I am not sure about those (I used TAB + 4 Spaces)...

The rest of the problems should now be fixed. I hope we can merge this branch ASAP, before starting work on the remaining problems cppcheck detected as those are the more complicated ones and should IMHO not be mixed into one large diff to provide better readability. That is why I named this branch compiz.fix1030473-part1 in the first place ;).

review: Needs Resubmitting
3437. By MC Return

Fixed possible performance problem by replacing postfix operator with prefix one for the variable 'it'

3438. By MC Return

Fixed possible performance problem by replacing postfix operator with prefix one for the variables 'it' and 'cur'

3439. By MC Return

Fixed possible performance problem by replacing postfix operator with prefix one for the variable 'it'

3440. By MC Return

Hopefully fixed indentation

3441. By MC Return

Reduced the scope of the variable 'temp'

3442. By MC Return

Reduced the scope of the variable 'pixmap'

3443. By MC Return

Reduced the scope of the variable 'i'

3444. By MC Return

Reduced the scope of the variables 'v', 's' and 'e'

3445. By MC Return

Reduced the scope of the variables 'v', 's' and 'e'

3446. By MC Return

Reduced the scope of the variables 'v', 's' and 'e'

3447. By MC Return

Reduced the scope of the variables 'v', 's' and 'e'

3448. By MC Return

Reduced the scope of the variable 'i'

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Looks good now, the only indentation thing that remains is aligning the next line of the for statements with the content of the statement itself and not the brace, eg

    for (....
         ....)

not

    for (....
        ....)

As for Qt Creator, here are the settings I use:

http://fpaste.org/MOvt/

3449. By MC Return

Reduced the scope of the variable 'icccmVersion'

Revision history for this message
MC Return (mc-return) wrote :

Sam, thanks for the comment. I will fix those also, now that I understand how it is supposed to be :)

And thanks a lot for your Qt Creator settings !

Revision history for this message
MC Return (mc-return) wrote :
Download full text (34.9 KiB)

Remaining problems detected:

[../compizconfig/gconf/src/gconf.c:479]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier:
    %s => %20s
    %i => %3i

Sample program that can crash:

#include <stdio.h>
int main()
{
    int a;
    scanf("%i", &a);
    return 0;
}

To make it crash:
perl -e 'print "5"x2100000' | ./a.out
[../compizconfig/gconf/src/gconf.c:1930]: (error) Memory pointed to by 'pathName' is freed twice.
[../compizconfig/gsettings/gsettings_backend_shared/gsettings_util.c:184]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier:
    %s => %20s
    %i => %3i

Sample program that can crash:

#include <stdio.h>
int main()
{
    int a;
    scanf("%i", &a);
    return 0;
}

To make it crash:
perl -e 'print "5"x2100000' | ./a.out
[../compizconfig/gsettings/src/gsettings.c:296]: (warning) Casting between double* and float* which have an incompatible binary data representation
[../compizconfig/libcompizconfig/backend/src/ini.c:686]: (error) Memory pointed to by 'filePath' is freed twice.
[../compizconfig/libcompizconfig/backend/src/ini.c:187]: (error) Common realloc mistake: 'privData' nulled but not freed upon failure
[../compizconfig/libcompizconfig/backend/src/ini.c:221]: (error) Common realloc mistake: 'privData' nulled but not freed upon failure
[../compizconfig/libcompizconfig/src/bindings.c:380]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier:
    %s => %20s
    %i => %3i

Sample program that can crash:

#include <stdio.h>
int main()
{
    int a;
    scanf("%i", &a);
    return 0;
}

To make it crash:
perl -e 'print "5"x2100000' | ./a.out
[../compizconfig/libcompizconfig/src/compiz.cpp:3039]: (warning) sscanf %s in format string (no. 1) does not specify a width, use %1023s to prevent overflowing destination: name[1024]
[../compizconfig/libcompizconfig/src/compiz.cpp:3039]: (warning) scanf without field width limits can crash with huge input data. To fix this error message add a field width specifier:
    %s => %20s
    %i => %3i

Sample program that can crash:

#include <stdio.h>
int main()
{
    int a;
    scanf("%i", &a);
    return 0;
}

To make it crash:
perl -e 'print "5"x2100000' | ./a.out
[../compizconfig/libcompizconfig/src/compiz.cpp:2705]: (error) Memory leak: pbFile
[../compizconfig/libcompizconfig/src/compiz.cpp:2771]: (error) Memory leak: pbFile
[../compizconfig/libcompizconfig/src/filewatch.c:113]: (error) Common realloc mistake: 'fwData' nulled but not freed upon failure
[../compizconfig/libcompizconfig/src/filewatch.c:173]: (error) Common realloc mistake: 'fwData' nulled but not freed upon failure
[../compizconfig/libcompizconfig/src/ini.c:791]: (error) Common realloc mistake: 'stringBuffer' nulled but not freed upon failure
[../compizconfig/libcompizconfig/src/iniparser.c:123]: (style) Defensive programming: The variable i is used as array index and then there is a check that it is within limits. This can mean that the array might be accessed out-of-bounds. Reorder conditions such ...

3450. By MC Return

Fixed indentation

3451. By MC Return

Fixed indentation

3452. By MC Return

Fixed intendation

3453. By MC Return

Fixed intendation

3454. By MC Return

Fixed intendation

3455. By MC Return

Fixed intendation

3456. By MC Return

Fixed intendation

3457. By MC Return

Fixed intendation

3458. By MC Return

Fixed intendation

3459. By MC Return

Fixed intendation

Revision history for this message
MC Return (mc-return) wrote :

Okay, should be ready now... :)

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

LGTM

review: Approve
3460. By MC Return

Replaced the magic number assignment of the variable 'lastX' by 'float lastX = std::numeric_limits <float>::min ()'

Revision history for this message
MC Return (mc-return) wrote :

I hope r3460 is okay as well ;) (followed your suggestion in your first comment here).

Revision history for this message
MC Return (mc-return) :
review: Needs Resubmitting
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Looks OK and passes basic testing too.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cmake/src/compiz/compiz_discover_gtest_tests.cpp'
2--- cmake/src/compiz/compiz_discover_gtest_tests.cpp 2012-07-13 09:58:47 +0000
3+++ cmake/src/compiz/compiz_discover_gtest_tests.cpp 2012-07-30 14:34:37 +0000
4@@ -43,10 +43,10 @@
5 if (testfilecmake.is_open ())
6 {
7 for (map <string, vector<string> >::iterator it = testCases.begin ();
8- it != testCases.end (); it++)
9+ it != testCases.end (); ++it)
10 {
11 for (vector <string>::iterator jt = it->second.begin ();
12- jt != it->second.end (); jt++)
13+ jt != it->second.end (); ++jt)
14 {
15 if (testfilecmake.good ())
16 {
17
18=== modified file 'compizconfig/libcompizconfig/src/bindings.c'
19--- compizconfig/libcompizconfig/src/bindings.c 2009-09-01 04:17:14 +0000
20+++ compizconfig/libcompizconfig/src/bindings.c 2012-07-30 14:34:37 +0000
21@@ -213,13 +213,13 @@
22 {
23 char *binding;
24 char *edges;
25- char buttonStr[256];
26
27 edges = ccsEdgesToModString (button->edgeMask);
28 binding = stringAppend (edges, ccsModifiersToString (button->buttonModMask));
29
30 if (button->button)
31 {
32+ char buttonStr[256];
33 snprintf (buttonStr, 256, "Button%d", button->button);
34 binding = stringAppend (binding, buttonStr);
35 }
36
37=== modified file 'compizconfig/libcompizconfig/src/compiz.cpp'
38--- compizconfig/libcompizconfig/src/compiz.cpp 2012-07-03 06:50:34 +0000
39+++ compizconfig/libcompizconfig/src/compiz.cpp 2012-07-30 14:34:37 +0000
40@@ -343,12 +343,13 @@
41 CCSSettingInfo * i,
42 const OptionMetadata & option)
43 {
44- int num, j;
45+ int num;
46
47 num = option.default_value_size ();
48
49 if (num)
50 {
51+ int j;
52 for (j = 0; j < num; j++)
53 {
54 CCSSettingValue *val;
55@@ -409,7 +410,6 @@
56 static void
57 initIntInfoPB (CCSSettingInfo * i, const OptionMetadata & option)
58 {
59- int num, j;
60 i->forInt.min = std::numeric_limits <short>::min ();
61 i->forInt.max = std::numeric_limits <short>::max ();
62 i->forInt.desc = NULL;
63@@ -422,7 +422,7 @@
64
65 if (!basicMetadata)
66 {
67- num = option.int_desc_size ();
68+ int j, num = option.int_desc_size ();
69 for (j = 0; j < num; j++)
70 {
71 const OptionMetadata::IntDescription & intDescMetadata =
72@@ -468,7 +468,6 @@
73 static void
74 initStringInfoPB (CCSSettingInfo * i, const OptionMetadata & option)
75 {
76- int num, j;
77 i->forString.restriction = NULL;
78 i->forString.sortStartsAt = -1;
79 i->forString.extensible = FALSE;
80@@ -481,7 +480,7 @@
81 if (option.has_sort_start ())
82 i->forString.sortStartsAt = option.sort_start ();
83
84- num = option.str_restriction_size ();
85+ int j, num = option.str_restriction_size ();
86 for (j = 0; j < num; j++)
87 {
88 const OptionMetadata::StringRestriction &
89@@ -746,14 +745,12 @@
90 initOptionsFromPB (CCSPlugin * plugin,
91 const PluginMetadata & pluginPB)
92 {
93- int numOpt, i;
94-
95 if (pluginPB.has_screen ())
96 {
97 const ScreenMetadata &screenPB = pluginPB.screen ();
98
99 // Screen options
100- numOpt = screenPB.option_size ();
101+ int i, numOpt = screenPB.option_size ();
102 for (i = 0; i < numOpt; i++)
103 addOptionFromPB (plugin,
104 screenPB.group_desc (),
105@@ -768,7 +765,7 @@
106 {
107 StringList::const_iterator it;
108
109- for (it = strings.begin (); it != strings.end (); it++)
110+ for (it = strings.begin (); it != strings.end (); ++it)
111 {
112 const char *value = (*it).c_str ();
113
114@@ -1551,11 +1548,12 @@
115 void * optionPBv)
116 {
117 xmlNode **nodes;
118- int num, j;
119+ int num;
120
121 nodes = getNodesFromXPath (node->doc, node, "value", &num);
122 if (num)
123 {
124+ int j;
125 for (j = 0; j < num; j++)
126 {
127 void *valuePBv = NULL;
128@@ -1616,9 +1614,8 @@
129 initIntInfo (CCSSettingInfo * i, xmlNode * node, void * optionPBv)
130 {
131 xmlNode **nodes;
132- char *name;
133 char *value;
134- int num, j;
135+ int num;
136 i->forInt.min = std::numeric_limits <short>::min ();
137 i->forInt.max = std::numeric_limits <short>::max ();
138 i->forInt.desc = NULL;
139@@ -1652,6 +1649,8 @@
140 nodes = getNodesFromXPath (node->doc, node, "desc", &num);
141 if (num)
142 {
143+ char *name;
144+ int j;
145 for (j = 0; j < num; j++)
146 {
147 value = getStringFromXPath (node->doc, nodes[j],
148@@ -1751,9 +1750,7 @@
149 initStringInfo (CCSSettingInfo * i, xmlNode * node, void * optionPBv)
150 {
151 xmlNode **nodes;
152- char *name;
153- char *value;
154- int num, j;
155+ int num;
156 i->forString.restriction = NULL;
157 i->forString.sortStartsAt = -1;
158 i->forString.extensible = FALSE;
159@@ -1772,6 +1769,7 @@
160 nodes = getNodesFromXPath (node->doc, node, "sort", &num);
161 if (num)
162 {
163+ char *value;
164 int val = 0; /* Start sorting at 0 unless otherwise specified. */
165
166 value = getStringFromXPath (node->doc, nodes[0], "@start");
167@@ -1794,6 +1792,8 @@
168 nodes = getNodesFromXPath (node->doc, node, "restriction", &num);
169 if (num)
170 {
171+ int j;
172+ char *name, *value;
173 for (j = 0; j < num; j++)
174 {
175 #ifdef USE_PROTOBUF
176@@ -2269,7 +2269,7 @@
177 {
178 xmlNode **nodes;
179 xmlNode **optNodes;
180- int num, i;
181+ int num;
182 void *groupListPBv = NULL;
183 void *subgroupListPBv = NULL;
184
185@@ -2294,6 +2294,7 @@
186 &num);
187 if (num)
188 {
189+ int i;
190 for (i = 0; i < num; i++)
191 {
192 void *optionPBv = NULL;
193@@ -2326,11 +2327,12 @@
194 void * stringListPBv)
195 {
196 xmlNode **nodes;
197- int num, i;
198+ int num;
199 nodes = getNodesFromXPath (node->doc, node, path, &num);
200
201 if (num)
202 {
203+ int i;
204 for (i = 0; i < num; i++)
205 {
206 char *value = stringFromNodeDef (nodes[i], "child::text()", NULL);
207
208=== modified file 'gtk/window-decorator/events.c'
209--- gtk/window-decorator/events.c 2012-05-26 10:13:26 +0000
210+++ gtk/window-decorator/events.c 2012-07-30 14:34:37 +0000
211@@ -440,11 +440,8 @@
212 decor_event *gtkwd_event,
213 decor_event_type gtkwd_type)
214 {
215- static int last_button_num = 0;
216 static Window last_button_xwindow = None;
217 static Time last_button_time = 0;
218- static int last_button_x = 0;
219- static int last_button_y = 0;
220
221 decor_t *d = g_object_get_data (G_OBJECT (win), "decor");
222
223@@ -460,6 +457,9 @@
224
225 if (gtkwd_event->button == 1)
226 {
227+ static int last_button_num = 0;
228+ static int last_button_x = 0;
229+ static int last_button_y = 0;
230 if (gtkwd_event->button == last_button_num &&
231 gtkwd_event->window == last_button_xwindow &&
232 gtkwd_event->time < last_button_time + double_click_timeout &&
233
234=== modified file 'kde/window-decorator-kde4/window.cpp'
235--- kde/window-decorator-kde4/window.cpp 2012-01-12 06:48:58 +0000
236+++ kde/window-decorator-kde4/window.cpp 2012-07-30 14:34:37 +0000
237@@ -1150,7 +1150,6 @@
238 unsigned int frameType = 0xffffff;
239 unsigned int frameState = 0;
240 unsigned int frameActions = 0;
241- int nQuad = 0;
242 int left, right, top, bottom, width, height;
243 unsigned int saveState;
244 bool allocated = false;
245@@ -1204,6 +1203,7 @@
246
247 if (mType != Normal2D)
248 {
249+ int nQuad = 0;
250 if (!data)
251 {
252 allocated = true;
253
254=== modified file 'plugins/animation/src/animation.cpp'
255--- plugins/animation/src/animation.cpp 2012-05-25 04:06:13 +0000
256+++ plugins/animation/src/animation.cpp 2012-07-30 14:34:37 +0000
257@@ -596,10 +596,10 @@
258 bool allRandom = optionGetAllRandom ();
259 AnimEffectVector *randomEffects = &mRandomEffects[animEvent].effects;
260 unsigned int nRandomEffects = randomEffects->size ();
261- unsigned int nFirstRandomEffect = 0;
262
263 if ((effect == AnimEffectRandom) || allRandom)
264 {
265+ unsigned int nFirstRandomEffect = 0;
266 if (nRandomEffects == 0) // no random animation selected, assume "all"
267 {
268 randomEffects = &mEventEffectsAllowed[animEvent];
269@@ -978,7 +978,7 @@
270 PrivateAnimScreen::eventMatchesChanged (CompOption *opt,
271 AnimationOptions::Options num)
272 {
273- if (mExtensionPlugins.size () == 0)
274+ if (mExtensionPlugins.empty ())
275 initAnimationList ();
276 foreach (CompOption::Value &val, opt->value ().list ())
277 val.match ().update ();
278@@ -988,7 +988,7 @@
279 PrivateAnimScreen::eventOptionsChanged (CompOption *opt,
280 AnimationOptions::Options num)
281 {
282- if (mExtensionPlugins.size () == 0)
283+ if (mExtensionPlugins.empty ())
284 initAnimationList ();
285 updateOptionSets (getCorrespondingAnimEvent (num));
286 }
287@@ -997,7 +997,7 @@
288 PrivateAnimScreen::eventEffectsChanged (CompOption *opt,
289 AnimationOptions::Options num)
290 {
291- if (mExtensionPlugins.size () == 0)
292+ if (mExtensionPlugins.empty ())
293 initAnimationList ();
294 updateEventEffects (getCorrespondingAnimEvent (num), false);
295 }
296@@ -1006,7 +1006,7 @@
297 PrivateAnimScreen::eventRandomEffectsChanged (CompOption *opt,
298 AnimationOptions::Options num)
299 {
300- if (mExtensionPlugins.size () == 0)
301+ if (mExtensionPlugins.empty ())
302 initAnimationList ();
303 updateEventEffects (getCorrespondingAnimEvent (num), true);
304 }
305@@ -1267,7 +1267,7 @@
306
307 /* Paint list includes destroyed windows */
308 for (CompWindowList::const_reverse_iterator rit = pl.rbegin ();
309- rit != pl.rend (); rit++)
310+ rit != pl.rend (); ++rit)
311 {
312 CompWindow *w = (*rit);
313 AnimWindow *animWin = AnimWindow::get (w);
314@@ -1383,7 +1383,7 @@
315
316 /* Paint list includes destroyed windows */
317 for (CompWindowList::const_reverse_iterator rit = pl.rbegin ();
318- rit != pl.rend (); rit++)
319+ rit != pl.rend (); ++rit)
320 {
321 CompWindow *w = (*rit);
322 AnimWindow *animWin = AnimWindow::get (w);
323@@ -2931,7 +2931,7 @@
324
325 // Destroy each persistent data object
326 PersistentDataMap::iterator itData = persistentData.begin ();
327- for (; itData != persistentData.end (); itData++)
328+ for (; itData != persistentData.end (); ++itData)
329 delete itData->second;
330
331 persistentData.clear ();
332
333=== modified file 'plugins/animation/src/extensionplugin.cpp'
334--- plugins/animation/src/extensionplugin.cpp 2011-09-15 09:54:32 +0000
335+++ plugins/animation/src/extensionplugin.cpp 2012-07-30 14:34:37 +0000
336@@ -149,7 +149,7 @@
337
338 // Go in reverse order so that restack chains are handled properly
339 for (CompWindowVector::reverse_iterator rit = mLastClientList.rbegin ();
340- rit != mLastClientList.rend (); rit++)
341+ rit != mLastClientList.rend (); ++rit)
342 {
343 CompWindow *w = (*rit);
344 AnimWindow *aw = AnimWindow::get (w);
345@@ -227,7 +227,7 @@
346 // Now initiate focus animations (after the restack chains are formed
347 // right above)
348 for (CompWindowVector::reverse_iterator rit = mLastClientList.rbegin ();
349- rit != mLastClientList.rend (); rit++)
350+ rit != mLastClientList.rend (); ++rit)
351 {
352 CompWindow *w = (*rit);
353 AnimWindow *aw = AnimWindow::get (w);
354@@ -274,7 +274,7 @@
355
356 // TODO consider removing this loop and skipPostPrepareScreen
357 for (CompWindowVector::reverse_iterator rit = mLastClientList.rbegin ();
358- rit != mLastClientList.rend (); rit++)
359+ rit != mLastClientList.rend (); ++rit)
360 {
361 CompWindow *w = (*rit);
362 AnimWindow *aw = AnimWindow::get (w);
363
364=== modified file 'plugins/animationaddon/src/burn.cpp'
365--- plugins/animationaddon/src/burn.cpp 2010-01-26 03:40:28 +0000
366+++ plugins/animationaddon/src/burn.cpp 2012-07-30 14:34:37 +0000
367@@ -392,11 +392,11 @@
368 // force animation to continue until particle systems are done
369 mRemainingTime = timestep;
370
371- int nParticles;
372 Particle *part;
373
374 if (mRemainingTime > 0)
375 {
376+ int nParticles;
377 if (mHasSmoke)
378 {
379 float partxg = outRect.width () / 40.0;
380
381=== modified file 'plugins/annotate/src/annotate.cpp'
382--- plugins/annotate/src/annotate.cpp 2012-06-24 10:12:15 +0000
383+++ plugins/annotate/src/annotate.cpp 2012-07-30 14:34:37 +0000
384@@ -779,12 +779,11 @@
385 AnnoScreen::handleMotionEvent (int xRoot,
386 int yRoot)
387 {
388- static unsigned short clearColor[] = { 0, 0, 0, 0 };
389-
390 CompRect damageRect;
391
392 if (grabIndex)
393 {
394+ static unsigned short clearColor[] = { 0, 0, 0, 0 };
395 switch (drawMode)
396 {
397 case EraseMode:
398
399=== modified file 'plugins/ccp/src/ccp.cpp'
400--- plugins/ccp/src/ccp.cpp 2012-07-03 06:22:53 +0000
401+++ plugins/ccp/src/ccp.cpp 2012-07-30 14:34:37 +0000
402@@ -193,7 +193,6 @@
403 else
404 {
405 CCSSettingValueList list;
406- int i = 0;
407 CompOption::Type type;
408
409 ccsGetList (s, &list);
410@@ -208,6 +207,7 @@
411 }
412 else
413 {
414+ int i = 0;
415 CompOption::Value::Vector val (ccsSettingValueListLength (list));
416
417 while (list)
418
419=== modified file 'plugins/clone/src/clone.cpp'
420--- plugins/clone/src/clone.cpp 2010-02-04 17:16:02 +0000
421+++ plugins/clone/src/clone.cpp 2012-07-30 14:34:37 +0000
422@@ -376,7 +376,7 @@
423 }
424 else
425 {
426- it++;
427+ ++it;
428 }
429 }
430
431@@ -533,7 +533,7 @@
432 {
433 std::list <Clone *>::iterator it;
434
435- for (it = clones.begin (); it != clones.end (); it++)
436+ for (it = clones.begin (); it != clones.end (); ++it)
437 {
438 if ((unsigned int) (*it)->dst >= screen->outputDevs ().size () ||
439 (unsigned int) (*it)->src >= screen->outputDevs ().size ())
440
441=== modified file 'plugins/colorfilter/src/parser.cpp'
442--- plugins/colorfilter/src/parser.cpp 2010-11-04 14:47:16 +0000
443+++ plugins/colorfilter/src/parser.cpp 2012-07-30 14:34:37 +0000
444@@ -149,7 +149,7 @@
445 {
446 CompString arg;
447 CompString string;
448- size_t next, temp, orig;
449+ size_t next, orig;
450 int length;
451 CompString retArg;
452
453@@ -167,6 +167,7 @@
454 if ((next = string.find (",", pos)) != std::string::npos ||
455 (next = string.find (";", pos)) != std::string::npos)
456 {
457+ size_t temp;
458 length = next - pos;
459 if (!length)
460 {
461
462=== modified file 'plugins/compiztoolbox/src/compiztoolbox.cpp'
463--- plugins/compiztoolbox/src/compiztoolbox.cpp 2012-01-18 16:26:45 +0000
464+++ plugins/compiztoolbox/src/compiztoolbox.cpp 2012-07-30 14:34:37 +0000
465@@ -267,7 +267,7 @@
466 if (!grabIndex)
467 return NULL;
468
469- for (it = windows.begin (); it != windows.end (); it++, cur++)
470+ for (it = windows.begin (); it != windows.end (); ++it, ++cur)
471 {
472 if (*it == selectedWindow)
473 break;
474@@ -278,7 +278,7 @@
475
476 if (toNext)
477 {
478- it++;
479+ ++it;
480 if (it == windows.end ())
481 w = windows.front ();
482 else
483
484=== modified file 'plugins/composite/src/screen.cpp'
485--- plugins/composite/src/screen.cpp 2012-06-24 10:01:31 +0000
486+++ plugins/composite/src/screen.cpp 2012-07-30 14:34:37 +0000
487@@ -573,7 +573,7 @@
488
489 for (CompWindowList::reverse_iterator rit =
490 screen->windows ().rbegin ();
491- rit != screen->windows ().rend (); rit++)
492+ rit != screen->windows ().rend (); ++rit)
493 if (CompositeWindow::get (*rit)->overlayWindow ())
494 {
495 tmpRegion -= (*rit)->region ();
496@@ -770,7 +770,7 @@
497 {
498 for (CompWindowList::reverse_iterator rit =
499 screen->windows ().rbegin ();
500- rit != screen->windows ().rend (); rit++)
501+ rit != screen->windows ().rend (); ++rit)
502 {
503 CompWindow *w = (*rit);
504
505@@ -800,7 +800,7 @@
506
507 Display *dpy = screen->dpy ();
508 std::map<Damage, XRectangle>::iterator d = priv->damages.begin ();
509- for (; d != priv->damages.end (); d++)
510+ for (; d != priv->damages.end (); ++d)
511 {
512 XserverRegion sub = XFixesCreateRegion (dpy, &d->second, 1);
513 if (sub != None)
514
515=== modified file 'plugins/cubeaddon/src/cubeaddon.cpp'
516--- plugins/cubeaddon/src/cubeaddon.cpp 2012-05-18 06:52:20 +0000
517+++ plugins/cubeaddon/src/cubeaddon.cpp 2012-07-30 14:34:37 +0000
518@@ -611,12 +611,11 @@
519 int i, oldVCount = geometry.vCount;
520 GLfloat *v;
521 int offX = 0, offY = 0;
522- int sx1, sx2, sw, sy1, sy2, sh, cLast;
523- float lastX, lastZ = 0.0, radSquare, last[2][4];
524+ int sx1, sx2, sw, sy1, sy2, sh;
525+ float radSquare, last[2][4];
526 float inv = (cubeScreen->invert () == 1) ? 1.0 : -1.0;
527
528- float a1, a2, ang, vpx, vpy, sx1g, sx2g, sy1g, sy2g;
529- int iang;
530+ float ang, sx1g, sx2g, sy1g, sy2g;
531
532 CubeScreen::MultioutputMode cMOM = cubeScreen->multioutputMode ();
533 int caD = caScreen->optionGetDeformation ();
534@@ -696,7 +695,7 @@
535
536 if (caD == CubeaddonScreen::DeformationCylinder || cubeScreen->unfolded ())
537 {
538- lastX = -1000000000.0;
539+ float lastX = std::numeric_limits <float>::min (), lastZ = 0.0;
540
541 for (i = oldVCount; i < geometry.vCount; i++)
542 {
543@@ -728,7 +727,7 @@
544 last[0][0] = -1000000000.0;
545 last[1][0] = -1000000000.0;
546
547- cLast = 0;
548+ int cLast = 0;
549 for (i = oldVCount; i < geometry.vCount; i++)
550 {
551 if (last[0][0] == v[0] && last[0][1] == v[1])
552@@ -746,21 +745,21 @@
553 continue;
554 }
555
556- vpx = v[0] + offX;
557- vpy = v[1] + offY;
558+ float vpx = v[0] + offX;
559+ float vpy = v[1] + offY;
560
561 if (vpx >= sx1g && vpx < sx2g &&
562 vpy >= sy1g && vpy < sy2g)
563 {
564 last[cLast][0] = v[0];
565 last[cLast][1] = v[1];
566- a1 = (((vpx - sx1) / (float)sw) - 0.5);
567- a2 = (((vpy - sy1) / (float)sh) - 0.5);
568+ float a1 = (((vpx - sx1) / (float)sw) - 0.5);
569+ float a2 = (((vpy - sy1) / (float)sh) - 0.5);
570 a2 *= a2;
571
572 ang = atanf (a1 / cDist);
573 a2 = sqrtf (radSquare - a2);
574- iang = (((int)(ang * RAD2I1024)) + 1024) & 0x3ff;
575+ int iang = (((int)(ang * RAD2I1024)) + 1024) & 0x3ff;
576
577 v[2] += ((caScreen->mCosT [iang] * a2) - cDist) * caScreen->mDeform * inv;
578 v[0] += ((caScreen->mSinT [iang] * a2) - a1) * sw * caScreen->mDeform;
579@@ -1001,8 +1000,8 @@
580 mCapDeformType != optionGetDeformation ())
581 {
582 float *quad;
583- int i, j;
584- float rS, r, x, y, z, w;
585+ int j;
586+ float rS, r, x, y, z;
587 if (optionGetDeformation () != DeformationSphere ||
588 !optionGetDeformCaps ())
589 {
590@@ -1039,6 +1038,8 @@
591 }
592 else
593 {
594+ int i;
595+ float w;
596 rS = cDist2 + 0.5;
597
598 mCapFill[0] = 0.0;
599
600=== modified file 'plugins/dbus/src/dbus.cpp'
601--- plugins/dbus/src/dbus.cpp 2012-06-24 09:00:27 +0000
602+++ plugins/dbus/src/dbus.cpp 2012-07-30 14:34:37 +0000
603@@ -211,7 +211,7 @@
604 CompPlugin::List::const_iterator it = plugins.begin ();
605 if (it != plugins.end ())
606 {
607- for (; it != plugins.end (); it++)
608+ for (; it != plugins.end (); ++it)
609 {
610 CompPlugin::VTable *v = it->vTable;
611 if (v)
612
613=== modified file 'plugins/decor/src/clip-groups/tests/clip-groups/src/test-decor-clip-groups.cpp'
614--- plugins/decor/src/clip-groups/tests/clip-groups/src/test-decor-clip-groups.cpp 2012-03-30 14:29:18 +0000
615+++ plugins/decor/src/clip-groups/tests/clip-groups/src/test-decor-clip-groups.cpp 2012-07-30 14:34:37 +0000
616@@ -134,7 +134,7 @@
617 const CompRect::vector &rv = reg.rects ();
618 for (CompRect::vector::const_iterator it = rv.begin ();
619 it != rv.end ();
620- it++)
621+ ++it)
622 {
623 const CompRect &r = *it;
624 *os << " - Rect : " << r.x () << " " << r.y () << " " << r.width () << " " << r.height () << std::endl;
625
626=== modified file 'plugins/decor/src/decor.cpp'
627--- plugins/decor/src/decor.cpp 2012-07-09 11:09:28 +0000
628+++ plugins/decor/src/decor.cpp 2012-07-30 14:34:37 +0000
629@@ -609,7 +609,6 @@
630 updateState (0),
631 mPixmapReceiver (requestor, this)
632 {
633- int left, right, top, bottom;
634 int x1, y1, x2, y2;
635
636 if (!texture && type == WINDOW_DECORATION_TYPE_PIXMAP)
637@@ -620,10 +619,7 @@
638
639 if (type == WINDOW_DECORATION_TYPE_PIXMAP)
640 {
641- left = 0;
642- right = minWidth;
643- top = 0;
644- bottom = minHeight;
645+ int left = 0, right = minWidth, top = 0, bottom = minHeight;
646
647 for (unsigned int i = 0; i < nQuad; i++)
648 {
649@@ -835,7 +831,7 @@
650 Decoration::Ptr d = Decoration::create (id, prop, n, type, i, requestor);
651
652 /* Try to replace an existing decoration */
653- for (; it != mList.end (); it++)
654+ for (; it != mList.end (); ++it)
655 {
656 if ((*it)->frameType == d->frameType &&
657 (*it)->frameState == d->frameState &&
658@@ -884,7 +880,7 @@
659 std::list <Decoration::Ptr>::iterator it = mList.begin ();
660
661 /* Use an existing decoration */
662- for (; it != mList.end (); it++)
663+ for (; it != mList.end (); ++it)
664 {
665 if ((*it)->frameType == frameType &&
666 (*it)->frameState == frameState &&
667@@ -1340,7 +1336,7 @@
668 cit = mList.begin ();
669
670 for (std::list <Decoration::Ptr>::iterator it = mList.begin ();
671- it != mList.end (); it++)
672+ it != mList.end (); ++it)
673 {
674 const Decoration::Ptr &d = *it;
675
676
677=== modified file 'plugins/extrawm/src/extrawm.cpp'
678--- plugins/extrawm/src/extrawm.cpp 2010-12-02 09:20:58 +0000
679+++ plugins/extrawm/src/extrawm.cpp 2012-07-30 14:34:37 +0000
680@@ -32,7 +32,7 @@
681 std::list <CompWindow *>::iterator it;
682
683 /* check if the window is already there */
684- for (it = attentionWindows.begin (); it != attentionWindows.end (); it++)
685+ for (it = attentionWindows.begin (); it != attentionWindows.end (); ++it)
686 {
687 if (*it == w)
688 return;
689@@ -90,7 +90,7 @@
690 * again, and that would mean that we'd want to handle them
691 * if they became wanting attention again) */
692
693- for (; it != es->attentionWindows.end (); it++)
694+ for (; it != es->attentionWindows.end (); ++it)
695 {
696 CompWindow *w = *it;
697
698
699=== modified file 'plugins/ezoom/src/ezoom.cpp'
700--- plugins/ezoom/src/ezoom.cpp 2012-05-18 06:52:20 +0000
701+++ plugins/ezoom/src/ezoom.cpp 2012-07-30 14:34:37 +0000
702@@ -1480,7 +1480,6 @@
703 CompOption::Vector options,
704 float target)
705 {
706- int x, y;
707 int out = screen->outputDeviceForPoint (pointerX, pointerY);
708 CompWindow *w;
709
710@@ -1499,8 +1498,8 @@
711 }
712 else
713 {
714- x = CompOption::getIntOptionNamed (options, "x", 0);
715- y = CompOption::getIntOptionNamed (options, "y", 0);
716+ int x = CompOption::getIntOptionNamed (options, "x", 0);
717+ int y = CompOption::getIntOptionNamed (options, "y", 0);
718 setCenter (x, y, false);
719 }
720
721
722=== modified file 'plugins/firepaint/src/firepaint.cpp'
723--- plugins/firepaint/src/firepaint.cpp 2010-10-23 15:42:02 +0000
724+++ plugins/firepaint/src/firepaint.cpp 2012-07-30 14:34:37 +0000
725@@ -453,7 +453,6 @@
726 void
727 FireScreen::preparePaint (int time)
728 {
729- float size = 4;
730 float bg = (float) optionGetBgBrightness () / 100.0;
731
732 if (init && points.size ())
733@@ -485,7 +484,7 @@
734 float max_new = MIN ((int) ps.particles.size (), (int) points.size () * 2) *
735 ((float) time / 50.0) *
736 (1.05 - optionGetFireLife());
737- float rVal;
738+ float rVal, size = 4;
739 int rVal2;
740
741 for (unsigned int i = 0;
742
743=== modified file 'plugins/grid/src/grid.cpp'
744--- plugins/grid/src/grid.cpp 2012-05-27 04:32:55 +0000
745+++ plugins/grid/src/grid.cpp 2012-07-30 14:34:37 +0000
746@@ -447,7 +447,7 @@
747 glDisableClientState (GL_TEXTURE_COORD_ARRAY);
748 glEnable (GL_BLEND);
749
750- for (iter = animations.begin (); iter != animations.end () && animating; iter++)
751+ for (iter = animations.begin (); iter != animations.end () && animating; ++iter)
752 {
753 Animation& anim = *iter;
754 float alpha = ((float) optionGetFillColorAlpha () / 65535.0f) * anim.opacity;
755@@ -632,7 +632,6 @@
756 {
757 CompOutput out;
758 CompWindow *w;
759- bool check = false;
760
761 screen->handleEvent (event);
762
763@@ -696,6 +695,7 @@
764
765 if (lastEdge != edge)
766 {
767+ bool check = false;
768 lastSlot = desiredSlot;
769
770 if (edge == NoEdge)
771@@ -932,7 +932,7 @@
772 {
773 std::vector<Animation>::iterator iter;
774
775- for (iter = animations.begin (); iter != animations.end (); iter++)
776+ for (iter = animations.begin (); iter != animations.end (); ++iter)
777 {
778 Animation& anim = *iter;
779 anim.timer -= msSinceLastPaint;
780@@ -972,7 +972,7 @@
781 if (anim.complete)
782 iter = animations.erase(iter);
783 else
784- iter++;
785+ ++iter;
786 }
787
788 if (animations.empty ())
789
790=== modified file 'plugins/group/src/group.cpp'
791--- plugins/group/src/group.cpp 2012-05-18 06:52:20 +0000
792+++ plugins/group/src/group.cpp 2012-07-30 14:34:37 +0000
793@@ -318,7 +318,7 @@
794 if ((w->id () != top->id ()) && (gw->mGroup == this))
795 {
796 (*it) = w;
797- it++;
798+ ++it;
799 }
800 }
801
802
803=== modified file 'plugins/group/src/init.cpp'
804--- plugins/group/src/init.cpp 2012-05-27 04:32:55 +0000
805+++ plugins/group/src/init.cpp 2012-07-30 14:34:37 +0000
806@@ -185,7 +185,7 @@
807 }
808 }
809
810- rit++;
811+ ++rit;
812 }
813
814 return false;
815@@ -298,7 +298,7 @@
816 bool topIdInGroup = false;
817 for (std::list <Window>::iterator it = group->mWindowIds.begin ();
818 it != group->mWindowIds.end ();
819- it++)
820+ ++it)
821 {
822 CompWindow *w = screen->findWindow (*it);
823
824@@ -493,7 +493,7 @@
825 {
826 GroupTabBarSlot *slot = *rit;
827 delete slot;
828- rit--;
829+ --rit;
830 }
831
832 group->mTabBar->mSlots.clear ();
833@@ -502,7 +502,7 @@
834 }
835
836 delete group;
837- rit++;
838+ ++rit;
839 }
840 }
841
842
843=== modified file 'plugins/group/src/paint.cpp'
844--- plugins/group/src/paint.cpp 2011-03-14 15:58:39 +0000
845+++ plugins/group/src/paint.cpp 2012-07-30 14:34:37 +0000
846@@ -588,7 +588,7 @@
847 /* groupDrawTabAnimation may delete the group, so better
848 save the pointer to the next chain element */
849
850- it++;
851+ ++it;
852
853 if (group->mTabbingState != GroupSelection::NoTabbing)
854 keepPainting |= group->drawTabAnimation (msSinceLastPaint);
855
856=== modified file 'plugins/group/src/selection.cpp'
857--- plugins/group/src/selection.cpp 2010-11-05 07:44:58 +0000
858+++ plugins/group/src/selection.cpp 2012-07-30 14:34:37 +0000
859@@ -120,14 +120,14 @@
860 */
861 if (gw->mGroup && groupFindGroupInWindows (gw->mGroup, *ret))
862 {
863- rit++;
864+ ++rit;
865 continue;
866 }
867
868 ret->push_back (w);
869 }
870
871- rit++;
872+ ++rit;
873 }
874
875 return ret;
876@@ -186,7 +186,7 @@
877 }
878
879 (*it) = cw;
880- it++;
881+ ++it;
882 }
883 }
884
885@@ -317,7 +317,7 @@
886 GroupScreen::get (screen)->mGroups.push_front (group);
887 }
888
889- for (; it != end (); it++)
890+ for (; it != end (); ++it)
891 {
892 cw = *it;
893 GROUP_WINDOW (cw);
894
895=== modified file 'plugins/group/src/tab.cpp'
896--- plugins/group/src/tab.cpp 2012-05-18 06:52:20 +0000
897+++ plugins/group/src/tab.cpp 2012-07-30 14:34:37 +0000
898@@ -983,7 +983,7 @@
899 /* Move all windows to their animation target position */
900 for (CompWindowList::iterator it = mWindows.begin ();
901 it != mWindows.end ();
902- it++)
903+ ++it)
904 {
905 CompWindow *w = *it;
906 GROUP_WINDOW (w);
907@@ -1850,11 +1850,11 @@
908 /* Count from left to the current top tab */
909 if (group->mTabBar->mTopTab)
910 for (; (*it) && ((*it) != group->mTabBar->mTopTab);
911- it++, distanceOld++);
912+ ++it, distanceOld++);
913
914 /* Count from left to the requested top tab */
915 for (it = group->mTabBar->mSlots.begin (); (*it) && ((*it) != topTab);
916- it++, distanceNew++);
917+ ++it, distanceNew++);
918
919 if (distanceNew < distanceOld)
920 group->mTabBar->mChangeAnimationDirection = 1; /*left */
921
922=== modified file 'plugins/loginout/src/loginout.cpp'
923--- plugins/loginout/src/loginout.cpp 2010-04-29 03:30:17 +0000
924+++ plugins/loginout/src/loginout.cpp 2012-07-30 14:34:37 +0000
925@@ -171,7 +171,7 @@
926 void
927 LoginoutScreen::preparePaint (int ms)
928 {
929- float val, val2;
930+ float val;
931
932 val = ((float)ms / 1000.0) / optionGetInTime ();
933
934@@ -190,7 +190,7 @@
935 if (in > 0.0 || out > 0.0)
936 {
937 val = (in * optionGetInOpacity () / 100.0) + (1.0 - in);
938- val2 = (out * optionGetOutOpacity () / 100.0) + (1.0 - out);
939+ float val2 = (out * optionGetOutOpacity () / 100.0) + (1.0 - out);
940 opacity = MIN (val, val2);
941
942 val = (in * optionGetInSaturation () / 100.0) + (1.0 - in);
943
944=== modified file 'plugins/mousepoll/src/mousepoll.cpp'
945--- plugins/mousepoll/src/mousepoll.cpp 2009-03-16 05:20:59 +0000
946+++ plugins/mousepoll/src/mousepoll.cpp 2012-07-30 14:34:37 +0000
947@@ -60,8 +60,8 @@
948 for (it = pollers.begin (); it != pollers.end (); )
949 {
950 MousePoller *poller = *it;
951-
952- it++;
953+
954+ ++it;
955 poller->mPoint = pos;
956 poller->mCallback (pos);
957 }
958
959=== modified file 'plugins/opengl/src/fragment.cpp'
960--- plugins/opengl/src/fragment.cpp 2012-01-18 16:26:45 +0000
961+++ plugins/opengl/src/fragment.cpp 2012-07-30 14:34:37 +0000
962@@ -1050,7 +1050,7 @@
963
964 it = s->fragmentStorage ()->programs.begin ();
965
966- for (; it != s->fragmentStorage ()->programs.end (); it++)
967+ for (; it != s->fragmentStorage ()->programs.end (); ++it)
968 {
969 foreach (FunctionId i, (*it)->signature)
970 if (i == id)
971
972=== modified file 'plugins/opengl/src/paint.cpp'
973--- plugins/opengl/src/paint.cpp 2012-04-14 06:36:49 +0000
974+++ plugins/opengl/src/paint.cpp 2012-07-30 14:34:37 +0000
975@@ -244,7 +244,7 @@
976 if (!(mask & PAINT_SCREEN_NO_OCCLUSION_DETECTION_MASK))
977 {
978 /* detect occlusions */
979- for (rit = pl.rbegin (); rit != pl.rend (); rit++)
980+ for (rit = pl.rbegin (); rit != pl.rend (); ++rit)
981 {
982 w = (*rit);
983 gw = GLWindow::get (w);
984
985=== modified file 'plugins/place/src/place.cpp'
986--- plugins/place/src/place.cpp 2012-06-24 09:00:27 +0000
987+++ plugins/place/src/place.cpp 2012-07-30 14:34:37 +0000
988@@ -959,7 +959,7 @@
989 winHeight = window->serverHeight ();
990
991 cascadeStage = 0;
992- for (iter = sorted.begin (); iter != sorted.end (); iter++)
993+ for (iter = sorted.begin (); iter != sorted.end (); ++iter)
994 {
995 Placeable *p = *iter;
996 int wx, wy;
997
998=== modified file 'plugins/place/src/screen-size-change/src/screen-size-change.cpp'
999--- plugins/place/src/screen-size-change/src/screen-size-change.cpp 2012-01-21 17:16:07 +0000
1000+++ plugins/place/src/screen-size-change/src/screen-size-change.cpp 2012-07-30 14:34:37 +0000
1001@@ -37,7 +37,7 @@
1002 compiz::place::ScreenSizeChangeObject::adjustForSize (const CompSize &oldSize,
1003 const CompSize &newSize)
1004 {
1005- int vpX, vpY, shiftX, shiftY;
1006+ int vpX, vpY;
1007 compiz::window::Geometry g, vpRelRect;
1008 int pivotX, pivotY;
1009 int curVpOffsetX = getViewport ().x () * newSize.width ();
1010@@ -92,8 +92,8 @@
1011
1012 g.setPos (g.pos ());
1013
1014- shiftX = vpX * (newSize.width () - oldSize.width ());
1015- shiftY = vpY * (newSize.width () - oldSize.height ());
1016+ int shiftX = vpX * (newSize.width () - oldSize.width ()),
1017+ shiftY = vpY * (newSize.width () - oldSize.height ());
1018
1019 /* if coords. relative to viewport are outside new viewport area,
1020 shift window left/up so that it falls inside */
1021
1022=== modified file 'plugins/resize/src/resize.cpp'
1023--- plugins/resize/src/resize.cpp 2012-04-19 12:06:05 +0000
1024+++ plugins/resize/src/resize.cpp 2012-07-30 14:34:37 +0000
1025@@ -1043,7 +1043,6 @@
1026
1027 if (isConstrained)
1028 {
1029- int minWidth = 50;
1030 int minHeight = 50;
1031
1032 /* rect. for a minimal height window + borders
1033@@ -1083,6 +1082,7 @@
1034 int nx = x;
1035 int nw = wi;
1036 int nh = he;
1037+ int minWidth = 50;
1038
1039 if (mask & (ResizeLeftMask | ResizeRightMask))
1040 {
1041@@ -1304,20 +1304,19 @@
1042 }
1043 else
1044 {
1045- static unsigned int mask[] = {
1046- ResizeUpMask | ResizeLeftMask,
1047- ResizeUpMask,
1048- ResizeUpMask | ResizeRightMask,
1049- ResizeRightMask,
1050- ResizeDownMask | ResizeRightMask,
1051- ResizeDownMask,
1052- ResizeDownMask | ResizeLeftMask,
1053- ResizeLeftMask,
1054- };
1055-
1056 /* TODO: not only button 1 */
1057 if (pointerMods & Button1Mask)
1058 {
1059+ static unsigned int mask[] = {
1060+ ResizeUpMask | ResizeLeftMask,
1061+ ResizeUpMask,
1062+ ResizeUpMask | ResizeRightMask,
1063+ ResizeRightMask,
1064+ ResizeDownMask | ResizeRightMask,
1065+ ResizeDownMask,
1066+ ResizeDownMask | ResizeLeftMask,
1067+ ResizeLeftMask,
1068+ };
1069 o.push_back (CompOption ("modifiers",
1070 CompOption::TypeInt));
1071 o.push_back (CompOption ("x",
1072
1073=== modified file 'plugins/ring/src/ring.cpp'
1074--- plugins/ring/src/ring.cpp 2011-02-23 20:59:45 +0000
1075+++ plugins/ring/src/ring.cpp 2012-07-30 14:34:37 +0000
1076@@ -221,14 +221,14 @@
1077 unsigned int mask)
1078 {
1079 bool status;
1080- bool pixmap = true;
1081
1082 RING_SCREEN (screen);
1083
1084 if (rs->mState != RingScreen::RingStateNone)
1085 {
1086 GLWindowPaintAttrib sAttrib = attrib;
1087- bool scaled = false;
1088+ bool scaled = false;
1089+ bool pixmap = true;
1090
1091 if (window->mapNum ())
1092 {
1093@@ -784,7 +784,7 @@
1094 mState == RingScreen::RingStateOut)
1095 {
1096 for (std::vector <RingDrawSlot>::iterator it = mDrawSlots.begin ();
1097- it != mDrawSlots.end (); it++)
1098+ it != mDrawSlots.end (); ++it)
1099 {
1100 CompWindow *w = (*it).w;
1101
1102@@ -1116,12 +1116,12 @@
1103
1104 if (w == selected)
1105 {
1106- it++;
1107+ ++it;
1108 if (it != mWindows.end ())
1109 selected = *it;
1110 else
1111 selected = mWindows.front ();
1112- it--;
1113+ --it;
1114
1115 mSelectedWindow = selected;
1116 renderWindowTitle ();
1117@@ -1130,7 +1130,7 @@
1118 mWindows.erase (it);
1119 break;
1120 }
1121- it++;
1122+ ++it;
1123 }
1124
1125 if (!inList)
1126
1127=== modified file 'plugins/scale/src/scale.cpp'
1128--- plugins/scale/src/scale.cpp 2012-06-22 10:10:44 +0000
1129+++ plugins/scale/src/scale.cpp 2012-07-30 14:34:37 +0000
1130@@ -770,7 +770,7 @@
1131 windows.clear ();
1132
1133 for (std::map<ScaleWindow *, ScaleSlot>::iterator it = slotWindows.begin ();
1134- it != slotWindows.end (); it++)
1135+ it != slotWindows.end (); ++it)
1136 {
1137 slots.push_back (it->second);
1138 windows.push_back (it->first);
1139@@ -949,7 +949,7 @@
1140 int x1, y1, x2, y2;
1141 CompWindowList::reverse_iterator rit = screen->windows ().rbegin ();
1142
1143- for (; rit != screen->windows ().rend (); rit++)
1144+ for (; rit != screen->windows ().rend (); ++rit)
1145 {
1146 CompWindow *w = *rit;
1147 SCALE_WINDOW (w);
1148
1149=== modified file 'plugins/session/src/session.cpp'
1150--- plugins/session/src/session.cpp 2012-05-18 06:52:20 +0000
1151+++ plugins/session/src/session.cpp 2012-07-30 14:34:37 +0000
1152@@ -200,12 +200,11 @@
1153 const char *prop)
1154 {
1155 xmlChar *temp;
1156- int num;
1157
1158 temp = xmlGetProp (node, BAD_CAST prop);
1159 if (temp)
1160 {
1161- num = xmlXPathCastStringToNumber (temp);
1162+ int num = xmlXPathCastStringToNumber (temp);
1163 xmlFree (temp);
1164
1165 return num;
1166@@ -267,7 +266,6 @@
1167 {
1168 CompString clientId, command, string;
1169 CompString resName, resClass;
1170- int x, y, width, height;
1171 xmlNodePtr node, childNode;
1172
1173 if (!getClientLeaderProperty (w, clientIdAtom, clientId) &&
1174@@ -308,8 +306,8 @@
1175 childNode = xmlNewChild (node, NULL, BAD_CAST "geometry", NULL);
1176 if (childNode)
1177 {
1178- x = (w->saveMask () & CWX) ? w->saveWc ().x : w->serverX ();
1179- y = (w->saveMask () & CWY) ? w->saveWc ().y : w->serverY ();
1180+ int x = (w->saveMask () & CWX) ? w->saveWc ().x : w->serverX ();
1181+ int y = (w->saveMask () & CWY) ? w->saveWc ().y : w->serverY ();
1182 if (!w->onAllViewports ())
1183 {
1184 x += screen->vp ().x () * screen->width ();
1185@@ -319,9 +317,9 @@
1186 x -= w->border ().left;
1187 y -= w->border ().top;
1188
1189- width = (w->saveMask () & CWWidth) ? w->saveWc ().width :
1190+ int width = (w->saveMask () & CWWidth) ? w->saveWc ().width :
1191 w->serverWidth ();
1192- height = (w->saveMask () & CWHeight) ? w->saveWc ().height :
1193+ int height = (w->saveMask () & CWHeight) ? w->saveWc ().height :
1194 w->serverHeight ();
1195
1196 addIntegerPropToNode (childNode, "x", x);
1197@@ -502,7 +500,7 @@
1198 getWindowTitle (w->id (), title);
1199 getTextProperty (w->id (), roleAtom, role);
1200
1201- for (item = items.begin (); item != items.end (); item++)
1202+ for (item = items.begin (); item != items.end (); ++item)
1203 {
1204 if (!clientId.empty () && clientId == item->clientId)
1205 {
1206
1207=== modified file 'plugins/shift/src/shift.cpp'
1208--- plugins/shift/src/shift.cpp 2011-03-14 15:56:53 +0000
1209+++ plugins/shift/src/shift.cpp 2012-07-30 14:34:37 +0000
1210@@ -1162,7 +1162,6 @@
1211 if (optionGetReflection ())
1212 {
1213 GLMatrix rTransform = sTransform;
1214- unsigned short color[4];
1215 int cull, cullInv;
1216 glGetIntegerv (GL_CULL_FACE_MODE, &cull);
1217 cullInv = (cull == GL_BACK)? GL_FRONT : GL_BACK;
1218@@ -1223,6 +1222,7 @@
1219
1220 if (optionGetGroundSize () > 0.0)
1221 {
1222+ unsigned short color[4];
1223 glBegin (GL_QUADS);
1224 color[0] = optionGetGroundColor1 ()[0];
1225 color[1] = optionGetGroundColor1 ()[1];
1226@@ -1452,13 +1452,14 @@
1227 CompWindow *w;
1228
1229 CompWindow *pw = NULL;
1230- int i;
1231
1232 mState = ShiftStateIn;
1233 mMoreAdjust = true;
1234 cScreen->damageScreen ();
1235
1236 if (!mCancelled && mMvTarget != 0)
1237+ {
1238+ int i;
1239 for (i = 0; i < mNSlots; i++)
1240 {
1241 w = mDrawSlots[i].w;
1242@@ -1472,6 +1473,7 @@
1243 pw = w;
1244 }
1245 }
1246+ }
1247
1248 if (!mCancelled && mSelectedWindow)
1249 {
1250
1251=== modified file 'plugins/snap/src/snap.cpp'
1252--- plugins/snap/src/snap.cpp 2012-05-18 06:52:20 +0000
1253+++ plugins/snap/src/snap.cpp 2012-07-30 14:34:37 +0000
1254@@ -201,7 +201,7 @@
1255 {
1256 if (e->id == w->id ())
1257 e->passed = true;
1258- it++;
1259+ ++it;
1260 continue;
1261 }
1262
1263@@ -244,7 +244,7 @@
1264 }
1265 else
1266 {
1267- it++;
1268+ ++it;
1269 }
1270 }
1271 }
1272@@ -289,7 +289,7 @@
1273
1274 if (!e->screenEdge)
1275 {
1276- it++;
1277+ ++it;
1278 continue;
1279 }
1280
1281@@ -330,7 +330,7 @@
1282 }
1283 else
1284 {
1285- it++;
1286+ ++it;
1287 }
1288 }
1289 }
1290
1291=== modified file 'plugins/staticswitcher/src/staticswitcher.cpp'
1292--- plugins/staticswitcher/src/staticswitcher.cpp 2011-03-14 15:50:29 +0000
1293+++ plugins/staticswitcher/src/staticswitcher.cpp 2012-07-30 14:34:37 +0000
1294@@ -553,20 +553,20 @@
1295
1296 if (w == selected)
1297 {
1298- it++;
1299+ ++it;
1300 if (it == windows.end ())
1301 selected = windows.front ();
1302 else
1303 selected = *it;
1304- it--;
1305+ --it;
1306 }
1307
1308 CompWindowList::iterator del = it;
1309- it++;
1310+ ++it;
1311 windows.erase (del);
1312 }
1313 else
1314- it++;
1315+ ++it;
1316 }
1317
1318 if (!inList)
1319
1320=== modified file 'plugins/switcher/src/switcher.cpp'
1321--- plugins/switcher/src/switcher.cpp 2012-01-25 09:20:47 +0000
1322+++ plugins/switcher/src/switcher.cpp 2012-07-30 14:34:37 +0000
1323@@ -480,7 +480,7 @@
1324 if (w == windows.back ())
1325 newSelected = windows.begin ();
1326 else
1327- newSelected++;
1328+ ++newSelected;
1329
1330 selected = *newSelected;
1331 }
1332
1333=== modified file 'plugins/td/src/3d.cpp'
1334--- plugins/td/src/3d.cpp 2010-10-23 15:42:55 +0000
1335+++ plugins/td/src/3d.cpp 2012-07-30 14:34:37 +0000
1336@@ -390,7 +390,7 @@
1337 pl = cScreen->getWindowPaintList ();
1338
1339 /* paint all windows from bottom to top */
1340- for (it = pl.begin (); it != pl.end (); it++)
1341+ for (it = pl.begin (); it != pl.end (); ++it)
1342 {
1343 CompWindow *w = (*it);
1344 tdw = TdWindow::get (w);
1345
1346=== modified file 'plugins/trailfocus/src/trailfocus.cpp'
1347--- plugins/trailfocus/src/trailfocus.cpp 2010-05-06 15:34:05 +0000
1348+++ plugins/trailfocus/src/trailfocus.cpp 2012-07-30 14:34:37 +0000
1349@@ -121,7 +121,7 @@
1350 if (!isTrailfocusWindow (w))
1351 return false;
1352
1353- for (iter = windows.begin (); iter != windows.end (); iter++)
1354+ for (iter = windows.begin (); iter != windows.end (); ++iter)
1355 if ((*iter)->window->id () == id)
1356 break;
1357
1358@@ -152,7 +152,7 @@
1359 int distance, bestDist = 1000000;
1360 unsigned int i;
1361
1362- for (iter = windows.begin (); iter != windows.end (); iter++)
1363+ for (iter = windows.begin (); iter != windows.end (); ++iter)
1364 if (*iter == tw)
1365 break;
1366
1367
1368=== modified file 'plugins/wall/src/offset_movement/src/offset-movement.cpp'
1369--- plugins/wall/src/offset_movement/src/offset-movement.cpp 2012-06-24 09:00:27 +0000
1370+++ plugins/wall/src/offset_movement/src/offset-movement.cpp 2012-07-30 14:34:37 +0000
1371@@ -45,7 +45,7 @@
1372
1373 for (std::vector <CompRect>::const_iterator it = rects.begin ();
1374 it != rects.end ();
1375- it++)
1376+ ++it)
1377 {
1378 const CompRect &r = *it;
1379
1380
1381=== modified file 'plugins/wobbly/src/wobbly.cpp'
1382--- plugins/wobbly/src/wobbly.cpp 2012-04-19 12:06:05 +0000
1383+++ plugins/wobbly/src/wobbly.cpp 2012-07-30 14:34:37 +0000
1384@@ -34,9 +34,9 @@
1385 void
1386 WobblyWindow::findNextWestEdge (Object *object)
1387 {
1388- int v, v1, v2;
1389- int s, start;
1390- int e, end;
1391+ int v1, v2;
1392+ int start;
1393+ int end;
1394 int x;
1395 int output;
1396 int workAreaEdge;
1397@@ -56,6 +56,7 @@
1398
1399 if (x >= workAreaEdge)
1400 {
1401+ int v, s, e;
1402 v1 = workAreaEdge;
1403
1404 foreach (CompWindow *p, ::screen->windows ())
1405@@ -142,9 +143,9 @@
1406 void
1407 WobblyWindow::findNextEastEdge (Object *object)
1408 {
1409- int v, v1, v2;
1410- int s, start;
1411- int e, end;
1412+ int v1, v2;
1413+ int start;
1414+ int end;
1415 int x;
1416 int output;
1417 int workAreaEdge;
1418@@ -164,6 +165,7 @@
1419
1420 if (x <= workAreaEdge)
1421 {
1422+ int v, s, e;
1423 v1 = workAreaEdge;
1424
1425 foreach (CompWindow *p, ::screen->windows ())
1426@@ -249,9 +251,9 @@
1427 void
1428 WobblyWindow::findNextNorthEdge (Object *object)
1429 {
1430- int v, v1, v2;
1431- int s, start;
1432- int e, end;
1433+ int v1, v2;
1434+ int start;
1435+ int end;
1436 int y;
1437 int output;
1438 int workAreaEdge;
1439@@ -271,6 +273,7 @@
1440
1441 if (y >= workAreaEdge)
1442 {
1443+ int v, s, e;
1444 v1 = workAreaEdge;
1445
1446 foreach (CompWindow *p, ::screen->windows ())
1447@@ -356,9 +359,9 @@
1448 void
1449 WobblyWindow::findNextSouthEdge (Object *object)
1450 {
1451- int v, v1, v2;
1452- int s, start;
1453- int e, end;
1454+ int v1, v2;
1455+ int start;
1456+ int end;
1457 int y;
1458 int output;
1459 int workAreaEdge;
1460@@ -378,6 +381,7 @@
1461
1462 if (y <= workAreaEdge)
1463 {
1464+ int v, s, e;
1465 v1 = workAreaEdge;
1466
1467 foreach (CompWindow *p, ::screen->windows ())
1468@@ -2141,7 +2145,6 @@
1469 if (ensureModel ())
1470 {
1471 Spring *s;
1472- int i;
1473
1474 if (wScreen->optionGetMaximizeEffect ())
1475 {
1476@@ -2207,6 +2210,7 @@
1477
1478 if (wScreen->optionGetGrabWindowMatch ().evaluate (window))
1479 {
1480+ int i;
1481 for (i = 0; i < model->numSprings; i++)
1482 {
1483 s = &model->springs[i];
1484
1485=== modified file 'src/event.cpp'
1486--- src/event.cpp 2012-06-24 09:00:27 +0000
1487+++ src/event.cpp 2012-07-30 14:34:37 +0000
1488@@ -2005,7 +2005,7 @@
1489 if (sibling)
1490 {
1491 for (CompWindowList::reverse_iterator rit = windowsLostFocus.rbegin ();
1492- rit != windowsLostFocus.rend (); rit++)
1493+ rit != windowsLostFocus.rend (); ++rit)
1494 {
1495 (*rit)->restackAbove (sibling);
1496 }
1497
1498=== modified file 'src/match.cpp'
1499--- src/match.cpp 2012-04-24 16:39:22 +0000
1500+++ src/match.cpp 2012-07-30 14:34:37 +0000
1501@@ -236,8 +236,8 @@
1502 break;
1503 }
1504
1505- it1++;
1506- it2++;
1507+ ++it1;
1508+ ++it2;
1509 }
1510
1511 return true;
1512
1513=== modified file 'src/plugin.cpp'
1514--- src/plugin.cpp 2012-06-24 09:00:27 +0000
1515+++ src/plugin.cpp 2012-07-30 14:34:37 +0000
1516@@ -279,7 +279,7 @@
1517 CompWindow *w;
1518
1519 it = fail = windowManager.begin ();
1520- for (;it != windowManager.end (); it++)
1521+ for (;it != windowManager.end (); ++it)
1522 {
1523 w = *it;
1524 if (!p->vTable->initWindow (w))
1525@@ -294,7 +294,7 @@
1526 }
1527
1528 it = windowManager.begin ();
1529- for (;it != fail; it++)
1530+ for (;it != fail; ++it)
1531 {
1532 w = *it;
1533 p->vTable->finiWindow (w);
1534@@ -331,7 +331,7 @@
1535 if (p->vTable->initScreen (s))
1536 s->initPluginForScreen (p);
1537
1538- it++;
1539+ ++it;
1540 }
1541
1542 return true;
1543
1544=== modified file 'src/screen.cpp'
1545--- src/screen.cpp 2012-06-24 09:00:27 +0000
1546+++ src/screen.cpp 2012-07-30 14:34:37 +0000
1547@@ -226,7 +226,7 @@
1548 {
1549 std::list<CompFileWatch *>::iterator it;
1550
1551- for (it = fileWatch.begin (); it != fileWatch.end (); it++)
1552+ for (it = fileWatch.begin (); it != fileWatch.end (); ++it)
1553 if ((*it)->handle == handle)
1554 break;
1555
1556@@ -333,7 +333,7 @@
1557 CompWatchFd * w;
1558
1559 for (it = watchFds.begin();
1560- it != watchFds.end (); it++)
1561+ it != watchFds.end (); ++it)
1562 {
1563 if ((*it)->mHandle == handle)
1564 break;
1565@@ -1026,7 +1026,7 @@
1566 bool skip = false;
1567
1568 for (iterator it = initialPlugins.begin(); it != initialPlugins.end();
1569- it++)
1570+ ++it)
1571 {
1572 if ((*it) == opt.s())
1573 {
1574@@ -1151,7 +1151,6 @@
1575 #define N_TARGETS 4
1576
1577 Atom conversionTargets[N_TARGETS];
1578- long icccmVersion[] = { 2, 0 };
1579
1580 conversionTargets[0] = Atoms::targets;
1581 conversionTargets[1] = Atoms::multiple;
1582@@ -1167,9 +1166,12 @@
1583 XA_INTEGER, 32, PropModeReplace,
1584 (unsigned char *) &time, 1);
1585 else if (target == Atoms::version)
1586+ {
1587+ long icccmVersion[] = { 2, 0 };
1588 XChangeProperty (dpy, w, property,
1589 XA_INTEGER, 32, PropModeReplace,
1590 (unsigned char *) icccmVersion, 2);
1591+ }
1592 else
1593 return false;
1594
1595@@ -2228,7 +2230,7 @@
1596
1597 std::list<CompStartupSequence *>::iterator it = startupSequences.begin ();
1598
1599- for (; it != startupSequences.end (); it++)
1600+ for (; it != startupSequences.end (); ++it)
1601 {
1602 if ((*it)->sequence == sequence)
1603 {
1604@@ -2938,7 +2940,7 @@
1605 {
1606 break;
1607 }
1608- it++;
1609+ ++it;
1610 }
1611
1612 if (it == windows.end ())
1613@@ -3002,7 +3004,7 @@
1614 {
1615 break;
1616 }
1617- it++;
1618+ ++it;
1619 }
1620
1621 if (it == serverWindows.end ())
1622@@ -3225,7 +3227,7 @@
1623
1624 std::list<cps::Grab *>::iterator it;
1625
1626- for (it = privateScreen.eventManager.grabsBegin (); it != privateScreen.eventManager.grabsEnd (); it++)
1627+ for (it = privateScreen.eventManager.grabsBegin (); it != privateScreen.eventManager.grabsEnd (); ++it)
1628 {
1629 va_start (ap, first);
1630
1631@@ -3369,7 +3371,7 @@
1632
1633 mask = modHandler->virtualToRealModMask (key.modifiers ());
1634
1635- for (it = keyGrabs.begin (); it != keyGrabs.end (); it++)
1636+ for (it = keyGrabs.begin (); it != keyGrabs.end (); ++it)
1637 {
1638 if (key.keycode () == (*it).keycode &&
1639 mask == (*it).modifiers)
1640@@ -3404,7 +3406,7 @@
1641
1642 mask = modHandler->virtualToRealModMask (key.modifiers ());
1643
1644- for (it = keyGrabs.begin (); it != keyGrabs.end (); it++)
1645+ for (it = keyGrabs.begin (); it != keyGrabs.end (); ++it)
1646 {
1647 if (key.keycode () == (*it).keycode &&
1648 mask == (*it).modifiers)
1649@@ -3436,7 +3438,7 @@
1650
1651 XUngrabKey (screen->dpy(), AnyKey, AnyModifier, screen->root());
1652
1653- for (it = keyGrabs.begin (); it != keyGrabs.end (); it++)
1654+ for (it = keyGrabs.begin (); it != keyGrabs.end (); ++it)
1655 {
1656 if (!((*it).modifiers & CompNoMask))
1657 {
1658@@ -3452,7 +3454,7 @@
1659 ButtonGrab newButtonGrab;
1660 std::list<ButtonGrab>::iterator it;
1661
1662- for (it = buttonGrabs.begin (); it != buttonGrabs.end (); it++)
1663+ for (it = buttonGrabs.begin (); it != buttonGrabs.end (); ++it)
1664 {
1665 if (button.button () == (*it).button &&
1666 button.modifiers () == (*it).modifiers)
1667@@ -3510,7 +3512,7 @@
1668 {
1669 std::list<ButtonGrab>::iterator it;
1670
1671- for (it = buttonGrabs.begin (); it != buttonGrabs.end (); it++)
1672+ for (it = buttonGrabs.begin (); it != buttonGrabs.end (); ++it)
1673 {
1674 if (button.button () == (*it).button &&
1675 button.modifiers () == (*it).modifiers)
1676
1677=== modified file 'src/stackdebugger.cpp'
1678--- src/stackdebugger.cpp 2012-06-24 09:00:27 +0000
1679+++ src/stackdebugger.cpp 2012-07-30 14:34:37 +0000
1680@@ -81,7 +81,7 @@
1681 /* Find the toplevel window in the list and remove it */
1682 for (CompWindowList::iterator it = mLastServerWindows.begin ();
1683 it != mLastServerWindows.end ();
1684- it++)
1685+ ++it)
1686 {
1687 if ((*it)->id () == id)
1688 {
1689@@ -105,7 +105,7 @@
1690 {
1691 for (CompWindowList::iterator it = mLastServerWindows.begin ();
1692 it != mLastServerWindows.end ();
1693- it++)
1694+ ++it)
1695 {
1696 if (sibling == (*it)->id () ||
1697 sibling == (*it)->frame ())
1698@@ -153,7 +153,7 @@
1699 while (it != mEvents.end ())
1700 {
1701 mFetchXEvent->getNextXEvent ((*it));
1702- it++;
1703+ ++it;
1704 }
1705
1706 XSync (mDpy, FALSE);
1707@@ -249,10 +249,10 @@
1708 err = true;
1709
1710 if (lrrit != windows.rend ())
1711- lrrit++;
1712+ ++lrrit;
1713
1714 if (lsrit != mLastServerWindows.rend())
1715- lsrit++;
1716+ ++lsrit;
1717
1718 if (i != serverSideWindows.size ())
1719 i++;
1720@@ -335,7 +335,7 @@
1721
1722 /* go backwards down the stack */
1723 for (CompWindowList::reverse_iterator rit = serverWindows.rbegin ();
1724- rit != serverWindows.rend (); rit++)
1725+ rit != serverWindows.rend (); ++rit)
1726 {
1727 CompWindow *w = (*rit);
1728
1729
1730=== modified file 'src/timer/src/timeouthandler.cpp'
1731--- src/timer/src/timeouthandler.cpp 2012-04-12 06:50:42 +0000
1732+++ src/timer/src/timeouthandler.cpp 2012-07-30 14:34:37 +0000
1733@@ -55,7 +55,7 @@
1734 if (it != priv->mTimers.end ())
1735 return;
1736
1737- for (it = priv->mTimers.begin (); it != priv->mTimers.end (); it++)
1738+ for (it = priv->mTimers.begin (); it != priv->mTimers.end (); ++it)
1739 {
1740 if (timer->minTime () < (*it)->minLeft ())
1741 break;
1742
1743=== modified file 'src/timer/src/timer.cpp'
1744--- src/timer/src/timer.cpp 2012-01-20 17:50:31 +0000
1745+++ src/timer/src/timer.cpp 2012-07-30 14:34:37 +0000
1746@@ -109,7 +109,7 @@
1747 break;
1748 if (t->maxLeft () < (unsigned int) timeout)
1749 timeout = (int) t->maxLeft ();
1750- it++;
1751+ ++it;
1752 }
1753 }
1754 else
1755@@ -152,7 +152,7 @@
1756 }
1757
1758 std::list<CompTimer*>::const_iterator i = requeue.begin ();
1759- for (; i != requeue.end (); i++)
1760+ for (; i != requeue.end (); ++i)
1761 {
1762 CompTimer *t = *i;
1763 handler->addTimer (t);
1764
1765=== modified file 'src/timer/tests/callbacks/src/test-timer-callbacks.cpp'
1766--- src/timer/tests/callbacks/src/test-timer-callbacks.cpp 2012-07-25 14:04:46 +0000
1767+++ src/timer/tests/callbacks/src/test-timer-callbacks.cpp 2012-07-30 14:34:37 +0000
1768@@ -146,7 +146,7 @@
1769 void Run ()
1770 {
1771 for (std::deque <CompTimer *>::iterator it = timers.begin ();
1772- it != timers.end (); it++)
1773+ it != timers.end (); ++it)
1774 (*it)->start ();
1775
1776 /* TimeoutHandler::timers should have the timer that
1777
1778=== modified file 'src/timer/tests/while-calling/src/test-timer-set-times-while-calling.cpp'
1779--- src/timer/tests/while-calling/src/test-timer-set-times-while-calling.cpp 2012-02-24 12:52:17 +0000
1780+++ src/timer/tests/while-calling/src/test-timer-set-times-while-calling.cpp 2012-07-30 14:34:37 +0000
1781@@ -50,7 +50,7 @@
1782 {
1783 for (std::list<CompTimer *>::iterator it =
1784 TimeoutHandler::Default()->timers().begin();
1785- it != TimeoutHandler::Default()->timers().end(); it++)
1786+ it != TimeoutHandler::Default()->timers().end(); ++it)
1787 {
1788 CompTimer *t = (*it);
1789 RecordProperty("minLeft", t->minLeft());

Subscribers

People subscribed via source and target branches