diff options
author | Florian Weimer <fweimer@redhat.com> | 2022-05-23 10:08:18 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2022-05-23 11:06:31 +0200 |
commit | 7ee41feba6b834d9e17e634bfbf222c4d8dd1a4f (patch) | |
tree | cae31634fe857b963791bf3697bdae20312acc2e /locale | |
parent | bbebe83a2874cd25934046d908824dfc11711a2b (diff) | |
download | glibc-7ee41feba6b834d9e17e634bfbf222c4d8dd1a4f.tar glibc-7ee41feba6b834d9e17e634bfbf222c4d8dd1a4f.tar.gz glibc-7ee41feba6b834d9e17e634bfbf222c4d8dd1a4f.tar.bz2 glibc-7ee41feba6b834d9e17e634bfbf222c4d8dd1a4f.zip |
locale: Remove private union from struct __locale_data
This avoids an alias violation later. This commit also fixes
an incorrect double-checked locking idiom in _nl_init_era_entries.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'locale')
-rw-r--r-- | locale/C-address.c | 2 | ||||
-rw-r--r-- | locale/C-collate.c | 2 | ||||
-rw-r--r-- | locale/C-ctype.c | 2 | ||||
-rw-r--r-- | locale/C-identification.c | 2 | ||||
-rw-r--r-- | locale/C-measurement.c | 2 | ||||
-rw-r--r-- | locale/C-messages.c | 2 | ||||
-rw-r--r-- | locale/C-monetary.c | 2 | ||||
-rw-r--r-- | locale/C-name.c | 2 | ||||
-rw-r--r-- | locale/C-numeric.c | 2 | ||||
-rw-r--r-- | locale/C-paper.c | 2 | ||||
-rw-r--r-- | locale/C-telephone.c | 2 | ||||
-rw-r--r-- | locale/C-time.c | 2 | ||||
-rw-r--r-- | locale/localeinfo.h | 14 |
13 files changed, 19 insertions, 19 deletions
diff --git a/locale/C-address.c b/locale/C-address.c index 1f509e4785..40ce9fbcf3 100644 --- a/locale/C-address.c +++ b/locale/C-address.c @@ -26,7 +26,7 @@ const struct __locale_data _nl_C_LC_ADDRESS attribute_hidden = { _nl_C_name, NULL, 0, 0, /* no file mapped */ - { NULL, }, /* no cached data */ + NULL, /* No cached data. */ UNDELETABLE, 0, 13, diff --git a/locale/C-collate.c b/locale/C-collate.c index 510e90cf14..f9c2b7741b 100644 --- a/locale/C-collate.c +++ b/locale/C-collate.c @@ -25,7 +25,7 @@ const struct __locale_data _nl_C_LC_COLLATE attribute_hidden = { _nl_C_name, NULL, 0, 0, /* no file mapped */ - { NULL, }, /* no cached data */ + NULL, /* No cached data. */ UNDELETABLE, 0, 19, diff --git a/locale/C-ctype.c b/locale/C-ctype.c index cc99bff930..ef4b67029c 100644 --- a/locale/C-ctype.c +++ b/locale/C-ctype.c @@ -542,7 +542,7 @@ const struct __locale_data _nl_C_LC_CTYPE attribute_hidden = { _nl_C_name, NULL, 0, 0, /* no file mapped */ - { NULL, }, /* no cached data */ + NULL, /* No cached data. */ UNDELETABLE, 1, /* Enable transliteration by default. */ NR_FIXED + NR_CLASSES + NR_MAPS, diff --git a/locale/C-identification.c b/locale/C-identification.c index edaf417c70..9648de05bc 100644 --- a/locale/C-identification.c +++ b/locale/C-identification.c @@ -26,7 +26,7 @@ const struct __locale_data _nl_C_LC_IDENTIFICATION attribute_hidden = { _nl_C_name, NULL, 0, 0, /* no file mapped */ - { NULL, }, /* no cached data */ + NULL, /* No cached data. */ UNDELETABLE, 0, 16, diff --git a/locale/C-measurement.c b/locale/C-measurement.c index b98d624b16..99e16caa3e 100644 --- a/locale/C-measurement.c +++ b/locale/C-measurement.c @@ -26,7 +26,7 @@ const struct __locale_data _nl_C_LC_MEASUREMENT attribute_hidden = { _nl_C_name, NULL, 0, 0, /* no file mapped */ - { NULL, }, /* no cached data */ + NULL, /* No cached data. */ UNDELETABLE, 0, 2, diff --git a/locale/C-messages.c b/locale/C-messages.c index 88331c7ab6..8fc5c397e3 100644 --- a/locale/C-messages.c +++ b/locale/C-messages.c @@ -26,7 +26,7 @@ const struct __locale_data _nl_C_LC_MESSAGES attribute_hidden = { _nl_C_name, NULL, 0, 0, /* no file mapped */ - { NULL, }, /* no cached data */ + NULL, /* No cached data. */ UNDELETABLE, 0, 5, diff --git a/locale/C-monetary.c b/locale/C-monetary.c index 295f7a93f0..9c752bc1b6 100644 --- a/locale/C-monetary.c +++ b/locale/C-monetary.c @@ -27,7 +27,7 @@ const struct __locale_data _nl_C_LC_MONETARY attribute_hidden = { _nl_C_name, NULL, 0, 0, /* no file mapped */ - { NULL, }, /* no cached data */ + NULL, /* No cached data. */ UNDELETABLE, 0, 46, diff --git a/locale/C-name.c b/locale/C-name.c index c9b03ef176..0c04b447cd 100644 --- a/locale/C-name.c +++ b/locale/C-name.c @@ -26,7 +26,7 @@ const struct __locale_data _nl_C_LC_NAME attribute_hidden = { _nl_C_name, NULL, 0, 0, /* no file mapped */ - { NULL, }, /* no cached data */ + NULL, /* No cached data. */ UNDELETABLE, 0, 7, diff --git a/locale/C-numeric.c b/locale/C-numeric.c index 178f61cd89..6f67deca1f 100644 --- a/locale/C-numeric.c +++ b/locale/C-numeric.c @@ -23,7 +23,7 @@ const struct __locale_data _nl_C_LC_NUMERIC attribute_hidden = { _nl_C_name, NULL, 0, 0, /* no file mapped */ - { NULL, }, /* no cached data */ + NULL, /* No cached data. */ UNDELETABLE, 0, 6, diff --git a/locale/C-paper.c b/locale/C-paper.c index 06822385f6..56b9519801 100644 --- a/locale/C-paper.c +++ b/locale/C-paper.c @@ -26,7 +26,7 @@ const struct __locale_data _nl_C_LC_PAPER attribute_hidden = { _nl_C_name, NULL, 0, 0, /* no file mapped */ - { NULL, }, /* no cached data */ + NULL, /* No cached data. */ UNDELETABLE, 0, 3, diff --git a/locale/C-telephone.c b/locale/C-telephone.c index 7f71f605c5..1e8e8b7a66 100644 --- a/locale/C-telephone.c +++ b/locale/C-telephone.c @@ -26,7 +26,7 @@ const struct __locale_data _nl_C_LC_TELEPHONE attribute_hidden = { _nl_C_name, NULL, 0, 0, /* no file mapped */ - { NULL, }, /* no cached data */ + NULL, /* No cached data. */ UNDELETABLE, 0, 5, diff --git a/locale/C-time.c b/locale/C-time.c index ebd79591e2..78d87046fb 100644 --- a/locale/C-time.c +++ b/locale/C-time.c @@ -26,7 +26,7 @@ const struct __locale_data _nl_C_LC_TIME attribute_hidden = { _nl_C_name, NULL, 0, 0, /* no file mapped */ - { NULL, }, /* no cached data */ + NULL, /* No cached data. */ UNDELETABLE, 0, 159, diff --git a/locale/localeinfo.h b/locale/localeinfo.h index 8ce072b7b4..01ec5535bb 100644 --- a/locale/localeinfo.h +++ b/locale/localeinfo.h @@ -59,13 +59,13 @@ struct __locale_data } alloc; /* This provides a slot for category-specific code to cache data - computed about this locale. This is deallocated at the start of - _nl_unload_locale. */ - union - { - struct lc_time_data *time; - const struct gconv_fcts *ctype; - } private; + computed about this locale. Type of the data pointed to: + + LC_CTYPE struct gconv_fcts (get_gconv_fcts, __wcsmbs_load_conv) + LC_TIME struct lc_time_data (_nl_init_alt_digit, _nl_init_era_entries) + + This data deallocated at the start of _nl_unload_locale. */ + void *private; unsigned int usage_count; /* Counter for users. */ |