[haiku-development] Re: src_build_libbe_storage_Volume.cpp.diff
- From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
- To: haiku-development@xxxxxxxxxxxxx
- Date: Fri, 30 May 2008 09:46:50 +0200 CEST
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.
- References:
- [haiku-development] Re: src_build_libbe_storage_Volume.cpp.diff
- From: Michael Pfeiffer
Other related posts:
- » [haiku-development] src_build_libbe_storage_Volume.cpp.diff
- » [haiku-development] Re: src_build_libbe_storage_Volume.cpp.diff
- » [haiku-development] Re: src_build_libbe_storage_Volume.cpp.diff
- » [haiku-development] Re: src_build_libbe_storage_Volume.cpp.diff
- » [haiku-development] Re: src_build_libbe_storage_Volume.cpp.diff
- » [haiku-development] src_build_libbe_storage_Volume.cpp.diff
- [haiku-development] Re: src_build_libbe_storage_Volume.cpp.diff
- From: Michael Pfeiffer