summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut2016-12-23 17:00:00 +0000
committerPeter Eisentraut2016-12-23 18:17:20 +0000
commit158df30359025d74daee74a3b927fd07c3b1a413 (patch)
tree54298db15c9d6e0b5a9bcd95911048147ffb0dc0 /src
parent3c9d398484fb6e188e665be8299d6e5e89924c94 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/tablecmds.c2
-rw-r--r--src/backend/executor/execQual.c14
-rw-r--r--src/backend/replication/repl_gram.y3
-rw-r--r--src/backend/rewrite/rowsecurity.c6
4 files changed, 12 insertions, 13 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 13b12f19035..0e7601fd942 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -12743,7 +12743,7 @@ transformPartitionSpec(Relation rel, PartitionSpec *partspec, char *strategy)
RangeTblEntry *rte;
ListCell *l;
- newspec = (PartitionSpec *) makeNode(PartitionSpec);
+ newspec = makeNode(PartitionSpec);
newspec->strategy = partspec->strategy;
newspec->location = partspec->location;
diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c
index ab09691fb20..ec1ca01c5aa 100644
--- a/src/backend/executor/execQual.c
+++ b/src/backend/executor/execQual.c
@@ -4594,16 +4594,16 @@ ExecInitExpr(Expr *node, PlanState *parent)
}
else
{
- state = (ExprState *) makeNode(ExprState);
+ state = makeNode(ExprState);
state->evalfunc = ExecEvalScalarVar;
}
break;
case T_Const:
- state = (ExprState *) makeNode(ExprState);
+ state = makeNode(ExprState);
state->evalfunc = ExecEvalConst;
break;
case T_Param:
- state = (ExprState *) makeNode(ExprState);
+ state = makeNode(ExprState);
switch (((Param *) node)->paramkind)
{
case PARAM_EXEC:
@@ -4619,11 +4619,11 @@ ExecInitExpr(Expr *node, PlanState *parent)
}
break;
case T_CoerceToDomainValue:
- state = (ExprState *) makeNode(ExprState);
+ state = makeNode(ExprState);
state->evalfunc = ExecEvalCoerceToDomainValue;
break;
case T_CaseTestExpr:
- state = (ExprState *) makeNode(ExprState);
+ state = makeNode(ExprState);
state->evalfunc = ExecEvalCaseTestExpr;
break;
case T_Aggref:
@@ -5176,7 +5176,7 @@ ExecInitExpr(Expr *node, PlanState *parent)
}
break;
case T_SQLValueFunction:
- state = (ExprState *) makeNode(ExprState);
+ state = makeNode(ExprState);
state->evalfunc = ExecEvalSQLValueFunction;
break;
case T_XmlExpr:
@@ -5250,7 +5250,7 @@ ExecInitExpr(Expr *node, PlanState *parent)
}
break;
case T_CurrentOfExpr:
- state = (ExprState *) makeNode(ExprState);
+ state = makeNode(ExprState);
state->evalfunc = ExecEvalCurrentOfExpr;
break;
case T_TargetEntry:
diff --git a/src/backend/replication/repl_gram.y b/src/backend/replication/repl_gram.y
index e75516c8d25..8cc9edd229f 100644
--- a/src/backend/replication/repl_gram.y
+++ b/src/backend/replication/repl_gram.y
@@ -131,8 +131,7 @@ identify_system:
base_backup:
K_BASE_BACKUP base_backup_opt_list
{
- BaseBackupCmd *cmd =
- (BaseBackupCmd *) makeNode(BaseBackupCmd);
+ BaseBackupCmd *cmd = makeNode(BaseBackupCmd);
cmd->options = $2;
$$ = (Node *) cmd;
}
diff --git a/src/backend/rewrite/rowsecurity.c b/src/backend/rewrite/rowsecurity.c
index e38586dd80b..53b27d11370 100644
--- a/src/backend/rewrite/rowsecurity.c
+++ b/src/backend/rewrite/rowsecurity.c
@@ -703,7 +703,7 @@ add_with_check_options(Relation rel,
*/
WithCheckOption *wco;
- wco = (WithCheckOption *) makeNode(WithCheckOption);
+ wco = makeNode(WithCheckOption);
wco->kind = kind;
wco->relname = pstrdup(RelationGetRelationName(rel));
wco->polname = NULL;
@@ -735,7 +735,7 @@ add_with_check_options(Relation rel,
qual = copyObject(qual);
ChangeVarNodes((Node *) qual, 1, rt_index, 0);
- wco = (WithCheckOption *) makeNode(WithCheckOption);
+ wco = makeNode(WithCheckOption);
wco->kind = kind;
wco->relname = pstrdup(RelationGetRelationName(rel));
wco->polname = pstrdup(policy->policy_name);
@@ -755,7 +755,7 @@ add_with_check_options(Relation rel,
*/
WithCheckOption *wco;
- wco = (WithCheckOption *) makeNode(WithCheckOption);
+ wco = makeNode(WithCheckOption);
wco->kind = kind;
wco->relname = pstrdup(RelationGetRelationName(rel));
wco->polname = NULL;