[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: KDE/kdebase/workspace/plasma/containments/desktop
From:       Ambroz Bizjak <ambrop7 () gmail ! com>
Date:       2009-02-16 17:44:13
Message-ID: 151c4ceb0902160944q5f795355mac00c18227f47de4 () mail ! gmail ! com
[Download RAW message or body]

Actually I'm not working on finding the bug bacause it's very rare and hard
to reproduce, and happens only with the -O2 optimization, which makes it
almost impossible to use a debugger. I've gone through my code several times
and I'm sure it's algorithmically correct.
Otherwise, I find "if (!(<expression>)) { <fail> }" easier to read, it's
like an assertion.

On Sun, Feb 15, 2009 at 1:55 AM, Chani <chanika@gmail.com> wrote:

> On February 12, 2009 11:10:25 Ambroz Bizjak wrote:
> > SVN commit 925216 by abizjak:
> >
> > Add safeguards to avoid an infinite loop, compiler/Qt bug suspected.
>
> since you suspect a bug, are you working on finding that bug?
>
> > +            if ((align & Qt::AlignTop)) {
> > +                newY = a.bottom();
> > +                if (!(newY > y)) return possiblePositions;
>
> nitpick: always use {} with if statements, please.
> also, ! and > is less clear than just <=
>
> --
> This message brought to you by eevil bananas and the number 3.
> www.chani3.com
>

[Attachment #3 (text/html)]

Actually I&#39;m not working on finding the bug bacause it&#39;s very rare and hard \
to reproduce, and happens only with the -O2 optimization, which makes it almost \
impossible to use a debugger. I&#39;ve gone through my code several times and I&#39;m \
sure it&#39;s algorithmically correct.<br> Otherwise, I find &quot;if \
(!(&lt;expression&gt;)) { &lt;fail&gt; }&quot; easier to read, it&#39;s like an \
assertion.<br><br><div class="gmail_quote">On Sun, Feb 15, 2009 at 1:55 AM, Chani \
<span dir="ltr">&lt;<a \
href="mailto:chanika@gmail.com">chanika@gmail.com</a>&gt;</span> wrote:<br> \
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); \
margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On February 12, 2009 11:10:25 Ambroz \
Bizjak wrote:<br> &gt; SVN commit 925216 by abizjak:<br>
&gt;<br>
&gt; Add safeguards to avoid an infinite loop, compiler/Qt bug suspected.<br>
<br>
since you suspect a bug, are you working on finding that bug?<br>
<br>
&gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ((align &amp; Qt::AlignTop)) {<br>
&gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;newY = a.bottom();<br>
&gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (!(newY &gt; y)) \
return possiblePositions;<br> <br>
nitpick: always use {} with if statements, please.<br>
also, ! and &gt; is less clear than just &lt;=<br>
<font color="#888888"><br>
--<br>
This message brought to you by eevil bananas and the number 3.<br>
<a href="http://www.chani3.com" target="_blank">www.chani3.com</a><br>
</font></blockquote></div><br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic