Skip to content

Commit 158df30

Browse files
committed
Remove unnecessary casts of makeNode() result
makeNode() is already a macro that has the right result pointer type, so casting it again to the same type is unnecessary.
1 parent 3c9d398 commit 158df30

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

src/backend/commands/tablecmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12743,7 +12743,7 @@ transformPartitionSpec(Relation rel, PartitionSpec *partspec, char *strategy)
1274312743
RangeTblEntry *rte;
1274412744
ListCell *l;
1274512745

12746-
newspec = (PartitionSpec *) makeNode(PartitionSpec);
12746+
newspec = makeNode(PartitionSpec);
1274712747

1274812748
newspec->strategy = partspec->strategy;
1274912749
newspec->location = partspec->location;

src/backend/executor/execQual.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4594,16 +4594,16 @@ ExecInitExpr(Expr *node, PlanState *parent)
45944594
}
45954595
else
45964596
{
4597-
state = (ExprState *) makeNode(ExprState);
4597+
state = makeNode(ExprState);
45984598
state->evalfunc = ExecEvalScalarVar;
45994599
}
46004600
break;
46014601
case T_Const:
4602-
state = (ExprState *) makeNode(ExprState);
4602+
state = makeNode(ExprState);
46034603
state->evalfunc = ExecEvalConst;
46044604
break;
46054605
case T_Param:
4606-
state = (ExprState *) makeNode(ExprState);
4606+
state = makeNode(ExprState);
46074607
switch (((Param *) node)->paramkind)
46084608
{
46094609
case PARAM_EXEC:
@@ -4619,11 +4619,11 @@ ExecInitExpr(Expr *node, PlanState *parent)
46194619
}
46204620
break;
46214621
case T_CoerceToDomainValue:
4622-
state = (ExprState *) makeNode(ExprState);
4622+
state = makeNode(ExprState);
46234623
state->evalfunc = ExecEvalCoerceToDomainValue;
46244624
break;
46254625
case T_CaseTestExpr:
4626-
state = (ExprState *) makeNode(ExprState);
4626+
state = makeNode(ExprState);
46274627
state->evalfunc = ExecEvalCaseTestExpr;
46284628
break;
46294629
case T_Aggref:
@@ -5176,7 +5176,7 @@ ExecInitExpr(Expr *node, PlanState *parent)
51765176
}
51775177
break;
51785178
case T_SQLValueFunction:
5179-
state = (ExprState *) makeNode(ExprState);
5179+
state = makeNode(ExprState);
51805180
state->evalfunc = ExecEvalSQLValueFunction;
51815181
break;
51825182
case T_XmlExpr:
@@ -5250,7 +5250,7 @@ ExecInitExpr(Expr *node, PlanState *parent)
52505250
}
52515251
break;
52525252
case T_CurrentOfExpr:
5253-
state = (ExprState *) makeNode(ExprState);
5253+
state = makeNode(ExprState);
52545254
state->evalfunc = ExecEvalCurrentOfExpr;
52555255
break;
52565256
case T_TargetEntry:

src/backend/replication/repl_gram.y

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,7 @@ identify_system:
131131
base_backup:
132132
K_BASE_BACKUP base_backup_opt_list
133133
{
134-
BaseBackupCmd *cmd =
135-
(BaseBackupCmd *) makeNode(BaseBackupCmd);
134+
BaseBackupCmd *cmd = makeNode(BaseBackupCmd);
136135
cmd->options = $2;
137136
$$ = (Node *) cmd;
138137
}

src/backend/rewrite/rowsecurity.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ add_with_check_options(Relation rel,
703703
*/
704704
WithCheckOption *wco;
705705

706-
wco = (WithCheckOption *) makeNode(WithCheckOption);
706+
wco = makeNode(WithCheckOption);
707707
wco->kind = kind;
708708
wco->relname = pstrdup(RelationGetRelationName(rel));
709709
wco->polname = NULL;
@@ -735,7 +735,7 @@ add_with_check_options(Relation rel,
735735
qual = copyObject(qual);
736736
ChangeVarNodes((Node *) qual, 1, rt_index, 0);
737737

738-
wco = (WithCheckOption *) makeNode(WithCheckOption);
738+
wco = makeNode(WithCheckOption);
739739
wco->kind = kind;
740740
wco->relname = pstrdup(RelationGetRelationName(rel));
741741
wco->polname = pstrdup(policy->policy_name);
@@ -755,7 +755,7 @@ add_with_check_options(Relation rel,
755755
*/
756756
WithCheckOption *wco;
757757

758-
wco = (WithCheckOption *) makeNode(WithCheckOption);
758+
wco = makeNode(WithCheckOption);
759759
wco->kind = kind;
760760
wco->relname = pstrdup(RelationGetRelationName(rel));
761761
wco->polname = NULL;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy