This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] remove nested functions from elf/dl-deps.c
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Konstantin Serebryany <konstantin dot s dot serebryany at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 1 Oct 2014 13:49:19 -0700 (PDT)
- Subject: Re: [PATCH] remove nested functions from elf/dl-deps.c
- Authentication-results: sourceware.org; auth=none
- References: <CAGQ9bdxGg2zzfCcGOj=MxoEKRqAU1ayLLPr6U1HvCtkHMUvKGg at mail dot gmail dot com>
> +static inline
> +void preload (struct link_map *map, struct list *known, unsigned int *nlist)
The return type goes on the first line. The function name always starts
its line.
It's general policy not to use the 'inline' keyword for static functions in
a .c file. Unless there is a strong known reason, just let the compiler
decide about inlining. (This is a relatively recent policy, so you might
find counterexamples in the code.)
When a function has some parameters that are the "context" and some that
are the specific parameters for the specific call, the style I prefer (and
have used throughout the codebase) is to put all the "context" ones first.
> +{
> + known[*nlist].done = 0;
> + known[*nlist].map = map;
> + known[*nlist].next = &known[*nlist + 1];
> +
> + ++(*nlist);
Drop superfluous parens.
Thanks,
Roland