Commit 158df303 authored by Peter Eisentraut's avatar Peter Eisentraut

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.
parent 3c9d3984
...@@ -12743,7 +12743,7 @@ transformPartitionSpec(Relation rel, PartitionSpec *partspec, char *strategy) ...@@ -12743,7 +12743,7 @@ transformPartitionSpec(Relation rel, PartitionSpec *partspec, char *strategy)
RangeTblEntry *rte; RangeTblEntry *rte;
ListCell *l; ListCell *l;
newspec = (PartitionSpec *) makeNode(PartitionSpec); newspec = makeNode(PartitionSpec);
newspec->strategy = partspec->strategy; newspec->strategy = partspec->strategy;
newspec->location = partspec->location; newspec->location = partspec->location;
......
...@@ -4594,16 +4594,16 @@ ExecInitExpr(Expr *node, PlanState *parent) ...@@ -4594,16 +4594,16 @@ ExecInitExpr(Expr *node, PlanState *parent)
} }
else else
{ {
state = (ExprState *) makeNode(ExprState); state = makeNode(ExprState);
state->evalfunc = ExecEvalScalarVar; state->evalfunc = ExecEvalScalarVar;
} }
break; break;
case T_Const: case T_Const:
state = (ExprState *) makeNode(ExprState); state = makeNode(ExprState);
state->evalfunc = ExecEvalConst; state->evalfunc = ExecEvalConst;
break; break;
case T_Param: case T_Param:
state = (ExprState *) makeNode(ExprState); state = makeNode(ExprState);
switch (((Param *) node)->paramkind) switch (((Param *) node)->paramkind)
{ {
case PARAM_EXEC: case PARAM_EXEC:
...@@ -4619,11 +4619,11 @@ ExecInitExpr(Expr *node, PlanState *parent) ...@@ -4619,11 +4619,11 @@ ExecInitExpr(Expr *node, PlanState *parent)
} }
break; break;
case T_CoerceToDomainValue: case T_CoerceToDomainValue:
state = (ExprState *) makeNode(ExprState); state = makeNode(ExprState);
state->evalfunc = ExecEvalCoerceToDomainValue; state->evalfunc = ExecEvalCoerceToDomainValue;
break; break;
case T_CaseTestExpr: case T_CaseTestExpr:
state = (ExprState *) makeNode(ExprState); state = makeNode(ExprState);
state->evalfunc = ExecEvalCaseTestExpr; state->evalfunc = ExecEvalCaseTestExpr;
break; break;
case T_Aggref: case T_Aggref:
...@@ -5176,7 +5176,7 @@ ExecInitExpr(Expr *node, PlanState *parent) ...@@ -5176,7 +5176,7 @@ ExecInitExpr(Expr *node, PlanState *parent)
} }
break; break;
case T_SQLValueFunction: case T_SQLValueFunction:
state = (ExprState *) makeNode(ExprState); state = makeNode(ExprState);
state->evalfunc = ExecEvalSQLValueFunction; state->evalfunc = ExecEvalSQLValueFunction;
break; break;
case T_XmlExpr: case T_XmlExpr:
...@@ -5250,7 +5250,7 @@ ExecInitExpr(Expr *node, PlanState *parent) ...@@ -5250,7 +5250,7 @@ ExecInitExpr(Expr *node, PlanState *parent)
} }
break; break;
case T_CurrentOfExpr: case T_CurrentOfExpr:
state = (ExprState *) makeNode(ExprState); state = makeNode(ExprState);
state->evalfunc = ExecEvalCurrentOfExpr; state->evalfunc = ExecEvalCurrentOfExpr;
break; break;
case T_TargetEntry: case T_TargetEntry:
......
...@@ -131,8 +131,7 @@ identify_system: ...@@ -131,8 +131,7 @@ identify_system:
base_backup: base_backup:
K_BASE_BACKUP base_backup_opt_list K_BASE_BACKUP base_backup_opt_list
{ {
BaseBackupCmd *cmd = BaseBackupCmd *cmd = makeNode(BaseBackupCmd);
(BaseBackupCmd *) makeNode(BaseBackupCmd);
cmd->options = $2; cmd->options = $2;
$$ = (Node *) cmd; $$ = (Node *) cmd;
} }
......
...@@ -703,7 +703,7 @@ add_with_check_options(Relation rel, ...@@ -703,7 +703,7 @@ add_with_check_options(Relation rel,
*/ */
WithCheckOption *wco; WithCheckOption *wco;
wco = (WithCheckOption *) makeNode(WithCheckOption); wco = makeNode(WithCheckOption);
wco->kind = kind; wco->kind = kind;
wco->relname = pstrdup(RelationGetRelationName(rel)); wco->relname = pstrdup(RelationGetRelationName(rel));
wco->polname = NULL; wco->polname = NULL;
...@@ -735,7 +735,7 @@ add_with_check_options(Relation rel, ...@@ -735,7 +735,7 @@ add_with_check_options(Relation rel,
qual = copyObject(qual); qual = copyObject(qual);
ChangeVarNodes((Node *) qual, 1, rt_index, 0); ChangeVarNodes((Node *) qual, 1, rt_index, 0);
wco = (WithCheckOption *) makeNode(WithCheckOption); wco = makeNode(WithCheckOption);
wco->kind = kind; wco->kind = kind;
wco->relname = pstrdup(RelationGetRelationName(rel)); wco->relname = pstrdup(RelationGetRelationName(rel));
wco->polname = pstrdup(policy->policy_name); wco->polname = pstrdup(policy->policy_name);
...@@ -755,7 +755,7 @@ add_with_check_options(Relation rel, ...@@ -755,7 +755,7 @@ add_with_check_options(Relation rel,
*/ */
WithCheckOption *wco; WithCheckOption *wco;
wco = (WithCheckOption *) makeNode(WithCheckOption); wco = makeNode(WithCheckOption);
wco->kind = kind; wco->kind = kind;
wco->relname = pstrdup(RelationGetRelationName(rel)); wco->relname = pstrdup(RelationGetRelationName(rel));
wco->polname = NULL; wco->polname = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment