Possible bug in kis_convolution_painter.cc

Boudewijn Rempt boud at valdyas.org
Thu Mar 23 07:17:44 CET 2006


On Thursday 23 March 2006 05:38, Christoph Bartoschek wrote:
> 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;
>         }
>
> }

I'm not sure which one it should be... Cyrille? You're our convolution guru...

-- 
Boudewijn Rempt 
http://www.valdyas.org/fading/index.cgi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20060323/ab691935/attachment.pgp 


More information about the kimageshop mailing list