public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Jonathan Nieder <jrnieder@gmail•com>
Cc: Thomas Rast <tr@thomasrast•ch>, Jeff King <peff@peff•net>,
	git@vger•kernel.org
Subject: Re: [PATCH v2] commit-slab: declare functions "static inline"
Date: Mon, 25 Nov 2013 12:33:29 -0800	[thread overview]
Message-ID: <xmqqiovgxluu.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20131125201200.GN4212@google.com> (Jonathan Nieder's message of "Mon, 25 Nov 2013 12:12:00 -0800")

Jonathan Nieder <jrnieder@gmail•com> writes:

> Thomas Rast wrote:
>
>> This shuts up compiler warnings about unused functions.
>
> If that is the only goal, I think it would be cleaner to use
>
> 	#define MAYBE_UNUSED __attribute__((__unused__))
>
> 	static MAYBE_UNUSED void init_ ...
>
> like was done in the vcs-svn/ directory until cba3546 (drop obj_pool,
> 2010-12-13) et al.
>
> I haven't thought carefully about whether encouraging inlining here
> (or encouraging the reader to think of these functions as inline) is a
> good or bad change.
>
> [...]
>> @@ -98,4 +98,16 @@ struct slabname {							\
>>  									\
>>  static int stat_ ##slabname## realloc
>>  
>> +/*
>> + * Note that this seemingly redundant second declaration is required
>> + * to allow a terminating semicolon, which makes instantiations look
>> + * like function declarations.  I.e., the expansion of
>
> Micronit: this reads more clearly without the "Note that".  That is,
> the comment can get the reader's attention more easily by going right
> into what it is about to say without asking for the reader's
> attention:
>
> 	/*
> 	 * This seemingly redundant second declaration is required to ...

Hmm, both of these are good points.

Thanks.

  parent reply	other threads:[~2013-11-25 20:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-25 19:01 [PATCH 0/2] commit-slab cleanups Thomas Rast
2013-11-25 19:02 ` [PATCH 1/2] commit-slab: document clear_$slabname() Thomas Rast
2013-11-25 20:24   ` Jonathan Nieder
2013-11-29 19:35     ` Thomas Rast
2013-11-25 20:39   ` Junio C Hamano
2013-11-27 10:39     ` Eric Sunshine
2013-11-25 19:02 ` [PATCH 2/2] commit-slab: declare functions "static inline" Thomas Rast
2013-11-25 19:36   ` Junio C Hamano
2013-11-25 19:53     ` Thomas Rast
2013-11-25 20:04       ` [PATCH v2] " Thomas Rast
2013-11-25 20:12         ` Jonathan Nieder
2013-11-25 20:15           ` Thomas Rast
2013-11-25 20:35             ` Jonathan Nieder
2013-11-25 20:33           ` Junio C Hamano [this message]
2013-11-25 20:23         ` Junio C Hamano
2013-12-01 10:36   ` [PATCH 2/2] " Duy Nguyen
2013-12-01 20:41     ` [PATCH] commit-slab: sizeof() the right type in xrealloc Thomas Rast
2013-12-02 15:35       ` 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=xmqqiovgxluu.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=jrnieder@gmail$(echo .)com \
    --cc=peff@peff$(echo .)net \
    --cc=tr@thomasrast$(echo .)ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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