1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

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.
This commit is contained in:
Peter Eisentraut
2016-12-23 12:00:00 -05:00
parent 3c9d398484
commit 158df30359
4 changed files with 12 additions and 13 deletions

View File

@ -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;

View File

@ -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)
} }
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)
} }
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)
} }
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:

View File

@ -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;
} }

View File

@ -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,
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,
*/ */
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;