aboutsummaryrefslogtreecommitdiff
path: root/locale/programs
diff options
context:
space:
mode:
Diffstat (limited to 'locale/programs')
-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
5 files changed, 24 insertions, 30 deletions
diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
index 037fd2f..c66df44 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 67846b3..48542eb 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 c9660e9..213ef58 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 cdd9960..452017a 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 1c4fe85..7e7f736 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)