v8-0004-apply-pgperltidy.patch
text/x-diff
Filename: v8-0004-apply-pgperltidy.patch
Type: text/x-diff
Part: 3
Patch
Format: unified
Series: patch v8-0004
| File | + | − |
|---|---|---|
| src/backend/nodes/gen_node_support.pl | 179 | 123 |
| src/tools/msvc/Solution.pm | 25 | 23 |
diff --git a/src/backend/nodes/gen_node_support.pl b/src/backend/nodes/gen_node_support.pl
index f6625a763e..dca5819f95 100644
--- a/src/backend/nodes/gen_node_support.pl
+++ b/src/backend/nodes/gen_node_support.pl
@@ -23,7 +23,7 @@ use File::Basename;
use FindBin;
use lib "$FindBin::RealBin/../catalog";
-use Catalog; # for RenameTempFile
+use Catalog; # for RenameTempFile
# Test whether first argument is element of the list in the second
@@ -51,8 +51,8 @@ my @no_read_write;
# types that are copied by straight assignment
my @scalar_types = qw(
- bits32 bool char double int int8 int16 int32 int64 long uint8 uint16 uint32 uint64
- AclMode AttrNumber Cardinality Cost Index Oid RelFileNumber Selectivity Size StrategyNumber SubTransactionId TimeLineID XLogRecPtr
+ bits32 bool char double int int8 int16 int32 int64 long uint8 uint16 uint32 uint64
+ AclMode AttrNumber Cardinality Cost Index Oid RelFileNumber Selectivity Size StrategyNumber SubTransactionId TimeLineID XLogRecPtr
);
# collect enum types
@@ -65,18 +65,18 @@ my @abstract_types = qw(Node);
# is not in a header file. We generate node tags for them, but
# they otherwise don't participate in node support.
my @extra_tags = qw(
- IntList OidList XidList
- AllocSetContext GenerationContext SlabContext
- TIDBitmap
- WindowObjectData
+ IntList OidList XidList
+ AllocSetContext GenerationContext SlabContext
+ TIDBitmap
+ WindowObjectData
);
# This is a regular node, but we skip parsing it from its header file
# since we won't use its internal structure here anyway.
push @node_types, qw(List);
# Lists are specially treated in all four support files, too.
-push @no_copy, qw(List);
-push @no_equal, qw(List);
+push @no_copy, qw(List);
+push @no_equal, qw(List);
push @no_read_write, qw(List);
# Nodes with custom copy/equal implementations are skipped from
@@ -95,21 +95,22 @@ push @scalar_types, qw(QualCost);
# XXX various things we are not publishing right now to stay level
# with the manual system
-push @no_copy, qw(CallContext InlineCodeBlock);
+push @no_copy, qw(CallContext InlineCodeBlock);
push @no_equal, qw(CallContext InlineCodeBlock);
-push @no_read_write, qw(AccessPriv AlterTableCmd CallContext CreateOpClassItem FunctionParameter InferClause InlineCodeBlock ObjectWithArgs OnConflictClause PartitionCmd RoleSpec VacuumRelation);
+push @no_read_write,
+ qw(AccessPriv AlterTableCmd CallContext CreateOpClassItem FunctionParameter InferClause InlineCodeBlock ObjectWithArgs OnConflictClause PartitionCmd RoleSpec VacuumRelation);
push @no_read, qw(A_ArrayExpr A_Indices A_Indirection AlterStatsStmt
-CollateClause ColumnDef ColumnRef CreateForeignTableStmt CreateStatsStmt
-CreateStmt FuncCall ImportForeignSchemaStmt IndexElem IndexStmt
-JsonAggConstructor JsonArgument JsonArrayAgg JsonArrayConstructor
-JsonArrayQueryConstructor JsonCommon JsonFuncExpr JsonKeyValue
-JsonObjectAgg JsonObjectConstructor JsonOutput JsonParseExpr JsonScalarExpr
-JsonSerializeExpr JsonTable JsonTableColumn JsonTablePlan LockingClause
-MultiAssignRef PLAssignStmt ParamRef PartitionElem PartitionSpec
-PlaceHolderVar PublicationObjSpec PublicationTable RangeFunction
-RangeSubselect RangeTableFunc RangeTableFuncCol RangeTableSample RawStmt
-ResTarget ReturnStmt SelectStmt SortBy StatsElem TableLikeClause
-TriggerTransition TypeCast TypeName WindowDef WithClause XmlSerialize);
+ CollateClause ColumnDef ColumnRef CreateForeignTableStmt CreateStatsStmt
+ CreateStmt FuncCall ImportForeignSchemaStmt IndexElem IndexStmt
+ JsonAggConstructor JsonArgument JsonArrayAgg JsonArrayConstructor
+ JsonArrayQueryConstructor JsonCommon JsonFuncExpr JsonKeyValue
+ JsonObjectAgg JsonObjectConstructor JsonOutput JsonParseExpr JsonScalarExpr
+ JsonSerializeExpr JsonTable JsonTableColumn JsonTablePlan LockingClause
+ MultiAssignRef PLAssignStmt ParamRef PartitionElem PartitionSpec
+ PlaceHolderVar PublicationObjSpec PublicationTable RangeFunction
+ RangeSubselect RangeTableFunc RangeTableFuncCol RangeTableSample RawStmt
+ ResTarget ReturnStmt SelectStmt SortBy StatsElem TableLikeClause
+ TriggerTransition TypeCast TypeName WindowDef WithClause XmlSerialize);
## read input
@@ -150,13 +151,13 @@ foreach my $infile (@ARGV)
if ($subline == 1)
{
$is_node_struct = 0;
- $supertype = undef;
+ $supertype = undef;
next if $line eq '{';
die "$infile:$.: expected opening brace\n";
}
# second line could be node attributes
- elsif ($subline == 2 &&
- $line =~ /^\s*pg_node_attr\(([\w(), ]*)\)$/)
+ elsif ($subline == 2
+ && $line =~ /^\s*pg_node_attr\(([\w(), ]*)\)$/)
{
$node_attrs = $1;
# hack: don't count the line
@@ -173,8 +174,8 @@ foreach my $infile (@ARGV)
}
elsif ($line =~ /\s*(\w+)\s+(\w+);/ and elem $1, @node_types)
{
- $is_node_struct = 1;
- $supertype = $1;
+ $is_node_struct = 1;
+ $supertype = $1;
$supertype_field = $2;
next;
}
@@ -212,7 +213,7 @@ foreach my $infile (@ARGV)
}
elsif ($attr eq 'no_copy_equal')
{
- push @no_copy, $in_struct;
+ push @no_copy, $in_struct;
push @no_equal, $in_struct;
}
elsif ($attr eq 'no_read')
@@ -234,7 +235,8 @@ foreach my $infile (@ARGV)
}
else
{
- die "$infile:$.: unrecognized attribute \"$attr\"\n";
+ die
+ "$infile:$.: unrecognized attribute \"$attr\"\n";
}
}
@@ -242,7 +244,7 @@ foreach my $infile (@ARGV)
push @node_types, $in_struct;
# field names, types, attributes
- my @f = @my_fields;
+ my @f = @my_fields;
my %ft = %my_field_types;
my %fa = %my_field_attrs;
@@ -250,18 +252,23 @@ foreach my $infile (@ARGV)
if ($supertype)
{
my @superfields;
- foreach my $sf (@{$node_type_info{$supertype}->{fields}})
+ foreach
+ my $sf (@{ $node_type_info{$supertype}->{fields} })
{
my $fn = "${supertype_field}.$sf";
push @superfields, $fn;
- $ft{$fn} = $node_type_info{$supertype}->{field_types}{$sf};
- if ($node_type_info{$supertype}->{field_attrs}{$sf})
+ $ft{$fn} =
+ $node_type_info{$supertype}->{field_types}{$sf};
+ if ($node_type_info{$supertype}
+ ->{field_attrs}{$sf})
{
# Copy any attributes, adjusting array_size field references
- my @newa = @{$node_type_info{$supertype}->{field_attrs}{$sf}};
+ my @newa = @{ $node_type_info{$supertype}
+ ->{field_attrs}{$sf} };
foreach my $a (@newa)
{
- $a =~ s/array_size\((\w+)\)/array_size(${supertype_field}.$1)/;
+ $a =~
+ s/array_size\((\w+)\)/array_size(${supertype_field}.$1)/;
}
$fa{$fn} = \@newa;
}
@@ -269,7 +276,7 @@ foreach my $infile (@ARGV)
unshift @f, @superfields;
}
# save in global info structure
- $node_type_info{$in_struct}->{fields} = \@f;
+ $node_type_info{$in_struct}->{fields} = \@f;
$node_type_info{$in_struct}->{field_types} = \%ft;
$node_type_info{$in_struct}->{field_attrs} = \%fa;
@@ -277,38 +284,44 @@ foreach my $infile (@ARGV)
# just node tags.
if (elem basename($infile),
qw(execnodes.h trigger.h event_trigger.h amapi.h tableam.h
- tsmapi.h fdwapi.h tuptable.h replnodes.h supportnodes.h))
+ tsmapi.h fdwapi.h tuptable.h replnodes.h supportnodes.h)
+ )
{
- push @no_copy, $in_struct;
- push @no_equal, $in_struct;
+ push @no_copy, $in_struct;
+ push @no_equal, $in_struct;
push @no_read_write, $in_struct;
}
# Propagate some node attributes from supertypes
if ($supertype)
{
- push @no_copy, $in_struct if elem $supertype, @no_copy;
- push @no_equal, $in_struct if elem $supertype, @no_equal;
- push @no_read, $in_struct if elem $supertype, @no_read;
+ push @no_copy, $in_struct
+ if elem $supertype, @no_copy;
+ push @no_equal, $in_struct
+ if elem $supertype, @no_equal;
+ push @no_read, $in_struct
+ if elem $supertype, @no_read;
}
}
# start new cycle
- $in_struct = undef;
- $node_attrs = '';
- @my_fields = ();
+ $in_struct = undef;
+ $node_attrs = '';
+ @my_fields = ();
%my_field_types = ();
%my_field_attrs = ();
}
# normal struct field
- elsif ($line =~ /^\s*(.+)\s*\b(\w+)(\[\w+\])?\s*(?:pg_node_attr\(([\w(), ]*)\))?;/)
+ elsif ($line =~
+ /^\s*(.+)\s*\b(\w+)(\[\w+\])?\s*(?:pg_node_attr\(([\w(), ]*)\))?;/
+ )
{
if ($is_node_struct)
{
- my $type = $1;
- my $name = $2;
+ my $type = $1;
+ my $name = $2;
my $array_size = $3;
- my $attrs = $4;
+ my $attrs = $4;
# strip "const"
$type =~ s/^const\s*//;
@@ -325,13 +338,16 @@ foreach my $infile (@ARGV)
@attrs = split /,\s*/, $attrs;
foreach my $attr (@attrs)
{
- if ($attr !~ /^array_size\(\w+\)$/ &&
- $attr !~ /^copy_as\(\w+\)$/ &&
- $attr !~ /^read_as\(\w+\)$/ &&
- !elem $attr, qw(equal_ignore equal_ignore_if_zero read_write_ignore
- write_only_relids write_only_nondefault_pathtarget write_only_req_outer))
+ if ( $attr !~ /^array_size\(\w+\)$/
+ && $attr !~ /^copy_as\(\w+\)$/
+ && $attr !~ /^read_as\(\w+\)$/
+ && !elem $attr,
+ qw(equal_ignore equal_ignore_if_zero read_write_ignore
+ write_only_relids write_only_nondefault_pathtarget write_only_req_outer)
+ )
{
- die "$infile:$.: unrecognized attribute \"$attr\"\n";
+ die
+ "$infile:$.: unrecognized attribute \"$attr\"\n";
}
}
}
@@ -357,20 +373,20 @@ foreach my $infile (@ARGV)
if ($line =~ /^(?:typedef )?struct (\w+)$/ && $1 ne 'Node')
{
$in_struct = $1;
- $subline = 0;
+ $subline = 0;
}
# one node type typedef'ed directly from another
elsif ($line =~ /^typedef (\w+) (\w+);$/ and elem $1, @node_types)
{
my $alias_of = $1;
- my $n = $2;
+ my $n = $2;
# copy everything over
push @node_types, $n;
- my @f = @{$node_type_info{$alias_of}->{fields}};
- my %ft = %{$node_type_info{$alias_of}->{field_types}};
- my %fa = %{$node_type_info{$alias_of}->{field_attrs}};
- $node_type_info{$n}->{fields} = \@f;
+ my @f = @{ $node_type_info{$alias_of}->{fields} };
+ my %ft = %{ $node_type_info{$alias_of}->{field_types} };
+ my %fa = %{ $node_type_info{$alias_of}->{field_attrs} };
+ $node_type_info{$n}->{fields} = \@f;
$node_type_info{$n}->{field_types} = \%ft;
$node_type_info{$n}->{field_attrs} = \%fa;
}
@@ -388,19 +404,19 @@ foreach my $infile (@ARGV)
}
close $ifh;
-} # for each file
+} # for each file
## write output
-my $tmpext = ".tmp$$";
+my $tmpext = ".tmp$$";
# nodetags.h
open my $nt, '>', 'nodetags.h' . $tmpext or die $!;
my $i = 1;
-foreach my $n (@node_types,@extra_tags)
+foreach my $n (@node_types, @extra_tags)
{
next if elem $n, @abstract_types;
print $nt "\tT_${n} = $i,\n";
@@ -421,9 +437,9 @@ foreach my $infile (sort @ARGV)
# copyfuncs.c, equalfuncs.c
-open my $cff, '>', 'copyfuncs.funcs.c' . $tmpext or die $!;
-open my $eff, '>', 'equalfuncs.funcs.c' . $tmpext or die $!;
-open my $cfs, '>', 'copyfuncs.switch.c' . $tmpext or die $!;
+open my $cff, '>', 'copyfuncs.funcs.c' . $tmpext or die $!;
+open my $eff, '>', 'equalfuncs.funcs.c' . $tmpext or die $!;
+open my $cfs, '>', 'copyfuncs.switch.c' . $tmpext or die $!;
open my $efs, '>', 'equalfuncs.switch.c' . $tmpext or die $!;
# add required #include lines to each file set
@@ -433,17 +449,19 @@ print $eff $node_includes;
foreach my $n (@node_types)
{
next if elem $n, @abstract_types;
- my $struct_no_copy = (elem $n, @no_copy);
+ my $struct_no_copy = (elem $n, @no_copy);
my $struct_no_equal = (elem $n, @no_equal);
next if $struct_no_copy && $struct_no_equal;
- print $cfs "\t\tcase T_${n}:\n".
- "\t\t\tretval = _copy${n}(from);\n".
- "\t\t\tbreak;\n" unless $struct_no_copy;
+ print $cfs "\t\tcase T_${n}:\n"
+ . "\t\t\tretval = _copy${n}(from);\n"
+ . "\t\t\tbreak;\n"
+ unless $struct_no_copy;
- print $efs "\t\tcase T_${n}:\n".
- "\t\t\tretval = _equal${n}(a, b);\n".
- "\t\t\tbreak;\n" unless $struct_no_equal;
+ print $efs "\t\tcase T_${n}:\n"
+ . "\t\t\tretval = _equal${n}(a, b);\n"
+ . "\t\t\tbreak;\n"
+ unless $struct_no_equal;
next if elem $n, @custom_copy_equal;
@@ -462,11 +480,11 @@ _equal${n}(const $n *a, const $n *b)
" unless $struct_no_equal;
# print instructions for each field
- foreach my $f (@{$node_type_info{$n}->{fields}})
+ foreach my $f (@{ $node_type_info{$n}->{fields} })
{
- my $t = $node_type_info{$n}->{field_types}{$f};
- my @a = @{ $node_type_info{$n}->{field_attrs}{$f} };
- my $copy_ignore = $struct_no_copy;
+ my $t = $node_type_info{$n}->{field_types}{$f};
+ my @a = @{ $node_type_info{$n}->{field_attrs}{$f} };
+ my $copy_ignore = $struct_no_copy;
my $equal_ignore = $struct_no_equal;
# extract per-field attributes
@@ -491,24 +509,26 @@ _equal${n}(const $n *a, const $n *b)
# override type-specific copy method if copy_as is specified
if (defined $copy_as_field)
{
- print $cff "\tnewnode->$f = $copy_as_field;\n" unless $copy_ignore;
+ print $cff "\tnewnode->$f = $copy_as_field;\n"
+ unless $copy_ignore;
$copy_ignore = 1;
}
# select instructions by field type
if ($t eq 'char*')
{
- print $cff "\tCOPY_STRING_FIELD($f);\n" unless $copy_ignore;
+ print $cff "\tCOPY_STRING_FIELD($f);\n" unless $copy_ignore;
print $eff "\tCOMPARE_STRING_FIELD($f);\n" unless $equal_ignore;
}
elsif ($t eq 'Bitmapset*' || $t eq 'Relids')
{
print $cff "\tCOPY_BITMAPSET_FIELD($f);\n" unless $copy_ignore;
- print $eff "\tCOMPARE_BITMAPSET_FIELD($f);\n" unless $equal_ignore;
+ print $eff "\tCOMPARE_BITMAPSET_FIELD($f);\n"
+ unless $equal_ignore;
}
elsif ($t eq 'int' && $f =~ 'location$')
{
- print $cff "\tCOPY_LOCATION_FIELD($f);\n" unless $copy_ignore;
+ print $cff "\tCOPY_LOCATION_FIELD($f);\n" unless $copy_ignore;
print $eff "\tCOMPARE_LOCATION_FIELD($f);\n" unless $equal_ignore;
}
elsif (elem $t, @scalar_types or elem $t, @enum_types)
@@ -516,12 +536,14 @@ _equal${n}(const $n *a, const $n *b)
print $cff "\tCOPY_SCALAR_FIELD($f);\n" unless $copy_ignore;
if (elem 'equal_ignore_if_zero', @a)
{
- print $eff "\tif (a->$f != b->$f && a->$f != 0 && b->$f != 0)\n\t\treturn false;\n";
+ print $eff
+ "\tif (a->$f != b->$f && a->$f != 0 && b->$f != 0)\n\t\treturn false;\n";
}
else
{
# All CoercionForm fields are treated as equal_ignore
- print $eff "\tCOMPARE_SCALAR_FIELD($f);\n" unless $equal_ignore || $t eq 'CoercionForm';
+ print $eff "\tCOMPARE_SCALAR_FIELD($f);\n"
+ unless $equal_ignore || $t eq 'CoercionForm';
}
}
# scalar type pointer
@@ -532,35 +554,45 @@ _equal${n}(const $n *a, const $n *b)
{
die "no array size defined for $n.$f of type $t";
}
- if ($node_type_info{$n}->{field_types}{$array_size_field} eq 'List*')
+ if ($node_type_info{$n}->{field_types}{$array_size_field} eq
+ 'List*')
{
- print $cff "\tCOPY_POINTER_FIELD($f, list_length(from->$array_size_field) * sizeof($tt));\n" unless $copy_ignore;
- print $eff "\tCOMPARE_POINTER_FIELD($f, list_length(a->$array_size_field) * sizeof($tt));\n" unless $equal_ignore;
+ print $cff
+ "\tCOPY_POINTER_FIELD($f, list_length(from->$array_size_field) * sizeof($tt));\n"
+ unless $copy_ignore;
+ print $eff
+ "\tCOMPARE_POINTER_FIELD($f, list_length(a->$array_size_field) * sizeof($tt));\n"
+ unless $equal_ignore;
}
else
{
- print $cff "\tCOPY_POINTER_FIELD($f, from->$array_size_field * sizeof($tt));\n" unless $copy_ignore;
- print $eff "\tCOMPARE_POINTER_FIELD($f, a->$array_size_field * sizeof($tt));\n" unless $equal_ignore;
+ print $cff
+ "\tCOPY_POINTER_FIELD($f, from->$array_size_field * sizeof($tt));\n"
+ unless $copy_ignore;
+ print $eff
+ "\tCOMPARE_POINTER_FIELD($f, a->$array_size_field * sizeof($tt));\n"
+ unless $equal_ignore;
}
}
# node type
elsif ($t =~ /(\w+)\*/ and elem $1, @node_types)
{
- print $cff "\tCOPY_NODE_FIELD($f);\n" unless $copy_ignore;
+ print $cff "\tCOPY_NODE_FIELD($f);\n" unless $copy_ignore;
print $eff "\tCOMPARE_NODE_FIELD($f);\n" unless $equal_ignore;
}
# array (inline)
elsif ($t =~ /\w+\[/)
{
- print $cff "\tCOPY_ARRAY_FIELD($f);\n" unless $copy_ignore;
+ print $cff "\tCOPY_ARRAY_FIELD($f);\n" unless $copy_ignore;
print $eff "\tCOMPARE_ARRAY_FIELD($f);\n" unless $equal_ignore;
}
- elsif ($t eq 'struct CustomPathMethods*' || $t eq 'struct CustomScanMethods*')
+ elsif ($t eq 'struct CustomPathMethods*'
+ || $t eq 'struct CustomScanMethods*')
{
# Fields of these types are required to be a pointer to a
# static table of callback functions. So we don't copy
# the table itself, just reference the original one.
- print $cff "\tCOPY_SCALAR_FIELD($f);\n" unless $copy_ignore;
+ print $cff "\tCOPY_SCALAR_FIELD($f);\n" unless $copy_ignore;
print $eff "\tCOMPARE_SCALAR_FIELD($f);\n" unless $equal_ignore;
}
else
@@ -587,9 +619,9 @@ close $efs;
# outfuncs.c, readfuncs.c
-open my $off, '>', 'outfuncs.funcs.c' . $tmpext or die $!;
-open my $rff, '>', 'readfuncs.funcs.c' . $tmpext or die $!;
-open my $ofs, '>', 'outfuncs.switch.c' . $tmpext or die $!;
+open my $off, '>', 'outfuncs.funcs.c' . $tmpext or die $!;
+open my $rff, '>', 'readfuncs.funcs.c' . $tmpext or die $!;
+open my $ofs, '>', 'outfuncs.switch.c' . $tmpext or die $!;
open my $rfs, '>', 'readfuncs.switch.c' . $tmpext or die $!;
print $off $node_includes;
@@ -603,7 +635,8 @@ foreach my $n (@node_types)
# XXX For now, skip all "Stmt"s except that ones that were there before.
if ($n =~ /Stmt$/)
{
- my @keep = qw(AlterStatsStmt CreateForeignTableStmt CreateStatsStmt CreateStmt DeclareCursorStmt ImportForeignSchemaStmt IndexStmt NotifyStmt PlannedStmt PLAssignStmt RawStmt ReturnStmt SelectStmt SetOperationStmt);
+ my @keep =
+ qw(AlterStatsStmt CreateForeignTableStmt CreateStatsStmt CreateStmt DeclareCursorStmt ImportForeignSchemaStmt IndexStmt NotifyStmt PlannedStmt PLAssignStmt RawStmt ReturnStmt SelectStmt SetOperationStmt);
next unless elem $n, @keep;
}
@@ -612,12 +645,14 @@ foreach my $n (@node_types)
# output format starts with upper case node type name
my $N = uc $n;
- print $ofs "\t\t\tcase T_${n}:\n".
- "\t\t\t\t_out${n}(str, obj);\n".
- "\t\t\t\tbreak;\n";
+ print $ofs "\t\t\tcase T_${n}:\n"
+ . "\t\t\t\t_out${n}(str, obj);\n"
+ . "\t\t\t\tbreak;\n";
- print $rfs "\telse if (MATCH(\"$N\", " . length($N) . "))\n".
- "\t\treturn_value = _read${n}();\n" unless $no_read;
+ print $rfs "\telse if (MATCH(\"$N\", "
+ . length($N) . "))\n"
+ . "\t\treturn_value = _read${n}();\n"
+ unless $no_read;
next if elem $n, @custom_read_write;
@@ -638,7 +673,7 @@ _read${n}(void)
" unless $no_read;
# print instructions for each field
- foreach my $f (@{$node_type_info{$n}->{fields}})
+ foreach my $f (@{ $node_type_info{$n}->{fields} })
{
my $t = $node_type_info{$n}->{field_types}{$f};
my @a = @{ $node_type_info{$n}->{field_attrs}{$f} };
@@ -684,12 +719,20 @@ _read${n}(void)
print $off "\tWRITE_LOCATION_FIELD($f);\n";
print $rff "\tREAD_LOCATION_FIELD($f);\n" unless $no_read;
}
- elsif ($t eq 'int' || $t eq 'int32' || $t eq 'AttrNumber' || $t eq 'StrategyNumber')
+ elsif ($t eq 'int'
+ || $t eq 'int32'
+ || $t eq 'AttrNumber'
+ || $t eq 'StrategyNumber')
{
print $off "\tWRITE_INT_FIELD($f);\n";
print $rff "\tREAD_INT_FIELD($f);\n" unless $no_read;
}
- elsif ($t eq 'uint32' || $t eq 'bits32' || $t eq 'AclMode' || $t eq 'BlockNumber' || $t eq 'Index' || $t eq 'SubTransactionId')
+ elsif ($t eq 'uint32'
+ || $t eq 'bits32'
+ || $t eq 'AclMode'
+ || $t eq 'BlockNumber'
+ || $t eq 'Index'
+ || $t eq 'SubTransactionId')
{
print $off "\tWRITE_UINT_FIELD($f);\n";
print $rff "\tREAD_UINT_FIELD($f);\n" unless $no_read;
@@ -733,7 +776,7 @@ _read${n}(void)
{
print $off "\tWRITE_FLOAT_FIELD($f.startup, \"%.2f\");\n";
print $off "\tWRITE_FLOAT_FIELD($f.per_tuple, \"%.2f\");\n";
- print $rff "\tREAD_FLOAT_FIELD($f.startup);\n" unless $no_read;
+ print $rff "\tREAD_FLOAT_FIELD($f.startup);\n" unless $no_read;
print $rff "\tREAD_FLOAT_FIELD($f.per_tuple);\n" unless $no_read;
}
elsif ($t eq 'Selectivity')
@@ -773,36 +816,46 @@ _read${n}(void)
{
die "no array size defined for $n.$f of type $t";
}
- if ($node_type_info{$n}->{field_types}{$array_size_field} eq 'List*')
+ if ($node_type_info{$n}->{field_types}{$array_size_field} eq
+ 'List*')
{
- print $off "\tWRITE_${tt}_ARRAY($f, list_length(node->$array_size_field));\n";
- print $rff "\tREAD_${tt}_ARRAY($f, list_length(local_node->$array_size_field));\n" unless $no_read;
+ print $off
+ "\tWRITE_${tt}_ARRAY($f, list_length(node->$array_size_field));\n";
+ print $rff
+ "\tREAD_${tt}_ARRAY($f, list_length(local_node->$array_size_field));\n"
+ unless $no_read;
}
else
{
- print $off "\tWRITE_${tt}_ARRAY($f, node->$array_size_field);\n";
- print $rff "\tREAD_${tt}_ARRAY($f, local_node->$array_size_field);\n" unless $no_read;
+ print $off
+ "\tWRITE_${tt}_ARRAY($f, node->$array_size_field);\n";
+ print $rff
+ "\tREAD_${tt}_ARRAY($f, local_node->$array_size_field);\n"
+ unless $no_read;
}
}
# Special treatments of several Path node fields
elsif ($t eq 'RelOptInfo*' && elem 'write_only_relids', @a)
{
- print $off "\tappendStringInfoString(str, \" :parent_relids \");\n".
- "\toutBitmapset(str, node->$f->relids);\n";
+ print $off
+ "\tappendStringInfoString(str, \" :parent_relids \");\n"
+ . "\toutBitmapset(str, node->$f->relids);\n";
}
- elsif ($t eq 'PathTarget*' && elem 'write_only_nondefault_pathtarget', @a)
+ elsif ($t eq 'PathTarget*' && elem 'write_only_nondefault_pathtarget',
+ @a)
{
(my $f2 = $f) =~ s/pathtarget/parent/;
- print $off "\tif (node->$f != node->$f2->reltarget)\n".
- "\t\tWRITE_NODE_FIELD($f);\n";
+ print $off "\tif (node->$f != node->$f2->reltarget)\n"
+ . "\t\tWRITE_NODE_FIELD($f);\n";
}
elsif ($t eq 'ParamPathInfo*' && elem 'write_only_req_outer', @a)
{
- print $off "\tappendStringInfoString(str, \" :required_outer \");\n".
- "\tif (node->$f)\n".
- "\t\toutBitmapset(str, node->$f->ppi_req_outer);\n".
- "\telse\n".
- "\t\toutBitmapset(str, NULL);\n";
+ print $off
+ "\tappendStringInfoString(str, \" :required_outer \");\n"
+ . "\tif (node->$f)\n"
+ . "\t\toutBitmapset(str, node->$f->ppi_req_outer);\n"
+ . "\telse\n"
+ . "\t\toutBitmapset(str, NULL);\n";
}
# node type
elsif ($t =~ /(\w+)\*/ and elem $1, @node_types)
@@ -810,7 +863,8 @@ _read${n}(void)
print $off "\tWRITE_NODE_FIELD($f);\n";
print $rff "\tREAD_NODE_FIELD($f);\n" unless $no_read;
}
- elsif ($t eq 'struct CustomPathMethods*' || $t eq 'struct CustomScanMethods*')
+ elsif ($t eq 'struct CustomPathMethods*'
+ || $t eq 'struct CustomScanMethods*')
{
print $off q{
/* CustomName is a key to lookup CustomScanMethods */
@@ -858,7 +912,9 @@ close $rfs;
# now rename the temporary files to their final name
-foreach my $file (qw(nodetags.h copyfuncs.funcs.c copyfuncs.switch.c equalfuncs.funcs.c equalfuncs.switch.c outfuncs.funcs.c outfuncs.switch.c readfuncs.funcs.c readfuncs.switch.c))
+foreach my $file (
+ qw(nodetags.h copyfuncs.funcs.c copyfuncs.switch.c equalfuncs.funcs.c equalfuncs.switch.c outfuncs.funcs.c outfuncs.switch.c readfuncs.funcs.c readfuncs.switch.c)
+ )
{
Catalog::RenameTempFile($file, $tmpext);
}
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 42ead5f789..b8b1728df7 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -839,32 +839,33 @@ EOF
close($chs);
}
- if (IsNewer('src/backend/nodes/node-support-stamp',
- 'src/backend/nodes/gen_node_support.pl'))
+ if (IsNewer(
+ 'src/backend/nodes/node-support-stamp',
+ 'src/backend/nodes/gen_node_support.pl'))
{
# XXX duplicates src/backend/nodes/Makefile
my @node_headers = qw(
- nodes/nodes.h
- nodes/execnodes.h
- nodes/plannodes.h
- nodes/primnodes.h
- nodes/pathnodes.h
- nodes/extensible.h
- nodes/parsenodes.h
- nodes/replnodes.h
- nodes/value.h
- commands/trigger.h
- commands/event_trigger.h
- foreign/fdwapi.h
- access/amapi.h
- access/tableam.h
- access/tsmapi.h
- utils/rel.h
- nodes/supportnodes.h
- executor/tuptable.h
- nodes/lockoptions.h
- access/sdir.h
+ nodes/nodes.h
+ nodes/execnodes.h
+ nodes/plannodes.h
+ nodes/primnodes.h
+ nodes/pathnodes.h
+ nodes/extensible.h
+ nodes/parsenodes.h
+ nodes/replnodes.h
+ nodes/value.h
+ commands/trigger.h
+ commands/event_trigger.h
+ foreign/fdwapi.h
+ access/amapi.h
+ access/tableam.h
+ access/tsmapi.h
+ utils/rel.h
+ nodes/supportnodes.h
+ executor/tuptable.h
+ nodes/lockoptions.h
+ access/sdir.h
);
chdir('src/backend/nodes');
@@ -872,7 +873,8 @@ EOF
my @node_files = map { "../../../src/include/$_" } @node_headers;
system("perl gen_node_support.pl @node_files");
- open(my $f, '>', 'node-support-stamp') || confess "Could not touch node-support-stamp";
+ open(my $f, '>', 'node-support-stamp')
+ || confess "Could not touch node-support-stamp";
close($f);
chdir('../../..');
}