]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - locale/localename.c
Add fall-through comments.
[thirdparty/glibc.git] / locale / localename.c
index 377ec296a69734b32a6a8c91828b4b4f0c4ac2a1..f6822e323aeb9d683a39cf825716b73acccfdd88 100644 (file)
@@ -1,5 +1,5 @@
 /* current locale setting names
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #include "localeinfo.h"
 
-/* Name of current locale for each individual category.
-   Each is malloc'd unless it is _nl_C_name.  */
-const char *_nl_current_names[] attribute_hidden =
-  {
-#define DEFINE_CATEGORY(category, category_name, items, a) \
-    [category] = _nl_C_name,
-#include "categories.def"
-#undef DEFINE_CATEGORY
-    [LC_ALL] = _nl_C_name              /* For LC_ALL.  */
-  };
-
-const char *
 attribute_hidden
+const char *
 __current_locale_name (int category)
 {
-  return (_NL_CURRENT_LOCALE == &_nl_global_locale
-         ? _nl_current_names[category]
-         : _NL_CURRENT_LOCALE->__locales[category]->name);
+  return _NL_CURRENT_LOCALE->__names[category];
 }