git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] contrib/git-credential-gnome-keyring.c: small stylistic cleanups

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 12, 2013, 23:41 UTC
Message-ID
<xmqq8uvpskld.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAEBDL5Wb+fU=qX4eypt3SrAKQjWRqf9KkNDoutbt7fTsdk02rw@mail.gmail.com>
John Szakmeister <john@szakmeister.net> writes:
Show 10 quoted lines
> On Mon, Dec 9, 2013 at 1:06 PM, Junio C Hamano <gitster@pobox.com> wrote:
> [snip]
>>
>> I thought we cast without SP after the (typename), i.e.
>>
>>         gpointer *data = (gpointer *)user_data;
>
> I've found a mixture of both in the code base, and the
> CodingGuidelines doesn't say either way.  I'm happy to switch the file
> to no SP after the typename if that's the project preference.
Somewhat arbitrary and unscientific, but between
    git grep -e '[^f]([a-z_ ]* \*)[^ ]' -- \*.c | wc -l
    422
    $ git grep -e '[^f]([a-z_ ]* \*) ' -- \*.c | wc -l
    233

I see that we favor "(struct blah *)apointer" over "(int *) apointer". Many hits in the latter grep come from compat/ that are borrowed pieces of code we tend not to style-fix.

The leading [^f] is crudely excludes "sizeof(typename *)"; it does not change the resulting picture in a major way, though.

Thanks.
Previous: John SzakmeisterNext: Junio C Hamano
Message 7 of 8 in “contrib/git-credential-gnome-keyring.c: small stylistic cleanups”
  1. contrib/git-credential-gnome-keyring.c: small stylistic cleanupsJohn Szakmeister, Dec 3, 2013
  2. Junio C HamanoDec 5, 2013
  3. Felipe ContrerasDec 7, 2013
  4. contrib/git-credential-gnome-keyring.c: small stylistic cleanupsJohn Szakmeister, Dec 7, 2013
  5. Junio C HamanoDec 9, 2013
  6. John SzakmeisterDec 10, 2013
  7. Junio C HamanoDec 12, 2013
  8. Junio C HamanoDec 13, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.