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-load.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 16:16:00 -0700 (PDT)
- Subject: Re: [PATCH] remove nested functions from elf/dl-load.c
- Authentication-results: sourceware.org; auth=none
- References: <CAGQ9bdxsbz1zjaNtOdEXdMd6kwJ_zqh1riNLK46nk84Qw+jXZw at mail dot gmail dot com>
> * elf/dl-load.c
> (add_path): New function broken out of _dl_rtld_di_serinfo.
> (_dl_rtld_di_serinfo): Remove a nested function. Update call sites.
Two spaces between sentences. Say "remove that" instead of "remove a".
> +struct add_path_args
This is not the arguments to the function so much as it's the state
relevant to the function. So add_path_state seems like a better name.
> {
> + struct add_path_args p;
> if (counting)
> {
> si->dls_cnt = 0;
> si->dls_size = 0;
> }
> + p.counting = counting;
> + p.idx = 0;
> + p.allocptr = (char *) &si->dls_serpath[si->dls_cnt];
> + p.si = si;
Use an initializing definition, and put that exactly where the previous
definitions of the shared locals were. That is, after the if block and a
blank line.
The change is OK with those fixes.
Thanks,
Roland