On Sun, Jul 19, 2009 at 10:10 PM, Pavel Roskin<pro...@gnu.org> wrote:
> On Sun, 2009-07-19 at 15:20 +0200, Vladimir 'phcoder' Serbinenko wrote:
>
>> > -  if ((! dir->inode.stream.size) ||
>> > +  if ((dir->inode.stream.size == 0) ||
>> >
>> > The later is marginally better, but it would be easier to review your
>> > patches if you don't include such changes.
>> It's not a stylistic improvement. dir->inode.stream.size is 64-bit
>> quantity which will be truncated on 32-bit platform
>
> No, values are not truncated like that.  No implicit conversions shorten
> the value.  That worst thing you can get is conversion from signed to
> unsigned or vice versa, but you will get a warning about it with -Wall.
>
> Just try compiling this for 32-bit:
>
You're right. Such a problem was pointed to me once by Yoshinori K
Okuji and I accepted it without really checking. Anyway with == 0 it's
sure to work and we both agree that it is a bit more readable even if
technically equivalent
> --
> Regards,
> Pavel Roskin
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>



-- 
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to