Possible bug in kis_convolution_painter.cc

Christoph Bartoschek bartoschek at gmx.de
Thu Mar 23 05:38:05 CET 2006


Hi,

In line 118 you have:

if (w < kw || h < kh || kw&1 == 0 || kh&1 == 0 || kernel->factor == 0 ) 
return;


The terms  kw&1 == 0  and kh&1 == 0  are evaluated in this way:  kw & (1 == 0) 
and this is equivalent to  kw & 0 and this is equivalent to 0.
The following programm shows the difference:

#include <iostream>

int main()
{
        unsigned val = 0;
        if (val & 1 == 0) {
                std::cout << "I am in" << std::endl;
        }
        if ((val & 1) == 0) {
                std::cout << "I am out" << std::endl;
        }

}


Christoph Bartoschek


More information about the kimageshop mailing list