1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-09 06:21:09 +03:00

More janitorial work: remove the explicit casting of NULL literals to a

pointer type when it is not necessary to do so.

For future reference, casting NULL to a pointer type is only necessary
when (a) invoking a function AND either (b) the function has no prototype
OR (c) the function is a varargs function.
This commit is contained in:
Neil Conway
2004-01-07 18:56:30 +00:00
parent afca5d50dc
commit 192ad63bd7
71 changed files with 424 additions and 436 deletions

View File

@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.442 2004/01/06 23:55:18 tgl Exp $
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.443 2004/01/07 18:56:27 neilc Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -467,13 +467,13 @@ stmtblock: stmtmulti { parsetree = $1; }
/* the thrashing around here is to discard "empty" statements... */
stmtmulti: stmtmulti ';' stmt
{ if ($3 != (Node *)NULL)
{ if ($3 != NULL)
$$ = lappend($1, $3);
else
$$ = $1;
}
| stmt
{ if ($1 != (Node *)NULL)
{ if ($1 != NULL)
$$ = makeList1($1);
else
$$ = NIL;
@@ -553,7 +553,7 @@ stmt :
| VariableShowStmt
| ViewStmt
| /*EMPTY*/
{ $$ = (Node *)NULL; }
{ $$ = NULL; }
;
/*****************************************************************************
@@ -1955,11 +1955,11 @@ OptSeqElem: CACHE NumericOnly
}
| NO MAXVALUE
{
$$ = makeDefElem("maxvalue", (Node *)NULL);
$$ = makeDefElem("maxvalue", NULL);
}
| NO MINVALUE
{
$$ = makeDefElem("minvalue", (Node *)NULL);
$$ = makeDefElem("minvalue", NULL);
}
| START opt_with NumericOnly
{
@@ -2371,7 +2371,7 @@ def_elem: ColLabel '=' def_arg
}
| ColLabel
{
$$ = makeDefElem($1, (Node *)NULL);
$$ = makeDefElem($1, NULL);
}
;
@@ -3563,13 +3563,13 @@ RuleActionList:
/* the thrashing around here is to discard "empty" statements... */
RuleActionMulti:
RuleActionMulti ';' RuleActionStmtOrEmpty
{ if ($3 != (Node *) NULL)
{ if ($3 != NULL)
$$ = lappend($1, $3);
else
$$ = $1;
}
| RuleActionStmtOrEmpty
{ if ($1 != (Node *) NULL)
{ if ($1 != NULL)
$$ = makeList1($1);
else
$$ = NIL;
@@ -3586,7 +3586,7 @@ RuleActionStmt:
RuleActionStmtOrEmpty:
RuleActionStmt { $$ = $1; }
| /*EMPTY*/ { $$ = (Node *)NULL; }
| /*EMPTY*/ { $$ = NULL; }
;
/* change me to select, update, etc. some day */

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/parse_func.c,v 1.164 2003/11/29 19:51:52 pgsql Exp $
* $PostgreSQL: pgsql/src/backend/parser/parse_func.c,v 1.165 2004/01/07 18:56:27 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -993,7 +993,7 @@ argtype_inherit(int nargs, Oid *argtypes)
else
{
arginh[i].nsupers = 0;
arginh[i].supervec = (Oid *) NULL;
arginh[i].supervec = NULL;
}
}
@@ -1090,7 +1090,7 @@ find_inheritors(Oid relid, Oid **supervec)
}
}
else
*supervec = (Oid *) NULL;
*supervec = NULL;
freeList(visited);