~uriboni/compiz/unminimize-configurable-independently

« back to all changes in this revision

Viewing changes to compizconfig/libcompizconfig/src/bindings.c

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.. Fixes: https://bugs.launchpad.net/bugs/1030473. Approved by Daniel van Vugt, Sam Spilsbury.

Show diffs side-by-side

added added

removed removed

Lines of Context:
213
213
{
214
214
    char *binding;
215
215
    char *edges;
216
 
    char buttonStr[256];
217
216
 
218
217
    edges = ccsEdgesToModString (button->edgeMask);
219
218
    binding = stringAppend (edges, ccsModifiersToString (button->buttonModMask));
220
219
 
221
220
    if (button->button)
222
221
    {
 
222
        char buttonStr[256];
223
223
        snprintf (buttonStr, 256, "Button%d", button->button);
224
224
        binding = stringAppend (binding, buttonStr);
225
225
    }