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

[PATCH 0/5] *.[ch]: don't duplicate *_init() and *_INIT logic

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jul 1, 2021, 10:51 UTC
Message-ID
<cover-0.5-00000000000-20210701T104855Z-avarab@gmail.com>

This series implements a suggestion by Jeff King to use an idiom for *_init() functions that avoids duplicating what we've declared in the corresponding *_INIT macros. See https://lore.kernel.org/git/YNytp0JAIaQih0Y4@coredump.intra.peff.net/

Ævar Arnfjörð Bjarmason (5):
  *.h: move some *_INIT to designated initializers
  *.c *_init(): define in terms of corresponding *_INIT macro
  dir.[ch]: replace dir_init() with DIR_INIT
  string-list.[ch]: add a string_list_init_{nodup,dup}()
  string-list.h users: change to use *_{nodup,dup}()
 apply.c                |  6 +++---
 archive.c              |  2 +-
 builtin/add.c          |  3 +--
 builtin/check-ignore.c |  3 +--
 builtin/clean.c        |  6 ++----
 builtin/grep.c         |  3 +--
 builtin/ls-files.c     |  3 +--
 builtin/stash.c        |  3 +--
 config.c               |  2 +-
 credential.c           |  4 ++--
 credential.h           |  4 +++-
 dir.c                  |  9 ++-------
 dir.h                  |  4 ++--
 entry.c                |  4 ++--
 json-writer.c          |  6 ++----
 json-writer.h          |  5 ++++-
 merge-ort.c            |  4 ++--
 merge-recursive.c      |  4 ++--
 merge.c                |  3 +--
 refs/packed-backend.c  |  2 +-
 run-command.c          |  5 ++---
 run-command.h          |  5 ++++-
 strbuf.c               |  4 ++--
 string-list.c          | 18 ++++++++++++++++--
 string-list.h          | 15 +++++++++++----
 strmap.c               |  3 ++-
 strvec.c               |  5 ++---
 transport.c            |  2 +-
 wt-status.c            |  3 +--
 29 files changed, 76 insertions(+), 64 deletions(-)
-- 
2.32.0.623.ge833f40cd87
Next: Ævar Arnfjörð Bjarmason
Message 1 of 10 in “*.[ch]: don't duplicate *_init() and *_INIT logic”
  1. 0/5 *.[ch]: don't duplicate *_init() and *_INIT logicÆvar Arnfjörð Bjarmason, Jul 1, 2021
  2. 3/5 dir.[ch]: replace dir_init() with DIR_INITÆvar Arnfjörð Bjarmason, Jul 1, 2021
  3. 2/5 *.c *_init(): define in terms of corresponding *_INIT macroÆvar Arnfjörð Bjarmason, Jul 1, 2021
  4. 1/5 *.h: move some *_INIT to designated initializersÆvar Arnfjörð Bjarmason, Jul 1, 2021
  5. Martin ÅgrenJul 1, 2021
  6. Junio C HamanoJul 1, 2021
  7. Ævar Arnfjörð BjarmasonJul 1, 2021
  8. 5/5 string-list.h users: change to use *_{nodup,dup}()Ævar Arnfjörð Bjarmason, Jul 1, 2021
  9. 4/5 string-list.[ch]: add a string_list_init_{nodup,dup}()Ævar Arnfjörð Bjarmason, Jul 1, 2021
  10. Jeff KingJul 1, 2021

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.