[PATCH 2/4] time/tst-strftime2.c: Make the file easier to maintain

Carlos O'Donell codonell@redhat.com
Tue Apr 2 01:43:00 GMT 2019


On 4/1/19 6:42 PM, Rafal Luzynski wrote:
> Carlos,
> 
> Thank you for your reviews.  One question below:
> 
> 1.04.2019 22:34 Carlos O'Donell <codonell@redhat.com> wrote:
>>
>> On 3/31/19 11:58 PM, TAMUKI Shoichi wrote:
>> [...]
>>>    #include <locale.h>
>>>    #include <time.h>
>>>    #include <stdio.h>
>>>    #include <string.h>
>>>    
>>> -static const char *locales[] = { "ja_JP.UTF-8", "lo_LA.UTF-8",
>>> "th_TH.UTF-8" };
>>> +static const char *locales[] =
>>> +{
>>> +  "ja_JP.UTF-8", "lo_LA.UTF-8", "th_TH.UTF-8"
>>> +};
>>
>> Add enum and use below, this prevents constant and comment
>> getting out of sync.
>>
>> /* Must match locale index into locales array.  */
>> typedef enum
>>     {
>>       ja_JP, lo_LA, th_TH
>>     } test_locale;
> 
> That's a great idea.  What about an idea to define an enum of
> months like DJ did in one of his recent patches?

This is just a test case, and I'd like it to land as quickly
as possible with the entire patch set. Therefore I don't want
to place any restrictions on this moving forward. We can clean
this up in another round of edits.

-- 
Cheers,
Carlos.



More information about the Libc-alpha mailing list