summaryrefslogtreecommitdiff
path: root/locale
diff options
context:
space:
mode:
Diffstat (limited to 'locale')
-rw-r--r--locale/loadlocale.c4
-rw-r--r--locale/localeinfo.h22
-rw-r--r--locale/programs/ld-collate.c17
-rw-r--r--locale/programs/ld-ctype.c4
-rw-r--r--locale/programs/locale.c23
-rw-r--r--locale/programs/locarchive.c4
-rw-r--r--locale/programs/locfile.c6
7 files changed, 37 insertions, 43 deletions
diff --git a/locale/loadlocale.c b/locale/loadlocale.c
index 13eecea4e5..3530a1aef4 100644
--- a/locale/loadlocale.c
+++ b/locale/loadlocale.c
@@ -47,7 +47,7 @@ static const size_t _nl_category_num_items[] =
#define DEFINE_CATEGORY(category, category_name, items, a) \
static const enum value_type _nl_value_type_##category[] = { NO_PAREN items };
#define DEFINE_ELEMENT(element, element_name, optstd, type, rest...) \
- [_NL_ITEM_INDEX (element)] = type,
+ [_NL_ITEM_INDEX (element)] = vt_##type,
#include "categories.def"
#undef DEFINE_CATEGORY
@@ -144,7 +144,7 @@ _nl_intern_locale_data (int category, const void *data, size_t datasize)
if ((category == LC_CTYPE
&& cnt >= (sizeof (_nl_value_type_LC_CTYPE)
/ sizeof (_nl_value_type_LC_CTYPE[0])))
- || __builtin_expect (_nl_value_types[category][cnt] != word, 1))
+ || __builtin_expect (_nl_value_types[category][cnt] != vt_word, 1))
newdata->values[cnt].string = newdata->filedata + idx;
else
{
diff --git a/locale/localeinfo.h b/locale/localeinfo.h
index 070914dd51..f9dcdb670c 100644
--- a/locale/localeinfo.h
+++ b/locale/localeinfo.h
@@ -113,17 +113,17 @@ enum coll_sort_rule
/* We can map the types of the entries into a few categories. */
enum value_type
{
- none,
- string,
- stringarray,
- byte,
- bytearray,
- word,
- stringlist,
- wordarray,
- wstring,
- wstringarray,
- wstringlist
+ vt_none,
+ vt_string,
+ vt_stringarray,
+ vt_byte,
+ vt_bytearray,
+ vt_word,
+ vt_stringlist,
+ vt_wordarray,
+ vt_wstring,
+ vt_wstringarray,
+ vt_wstringlist
};
diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
index 037fd2fcc5..c66df44fc9 100644
--- a/locale/programs/ld-collate.c
+++ b/locale/programs/ld-collate.c
@@ -977,17 +977,17 @@ insert_value (struct linereader *ldfile, const char *symstr, size_t symlen,
void *ptr = elem;
if (find_entry (&collate->elem_table, symstr, symlen, &ptr) != 0)
{
- void *result;
+ void *found;
struct symbol_t *sym = NULL;
/* It's also collation element. Therefore it's either a
collating symbol or it's a character which is not
supported by the character set. In the later case we
simply create a dummy entry. */
- if (find_entry (&collate->sym_table, symstr, symlen, &result) == 0)
+ if (find_entry (&collate->sym_table, symstr, symlen, &found) == 0)
{
/* It's a collation symbol. */
- sym = (struct symbol_t *) result;
+ sym = found;
elem = sym->order;
}
@@ -2116,7 +2116,6 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
uint32_t elem_size;
uint32_t *elem_table;
int i;
- struct element_t *runp;
init_locale_data (&file, nelems);
add_locale_uint32 (&file, nrules);
@@ -2230,7 +2229,6 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
&& (runp->mbs[runp->nmbs - 1]
== runp->mbnext->mbs[runp->nmbs - 1] + 1))
{
- int i;
struct element_t *series_startp = runp;
struct element_t *curp;
@@ -2289,8 +2287,6 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
/* A single entry. Simply add the index and the length and
string (except for the first character which is already
tested for). */
- int i;
-
/* Output the weight info. */
weightidx = output_weight (&weightpool, collate, runp);
@@ -2402,7 +2398,7 @@ collate_output (struct localedef_t *locale, const struct charmap_t *charmap,
larger to avoid extremely long search times. We can achieve
good results with a 40% larger table than there are entries. */
elem_size = 0;
- runp = collate->start;
+ struct element_t *runp = collate->start;
while (runp != NULL)
{
if (runp->mbs != NULL && runp->weights != NULL && !runp->is_character)
@@ -3313,7 +3309,6 @@ error while adding equivalent collating symbol"));
else
{
struct symbol_t *symbp;
- void *ptr;
if (find_entry (&collate->sym_table, startmb, lenmb,
&ptr) == 0)
@@ -3535,10 +3530,10 @@ error while adding equivalent collating symbol"));
}
else
{
- void *result;
+ void *found;
if (find_entry (&collate->sym_table, symstr, symlen,
- &result) != 0)
+ &found) != 0)
/* No collating symbol, it's an error. */
goto err_label;
diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
index 67846b398a..48542ebeae 100644
--- a/locale/programs/ld-ctype.c
+++ b/locale/programs/ld-ctype.c
@@ -1700,7 +1700,6 @@ to-value character sequence is smaller than from-value sequence"));
}
else if (handle_digits == 2)
{
- struct charseq *seq;
/* We must store the digit values. */
if (ctype->outdigits_act >= 10)
{
@@ -3994,9 +3993,9 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
{
/* Search for the place where to insert this string.
XXX Better use a real sorting algorithm later. */
- size_t idx = 0;
int replace = 0;
+ idx = 0;
while (idx < number)
{
int res = wcscmp ((const wchar_t *) sorted[idx]->from,
@@ -4059,7 +4058,6 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
to_len = 0;
for (size_t cnt = 0; cnt < number; ++cnt)
{
- size_t len;
struct translit_to_t *srunp;
ctype->translit_from_idx[cnt] = from_len;
diff --git a/locale/programs/locale.c b/locale/programs/locale.c
index c9660e94c4..213ef5897d 100644
--- a/locale/programs/locale.c
+++ b/locale/programs/locale.c
@@ -138,7 +138,8 @@ struct category
/* We have all categories defined in `categories.def'. Now construct
the description and data structure used for all categories. */
-#define DEFINE_ELEMENT(Item, More...) { Item, ## More },
+#define DEFINE_ELEMENT(item, name, std, type, rest...) \
+ { item, name, std, vt_##type ,##rest },
#define DEFINE_CATEGORY(category, name, items, postload) \
static struct cat_item category##_desc[] = \
{ \
@@ -826,7 +827,7 @@ print_item (struct cat_item *item)
{
switch (item->value_type)
{
- case string:
+ case vt_string:
if (show_keyword_name)
printf ("%s=\"", item->name);
fputs (nl_langinfo (item->item_id) ? : "", stdout);
@@ -834,7 +835,7 @@ print_item (struct cat_item *item)
putchar ('"');
putchar ('\n');
break;
- case stringarray:
+ case vt_stringarray:
{
const char *val;
int cnt;
@@ -859,7 +860,7 @@ print_item (struct cat_item *item)
putchar ('\n');
}
break;
- case stringlist:
+ case vt_stringlist:
{
int first = 1;
const char *val = nl_langinfo (item->item_id) ? : "";
@@ -878,7 +879,7 @@ print_item (struct cat_item *item)
putchar ('\n');
}
break;
- case byte:
+ case vt_byte:
{
const char *val = nl_langinfo (item->item_id);
@@ -890,7 +891,7 @@ print_item (struct cat_item *item)
putchar ('\n');
}
break;
- case bytearray:
+ case vt_bytearray:
{
const char *val = nl_langinfo (item->item_id);
int cnt = val ? strlen (val) : 0;
@@ -908,7 +909,7 @@ print_item (struct cat_item *item)
printf ("%d\n", cnt == 0 || *val == '\177' ? -1 : *val);
}
break;
- case word:
+ case vt_word:
{
union { unsigned int word; char *string; } val;
val.string = nl_langinfo (item->item_id);
@@ -918,7 +919,7 @@ print_item (struct cat_item *item)
printf ("%d\n", val.word);
}
break;
- case wordarray:
+ case vt_wordarray:
{
int first = 1;
union { unsigned int *wordarray; char *string; } val;
@@ -935,9 +936,9 @@ print_item (struct cat_item *item)
putchar ('\n');
}
break;
- case wstring:
- case wstringarray:
- case wstringlist:
+ case vt_wstring:
+ case vt_wstringarray:
+ case vt_wstringlist:
/* We don't print wide character information since the same
information is available in a multibyte string. */
default:
diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
index cdd99602c2..452017aef7 100644
--- a/locale/programs/locarchive.c
+++ b/locale/programs/locarchive.c
@@ -1629,7 +1629,7 @@ dataentcmp (const void *a, const void *b)
void
-show_archive_content (const char *fname, int verbose)
+show_archive_content (const char *fname, int be_verbose)
{
struct locarhandle ah;
struct locarhead *head;
@@ -1660,7 +1660,7 @@ show_archive_content (const char *fname, int verbose)
/* Sort the names. */
qsort (names, used, sizeof (struct nameent), nameentcmp);
- if (verbose)
+ if (be_verbose)
{
struct dataent *files;
struct sumhashent *sumhashtab;
diff --git a/locale/programs/locfile.c b/locale/programs/locfile.c
index 1c4fe854e0..7e7f736d9f 100644
--- a/locale/programs/locfile.c
+++ b/locale/programs/locfile.c
@@ -699,7 +699,7 @@ void
write_locale_data (const char *output_path, int catidx, const char *category,
struct locale_file *file)
{
- size_t cnt, step, maxiov;
+ size_t step, maxiov;
int fd;
char *fname;
const char **other_paths;
@@ -724,7 +724,7 @@ write_locale_data (const char *output_path, int catidx, const char *category,
/* The data will be added to the archive. For now we simply
generate the image which will be written. First determine
the size. */
- int cnt;
+ size_t cnt;
void *endp;
to_archive[catidx].size = 0;
@@ -812,7 +812,7 @@ cannot open output file `%s' for category `%s'"), fname, category));
/* Write the data using writev. But we must take care for the
limitation of the implementation. */
- for (cnt = 0; cnt < n_elem; cnt += step)
+ for (size_t cnt = 0; cnt < n_elem; cnt += step)
{
step = n_elem - cnt;
if (maxiov > 0)