Small fixes to the Perl scripts to create unicode conversion tables.
authorHeikki Linnakangas
Wed, 1 Feb 2017 09:23:53 +0000 (11:23 +0200)
committerHeikki Linnakangas
Wed, 1 Feb 2017 09:23:53 +0000 (11:23 +0200)
Add missing semicolons in UCS_to_* perl scripts.
For consistency, use "$hashref->{key}" style everywhere.

Kyotaro Horiguchi

Discussion: https://www.postgresql.org/message-id/20170130.153738.139030994[email protected]

src/backend/utils/mb/Unicode/UCS_to_EUC_CN.pl
src/backend/utils/mb/Unicode/UCS_to_EUC_JP.pl
src/backend/utils/mb/Unicode/UCS_to_EUC_TW.pl
src/backend/utils/mb/Unicode/UCS_to_GB18030.pl
src/backend/utils/mb/Unicode/UCS_to_UHC.pl
src/backend/utils/mb/Unicode/convutils.pm

index 7566104f337206f65d288af8d270f9cd2f25e740..4f4375eb8f1fac24bc5532e1b01d8e6a4d19a90f 100755 (executable)
@@ -69,7 +69,7 @@ while (<$in>)
        ucs => $ucs,
        code => $code,
        direction => 'both'
-   }
+   };
 }
 close($in);
 
index b70f7144c7648577332ae3eb541839a42515bcda..926d2d8b30d5f8dc828a32c2fcea0ae1b30dccf2 100755 (executable)
@@ -218,7 +218,7 @@ sub sjis2jis
        $pos = $pos - ((31 * 0x5e) + 12);
 
        # after 85-ku 82-ten needs to be moved 2 codepoints
-       $pos = $pos - 2 if ($pos >= 84 * 0x5c + 82)
+       $pos = $pos - 2 if ($pos >= 84 * 0x5c + 82);
    }
 
    my $hi2 = $pos / 0x5e;
index 91699f6d20e794782ce4706822b543d6533bf0fe..296ed2bc1ecab302967ecd46e59276caeb82a59a 100755 (executable)
@@ -55,7 +55,7 @@ foreach my $i (@$mapping)
            code => ($i->{code} + 0x8ea10000),
            rest => $i->{rest},
            direction => 'to_unicode'
-       }
+       };
    }
 }
 
index 701c35cfa7200a2ef47c15cad51a7794ea872033..f754611ce80663a692d7f95e29ad2bf4806e8a9e 100755 (executable)
@@ -37,7 +37,7 @@ while (<$in>)
            ucs => $ucs,
            code => $code,
            direction => 'both'
-       }
+       };
    }
 }
 close($in);
index 45c6db538ce89f1b8ff6dd4950b0a1f6e9ffb9cd..a65c537820f9edd1418e29a6f842da8655ac94b2 100755 (executable)
@@ -40,7 +40,7 @@ while (<$in>)
            ucs => $ucs,
            code => $code,
            direction => 'both'
-       }
+       };
    }
 }
 close($in);
index 7adcee4857010cde8d0a82939d226b31b74189f9..0ae79a2f33170ed12d7acd4fb67c37c6d1dcfffa 100644 (file)
@@ -168,20 +168,20 @@ sub print_from_utf8_map
           "static const pg_utf_to_local ULmap${charset}[ %d ] = {",
           scalar(@$table));
    my $first = 1;
-   foreach my $i (sort {$$a{utf8} <=> $$b{utf8}} @$table)
+   foreach my $i (sort {$a->{utf8} <=> $b->{utf8}} @$table)
     {
        print($out ",") if (!$first);
        $first = 0;
        print($out "\t/* $last_comment */") if ($verbose);
 
-       printf($out "\n  {0x%04x, 0x%04x}", $$i{utf8}, $$i{code});
+       printf($out "\n  {0x%04x, 0x%04x}", $i->{utf8}, $i->{code});
        if ($verbose >= 2)
        {
-           $last_comment = "$$i{f}:$$i{l} $$i{comment}";
+           $last_comment = "$i->{f}:$i->{l} $i->{comment}";
        }
        else
        {
-           $last_comment = $$i{comment};
+           $last_comment = $i->{comment};
        }
    }
    print($out "\t/* $last_comment */") if ($verbose);
@@ -202,14 +202,14 @@ sub print_from_utf8_combined_map
           "static const pg_utf_to_local_combined ULmap${charset}_combined[ %d ] = {",
           scalar(@$table));
    my $first = 1;
-   foreach my $i (sort {$$a{utf8} <=> $$b{utf8}} @$table)
+   foreach my $i (sort {$a->{utf8} <=> $b->{utf8}} @$table)
     {
        print($out ",") if (!$first);
        $first = 0;
        print($out "\t/* $last_comment */") if ($verbose);
 
-       printf($out "\n  {0x%08x, 0x%08x, 0x%04x}", $$i{utf8}, $$i{utf8_second}, $$i{code});
-       $last_comment = "$$i{comment}";
+       printf($out "\n  {0x%08x, 0x%08x, 0x%04x}", $i->{utf8}, $i->{utf8_second}, $i->{code});
+       $last_comment = "$i->{comment}";
    }
    print($out "\t/* $last_comment */") if ($verbose);
    print $out "\n};\n";
@@ -230,20 +230,20 @@ sub print_to_utf8_map
           "static const pg_local_to_utf LUmap${charset}[ %d ] = {",
           scalar(@$table));
    my $first = 1;
-   foreach my $i (sort {$$a{code} <=> $$b{code}} @$table)
+   foreach my $i (sort {$a->{code} <=> $b->{code}} @$table)
     {
        print($out ",") if (!$first);
        $first = 0;
        print($out "\t/* $last_comment */") if ($verbose);
 
-       printf($out "\n  {0x%04x, 0x%x}", $$i{code}, $$i{utf8});
+       printf($out "\n  {0x%04x, 0x%x}", $i->{code}, $i->{utf8});
        if ($verbose >= 2)
        {
-           $last_comment = "$$i{f}:$$i{l} $$i{comment}";
+           $last_comment = "$i->{f}:$i->{l} $i->{comment}";
        }
        else
        {
-           $last_comment = $$i{comment};
+           $last_comment = $i->{comment};
        }
    }
    print($out "\t/* $last_comment */") if ($verbose);
@@ -265,14 +265,14 @@ sub print_to_utf8_combined_map
           "static const pg_local_to_utf_combined LUmap${charset}_combined[ %d ] = {",
           scalar(@$table));
    my $first = 1;
-   foreach my $i (sort {$$a{code} <=> $$b{code}} @$table)
+   foreach my $i (sort {$a->{code} <=> $b->{code}} @$table)
     {
        print($out ",") if (!$first);
        $first = 0;
        print($out "\t/* $last_comment */") if ($verbose);
 
-       printf($out "\n  {0x%04x, 0x%08x, 0x%08x}", $$i{code}, $$i{utf8}, $$i{utf8_second});
-       $last_comment = "$$i{comment}";
+       printf($out "\n  {0x%04x, 0x%08x, 0x%08x}", $i->{code}, $i->{utf8}, $i->{utf8_second});
+       $last_comment = "$i->{comment}";
    }
    print($out "\t/* $last_comment */") if ($verbose);
    print $out "\n};\n";