This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
remove a warning in intl/
- From: Bruno Haible <bruno at clisp dot org>
- To: libc-alpha at sources dot redhat dot com
- Date: Tue, 29 Mar 2005 14:09:30 +0200
- Subject: remove a warning in intl/
Hi,
This is the start of a small series of intl/ patches, brought here from
GNU gettext.
When configured with --enable-all-warnings, we have this warning (among
others):
dcigettext.c: In function `__dcigettext':
dcigettext.c:439: warning: cast discards qualifiers from pointer target type
The appended patch removes the warning. It has no other effects.
Bruno
2005-03-19 Bruno Haible <bruno@clisp.org>
* dcigettext.c (struct known_translation_t): Change type of domainname
field to 'const char *'.
(DCIGETTEXT): Remove const-cast.
--- glibc-20050322/intl/dcigettext.c.bak Tue Feb 22 22:16:39 2005
+++ glibc-20050322/intl/dcigettext.c Sun Mar 27 23:04:27 2005
@@ -177,7 +177,7 @@
struct known_translation_t
{
/* Domain in which to search. */
- char *domainname;
+ const char *domainname;
/* The category. */
int category;
@@ -436,7 +436,7 @@
search = (struct known_translation_t *)
alloca (offsetof (struct known_translation_t, msgid) + msgid_len);
memcpy (search->msgid, msgid1, msgid_len);
- search->domainname = (char *) domainname;
+ search->domainname = domainname;
search->category = category;
/* Since tfind/tsearch manage a balanced tree, concurrent tfind and
@@ -632,9 +632,11 @@
+ msgid_len + domainname_len + 1);
if (newp != NULL)
{
- newp->domainname =
- mempcpy (newp->msgid, msgid1, msgid_len);
- memcpy (newp->domainname, domainname, domainname_len + 1);
+ char *new_domainname;
+
+ new_domainname = mempcpy (newp->msgid, msgid1, msgid_len);
+ memcpy (new_domainname, domainname, domainname_len + 1);
+ newp->domainname = new_domainname;
newp->category = category;
newp->counter = _nl_msg_cat_cntr;
newp->domain = domain;