mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
Update.
* intl/dcigettext.c (transcmp): Make s1 and s2 const. (DCIGETTEXT): Make domaindata variable const. * intl/loadmsgcat.c (_nl_load_domain): Rearrange domain initialization to avoid warning.
This commit is contained in:
@ -43,6 +43,10 @@
|
|||||||
warning.
|
warning.
|
||||||
* sysdeps/unix/sysv/linux/init-first.c: Add prototypes for
|
* sysdeps/unix/sysv/linux/init-first.c: Add prototypes for
|
||||||
__libc_init_first and _dl_start.
|
__libc_init_first and _dl_start.
|
||||||
|
* intl/dcigettext.c (transcmp): Make s1 and s2 const.
|
||||||
|
(DCIGETTEXT): Make domaindata variable const.
|
||||||
|
* intl/loadmsgcat.c (_nl_load_domain): Rearrange domain initialization
|
||||||
|
to avoid warning.
|
||||||
|
|
||||||
2000-11-20 Hiroyuki Machida <machida@sm.sony.co.jp>
|
2000-11-20 Hiroyuki Machida <machida@sm.sony.co.jp>
|
||||||
|
|
||||||
|
@ -243,10 +243,13 @@ static void *root;
|
|||||||
static int
|
static int
|
||||||
transcmp (const void *p1, const void *p2)
|
transcmp (const void *p1, const void *p2)
|
||||||
{
|
{
|
||||||
struct known_translation_t *s1 = (struct known_translation_t *) p1;
|
const struct known_translation_t *s1;
|
||||||
struct known_translation_t *s2 = (struct known_translation_t *) p2;
|
const struct known_translation_t *s2;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
|
s1 = (const struct known_translation_t *) p1;
|
||||||
|
s2 = (const struct known_translation_t *) p2;
|
||||||
|
|
||||||
result = strcmp (s1->msgid, s2->msgid);
|
result = strcmp (s1->msgid, s2->msgid);
|
||||||
if (result == 0)
|
if (result == 0)
|
||||||
{
|
{
|
||||||
@ -564,8 +567,8 @@ DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category)
|
|||||||
|
|
||||||
if (plural != 0)
|
if (plural != 0)
|
||||||
{
|
{
|
||||||
struct loaded_domain *domaindata =
|
const struct loaded_domain *domaindata =
|
||||||
(struct loaded_domain *) domain->data;
|
(const struct loaded_domain *) domain->data;
|
||||||
index = plural_eval (domaindata->plural, n);
|
index = plural_eval (domaindata->plural, n);
|
||||||
if (index >= domaindata->nplurals)
|
if (index >= domaindata->nplurals)
|
||||||
/* This should never happen. It means the plural expression
|
/* This should never happen. It means the plural expression
|
||||||
@ -662,7 +665,7 @@ _nl_find_msg (domain_file, msgid, index)
|
|||||||
const char *msgid;
|
const char *msgid;
|
||||||
unsigned long int index;
|
unsigned long int index;
|
||||||
{
|
{
|
||||||
struct loaded_domain *domain;
|
const struct loaded_domain *domain;
|
||||||
size_t act;
|
size_t act;
|
||||||
char *result;
|
char *result;
|
||||||
|
|
||||||
@ -672,7 +675,7 @@ _nl_find_msg (domain_file, msgid, index)
|
|||||||
if (domain_file->data == NULL)
|
if (domain_file->data == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
domain = (struct loaded_domain *) domain_file->data;
|
domain = (const struct loaded_domain *) domain_file->data;
|
||||||
|
|
||||||
/* Locate the MSGID and its translation. */
|
/* Locate the MSGID and its translation. */
|
||||||
if (domain->hash_size > 2 && domain->hash_tab != NULL)
|
if (domain->hash_size > 2 && domain->hash_tab != NULL)
|
||||||
|
@ -214,12 +214,11 @@ _nl_load_domain (domain_file)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
domain_file->data
|
domain = (struct loaded_domain *) malloc (sizeof (struct loaded_domain));
|
||||||
= (struct loaded_domain *) malloc (sizeof (struct loaded_domain));
|
if (domain == NULL)
|
||||||
if (domain_file->data == NULL)
|
|
||||||
return;
|
return;
|
||||||
|
domain_file->data = domain;
|
||||||
|
|
||||||
domain = (struct loaded_domain *) domain_file->data;
|
|
||||||
domain->data = (char *) data;
|
domain->data = (char *) data;
|
||||||
domain->use_mmap = use_mmap;
|
domain->use_mmap = use_mmap;
|
||||||
domain->mmap_size = size;
|
domain->mmap_size = size;
|
||||||
|
Reference in New Issue
Block a user