Code review comment for lp:~mc-return/compiz/compiz.fix1030473-part3

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

> 8 - unsigned int nOffset = 1, frameType = 0, frameState = 0,
> frameActions = 0;
> 9 + unsigned int nOffset = 1, frameType, frameState, frameActions;
>
> Are these guaranteed to be assigned to something we know later in the
> function? If so, we can move them there and declare and assign them at the
> same time.

Hmm. It seems I made a mistake - Maybe cppcheck had a problem with the #ifdef.
But those variables are used only here in the function updateWindowProperties ():

#ifdef QT_45
    decor_quads_to_property (data, nOffset - 1, mX11Pixmap,
        &mBorder, &mBorder, &mBorder, &mBorder,
        0, 0,
        quads, nQuad, frameType, frameState, frameActions);

So theoretically we could remove the declaration of those variables completely and simplify this to:

#ifdef QT_45
    decor_quads_to_property (data, nOffset - 1, mX11Pixmap,
        &mBorder, &mBorder, &mBorder, &mBorder,
        0, 0,
        quads, nQuad, 0, 0, 0);

...as those variables are not used anywhere else in this function and are always 0 anyway.

Unfortunately I am having problems convincing cmake and make to compile the KDE part of Compiz here to test it, but it *should* be okay. Please check the diff.

« Back to merge proposal