This is the mail archive of the libc-alpha@sourceware.org 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] Properly display unavailable elements in LC_MONETARY category


On Tue, Nov 12, 2013 at 12:07:55PM +0100, Andreas Schwab wrote:
> On architectures with unsigned characters the elements were displayed as
> 255 instead of -1.
>
This puzzles me, it seems to revert part of following commit:

2003-04-27  Ulrich Drepper  <drepper@redhat.com>

        * nscd/connections.c (client_queued): New variable.
        (nscd_run): Revamp the loop.  Don't call poll except for cleanup
        threads.  Keep track of the number of delays caused because of busy
        worker threads.
        * nscd/nscd.h: Declare client_queued.
        * nscd/nscd_stat.c: Transmit and print client_queued information.

        * locale/programs/locale.c (show_info): Use '\177' instead of CHAR_MAX.

        * Makerules ($(common-objpfx)shlib.lds): Don't use PROVIDE to
        define __start_libc_freeres_ptrs and __stop___libc_freeres_ptrs.

Also locale/programs/ld-monetary.c uses \177.

This is consistent with locale/C-monetary.c which defines unavailable
based on if char is signed or unsigned.

If these issues are clarified a patch is ok.

> Andreas.
> 
> 	* locale/programs/locale.c (show_info): Check for CHAR_MAX instead
> 	of '\177'.
> ---
>  locale/programs/locale.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/locale/programs/locale.c b/locale/programs/locale.c
> index 14d34e6..4f8734c 100644
> --- a/locale/programs/locale.c
> +++ b/locale/programs/locale.c
> @@ -895,7 +895,7 @@ show_info (const char *name)
>  	      printf ("%s=", item->name);
>  
>  	    if (val != NULL)
> -	      printf ("%d", *val == '\177' ? -1 : *val);
> +	      printf ("%d", *val == CHAR_MAX ? -1 : *val);
>  	    putchar ('\n');
>  	  }
>  	  break;
> @@ -909,12 +909,12 @@ show_info (const char *name)
>  
>  	    while (cnt > 1)
>  	      {
> -		printf ("%d;", *val == '\177' ? -1 : *val);
> +		printf ("%d;", *val == CHAR_MAX ? -1 : *val);
>  		--cnt;
>  		++val;
>  	      }
>  
> -	    printf ("%d\n", cnt == 0 || *val == '\177' ? -1 : *val);
> +	    printf ("%d\n", cnt == 0 || *val == CHAR_MAX ? -1 : *val);
>  	  }
>  	  break;
>  	case word:
> -- 
> 1.8.4.3
> 
> -- 


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