[PATCH PR/42686] Align the help text output
Shujing Zhao
pearly.zhao@oracle.com
Thu Mar 18 11:48:00 GMT 2010
On 03/17/2010 08:04 PM, Joseph S. Myers wrote:
>
> But you should be able to treat all ITEMs as if they have wide characters;
> there should be no need to do something special for the case of no wide
> characters.
>
> The check still isn't appropriate. The width might equal the number of
> bytes even when wide characters are present. I think the logic should be:
> if NLS enabled and the relevant wide character functions available, use
> get_wcs_aligned_len, otherwise use get_str_aligned_len. This means only
> one of those functions is used in any compiler configuration, so you can
> just make them two different implementations of get_aligned_len depending
> on the configuration, rather than having three function names involved.
>
Thanks. I merge the algorithm of line break in function get_aligned_len and
don't care if it includes wide characters. Yes, not only the code, but also the
logic is clearer.
I add a separate conditional directive to get the aligned length when
--diable-nls or the relevant interfaces are not available. The definition of
function fake_ngettext is moved to the inclusions of ENABLE_NLS, not used a
separate "ifndef ENABLE_NLS". That would use less conditionals at intl.c.
Tested on i686-pc-linux and enabled nls, the help output isn't changed when the
locale is C. Disabled nls, the output isn't changed too.
Thanks
Pearly
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 03181811.patch
Type: text/x-patch
Size: 6917 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100318/80678950/attachment.bin>
More information about the Gcc-patches
mailing list