aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
authorNeil Conway <neilc@samurai.com>2004-01-07 18:56:30 +0000
committerNeil Conway <neilc@samurai.com>2004-01-07 18:56:30 +0000
commit192ad63bd765d448e91389c6ff1d75f8b18bb268 (patch)
tree85873642a16b5ac877dc443a681fe9249c210693 /src/backend/executor
parentafca5d50dc296580925b560fff0eb75bb48f0cbe (diff)
downloadpostgresql-192ad63bd765d448e91389c6ff1d75f8b18bb268.tar.gz
postgresql-192ad63bd765d448e91389c6ff1d75f8b18bb268.zip
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.
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/execJunk.c4
-rw-r--r--src/backend/executor/execMain.c6
-rw-r--r--src/backend/executor/execQual.c8
-rw-r--r--src/backend/executor/execTuples.c12
-rw-r--r--src/backend/executor/functions.c12
-rw-r--r--src/backend/executor/nodeHashjoin.c10
-rw-r--r--src/backend/executor/nodeIndexscan.c6
7 files changed, 29 insertions, 29 deletions
diff --git a/src/backend/executor/execJunk.c b/src/backend/executor/execJunk.c
index 28b48243787..e970086d522 100644
--- a/src/backend/executor/execJunk.c
+++ b/src/backend/executor/execJunk.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/execJunk.c,v 1.37 2003/11/29 19:51:48 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/execJunk.c,v 1.38 2004/01/07 18:56:26 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -267,7 +267,7 @@ ExecRemoveJunk(JunkFilter *junkfilter, TupleTableSlot *slot)
* Handle the trivial case first.
*/
if (cleanLength == 0)
- return (HeapTuple) NULL;
+ return NULL;
/*
* Create the arrays that will hold the attribute values and the null
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index f84b4dd690e..cf581907a4f 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -26,7 +26,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.224 2003/12/28 21:57:36 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.225 2004/01/07 18:56:26 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -782,7 +782,7 @@ InitPlan(QueryDesc *queryDesc, bool explainOnly)
*
* If EXPLAIN, skip creating the "into" relation.
*/
- intoRelationDesc = (Relation) NULL;
+ intoRelationDesc = NULL;
if (do_select_into && !explainOnly)
{
@@ -1076,7 +1076,7 @@ lnext: ;
*
* Also, extract all the junk information we need.
*/
- if ((junkfilter = estate->es_junkFilter) != (JunkFilter *) NULL)
+ if ((junkfilter = estate->es_junkFilter) != NULL)
{
Datum datum;
HeapTuple newTuple;
diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c
index 0377f9f4104..bbed6f014b1 100644
--- a/src/backend/executor/execQual.c
+++ b/src/backend/executor/execQual.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.152 2003/12/18 22:23:42 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.153 2004/01/07 18:56:26 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -548,7 +548,7 @@ GetAttributeByNum(TupleTableSlot *slot,
if (!AttributeNumberIsValid(attrno))
elog(ERROR, "invalid attribute number %d", attrno);
- if (isNull == (bool *) NULL)
+ if (isNull == NULL)
elog(ERROR, "a NULL isNull pointer was passed");
if (TupIsNull(slot))
@@ -579,7 +579,7 @@ GetAttributeByName(TupleTableSlot *slot, char *attname, bool *isNull)
if (attname == NULL)
elog(ERROR, "invalid attribute name");
- if (isNull == (bool *) NULL)
+ if (isNull == NULL)
elog(ERROR, "a NULL isNull pointer was passed");
if (TupIsNull(slot))
@@ -3116,7 +3116,7 @@ ExecProject(ProjectionInfo *projInfo, ExprDoneCond *isDone)
* sanity checks
*/
if (projInfo == NULL)
- return (TupleTableSlot *) NULL;
+ return NULL;
/*
* get the projection info we want
diff --git a/src/backend/executor/execTuples.c b/src/backend/executor/execTuples.c
index e7e02fdb6d8..0bb59d26b11 100644
--- a/src/backend/executor/execTuples.c
+++ b/src/backend/executor/execTuples.c
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/execTuples.c,v 1.74 2003/12/01 23:09:02 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/execTuples.c,v 1.75 2004/01/07 18:56:26 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -271,11 +271,11 @@ ExecAllocTableSlot(TupleTable table)
/* Make sure the allocated slot is valid (and empty) */
slot->type = T_TupleTableSlot;
- slot->val = (HeapTuple) NULL;
+ slot->val = NULL;
slot->ttc_shouldFree = true;
slot->ttc_descIsNew = true;
slot->ttc_shouldFreeDesc = true;
- slot->ttc_tupleDescriptor = (TupleDesc) NULL;
+ slot->ttc_tupleDescriptor = NULL;
slot->ttc_buffer = InvalidBuffer;
return slot;
@@ -296,11 +296,11 @@ MakeTupleTableSlot(void)
TupleTableSlot *slot = makeNode(TupleTableSlot);
/* This should match ExecAllocTableSlot() */
- slot->val = (HeapTuple) NULL;
+ slot->val = NULL;
slot->ttc_shouldFree = true;
slot->ttc_descIsNew = true;
slot->ttc_shouldFreeDesc = true;
- slot->ttc_tupleDescriptor = (TupleDesc) NULL;
+ slot->ttc_tupleDescriptor = NULL;
slot->ttc_buffer = InvalidBuffer;
return slot;
@@ -406,7 +406,7 @@ ExecClearTuple(TupleTableSlot *slot) /* slot in which to store tuple */
if (slot->ttc_shouldFree && oldtuple != NULL)
heap_freetuple(oldtuple);
- slot->val = (HeapTuple) NULL;
+ slot->val = NULL;
slot->ttc_shouldFree = true; /* probably useless code... */
diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c
index 03a4abbe2f5..6ffc8875f19 100644
--- a/src/backend/executor/functions.c
+++ b/src/backend/executor/functions.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.76 2003/11/29 19:51:48 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.77 2004/01/07 18:56:26 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -47,7 +47,7 @@ typedef struct local_es
QueryDesc *qd; /* null unless status == RUN */
} execution_state;
-#define LAST_POSTQUEL_COMMAND(es) ((es)->next == (execution_state *) NULL)
+#define LAST_POSTQUEL_COMMAND(es) ((es)->next == NULL)
/*
@@ -259,7 +259,7 @@ init_sql_fcache(FmgrInfo *finfo)
}
}
else
- argOidVect = (Oid *) NULL;
+ argOidVect = NULL;
tmp = SysCacheGetAttr(PROCOID,
procedureTuple,
@@ -304,7 +304,7 @@ postquel_getnext(execution_state *es)
if (es->qd->operation == CMD_UTILITY)
{
ProcessUtility(es->qd->parsetree->utilityStmt, es->qd->dest, NULL);
- return (TupleTableSlot *) NULL;
+ return NULL;
}
/*
@@ -358,7 +358,7 @@ postquel_sub_params(SQLFunctionCachePtr fcache,
paramLI[nargs].kind = PARAM_INVALID;
}
else
- paramLI = (ParamListInfo) NULL;
+ paramLI = NULL;
if (fcache->paramLI)
pfree(fcache->paramLI);
@@ -551,7 +551,7 @@ fmgr_sql(PG_FUNCTION_ARGS)
/*
* If we've gone through every command in this function, we are done.
*/
- if (es == (execution_state *) NULL)
+ if (es == NULL)
{
/*
* Reset the execution states to start over again on next call.
diff --git a/src/backend/executor/nodeHashjoin.c b/src/backend/executor/nodeHashjoin.c
index 5dc61a1a185..f0c1ee69e69 100644
--- a/src/backend/executor/nodeHashjoin.c
+++ b/src/backend/executor/nodeHashjoin.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/nodeHashjoin.c,v 1.59 2003/11/29 19:51:48 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/nodeHashjoin.c,v 1.60 2004/01/07 18:56:26 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -405,10 +405,10 @@ ExecInitHashJoin(HashJoin *node, EState *estate)
*/
hjstate->hj_hashdone = false;
- hjstate->hj_HashTable = (HashJoinTable) NULL;
+ hjstate->hj_HashTable = NULL;
hjstate->hj_CurBucketNo = 0;
- hjstate->hj_CurTuple = (HashJoinTuple) NULL;
+ hjstate->hj_CurTuple = NULL;
/*
* Deconstruct the hash clauses into outer and inner argument values,
@@ -733,9 +733,9 @@ ExecReScanHashJoin(HashJoinState *node, ExprContext *exprCtxt)
/* Always reset intra-tuple state */
node->hj_CurBucketNo = 0;
- node->hj_CurTuple = (HashJoinTuple) NULL;
+ node->hj_CurTuple = NULL;
- node->js.ps.ps_OuterTupleSlot = (TupleTableSlot *) NULL;
+ node->js.ps.ps_OuterTupleSlot = NULL;
node->js.ps.ps_TupFromTlist = false;
node->hj_NeedNewOuter = true;
node->hj_MatchedOuter = false;
diff --git a/src/backend/executor/nodeIndexscan.c b/src/backend/executor/nodeIndexscan.c
index 3a489b361c6..d7c62110e93 100644
--- a/src/backend/executor/nodeIndexscan.c
+++ b/src/backend/executor/nodeIndexscan.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/nodeIndexscan.c,v 1.89 2004/01/06 04:31:01 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/nodeIndexscan.c,v 1.90 2004/01/07 18:56:26 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -758,9 +758,9 @@ ExecInitIndexScan(IndexScan *node, EState *estate)
lossyflags = lfirst(indxlossy);
indxlossy = lnext(indxlossy);
n_keys = length(quals);
- scan_keys = (n_keys <= 0) ? (ScanKey) NULL :
+ scan_keys = (n_keys <= 0) ? NULL :
(ScanKey) palloc(n_keys * sizeof(ScanKeyData));
- run_keys = (n_keys <= 0) ? (ExprState **) NULL :
+ run_keys = (n_keys <= 0) ? NULL :
(ExprState **) palloc(n_keys * sizeof(ExprState *));
/*