[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Human readable sort
From: |
Pádraig Brady |
Subject: |
Re: Human readable sort |
Date: |
Thu, 21 May 2009 15:50:12 +0100 |
User-agent: |
Thunderbird 2.0.0.6 (X11/20071008) |
Eric Blake wrote:
> Pádraig Brady <P <at> draigBrady.com> writes:
>
>> Looks like your copyright assignment papers went through.
>> Attached is the latest patch rebased against master
>> and with a couple of extra whitespace fixups.
>>
>
> +static int
> +find_unit_order (const char *number)
> +{
> + static const char orders [UCHAR_LIM] = {
> + ['K']=1, ['M']=2, ['G']=3, ['T']=4, ['P']=5, ['E']=6, ['Z']=7, ['Y']=8,
> + ['k']=1,
> + };
>
> This assumes more of C99 than we have previously required. Are we sure that
> all compilers out there will support this syntax?
Designated Initializers were a GNU C C89 extension.
So I thought they were both elegant and not too new.
I've not got access to older machines to test unfortunately.
>
> Also, your tests only cover 'sort -h'; what about covering 'sort -k1,1h'?
>
OK I'll flesh out the tests a bit.
cheers,
Pádraig.
- Re: Human readable sort, Pádraig Brady, 2009/05/21
- Re: Human readable sort, Eric Blake, 2009/05/21
- Re: Human readable sort,
Pádraig Brady <=
- Re: Human readable sort, Jim Meyering, 2009/05/22
- Re: Human readable sort, Pádraig Brady, 2009/05/22
- Re: Human readable sort, Jim Meyering, 2009/05/22
- Re: Human readable sort, Pádraig Brady, 2009/05/26
- Re: Human readable sort, Jim Meyering, 2009/05/27
- Re: Human readable sort, Matthew Woehlke, 2009/05/26
Re: Human readable sort, Giuseppe Scrivano, 2009/05/21