git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Erik Faye-Lund <kusmabite@googlemail.com>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] read_cache: cast types from stat to ce_cache
Date: Fri, 11 Jun 2010 16:15:16 +0200	[thread overview]
Message-ID: <AANLkTimC9RAD0OGArk3JAIAnDHNskJRgX1nBlcrhc7vX@mail.gmail.com> (raw)
In-Reply-To: <4C123AD4.6070606@drmicha.warpmail.net>

On Fri, Jun 11, 2010 at 3:32 PM, Michael J Gruber
<git@drmicha.warpmail.net> wrote:
> Junio C Hamano venit, vidit, dixit 10.06.2010 17:54:
>> Michael J Gruber <git@drmicha.warpmail.net> writes:
>>
>>> -    ce->ce_dev = st->st_dev;
>>> -    ce->ce_ino = st->st_ino;
>>> -    ce->ce_uid = st->st_uid;
>>> -    ce->ce_gid = st->st_gid;
>>> -    ce->ce_size = st->st_size;
>>> +    ce->ce_dev = (unsigned int)st->st_dev;
>>> +    ce->ce_ino = (unsigned int)st->st_ino;
>>> +    ce->ce_uid = (unsigned int)st->st_uid;
>>> +    ce->ce_gid = (unsigned int)st->st_gid;
>>> +    ce->ce_size = (unsigned int)st->st_size;
>>
>> I haven't had my morning coffee yet, but wouldn't the conversion be
>> automatic by assignment anyway?
>
> Well, we do cast from dev_t etc. to unsigned int in all other places in
> read_cache.c.
>

The only cases where we cast anything to unsigned in on assignment in
read-cache.h is where we assign the second-part of the ce_ctime and
ce_mtime members:
	ce->ce_ctime.sec = (unsigned int)st->st_ctime;
	ce->ce_mtime.sec = (unsigned int)st->st_mtime;

These are indeed superfluous (as yours are) as far as I can tell.
There's also some casts on comparison, and I think they also are
superfluous. The current casts originate from commits fba2f38a,
5bcf109c, e1afca4f and 7a51ed66.

They don't do any harm though, so I don't think it makes much sense to
remove them.

-- 
Erik "kusma" Faye-Lund

  reply	other threads:[~2010-06-11 14:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-10  9:15 [PATCH] read_cache: cast types from stat to ce_cache Michael J Gruber
2010-06-10 15:54 ` Junio C Hamano
2010-06-11 13:32   ` Michael J Gruber
2010-06-11 14:15     ` Erik Faye-Lund [this message]
2010-06-11 14:59       ` Michael J Gruber

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=AANLkTimC9RAD0OGArk3JAIAnDHNskJRgX1nBlcrhc7vX@mail.gmail.com \
    --to=kusmabite@googlemail.com \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kusmabite@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).