Suspicous code in kdelibs-3.5.2

Michael Brade brade at kde.org
Wed Apr 5 19:33:03 BST 2006


On Wednesday 05 April 2006 19:16, Alexander Neundorf wrote:
> On Wednesday 05 April 2006 19:12, Michael Brade wrote:
> > On Wednesday 05 April 2006 16:26, Christoph Bartoschek wrote:
> > > -----------------------------------------------------------------
> > > Lines where boolean expressions are used in non-boolean contexts:
> > > -----------------------------------------------------------------
> > >
> > > - kio/kio/kdirlister.cpp:947
> > > - kio/kio/kdirlister.cpp:1524
> >
> > I don't quite understand... what's wrong with this:
> >
> >   bool delayedMimeTypes = true;
> >   for ( KDirLister *kdl = listers->first(); kdl; kdl = listers->next() )
> >     delayedMimeTypes &= kdl->d->delayedMimeTypes;
>
> Not sure, isn't this the same as
> delayedMimeTypes = delayedMimeTypes & kdl->d->delayedMimeTypes;
> while you probably want
> delayedMimeTypes = delayedMimeTypes && kdl->d->delayedMimeTypes;
Yes, I guess so, but what is the difference if the operands are bool? Does it 
matter that bool is maybe not one bit on actual implementations? I wouldn't 
think so...

-- 
Michael Brade;                 KDE Developer, Student of Computer Science
  |-mail: echo brade !#|tr -d "c oh"|s\e\d 's/e/\@/2;s/$/.org/;s/bra/k/2'
  °--web: http://www.kde.org/people/michaelb.html

KDE 4: Beyond Your Expectations
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060405/3bd1fa89/attachment.sig>


More information about the kde-core-devel mailing list