1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-04 12:02:48 +03:00

Run newly-configured perltidy script on Perl files.

Run on HEAD and 9.2.
This commit is contained in:
Bruce Momjian
2012-07-04 21:47:49 -04:00
parent d7c734841b
commit 042d9ffc28
53 changed files with 3253 additions and 2593 deletions

View File

@@ -22,60 +22,68 @@ require "ucs2utf.pl";
# first generate UTF-8 --> SJIS table
$in_file = "CP932.TXT";
$count = 0;
$count = 0;
open( FILE, $in_file ) || die( "cannot open $in_file" );
open(FILE, $in_file) || die("cannot open $in_file");
while( <FILE> ){
chop;
if( /^#/ ){
next;
}
( $c, $u, $rest ) = split;
$ucs = hex($u);
$code = hex($c);
if( $code >= 0x80 && $ucs >= 0x0080 ){
$utf = &ucs2utf($ucs);
if((( $code >= 0xed40 )
&& ( $code <= 0xeefc ))
|| (( $code >= 0x8754 )
&&( $code <= 0x875d ))
|| ( $code == 0x878a )
|| ( $code == 0x8782 )
|| ( $code == 0x8784 )
|| ( $code == 0xfa5b )
|| ( $code == 0xfa54 )
|| (( $code >= 0x8790 )
&& ( $code <= 0x8792 ))
|| (( $code >= 0x8795 )
&& ( $code <= 0x8797 ))
|| (( $code >= 0x879a )
&& ( $code <= 0x879c )))
{
printf STDERR "Warning: duplicate UTF8 : UCS=0x%04x SJIS=0x%04x\n",$ucs,$code;
next;
}
$count++;
$array{ $utf } = $code;
}
while (<FILE>)
{
chop;
if (/^#/)
{
next;
}
($c, $u, $rest) = split;
$ucs = hex($u);
$code = hex($c);
if ($code >= 0x80 && $ucs >= 0x0080)
{
$utf = &ucs2utf($ucs);
if ((($code >= 0xed40) && ($code <= 0xeefc))
|| ( ($code >= 0x8754)
&& ($code <= 0x875d))
|| ($code == 0x878a)
|| ($code == 0x8782)
|| ($code == 0x8784)
|| ($code == 0xfa5b)
|| ($code == 0xfa54)
|| ( ($code >= 0x8790)
&& ($code <= 0x8792))
|| ( ($code >= 0x8795)
&& ($code <= 0x8797))
|| ( ($code >= 0x879a)
&& ($code <= 0x879c)))
{
printf STDERR
"Warning: duplicate UTF8 : UCS=0x%04x SJIS=0x%04x\n", $ucs,
$code;
next;
}
$count++;
$array{$utf} = $code;
}
}
close( FILE );
close(FILE);
#
# first, generate UTF8 --> SJIS table
#
$file = "utf8_to_sjis.map";
open( FILE, "> $file" ) || die( "cannot open $file" );
open(FILE, "> $file") || die("cannot open $file");
print FILE "static pg_utf_to_local ULmapSJIS[ $count ] = {\n";
for $index ( sort {$a <=> $b} keys( %array ) ){
$code = $array{ $index };
for $index (sort { $a <=> $b } keys(%array))
{
$code = $array{$index};
$count--;
if( $count == 0 ){
if ($count == 0)
{
printf FILE " {0x%04x, 0x%04x}\n", $index, $code;
} else {
}
else
{
printf FILE " {0x%04x, 0x%04x},\n", $index, $code;
}
}
@@ -87,37 +95,44 @@ close(FILE);
# then generate SJIS --> UTF8 table
#
open( FILE, $in_file ) || die( "cannot open $in_file" );
open(FILE, $in_file) || die("cannot open $in_file");
reset 'array';
$count = 0;
while( <FILE> ){
while (<FILE>)
{
chop;
if( /^#/ ){
if (/^#/)
{
next;
}
( $c, $u, $rest ) = split;
$ucs = hex($u);
($c, $u, $rest) = split;
$ucs = hex($u);
$code = hex($c);
if( $code >= 0x80 && $ucs >= 0x0080 ){
if ($code >= 0x80 && $ucs >= 0x0080)
{
$utf = &ucs2utf($ucs);
$count++;
$array{ $code } = $utf;
$array{$code} = $utf;
}
}
close( FILE );
close(FILE);
$file = "sjis_to_utf8.map";
open( FILE, "> $file" ) || die( "cannot open $file" );
open(FILE, "> $file") || die("cannot open $file");
print FILE "static pg_local_to_utf LUmapSJIS[ $count ] = {\n";
for $index ( sort {$a <=> $b} keys( %array ) ){
$utf = $array{ $index };
for $index (sort { $a <=> $b } keys(%array))
{
$utf = $array{$index};
$count--;
if( $count == 0 ){
if ($count == 0)
{
printf FILE " {0x%04x, 0x%04x}\n", $index, $utf;
} else {
}
else
{
printf FILE " {0x%04x, 0x%04x},\n", $index, $utf;
}
}