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