This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/25] Remove nested functions: crypt/md5-crypt.c
- From: Konstantin Serebryany <konstantin dot s dot serebryany at gmail dot com>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 21 May 2014 15:48:32 +0400
- Subject: Re: [PATCH 1/25] Remove nested functions: crypt/md5-crypt.c
- Authentication-results: sourceware.org; auth=none
- References: <CAGQ9bdzqT1EyXYMwACrHpPU=vPjM_b72LJRjb7BW_OzJRXG3bw at mail dot gmail dot com> <20140520131314 dot GB14500 at spoyarek dot pnq dot redhat dot com> <CAGQ9bdw=-pzbi00gn5t_W8pXBjU0edFvLGMNUc+o=g9og=f9+Q at mail dot gmail dot com> <20140520144605 dot GE14500 at spoyarek dot pnq dot redhat dot com> <CAGQ9bdz44LJM6SY83vwGEyOKHScOQor6xVJ1xADEOrcskhot7A at mail dot gmail dot com> <20140520154645 dot GI14500 at spoyarek dot pnq dot redhat dot com> <CAGQ9bdzbSWwbfuKUV-0e3XkqsJ9-YEbKy_rHipaXuwaMe9mxUw at mail dot gmail dot com> <20140521114751 dot GO14500 at spoyarek dot pnq dot redhat dot com>
On Wed, May 21, 2014 at 3:47 PM, Siddhesh Poyarekar <siddhesh@redhat.com> wrote:
> On Wed, May 21, 2014 at 03:35:43PM +0400, Konstantin Serebryany wrote:
>> I realized that two other files have the same situation with the
>> function b64_from_24bit.
>> md5-crypt.c, sha256-crypt.c, and sha512-crypt.c have exactly the same
>> implementations of b64_from_24bit as a nested function.
>> One possible fix is to move those two out and make them regular static
>> functions, just like I did in md5-crypt.c.
>>
>> Another solution is to create just one implementation of
>> b64_from_24bit and place it somewhere else.
>> For example declare it as __b64_from_24bit in crypt-private.h and
>> implement it in crypt_util.c.
>>
>> WDYT?
>
> One implementation would obviously be better.
Let me prepare another patch then.
Does __b64_from_24bit declared in crypt-private.h and defined in
crypt_util.c sound good?
>
> Siddhesh