[PATCH] remove nested functions from elf/dl-load.c

Konstantin Serebryany konstantin.s.serebryany@gmail.com
Mon Oct 6 18:17:00 GMT 2014


Fixed all, please take another look.

2014-10-06  Kostya Serebryany  <konstantin.s.serebryany@gmail.com>

        * elf/dl-load.c
        (add_path): New function broken out of _dl_rtld_di_serinfo.
        (_dl_rtld_di_serinfo): Remove that nested function.  Update call sites.





On Wed, Oct 1, 2014 at 4:16 PM, Roland McGrath <roland@hack.frob.com> wrote:
>>         * 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unnest-dl-load-1.patch
Type: text/x-patch
Size: 3977 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20141006/92b2c955/attachment.bin>


More information about the Libc-alpha mailing list