This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
intl patches (13)
- To: libc-alpha at sources dot redhat dot com
- Subject: intl patches (13)
- From: Bruno Haible <haible at ilog dot fr>
- Date: Mon, 19 Mar 2001 22:02:22 +0100 (CET)
This patch avoids compiler warnings on various platforms (char / unsigned char
pointer mismatch). Resolve by using ICONV_CONST which is a macro
defined through autoconf.
This patch doesn't cause behaviour changes in glibc.
2001-03-09 Bruno Haible <haible@clisp.cons.org>
* intl/dcigettext.c (transmem_block_t): Change to unsigned char, to
avoid compiler warning.
(_nl_find_msg): Add casts to avoid compiler warnings.
diff -r -c3 intl/dcigettext.c intl-98/dcigettext.c
*** intl/dcigettext.c Sat Mar 17 18:40:11 2001
--- intl/dcigettext.c Sat Mar 17 14:40:20 2001
***************
*** 339,345 ****
} transmem_block_t;
static struct transmem_list *transmem_list;
#else
! typedef char transmem_block_t;
#endif
--- 361,367 ----
} transmem_block_t;
static struct transmem_list *transmem_list;
#else
! typedef unsigned char transmem_block_t;
#endif
***************
*** 797,803 ****
__libc_lock_lock (lock);
! inbuf = result;
outbuf = freemem + sizeof (size_t);
malloc_count = 0;
--- 821,827 ----
__libc_lock_lock (lock);
! inbuf = (const unsigned char *) result;
outbuf = freemem + sizeof (size_t);
malloc_count = 0;
***************
*** 838,844 ****
goto resize_freemem;
outleft = freemem_size - sizeof (size_t);
! if (iconv (domain->conv, &inptr, &inleft, &outptr, &outleft)
!= (size_t) (-1))
{
outbuf = (unsigned char *) outptr;
--- 862,870 ----
goto resize_freemem;
outleft = freemem_size - sizeof (size_t);
! if (iconv (domain->conv,
! (ICONV_CONST char **) &inptr, &inleft,
! &outptr, &outleft)
!= (size_t) (-1))
{
outbuf = (unsigned char *) outptr;
***************
*** 905,911 ****
/* We have now in our buffer a converted string. Put this
into the table of conversions. */
*(size_t *) freemem = outbuf - freemem - sizeof (size_t);
! domain->conv_tab[act] = freemem;
/* Shrink freemem, but keep it aligned. */
freemem_size -= outbuf - freemem;
freemem = outbuf;
--- 931,937 ----
/* We have now in our buffer a converted string. Put this
into the table of conversions. */
*(size_t *) freemem = outbuf - freemem - sizeof (size_t);
! domain->conv_tab[act] = (char *) freemem;
/* Shrink freemem, but keep it aligned. */
freemem_size -= outbuf - freemem;
freemem = outbuf;