This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: patch: Correct formatting of internatinal currency


[Ulrich Drepper]
> I don't see a reason for this complicated macro.  The international
> value for most fields is always defined.

Are you sure?  I'm unable to find the code to verify this.  The
international value should only be used if it is present in the
locale, and if it isn't, international formatting should use the
normal value instead.

> The only exception is int_frac_digits.  And here the value -1 is
> used (not CHAR_MAX) and it has a legitimate meaning.

The test in the code already compared with CHAR_MAX, so I believed this
to be the value used for non-values.

> So the whole macro expansion should be
> 
>   *_NL_CURRENT (category, int_format ? int_item : item)
> 
> Drop the 'value' parameter in the macro, and make the assignment
> explicit in the code.

I'm not convinced that this will work.  I'll test and read more code
to find out if I'm mistaken.

> And drop the extra { } around single statements, they just make the
> code less readable.

OK.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]