Git development
 help / color / mirror / Atom feed
From: Olivier Galibert <galibert@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Junio C Hamano <junkio@cox.net>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: Fix up ugly open-coded "alloc_nr()" user in object.c
Date: Sun, 17 Jun 2007 00:15:06 +0200	[thread overview]
Message-ID: <20070616221506.GA78651@dspnet.fr.eu.org> (raw)
In-Reply-To: <20070616182134.GA22003@coredump.intra.peff.net>

On Sat, Jun 16, 2007 at 02:21:34PM -0400, Jeff King wrote:
> How about using the new ALLOC_GROW macro to make it even shorter? I also
> got rid of the aliased variables, which IMO just make it harder to see

> what's going on.
> +	ALLOC_GROW(array->objects, array->nr, array->alloc);
> +	array->objects[array->nr].item = obj;
> +	array->objects[array->nr].name = name;
> +	array->objects[array->nr].mode = mode;
> +	array->nr++;

Unless the ALLOC_GROW semantics are weird, shouldn't that be:
  ALLOC_GROW(array->objects, array->nr+1, array->alloc);

  OG.

  reply	other threads:[~2007-06-16 22:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-16 17:30 Fix up ugly open-coded "alloc_nr()" user in object.c Linus Torvalds
2007-06-16 18:21 ` Jeff King
2007-06-16 22:15   ` Olivier Galibert [this message]
2007-06-16 22:37     ` Jeff King

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=20070616221506.GA78651@dspnet.fr.eu.org \
    --to=galibert@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=peff@peff.net \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox