Skip to content

Commit

Permalink
locale.c: Rmv no longer used code; UTF8ness cache
Browse files Browse the repository at this point in the history
What these functions do has been subsumed by code introduced in previous
commits, and in a more straight forward manner.

Also removed in this commit is the cache of the knowing what locales are
UTF-8 or not.  This data is now cheaper to calculate when needed, and
there is now a single entry cache, so I don't think the complexity
warrants keeping it.

It could be added back if necessary, split off from the remainder of
this commit.
  • Loading branch information
khwilliamson committed May 6, 2021
1 parent 461921d commit 240a9b7
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 768 deletions.
12 changes: 0 additions & 12 deletions embed.fnc
Expand Up @@ -3226,10 +3226,7 @@ SG |bool |sv_derived_from_svpvn |NULLOK SV *sv \

#if defined(PERL_IN_LOCALE_C)
# ifdef USE_LOCALE
ST |const char*|category_name |const int category
ST |unsigned int|get_category_index|const int category|NULLOK const char * locale
S |const char*|switch_category_locale_to_template|const int switch_category|const int template_category|NULLOK const char * template_locale
S |void |restore_switched_locale|const int category|NULLOK const char * const original_locale
S |unsigned|get_locale_string_utf8ness_i \
|NULLOK const char * locale \
|const unsigned cat_index \
Expand Down Expand Up @@ -3332,15 +3329,6 @@ S |void |print_bytes_for_locale |NN const char * const s \
# endif
#endif

#if defined(USE_LOCALE) \
&& ( defined(PERL_IN_LOCALE_C) \
|| defined(PERL_IN_MG_C) \
|| defined (PERL_EXT_POSIX) \
|| defined (PERL_EXT_LANGINFO))
Cp |bool |_is_cur_LC_category_utf8|int category
#endif


#if defined(PERL_IN_UTIL_C)
S |SV* |mess_alloc
S |SV * |with_queued_errors|NN SV *ex
Expand Down
6 changes: 0 additions & 6 deletions embed.h
Expand Up @@ -902,9 +902,6 @@
#define sv_dup(a,b) Perl_sv_dup(aTHX_ a,b)
#define sv_dup_inc(a,b) Perl_sv_dup_inc(aTHX_ a,b)
#endif
#if defined(USE_LOCALE) && ( defined(PERL_IN_LOCALE_C) || defined(PERL_IN_MG_C) || defined (PERL_EXT_POSIX) || defined (PERL_EXT_LANGINFO))
#define _is_cur_LC_category_utf8(a) Perl__is_cur_LC_category_utf8(aTHX_ a)
#endif
#if defined(USE_LOCALE_COLLATE)
#define sv_collxfrm_flags(a,b,c) Perl_sv_collxfrm_flags(aTHX_ a,b,c)
#endif
Expand Down Expand Up @@ -1726,7 +1723,6 @@
# endif
# if defined(PERL_IN_LOCALE_C)
# if defined(USE_LOCALE)
#define category_name S_category_name
#define get_category_index S_get_category_index
#define get_locale_string_utf8ness_i(a,b,c,d) S_get_locale_string_utf8ness_i(aTHX_ a,b,c,d)
#define is_codeset_name_UTF8 S_is_codeset_name_UTF8
Expand All @@ -1735,13 +1731,11 @@
#define new_collate(a) S_new_collate(aTHX_ a)
#define new_ctype(a) S_new_ctype(aTHX_ a)
#define new_numeric(a) S_new_numeric(aTHX_ a)
#define restore_switched_locale(a,b) S_restore_switched_locale(aTHX_ a,b)
#define restore_toggled_locale_i(a,b) S_restore_toggled_locale_i(aTHX_ a,b)
#define save_to_buffer S_save_to_buffer
#define set_numeric_radix(a) S_set_numeric_radix(aTHX_ a)
#define setlocale_failure_panic_i(a,b,c,d,e) S_setlocale_failure_panic_i(aTHX_ a,b,c,d,e)
#define stdize_locale(a,b,c,d) S_stdize_locale(aTHX_ a,b,c,d)
#define switch_category_locale_to_template(a,b,c) S_switch_category_locale_to_template(aTHX_ a,b,c)
#define toggle_locale_i(a,b) S_toggle_locale_i(aTHX_ a,b)
# if defined(USE_POSIX_2008_LOCALE)
#define emulate_setlocale_i(a,b,c,d) S_emulate_setlocale_i(aTHX_ a,b,c,d)
Expand Down
1 change: 0 additions & 1 deletion embedvar.h
Expand Up @@ -189,7 +189,6 @@
#define PL_laststatval (vTHX->Ilaststatval)
#define PL_laststype (vTHX->Ilaststype)
#define PL_lc_numeric_mutex_depth (vTHX->Ilc_numeric_mutex_depth)
#define PL_locale_utf8ness (vTHX->Ilocale_utf8ness)
#define PL_localizing (vTHX->Ilocalizing)
#define PL_localpatches (vTHX->Ilocalpatches)
#define PL_lockhook (vTHX->Ilockhook)
Expand Down
1 change: 0 additions & 1 deletion intrpvar.h
Expand Up @@ -370,7 +370,6 @@ PERLVAR(I, in_utf8_turkic_locale, bool)
#if defined(USE_ITHREADS) && ! defined(USE_THREAD_SAFE_LOCALE)
PERLVARI(I, lc_numeric_mutex_depth, int, 0) /* Emulate general semaphore */
#endif
PERLVARA(I, locale_utf8ness, 256, char)

#ifdef USE_LOCALE_CTYPE
PERLVAR(I, warn_locale, SV *)
Expand Down

0 comments on commit 240a9b7

Please sign in to comment.