On Friday 06 June 2008 21:34:19 Zakhar Levchenko wrote:
> Since in the case when parent value is out of bounds parentrec is always
> zero and not zero if parent value is in the range [0..n-1],
> 
> while(parent >= 0 && parent < n &&...  structure is fully equivalent to
> while(parentrec &&...
> 
> The only difference between previous and current version is that previously
> parentrec might potentially be an invalid pointer. Yes, no data was accessed
> by this pointer (check for parent value in the loop condition prevented
> this), but I hate to have invalid pointers even if they are not used. I hope
> this explains why I've changed code a bit.
> 

Somehow 0 made me think of &extrec[dev][0] and not NULL.. You really should be 
using NULL for pointers and 0 for integers ("But this is entirely equivalent!" 
It's still bad programming[1]).

[1] http://lwn.net/Articles/93574/

Yours,
        Yair K.
_______________________________________________
oss-devel mailing list
oss-devel@mailman.opensound.com
http://mailman.opensound.com/mailman/listinfo/oss-devel

Reply via email to