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

Re: [PATCH v7 3/5] dir_iterator: add helpers to dir_iterator_advance

From
Stefan Beller <sbeller@google.com>
Date
Apr 3, 2017, 22:48 UTC
Message-ID
<CAGZ79kYrH73WrXyw+JypdSVfgpvduL-mUVZ3yyEUuib4BTZ9uw@mail.gmail.com>
In-Reply-To
<1491163388-41255-4-git-send-email-bnmvco@gmail.com>
On Sun, Apr 2, 2017 at 1:03 PM, Daniel Ferreira <bnmvco@gmail.com> wrote:
Show 6 quoted lines
> Create inline helpers to dir_iterator_advance(). Make
> dir_iterator_advance()'s code more legible and allow some behavior to
> be reusable.
>
> Signed-off-by: Daniel Ferreira <bnmvco@gmail.com>
> ---
> +static inline void push_dir_level(struct dir_iterator_int *iter, struct dir_iterator_level *level)

Sometimes we use inline, sometimes we do not: $ git grep "static inline" -- *.c |wc -l 84 $ git grep "static inline" -- *.h |wc -l 130 # approximate a function definition: $ git grep -e "static" -- *.c |grep "("|wc -l 2971

So I think we'd want to have the inline keyword in the header only (when the code is actually to be inlined). As a C file is one translation unit, the compiler can figure out best whether to inline a particular static function on its own.

The rest looks good to me,

Thanks, Stefan

Previous: Daniel FerreiraNext: Daniel Ferreira
Message 7 of 13 in “[GSoC] remove_subtree(): reimplement using iterators”
  1. 0/5 [GSoC] remove_subtree(): reimplement using iteratorsDaniel Ferreira, Apr 2, 2017
  2. 1/5 dir_iterator: add tests for dir_iterator APIDaniel Ferreira, Apr 2, 2017
  3. Stefan BellerApr 3, 2017
  4. 2/5 remove_subtree(): test removing nested directoriesDaniel Ferreira, Apr 2, 2017
  5. Stefan BellerApr 3, 2017
  6. 3/5 dir_iterator: add helpers to dir_iterator_advanceDaniel Ferreira, Apr 2, 2017
  7. Stefan BellerApr 3, 2017
  8. 4/5 dir_iterator: refactor state machine modelDaniel Ferreira, Apr 2, 2017
  9. Michael HaggertyApr 3, 2017
  10. Daniel Ferreira (theiostream)Apr 3, 2017
  11. Michael HaggertyApr 4, 2017
  12. 5/5 remove_subtree(): reimplement using iteratorsDaniel Ferreira, Apr 2, 2017
  13. Michael HaggertyApr 3, 2017

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.