This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regen/mk_invlists.pl: Inversion maps don't have to be IV
authorKarl Williamson <khw@cpan.org>
Thu, 29 Mar 2018 00:01:50 +0000 (18:01 -0600)
committerKarl Williamson <khw@cpan.org>
Sat, 31 Mar 2018 21:36:46 +0000 (15:36 -0600)
An inversion map currently is used only for Unicode-range code points,
which can fit in an int, so don't use the space unnecessarily

charclass_invlists.h
embed.fnc
proto.h
regen/mk_invlists.pl
utf8.c

index a6fcee9..93cd6ae 100644 (file)
@@ -3627,7 +3627,7 @@ static const U8 CF_AUX_TABLE_lengths[] = {
        2       /* CF_AUX_TABLE_73 */
 };
 
-static const IV Case_Folding_invmap[] = { /* for ASCII/Latin1 */
+static const int Case_Folding_invmap[] = { /* for ASCII/Latin1 */
        0,
        0x61,
        0,
@@ -6283,7 +6283,7 @@ static const U8 LC_AUX_TABLE_lengths[] = {
        2       /* LC_AUX_TABLE_1 */
 };
 
-static const IV Lowercase_Mapping_invmap[] = { /* for ASCII/Latin1 */
+static const int Lowercase_Mapping_invmap[] = { /* for ASCII/Latin1 */
        0,
        0x61,
        0,
@@ -35963,7 +35963,7 @@ static const UV Simple_Case_Folding_invlist[] = { /* for ASCII/Latin1 */
 
 #if defined(PERL_IN_UTF8_C)
 
-static const IV Simple_Case_Folding_invmap[] = { /* for ASCII/Latin1 */
+static const int Simple_Case_Folding_invmap[] = { /* for ASCII/Latin1 */
        0,
        0x61,
        0,
@@ -38959,7 +38959,7 @@ static const U8 TC_AUX_TABLE_lengths[] = {
        2       /* TC_AUX_TABLE_45 */
 };
 
-static const IV Titlecase_Mapping_invmap[] = { /* for ASCII/Latin1 */
+static const int Titlecase_Mapping_invmap[] = { /* for ASCII/Latin1 */
        0,
        0x41,
        0,
@@ -42270,7 +42270,7 @@ static const U8 UC_AUX_TABLE_lengths[] = {
        2       /* UC_AUX_TABLE_72 */
 };
 
-static const IV Uppercase_Mapping_invmap[] = { /* for ASCII/Latin1 */
+static const int Uppercase_Mapping_invmap[] = { /* for ASCII/Latin1 */
        0,
        0x41,
        0,
@@ -57245,7 +57245,7 @@ static const U8 CF_AUX_TABLE_lengths[] = {
        2       /* CF_AUX_TABLE_73 */
 };
 
-static const IV Case_Folding_invmap[] = { /* for EBCDIC 1047 */
+static const int Case_Folding_invmap[] = { /* for EBCDIC 1047 */
        0,
        CF_use_AUX_TABLE_1,
        0,
@@ -59938,7 +59938,7 @@ static const U8 LC_AUX_TABLE_lengths[] = {
        2       /* LC_AUX_TABLE_1 */
 };
 
-static const IV Lowercase_Mapping_invmap[] = { /* for EBCDIC 1047 */
+static const int Lowercase_Mapping_invmap[] = { /* for EBCDIC 1047 */
        0,
        0x42,
        0,
@@ -89958,7 +89958,7 @@ static const UV Simple_Case_Folding_invlist[] = { /* for EBCDIC 1047 */
 
 #if defined(PERL_IN_UTF8_C)
 
-static const IV Simple_Case_Folding_invmap[] = { /* for EBCDIC 1047 */
+static const int Simple_Case_Folding_invmap[] = { /* for EBCDIC 1047 */
        0,
        0x42,
        0,
@@ -92988,7 +92988,7 @@ static const U8 TC_AUX_TABLE_lengths[] = {
        2       /* TC_AUX_TABLE_45 */
 };
 
-static const IV Titlecase_Mapping_invmap[] = { /* for EBCDIC 1047 */
+static const int Titlecase_Mapping_invmap[] = { /* for EBCDIC 1047 */
        0,
        0x62,
        0,
@@ -96331,7 +96331,7 @@ static const U8 UC_AUX_TABLE_lengths[] = {
        2       /* UC_AUX_TABLE_72 */
 };
 
-static const IV Uppercase_Mapping_invmap[] = { /* for EBCDIC 1047 */
+static const int Uppercase_Mapping_invmap[] = { /* for EBCDIC 1047 */
        0,
        0x62,
        0,
@@ -111480,7 +111480,7 @@ static const U8 CF_AUX_TABLE_lengths[] = {
        2       /* CF_AUX_TABLE_73 */
 };
 
-static const IV Case_Folding_invmap[] = { /* for EBCDIC 037 */
+static const int Case_Folding_invmap[] = { /* for EBCDIC 037 */
        0,
        CF_use_AUX_TABLE_1,
        0,
@@ -114165,7 +114165,7 @@ static const U8 LC_AUX_TABLE_lengths[] = {
        2       /* LC_AUX_TABLE_1 */
 };
 
-static const IV Lowercase_Mapping_invmap[] = { /* for EBCDIC 037 */
+static const int Lowercase_Mapping_invmap[] = { /* for EBCDIC 037 */
        0,
        0x42,
        0,
@@ -144133,7 +144133,7 @@ static const UV Simple_Case_Folding_invlist[] = { /* for EBCDIC 037 */
 
 #if defined(PERL_IN_UTF8_C)
 
-static const IV Simple_Case_Folding_invmap[] = { /* for EBCDIC 037 */
+static const int Simple_Case_Folding_invmap[] = { /* for EBCDIC 037 */
        0,
        0x42,
        0,
@@ -147157,7 +147157,7 @@ static const U8 TC_AUX_TABLE_lengths[] = {
        2       /* TC_AUX_TABLE_45 */
 };
 
-static const IV Titlecase_Mapping_invmap[] = { /* for EBCDIC 037 */
+static const int Titlecase_Mapping_invmap[] = { /* for EBCDIC 037 */
        0,
        0x62,
        0,
@@ -150496,7 +150496,7 @@ static const U8 UC_AUX_TABLE_lengths[] = {
        2       /* UC_AUX_TABLE_72 */
 };
 
-static const IV Uppercase_Mapping_invmap[] = { /* for EBCDIC 037 */
+static const int Uppercase_Mapping_invmap[] = { /* for EBCDIC 037 */
        0,
        0x62,
        0,
@@ -162117,5 +162117,5 @@ static const U8 WB_table[24][24] = {
  * ea4dc61a00d2db9bd46f3ddec706b5b7b11e8fcf848fb384b54b507fb70d8e90 lib/unicore/mktables
  * 21653d2744fdd071f9ef138c805393901bb9547cf3e777ebf50215a191f986ea lib/unicore/version
  * 913d2f93f3cb6cdf1664db888bf840bc4eb074eef824e082fceda24a9445e60c regen/charset_translations.pl
- * 90f9d3726f5dfaa25d13f513332ba162be34f1cef8623322b3de7cb36b0e3dca regen/mk_invlists.pl
+ * 2bb5298fa931bbd4b5b6b37d87c1e19751030a45dede86cebdc395819b6c6ba4 regen/mk_invlists.pl
  * ex: set ro: */
index 580e304..4a9992f 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -1798,7 +1798,7 @@ s |UV     |_to_utf8_case  |const UV uv1                                   \
                                |NN U8* ustrp                                   \
                                |NULLOK STRLEN *lenp                            \
                                |NN SV *invlist                                 \
-                               |NN const IV * const invmap                     \
+                               |NN const int * const invmap                    \
                                |NULLOK const int * const * const aux_tables    \
                                |NULLOK const U8 * const aux_table_lengths      \
                                |NN const char * const normal
diff --git a/proto.h b/proto.h
index ff049bf..82ab3eb 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -5967,7 +5967,7 @@ STATIC bool       S_isa_lookup(pTHX_ HV *stash, const char * const name, STRLEN len, U
        assert(stash); assert(name)
 #endif
 #if defined(PERL_IN_UTF8_C)
-STATIC UV      S__to_utf8_case(pTHX_ const UV uv1, const U8 *p, U8* ustrp, STRLEN *lenp, SV *invlist, const IV * const invmap, const int * const * const aux_tables, const U8 * const aux_table_lengths, const char * const normal);
+STATIC UV      S__to_utf8_case(pTHX_ const UV uv1, const U8 *p, U8* ustrp, STRLEN *lenp, SV *invlist, const int * const invmap, const int * const * const aux_tables, const U8 * const aux_table_lengths, const char * const normal);
 #define PERL_ARGS_ASSERT__TO_UTF8_CASE \
        assert(p); assert(ustrp); assert(invlist); assert(invmap); assert(normal)
 STATIC U32     S_check_and_deprecate(pTHX_ const U8 * p, const U8 ** e, const unsigned type, const bool use_locale, const char * const file, const unsigned line);
index 89546d1..525d44b 100644 (file)
@@ -461,7 +461,7 @@ sub output_invmap ($$$$$$$) {
 
         $invmap_declaration_type = ($input_format =~ /s/)
                                  ? $enum_declaration_type
-                                 : "IV";
+                                 : "int";
         $aux_declaration_type = ($input_format =~ /s/)
                                  ? $enum_declaration_type
                                  : "int";
diff --git a/utf8.c b/utf8.c
index 5e62592..77115f3 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -3470,7 +3470,7 @@ Perl__is_utf8_mark(pTHX_ const U8 *p)
 STATIC UV
 S__to_utf8_case(pTHX_ const UV uv1, const U8 *p,
                       U8* ustrp, STRLEN *lenp,
-                      SV *invlist, const IV * const invmap,
+                      SV *invlist, const int * const invmap,
                       const int * const * aux_tables,
                       const U8 * const aux_table_lengths,
                       const char * const normal)