From 050006877a321d712a1a9cfcbfdc4ecd87206be8 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Mon, 31 Oct 2016 15:55:56 +0100 Subject: [PATCH 4/5] Various small style nits and typos --- src/backend/utils/mb/Unicode/UCS_to_SJIS.pl | 1 - src/backend/utils/mb/Unicode/UCS_to_UHC.pl | 7 +++++-- src/backend/utils/mb/Unicode/convutils.pm | 21 ++++++++++----------- src/backend/utils/mb/Unicode/make_mapchecker.pl | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/backend/utils/mb/Unicode/UCS_to_SJIS.pl b/src/backend/utils/mb/Unicode/UCS_to_SJIS.pl index 410fc54..162b97b 100755 --- a/src/backend/utils/mb/Unicode/UCS_to_SJIS.pl +++ b/src/backend/utils/mb/Unicode/UCS_to_SJIS.pl @@ -47,6 +47,5 @@ push @$mapping, ( {direction => "from_unicode", ucs => 0x301c, code => 0x8160, comment => '# WAVE DASH'} ); - print_tables("SJIS", $mapping); print_radix_trees($this_script, "SJIS", $mapping); diff --git a/src/backend/utils/mb/Unicode/UCS_to_UHC.pl b/src/backend/utils/mb/Unicode/UCS_to_UHC.pl index 17f58d3..c852aa2 100755 --- a/src/backend/utils/mb/Unicode/UCS_to_UHC.pl +++ b/src/backend/utils/mb/Unicode/UCS_to_UHC.pl @@ -43,13 +43,16 @@ while (<$in>) ucs => $ucs, code => $code, direction => 'both' - } + }; } } close($in); # One extra character that's not in the source file. -push @mapping, { direction => 'both', code => 0xa2e8, ucs => 0x327e, comment => 'CIRCLED HANGUL IEUNG U' }; +push @mapping, { direction => 'both', + code => 0xa2e8, + ucs => 0x327e, + comment => 'CIRCLED HANGUL IEUNG U' }; print_tables("UHC", \@mapping); print_radix_trees($this_script, "UHC", \@mapping); diff --git a/src/backend/utils/mb/Unicode/convutils.pm b/src/backend/utils/mb/Unicode/convutils.pm index 6668397..3ae7c7b 100644 --- a/src/backend/utils/mb/Unicode/convutils.pm +++ b/src/backend/utils/mb/Unicode/convutils.pm @@ -291,13 +291,13 @@ my $radix_type = "pg_mb_radix_tree"; my $radix_node_type = "pg_mb_radix_index"; ######################################### -# load_chartable() +# load_maptable() # # extract data from map files and returns a character table. # returns a reference to a hash => sub load_maptable { - my($fname) = @_; + my ($fname) = @_; my %c; open(my $in, '<', $fname) || die("cannot open $fname"); @@ -693,7 +693,7 @@ sub make_index_link sub print_radix_table { - my($hd, $table, $tblname, $width) = @_; + my ($hd, $table, $tblname, $width) = @_; return 0 if (! defined $table->{i}); @@ -725,9 +725,9 @@ sub print_radix_table sub print_chars_table { - my($hd, $table, $tblname, $width) = @_; - my($st, $ed) = ($table->{attr}{min}, $table->{attr}{max}); - my($type) = $table->{attr}{is32bit} ? "uint32" : "uint16"; + my ($hd, $table, $tblname, $width) = @_; + my ($st, $ed) = ($table->{attr}{min}, $table->{attr}{max}); + my $type = $table->{attr}{is32bit} ? "uint32" : "uint16"; printf { $$hd } "static const %s %s[] =\n{", $type, $tblname; printf { $$hd } " /* chars content - index range = [%02x, %02x] */", $st, $ed; @@ -764,7 +764,7 @@ sub print_chars_table # write segment content my $first1 = 1; my ($segstart, $segend) = ($s->{lower}, $s->{upper}); - my($xpos, $nocomma) = (0, 0); + my ($xpos, $nocomma) = (0, 0); foreach my $j (($segstart - ($segstart % $colnum)) .. $segend) { @@ -818,8 +818,8 @@ sub print_chars_table sub print_flat_table { - my($hd, $table, $tblname, $width) = @_; - my($st, $ed) = ($table->{attr}{min}, $table->{attr}{max}); + my ($hd, $table, $tblname, $width) = @_; + my ($st, $ed) = ($table->{attr}{min}, $table->{attr}{max}); print { $$hd } "static const $radix_node_type $tblname =\n{"; printf { $$hd } "\n 0x%x, 0x%x, /* table range */\n", $st, $ed; @@ -867,7 +867,7 @@ sub print_flat_table sub print_segmented_table { - my($hd, $table, $tblname, $width) = @_; + my ($hd, $table, $tblname, $width) = @_; my ($st, $ed) = ($table->{attr}{min}, $table->{attr}{max}); # write the variable definition @@ -1015,7 +1015,6 @@ sub make_charmap { $charmap{ucs2utf($src)} = $dst; } - } return \%charmap; diff --git a/src/backend/utils/mb/Unicode/make_mapchecker.pl b/src/backend/utils/mb/Unicode/make_mapchecker.pl index d2ef1d6..620f0fb 100755 --- a/src/backend/utils/mb/Unicode/make_mapchecker.pl +++ b/src/backend/utils/mb/Unicode/make_mapchecker.pl @@ -23,7 +23,7 @@ foreach my $rmap (@radixmaps) # Generate sanity checker source my $out; open($out, '>', "map_checker.h") || - die "cannot open file to write: map_checker.c"; + die "cannot open file to write: map_checker.h"; foreach my $i (sort @radixmaps) { print $out "#include \"$i\"\n"; -- 2.6.4 (Apple Git-63)