diff options
Diffstat (limited to 'locale/programs')
-rw-r--r-- | locale/programs/charset.c | 8 | ||||
-rw-r--r-- | locale/programs/ld-collate.c | 2 | ||||
-rw-r--r-- | locale/programs/ld-monetary.c | 4 | ||||
-rw-r--r-- | locale/programs/locfile.c | 4 |
4 files changed, 12 insertions, 6 deletions
diff --git a/locale/programs/charset.c b/locale/programs/charset.c index 2e2f63bd9a..a7f988d3a5 100644 --- a/locale/programs/charset.c +++ b/locale/programs/charset.c @@ -66,7 +66,7 @@ charset_find_value (const struct charset_t *cs, const char *name, size_t len) if (find_entry ((hash_table *) &cs->char_table, name, len, &result) < 0) return ILLEGAL_CHAR_VALUE; - return (unsigned int) result; + return (unsigned int) ((unsigned long int) result); } @@ -81,7 +81,8 @@ insert_char (struct linereader *lr, struct charset_t *cs, int bytes, if (to == NULL) { - if (insert_entry (&cs->char_table, from, strlen (from), (void *) value) + if (insert_entry (&cs->char_table, from, strlen (from), + (void *) (unsigned long int) value) < 0) lr_error (lr, _("duplicate character name `%s'"), from); @@ -126,7 +127,8 @@ insert_char (struct linereader *lr, struct charset_t *cs, int bytes, { sprintf (&buf[prefix_len], "%0d", cnt); - if (insert_entry (&cs->char_table, buf, len1, (void *) cnt) < 0) + if (insert_entry (&cs->char_table, buf, len1, + (void *) (unsigned long int) cnt) < 0) lr_error (lr, _("duplicate character name `%s'"), buf); } } diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c index 629df90ced..4bdf0b2256 100644 --- a/locale/programs/ld-collate.c +++ b/locale/programs/ld-collate.c @@ -233,7 +233,7 @@ collate_finish (struct localedef_t *locale, struct charset_t *charset) else if (find_entry (&collate->symbols, patch->token, toklen, &ptmp) >= 0) { - value = (unsigned int) ptmp; + value = (unsigned long int) ptmp; } else value = 0; diff --git a/locale/programs/ld-monetary.c b/locale/programs/ld-monetary.c index a717377a8b..5efa969baa 100644 --- a/locale/programs/ld-monetary.c +++ b/locale/programs/ld-monetary.c @@ -164,8 +164,12 @@ value for field `%s' in category `%s' must not be the empty string"), value for field `%s' in category `%s' must be in range %d...%d"), \ #cat, "LC_MONETARY", min, max) +#if 0 + /* The following two test are not really necessary because all values + the variable could have are valid. */ TEST_ELEM (int_frac_digits, -128, 127); /* No range check. */ TEST_ELEM (frac_digits, -128, 127); /* No range check. */ +#endif TEST_ELEM (p_cs_precedes, -1, 1); TEST_ELEM (p_sep_by_space, -1, 2); TEST_ELEM (n_cs_precedes, -1, 1); diff --git a/locale/programs/locfile.c b/locale/programs/locfile.c index 89dc6bb539..3bbe479017 100644 --- a/locale/programs/locfile.c +++ b/locale/programs/locfile.c @@ -935,7 +935,7 @@ write_locale_data (const char *output_path, const char *category, int fd; char *fname; - asprintf (&fname, "%s/%s", output_path, category); + asprintf (&fname, "%s%s", output_path, category); fd = creat (fname, 0666); if (fd == -1) { @@ -944,7 +944,7 @@ write_locale_data (const char *output_path, const char *category, if (errno == EISDIR) { free (fname); - asprintf (&fname, "%1$s/%2$s/SYS_%2$s", output_path, category); + asprintf (&fname, "%1$s%2$s/SYS_%2$s", output_path, category); fd = creat (fname, 0666); if (fd == -1) save_err = errno; |