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:

#include <stdio.h>
unsigned long long size = 0x100000000ULL;
int main()
{
        if (! size)
                printf("test1: size is 0\n");
        else
                printf("test1: size is not 0\n");
        if (size == 0)
                printf("test2: size is 0\n");
        else
                printf("test2: size is not 0\n");
}

-- 
Regards,
Pavel Roskin


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

Reply via email to