[haiku-development] Re: src_build_libbe_storage_Volume.cpp.diff

Michael Pfeiffer <michael.w.pfeiffer@xxxxxxxxx> wrote:
> Since when did we let the compiler dictate our coding style? :-)
> I suggest to turn off this kind of warnings.

Me too.

> BTW the return expression should not be between parentheses:
>       return InitCheck() != B_OK && volume.InitCheck() != B_OK
>                       || fDevice == volume.fDevice;
> 
> and the expression seems to be wrong too, shouldn't it be:
>       return InitCheck() == B_OK && volume.InitCheck() == B_OK
>                       && fDevice == volume.fDevice;

I guess the idea behind it is that too uninitialized BVolumes are equal 
as well (I don't know if that really makes sense, though).
But since uninitialized volumes always set their fDevice member to -1, 
the check could be simplified to:
        return fDevice == volume.fDevice;

Bye,
   Axel.


Other related posts: