git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan McGee <dpmcgee@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 1/4] write_idx_file should use an unsigned nr_objects parameter
Date: Fri, 1 Apr 2011 13:36:09 -0500	[thread overview]
Message-ID: <AANLkTi=ZxV5WbDhhZG1SnS9W+MMhwpf-jdoKwdAD=zWN@mail.gmail.com> (raw)
In-Reply-To: <7vtyehg71w.fsf@alter.siamese.dyndns.org>

On Fri, Apr 1, 2011 at 1:28 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Dan McGee <dpmcgee@gmail.com> writes:
>
>> This follows the precedent set in the pack-objects code and being
>> adjusted for in index-pack and unpack-objects.
>
> Eh, why?  The use of a fixed-width type in the existing code is mostly to
> make sure that the on-disk result will fit within the on-disk field.  The
> variables like iteration counter "i" we use in write_idx_file() need to be
> at least as wide but there is no reason to forbid the compiler from using
> the natural interger type as long as it is more suiable on the platform,
> no?

Hmm. when making this patch, I thought it was required due to the
other ones in this sequence or I was seeing compile errors. Reverting
it seems to prove otherwise, as things compile just fine...

Either way, it should at least be an unsigned parameter of at least
int length, no? The current parameter is signed, so 'unsigned' might
make sense here.

-Dan

      reply	other threads:[~2011-04-01 18:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-31  1:24 [PATCH 1/4] write_idx_file should use an unsigned nr_objects parameter Dan McGee
2011-03-31  1:24 ` [PATCH 2/4] Use uint32_t for unpack-objects counters Dan McGee
2011-03-31  1:24 ` [PATCH 3/4] Use uint32_t for index-pack counters Dan McGee
2011-03-31  1:24 ` [PATCH 4/4] Unify pack header checking between index-pack and unpack-objects Dan McGee
2011-04-01 18:28 ` [PATCH 1/4] write_idx_file should use an unsigned nr_objects parameter Junio C Hamano
2011-04-01 18:36   ` Dan McGee [this message]

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='AANLkTi=ZxV5WbDhhZG1SnS9W+MMhwpf-jdoKwdAD=zWN@mail.gmail.com' \
    --to=dpmcgee@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
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 NNTP newsgroup(s).