All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] AFS fixes and improvements
Date: Sun, 19 Jul 2009 16:10:57 -0400	[thread overview]
Message-ID: <1248034257.2519.26.camel@mj> (raw)
In-Reply-To: <d7ead6de0907190620ia3933c7mcf23418ee776a3fd@mail.gmail.com>

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



  parent reply	other threads:[~2009-07-19 20:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-17 19:30 [PATCH] AFS fixes and improvements Vladimir 'phcoder' Serbinenko
2009-07-17 22:35 ` Vladimir 'phcoder' Serbinenko
2009-07-19  5:11   ` Pavel Roskin
2009-07-19 13:20     ` Vladimir 'phcoder' Serbinenko
2009-07-19 15:34       ` Vladimir 'phcoder' Serbinenko
2009-07-19 19:56         ` Pavel Roskin
2009-07-19 20:23           ` Vladimir 'phcoder' Serbinenko
2009-07-19 20:32             ` Pavel Roskin
2009-07-19 20:40               ` Vladimir 'phcoder' Serbinenko
2009-07-19 20:47                 ` Pavel Roskin
2009-07-20  9:36                   ` Vladimir 'phcoder' Serbinenko
2009-07-20 18:34                     ` Pavel Roskin
2009-07-20 18:56                       ` Vladimir 'phcoder' Serbinenko
2009-07-20 19:36                         ` Pavel Roskin
2009-07-19 20:10       ` Pavel Roskin [this message]
2009-07-19 20:18         ` Vladimir 'phcoder' Serbinenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1248034257.2519.26.camel@mj \
    --to=proski@gnu.org \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.