git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Stephen Boyd <bebarino@gmail.com>
Cc: Felipe Contreras <felipe.contreras@gmail.com>,
	git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] Fix a bunch of pointer declarations (codestyle)
Date: Fri, 1 May 2009 16:39:10 -0400	[thread overview]
Message-ID: <20090501203910.GA15549@coredump.intra.peff.net> (raw)
In-Reply-To: <780e0a6b0905011220g42d9784dp186cc7ff7669081e@mail.gmail.com>

On Fri, May 01, 2009 at 12:20:08PM -0700, Stephen Boyd wrote:

> On Fri, May 1, 2009 at 2:06 AM, Felipe Contreras
> <felipe.contreras@gmail.com> wrote:
> >
> > -       *argv = xmalloc(sizeof(char*) * size);
> > +       *argv = xmalloc(sizeof(char *) * size);
> >
> 
> I don't think this is what the coding guidelines is talking about. A
> pointer isn't being declared here plus there isn't any variable the
> star should be sticking to.

Besides that, don't we usually prefer sizeof() on the actual variable
instead of the type, which is less error prone? IOW,

  *argv = xmalloc(sizeof(**argv) * size);

-Peff

  reply	other threads:[~2009-05-01 20:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-01  9:06 [PATCH] Fix a bunch of pointer declarations (codestyle) Felipe Contreras
2009-05-01  9:07 ` Felipe Contreras
2009-05-01 19:20 ` Stephen Boyd
2009-05-01 20:39   ` Jeff King [this message]
2009-05-01 22:59     ` Junio C Hamano
2009-05-01 22:37 ` Junio C Hamano

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=20090501203910.GA15549@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=bebarino@gmail.com \
    --cc=felipe.contreras@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).