summaryrefslogtreecommitdiff
path: root/regen
diff options
context:
space:
mode:
authorAaron Crane <arc@cpan.org>2016-01-21 14:41:56 +0000
committerAaron Crane <arc@cpan.org>2016-01-21 14:41:56 +0000
commit78e3ac85aa4b4e666e115b0d8e3d9ea9f512fbd4 (patch)
treec04565306fc5f9112be6a7a7b34e78bba94f6b48 /regen
parent2ff6ae51776ea7ad252ee15ca433f0390b3ab50b (diff)
downloadperl-78e3ac85aa4b4e666e115b0d8e3d9ea9f512fbd4.tar.gz
regen/mk_invlists.pl: add braces round subobject initialisers
This suppresses many clang warnings saying "suggest braces around initialization of subobject" when the generated charclass_invlists.h is included.
Diffstat (limited to 'regen')
-rw-r--r--regen/mk_invlists.pl26
1 files changed, 12 insertions, 14 deletions
diff --git a/regen/mk_invlists.pl b/regen/mk_invlists.pl
index 974800cc04..5bcc17728a 100644
--- a/regen/mk_invlists.pl
+++ b/regen/mk_invlists.pl
@@ -544,19 +544,18 @@ sub output_GCB_table() {
$gcb_table[$gcb_enums{'edge'}][$gcb_enums{'edge'}] = 0;
print $out_fh "\nstatic const bool GCB_table[$table_size][$table_size] = {\n";
- print $out_fh "/* ";
+ print $out_fh "/* ";
for my $i (0 .. @gcb_table - 1) {
printf $out_fh "%5s", $gcb_short_enums[$i];
}
- print $out_fh " */\n";
+ print $out_fh "*/\n";
for my $i (0 .. @gcb_table - 1) {
- printf $out_fh "/*%5s */ ", $gcb_short_enums[$i];
- for my $j (0 .. @gcb_table - 1) {
- printf $out_fh "%3d", $gcb_table[$i][$j];
- print $out_fh "," if $i < @gcb_table - 1 || $j < @gcb_table - 1;
- print $out_fh " " if $j < @gcb_table - 1;
- }
+ printf $out_fh "/*%4s*/ ", $gcb_short_enums[$i];
+ print $out_fh "{";
+ print $out_fh join ", ", map sprintf("%3d", $_), @{ $gcb_table[$i] };
+ print $out_fh "}";
+ print $out_fh "," if $i < @gcb_table - 1;
print $out_fh "\n";
}
@@ -1089,7 +1088,7 @@ sub output_LB_table() {
print $out_fh "\nstatic const U8 LB_table[$table_size][$table_size] = {\n";
print $out_fh "\n/* 'ed' stands for 'edge' */\n";
- print $out_fh "/* ";
+ print $out_fh "/* ";
for my $i (0 .. @lb_table - 1) {
print $out_fh " $lb_short_enums[$i]";
}
@@ -1097,11 +1096,10 @@ sub output_LB_table() {
for my $i (0 .. @lb_table - 1) {
print $out_fh "/* $lb_short_enums[$i] */ ";
- for my $j (0 .. @lb_table - 1) {
- printf $out_fh "%2d", $lb_table[$i][$j];
- print $out_fh "," if $i < @lb_table - 1 || $j < @lb_table - 1;
- print $out_fh " " if $j < @lb_table - 1;
- }
+ print $out_fh "{ ";
+ print $out_fh join ", ", map sprintf("%2d", $_), @{ $lb_table[$i] };
+ print $out_fh " }";
+ print $out_fh "," if $i < @lb_table - 1;
print $out_fh "\n";
}