[Top][All Lists]

[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-> ||
> > +  if ((dir-> == 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-> 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");
                printf("test1: size is not 0\n");
        if (size == 0)
                printf("test2: size is 0\n");
                printf("test2: size is not 0\n");

Pavel Roskin

reply via email to

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