This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
PERL_GLOBAL_STRUCT_PRIVATE: fix some const strings
authorDavid Mitchell <davem@iabyn.com>
Fri, 28 Dec 2018 11:29:27 +0000 (11:29 +0000)
committerDavid Mitchell <davem@iabyn.com>
Tue, 19 Feb 2019 13:28:12 +0000 (13:28 +0000)
change a couple of
    const char * foo[] = { ... }
to
    const char * const foo[] = { ... }

Making the string ptrs const means the whole thing is RO and doesn't
appear in data section, making porting/libperl.t happier when building
under -DPERL_GLOBAL_STRUCT_PRIVATE.

charclass_invlists.h
locale.c
regen/mk_invlists.pl
uni_keywords.h

index e0fc111..00a3407 100644 (file)
@@ -182193,7 +182193,7 @@ static const UV UNI__PERL_PROBLEMATIC_LOCALE_FOLDEDS_START_invlist[] = {  /* for
        0x0,
        0x100,
        0x130,
-       0x132,
+       0x131,
        0x149,
        0x14A,
        0x178,
@@ -182219,14 +182219,14 @@ static const UV UNI__PERL_PROBLEMATIC_LOCALE_FOLDEDS_START_invlist[] = {  /* for
 };
 
 static const UV UNI__PERL_PROBLEMATIC_LOCALE_FOLDS_invlist[] = {  /* for all charsets */
-       26,     /* Number of elements */
+       24,     /* Number of elements */
        148565664, /* Version and data structure type */
        0,      /* 0 if the list starts at 0;
                   1 if it starts at the element beyond 0 */
        0x0,
        0x100,
        0x130,
-       0x132,
+       0x131,
        0x149,
        0x14A,
        0x178,
@@ -182235,8 +182235,6 @@ static const UV UNI__PERL_PROBLEMATIC_LOCALE_FOLDS_invlist[] = {  /* for all cha
        0x180,
        0x1F0,
        0x1F1,
-       0x307,
-       0x308,
        0x39C,
        0x39D,
        0x3BC,
@@ -381512,7 +381510,7 @@ static const UV UNI__PERL_SURROGATE_invlist[] = {  /* for all charsets */
        0xE000
 };
 
-const char * deprecated_property_msgs[] = {
+const char * const deprecated_property_msgs[] = {
        "",
        "Surrogates should never appear in well-formed text, and therefore shouldn't be the basis for line breaking",
        "Supplanted by Line_Break property values; see www.unicode.org/reports/tr14"
@@ -384050,5 +384048,5 @@ static const U8 WB_table[23][23] = {
  * 7bd6bcbe3813e0cd55e0998053d182b7bc8c97dcfd0b85028e9f7f55af4ad61b lib/unicore/version
  * 4bb677187a1a64e39d48f2e341b5ecb6c99857e49d7a79cf503bd8a3c709999b regen/charset_translations.pl
  * 03e51b0f07beebd5da62ab943899aa4934eee1f792fa27c1fb638c33bf4ac6ea regen/mk_PL_charclass.pl
- * 8ae37f2b5bbc7d215f63e8d1189754d83a16c6156fd353847f6fcced90c513d5 regen/mk_invlists.pl
+ * 2fb19108265d37fc38920cd3f775c5c9fc25ae8b95be3bf197f47da1dc4989f4 regen/mk_invlists.pl
  * ex: set ro: */
index a249f80..c8f0196 100644 (file)
--- a/locale.c
+++ b/locale.c
@@ -207,7 +207,7 @@ const int categories[] = {
 
 /* The top-most real element is LC_ALL */
 
-const char * category_names[] = {
+const char * const category_names[] = {
 
 #    ifdef USE_LOCALE_NUMERIC
                                  "LC_NUMERIC",
index 55c4afb..6114828 100644 (file)
@@ -2911,7 +2911,7 @@ foreach my $prop (@props) {
 
 switch_pound_if ('binary_property_tables', 'PERL_IN_REGCOMP_C');
 
-print $out_fh "\nconst char * deprecated_property_msgs[] = {\n\t";
+print $out_fh "\nconst char * const deprecated_property_msgs[] = {\n\t";
 print $out_fh join ",\n\t", map { "\"$_\"" } @deprecated_messages;
 print $out_fh "\n};\n";
 
index 9f9243f..2808b27 100644 (file)
@@ -6996,6 +6996,6 @@ MPH_VALt match_uniprop( const unsigned char * const key, const U16 key_len ) {
  * 7bd6bcbe3813e0cd55e0998053d182b7bc8c97dcfd0b85028e9f7f55af4ad61b lib/unicore/version
  * 4bb677187a1a64e39d48f2e341b5ecb6c99857e49d7a79cf503bd8a3c709999b regen/charset_translations.pl
  * 03e51b0f07beebd5da62ab943899aa4934eee1f792fa27c1fb638c33bf4ac6ea regen/mk_PL_charclass.pl
- * 8ae37f2b5bbc7d215f63e8d1189754d83a16c6156fd353847f6fcced90c513d5 regen/mk_invlists.pl
+ * 2fb19108265d37fc38920cd3f775c5c9fc25ae8b95be3bf197f47da1dc4989f4 regen/mk_invlists.pl
  * c56b78df81e0f96632246052d71580b212546ca02ba4075158965e11d892f21e regen/mph.pl
  * ex: set ro: */