grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] AFS fixes and improvements


From: Pavel Roskin
Subject: Re: [PATCH] AFS fixes and improvements
Date: Sun, 19 Jul 2009 16:10:57 -0400

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]