<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/108708/">http://git.reviewboard.kde.org/r/108708/</a>
     </td>
    </tr>
   </table>
   <br />





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On February 2nd, 2013, 9:44 p.m. UTC, <b>Boudewijn Rempt</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Yeah... If msvc warns about it, but I do think it's silly :-). Anyway, I still need to test, but I'm sure it's fine, it doesn't alter what we meant with the code.</pre>
 </blockquote>




 <p>On February 3rd, 2013, 1:14 a.m. UTC, <b>Friedrich W. H. Kossebau</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I was surprised as well, but really operator-() on an unsigned int only result in the 2-complement.
--- 8< ---
#include <iostream>

int main()
{
    int a = 5;
    unsigned int b = 5;

    std::cout <<"int: "<< (-a)<<" uint: "<< (-b) << std::endl;
}
--- 8< ---
$ g++ test.cpp -o test
$ ./test 
int: -5 uint: 4294967291
</pre>
 </blockquote>








</blockquote>

<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I tested it and it still blurs, the same way as before, so I guess it's good :-)</pre>
<br />










<p>- Boudewijn</p>


<br />
<p>On February 2nd, 2013, 12:49 a.m. UTC, Friedrich W. H. Kossebau wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Calligra and Boudewijn Rempt.</div>
<div>By Friedrich W. H. Kossebau.</div>


<p style="color: grey;"><i>Updated Feb. 2, 2013, 12:49 a.m.</i></p>






<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">MSVC hints in its warnings that using operator-() on an unsigned int will still result in an unsigned int.
Reading up the intertubes on that it seems to be usually the 2's complement of the value.
So all the rect calculations in these blur filter must have been giving strange results for quite some time.

Is that true? Nobody saw that?

Attached patch fixes that by always turning the values used for calculations into signed integer, by the implicit conversion coming with the assignment.

Other possible fixes would be to simply switch the operator-() usage into a -1* operation. Not sure what I prefer, your choice :)</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">None, as I have no clue of the blur filters and how to see the effect of the patch. Left for Krita insiders.</pre>
  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>krita/plugins/filters/blur/kis_blur_filter.cpp <span style="color: grey">(b81f0bd)</span></li>

 <li>krita/plugins/filters/blur/kis_gaussian_blur_filter.cpp <span style="color: grey">(0c68562)</span></li>

 <li>krita/plugins/filters/blur/kis_motion_blur_filter.cpp <span style="color: grey">(6a13ca3)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/108708/diff/" style="margin-left: 3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>