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.
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/common/printtup.c,v 1.79 2003/11/29 19:51:39 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/access/common/printtup.c,v 1.80 2004/01/07 18:56:23 neilc Exp $
*
*-------------------------------------------------------------------------
*/
* show the return type of the tuples
*/
for (i = 0; i < natts; ++i)
- printatt((unsigned) i + 1, attinfo[i], (char *) NULL);
+ printatt((unsigned) i + 1, attinfo[i], NULL);
printf("\t----\n");
}
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/gist/gist.c,v 1.106 2003/11/29 19:51:39 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/access/gist/gist.c,v 1.107 2004/01/07 18:56:23 neilc Exp $
*
*-------------------------------------------------------------------------
*/
*/
#define FILLITEM(evp, isnullkey, okey, okeyb, rkey, rkeyb) do { \
if ( isnullkey ) { \
- gistentryinit((evp), rkey, r, (Page) NULL , \
+ gistentryinit((evp), rkey, r, NULL, \
(OffsetNumber) 0, rkeyb, FALSE); \
} else { \
- gistentryinit((evp), okey, r, (Page) NULL, \
+ gistentryinit((evp), okey, r, NULL, \
(OffsetNumber) 0, okeyb, FALSE); \
} \
} while(0)
else
{
gistcentryinit(&buildstate->giststate, i, &tmpcentry, attdata[i],
- (Relation) NULL, (Page) NULL, (OffsetNumber) 0,
+ NULL, NULL, (OffsetNumber) 0,
-1 /* size is currently bogus */ , TRUE, FALSE);
if (attdata[i] != tmpcentry.key &&
!(isAttByVal(&buildstate->giststate, i)))
else
{
gistcentryinit(&giststate, i, &tmpentry, datum[i],
- (Relation) NULL, (Page) NULL, (OffsetNumber) 0,
+ NULL, NULL, (OffsetNumber) 0,
-1 /* size is currently bogus */ , TRUE, FALSE);
if (datum[i] != tmpentry.key && !(isAttByVal(&giststate, i)))
compvec[i] = TRUE;
gistdentryinit(giststate, j,
&((GISTENTRY *) VARDATA(evec))[reallen],
datum,
- (Relation) NULL, (Page) NULL, (OffsetNumber) NULL,
+ NULL, NULL, (OffsetNumber) 0,
ATTSIZE(datum, giststate->tupdesc, j + 1, IsNull), FALSE, IsNull);
if ((!isAttByVal(giststate, j)) &&
((GISTENTRY *) VARDATA(evec))[reallen].key != datum)
{
VARATT_SIZEP(evec) = 2 * sizeof(GISTENTRY) + VARHDRSZ;
gistentryinit(((GISTENTRY *) VARDATA(evec))[1],
- ((GISTENTRY *) VARDATA(evec))[0].key, r, (Page) NULL,
+ ((GISTENTRY *) VARDATA(evec))[0].key, r, NULL,
(OffsetNumber) 0, ((GISTENTRY *) VARDATA(evec))[0].bytes, FALSE);
}
pfree(DatumGetPointer(((GISTENTRY *) VARDATA(evec))[i].key));
gistcentryinit(giststate, j, ¢ry[j], datum,
- (Relation) NULL, (Page) NULL, (OffsetNumber) NULL,
+ NULL, NULL, (OffsetNumber) 0,
datumsize, FALSE, FALSE);
isnull[j] = ' ';
attr[j] = centry[j].key;
ev0p = &((GISTENTRY *) VARDATA(evec))[0];
ev1p = &((GISTENTRY *) VARDATA(evec))[1];
- gistDeCompressAtt(giststate, r, oldtup, (Page) NULL,
+ gistDeCompressAtt(giststate, r, oldtup, NULL,
(OffsetNumber) 0, oldatt, olddec, oldisnull);
- gistDeCompressAtt(giststate, r, addtup, (Page) NULL,
+ gistDeCompressAtt(giststate, r, addtup, NULL,
(OffsetNumber) 0, addatt, adddec, addisnull);
pfree(DatumGetPointer(addatt[j].key));
gistcentryinit(giststate, j, ¢ry[j], datum,
- (Relation) NULL, (Page) NULL, (OffsetNumber) NULL,
+ NULL, NULL, (OffsetNumber) 0,
datumsize, FALSE, FALSE);
isnull[j] = ' ';
gistdentryinit(giststate, j,
&((GISTENTRY *) VARDATA(evec))[reallen],
datum,
- (Relation) NULL, (Page) NULL,
- (OffsetNumber) NULL,
+ NULL, NULL, (OffsetNumber) 0,
ATTSIZE(datum, giststate->tupdesc, j + 1, IsNull), FALSE, IsNull);
if ((!isAttByVal(giststate, j)) &&
((GISTENTRY *) VARDATA(evec))[reallen].key != datum)
{
if (v->spl_idgrp[i + 1] == 0) /* already inserted */
continue;
- gistDeCompressAtt(giststate, r, itup[i], (Page) NULL, (OffsetNumber) 0,
+ gistDeCompressAtt(giststate, r, itup[i], NULL, (OffsetNumber) 0,
identry, decfree, isnull);
v->spl_ngrp[v->spl_idgrp[i + 1]]--;
/* where? */
for (j = 1; j < r->rd_att->natts; j++)
{
- gistentryinit(entry, v->spl_lattr[j], r, (Page) NULL,
+ gistentryinit(entry, v->spl_lattr[j], r, NULL,
(OffsetNumber) 0, v->spl_lattrsize[j], FALSE);
gistpenalty(giststate, j, &entry, v->spl_lisnull[j],
&identry[j], isnull[j], &lpenalty);
- gistentryinit(entry, v->spl_rattr[j], r, (Page) NULL,
+ gistentryinit(entry, v->spl_rattr[j], r, NULL,
(OffsetNumber) 0, v->spl_rattrsize[j], FALSE);
gistpenalty(giststate, j, &entry, v->spl_risnull[j],
&identry[j], isnull[j], &rpenalty);
which = -1;
sum_grow = 1;
gistDeCompressAtt(giststate, r,
- it, (Page) NULL, (OffsetNumber) 0,
+ it, NULL, (OffsetNumber) 0,
identry, decompvec, isnull);
for (i = FirstOffsetNumber; i <= maxoff && sum_grow; i = OffsetNumberNext(i))
{
GISTSTACK *p;
- while (s != (GISTSTACK *) NULL)
+ while (s != NULL)
{
p = s->gs_parent;
pfree(s);
*/
/* walk through the entire index */
- iscan = index_beginscan(NULL, rel, SnapshotAny, 0, (ScanKey) NULL);
+ iscan = index_beginscan(NULL, rel, SnapshotAny, 0, NULL);
/* including killed tuples */
iscan->ignore_killed_tuples = false;
else
{
gistcentryinit(giststate, j, ¢ry[j], attdata[j],
- (Relation) NULL, (Page) NULL, (OffsetNumber) NULL,
+ NULL, NULL, (OffsetNumber) 0,
datumsize[j], FALSE, FALSE);
isnullchar[j] = ' ';
compatt[j] = centry[j].key;
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/gist/gistget.c,v 1.39 2003/11/29 19:51:39 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/access/gist/gistget.c,v 1.40 2004/01/07 18:56:23 neilc Exp $
*
*-------------------------------------------------------------------------
*/
while (n < FirstOffsetNumber || n > maxoff)
{
ReleaseBuffer(b);
- if (so->s_stack == (GISTSTACK *) NULL)
+ if (so->s_stack == NULL)
return false;
stk = so->s_stack;
while (n < FirstOffsetNumber || n > maxoff)
{
ReleaseBuffer(b);
- if (so->s_stack == (GISTSTACK *) NULL)
+ if (so->s_stack == NULL)
return false;
stk = so->s_stack;
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/gist/gistscan.c,v 1.50 2003/11/29 19:51:39 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/access/gist/gistscan.c,v 1.51 2004/01/07 18:56:23 neilc Exp $
*
*-------------------------------------------------------------------------
*/
typedef GISTScanListData *GISTScanList;
/* pointer to list of local scans on GiSTs */
-static GISTScanList GISTScans = (GISTScanList) NULL;
+static GISTScanList GISTScans = NULL;
Datum
gistbeginscan(PG_FUNCTION_ARGS)
ItemPointerSetInvalid(&s->currentMarkData);
p = (GISTScanOpaque) s->opaque;
- if (p != (GISTScanOpaque) NULL)
+ if (p != NULL)
{
/* rescan an existing indexscan --- reset state */
gistfreestack(p->s_stack);
gistfreestack(p->s_markstk);
- p->s_stack = p->s_markstk = (GISTSTACK *) NULL;
+ p->s_stack = p->s_markstk = NULL;
p->s_flags = 0x0;
}
else
{
/* initialize opaque data */
p = (GISTScanOpaque) palloc(sizeof(GISTScanOpaqueData));
- p->s_stack = p->s_markstk = (GISTSTACK *) NULL;
+ p->s_stack = p->s_markstk = NULL;
p->s_flags = 0x0;
s->opaque = p;
p->giststate = (GISTSTATE *) palloc(sizeof(GISTSTATE));
else
p->s_flags &= ~GS_MRKBEFORE;
- o = (GISTSTACK *) NULL;
+ o = NULL;
n = p->s_stack;
/* copy the parent stack from the current item data */
- while (n != (GISTSTACK *) NULL)
+ while (n != NULL)
{
tmp = (GISTSTACK *) palloc(sizeof(GISTSTACK));
tmp->gs_child = n->gs_child;
else
p->s_flags &= ~GS_CURBEFORE;
- o = (GISTSTACK *) NULL;
+ o = NULL;
n = p->s_markstk;
/* copy the parent stack from the current item data */
- while (n != (GISTSTACK *) NULL)
+ while (n != NULL)
{
tmp = (GISTSTACK *) palloc(sizeof(GISTSTACK));
tmp->gs_child = n->gs_child;
p = (GISTScanOpaque) s->opaque;
- if (p != (GISTScanOpaque) NULL)
+ if (p != NULL)
{
gistfreestack(p->s_stack);
gistfreestack(p->s_markstk);
GISTScanList l;
GISTScanList prev;
- prev = (GISTScanList) NULL;
+ prev = NULL;
- for (l = GISTScans;
- l != (GISTScanList) NULL && l->gsl_scan != s;
- l = l->gsl_next)
+ for (l = GISTScans; l != NULL && l->gsl_scan != s; l = l->gsl_next)
prev = l;
- if (l == (GISTScanList) NULL)
+ if (l == NULL)
elog(ERROR, "GiST scan list corrupted -- could not find 0x%p",
(void *) s);
- if (prev == (GISTScanList) NULL)
+ if (prev == NULL)
GISTScans = l->gsl_next;
else
prev->gsl_next = l->gsl_next;
Oid relid;
relid = RelationGetRelid(rel);
- for (l = GISTScans; l != (GISTScanList) NULL; l = l->gsl_next)
+ for (l = GISTScans; l != NULL; l = l->gsl_next)
{
if (l->gsl_scan->indexRelation->rd_id == relid)
gistadjone(l->gsl_scan, op, blkno, offnum);
* are looking at already in this transaction, we ignore the update
* request.
*/
-/*ARGSUSED*/
static void
-adjuststack(GISTSTACK *stk,
- BlockNumber blkno)
+adjuststack(GISTSTACK *stk, BlockNumber blkno)
{
- while (stk != (GISTSTACK *) NULL)
+ while (stk != NULL)
{
if (stk->gs_blk == blkno)
stk->gs_child = FirstOffsetNumber;
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/hash/hash.c,v 1.69 2003/11/29 19:51:40 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/access/hash/hash.c,v 1.70 2004/01/07 18:56:23 neilc Exp $
*
* NOTES
* This file contains only the public interface routines.
if (IndexTupleHasNulls(itup))
{
pfree(itup);
- PG_RETURN_POINTER((InsertIndexResult) NULL);
+ PG_RETURN_POINTER(NULL);
}
hitem = _hash_formitem(itup);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/hash/hashscan.c,v 1.32 2003/11/29 19:51:40 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/access/hash/hashscan.c,v 1.33 2004/01/07 18:56:23 neilc Exp $
*
*-------------------------------------------------------------------------
*/
typedef HashScanListData *HashScanList;
-static HashScanList HashScans = (HashScanList) NULL;
+static HashScanList HashScans = NULL;
/*
HashScanList chk,
last;
- last = (HashScanList) NULL;
+ last = NULL;
for (chk = HashScans;
- chk != (HashScanList) NULL && chk->hashsl_scan != scan;
+ chk != NULL && chk->hashsl_scan != scan;
chk = chk->hashsl_next)
last = chk;
- if (chk == (HashScanList) NULL)
+ if (chk == NULL)
elog(ERROR, "hash scan list trashed; can't find 0x%p", (void *) scan);
- if (last == (HashScanList) NULL)
+ if (last == NULL)
HashScans = chk->hashsl_next;
else
last->hashsl_next = chk->hashsl_next;
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.160 2004/01/05 20:36:04 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.161 2004/01/07 18:56:24 neilc Exp $
*
*
* INTERFACE ROUTINES
int linesleft;
ItemPointer tid;
- tid = (tuple->t_data == NULL) ? (ItemPointer) NULL : &(tuple->t_self);
+ tid = (tuple->t_data == NULL) ? NULL : &(tuple->t_self);
/*
* debugging stuff
* check time qualification of tuple, then release lock
*/
HeapTupleSatisfies(tuple, relation, buffer, dp,
- snapshot, 0, (ScanKey) NULL, valid);
+ snapshot, 0, NULL, valid);
LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
*/
HeapTupleSatisfies(&tp, relation, buffer, dp,
- snapshot, 0, (ScanKey) NULL, valid);
+ snapshot, 0, NULL, valid);
linkend = true;
if ((t_data->t_infomask & HEAP_XMIN_COMMITTED) != 0 &&
&(scan->rs_cbuf),
scan->rs_snapshot,
0,
- (ScanKey) NULL);
+ NULL);
}
}
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.110 2003/12/21 01:23:06 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.111 2004/01/07 18:56:24 neilc Exp $
*
*-------------------------------------------------------------------------
*/
{
Buffer rootbuf;
- Assert(stack == (BTStack) NULL);
+ Assert(stack == NULL);
Assert(is_only);
/* create a new root node and update the metapage */
rootbuf = _bt_newroot(rel, buf, rbuf);
BTItem ritem;
Buffer pbuf;
- if (stack == (BTStack) NULL)
+ if (stack == NULL)
{
BTPageOpaque lpageop;
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtree.c,v 1.108 2003/11/29 19:51:40 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtree.c,v 1.109 2004/01/07 18:56:24 neilc Exp $
*
*-------------------------------------------------------------------------
*/
if (scan->numberOfKeys > 0)
so->keyData = (ScanKey) palloc(scan->numberOfKeys * sizeof(ScanKeyData));
else
- so->keyData = (ScanKey) NULL;
+ so->keyData = NULL;
scan->opaque = so;
}
ItemPointerSetInvalid(iptr);
}
- if (so->keyData != (ScanKey) NULL)
+ if (so->keyData != NULL)
pfree(so->keyData);
pfree(so);
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.79 2003/11/29 19:51:40 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.80 2004/01/07 18:56:24 neilc Exp $
*
*-------------------------------------------------------------------------
*/
/* create initial page */
_bt_blnewpage(index, &(state->btps_buf), &(state->btps_page), level);
- state->btps_minkey = (BTItem) NULL;
+ state->btps_minkey = NULL;
/* initialize lastoff so first item goes into P_FIRSTKEY */
state->btps_lastoff = P_HIKEY;
state->btps_level = level;
else
state->btps_full = PageGetPageSize(state->btps_page) / 10;
/* no parent level, yet */
- state->btps_next = (BTPageState *) NULL;
+ state->btps_next = NULL;
return state;
}
* we don't have a parent, we have to create one; this adds a new
* btree level.
*/
- if (state->btps_next == (BTPageState *) NULL)
+ if (state->btps_next == NULL)
state->btps_next = _bt_pagestate(index, state->btps_level + 1);
Assert(state->btps_minkey != NULL);
/*
* Each iteration of this loop completes one more level of the tree.
*/
- for (s = state; s != (BTPageState *) NULL; s = s->btps_next)
+ for (s = state; s != NULL; s = s->btps_next)
{
BlockNumber blkno;
BTPageOpaque opaque;
* key. This may cause the last page of the parent level to
* split, but that's not a problem -- we haven't gotten to it yet.
*/
- if (s->btps_next == (BTPageState *) NULL)
+ if (s->btps_next == NULL)
{
opaque->btpo_flags |= BTP_ROOT;
rootblkno = blkno;
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtutils.c,v 1.57 2003/11/29 19:51:40 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtutils.c,v 1.58 2004/01/07 18:56:24 neilc Exp $
*
*-------------------------------------------------------------------------
*/
{
BTStack ostack;
- while (stack != (BTStack) NULL)
+ while (stack != NULL)
{
ostack = stack;
stack = stack->bts_parent;
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.9 2003/12/14 00:34:47 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.10 2004/01/07 18:56:24 neilc Exp $
*
*-------------------------------------------------------------------------
*/
/* if the two pages are all of their level, it's a only-page split */
is_only = P_LEFTMOST(lpageop) && P_RIGHTMOST(rpageop);
- _bt_insert_parent(reln, lbuf, rbuf, (BTStack) NULL,
+ _bt_insert_parent(reln, lbuf, rbuf, NULL,
split->is_root, is_only);
}
incomplete_splits = NIL;
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/rtree/rtget.c,v 1.30 2003/11/29 19:51:40 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/access/rtree/rtget.c,v 1.31 2004/01/07 18:56:24 neilc Exp $
*
*-------------------------------------------------------------------------
*/
while (n < FirstOffsetNumber || n > maxoff)
{
ReleaseBuffer(b);
- if (so->s_stack == (RTSTACK *) NULL)
+ if (so->s_stack == NULL)
return false;
stk = so->s_stack;
while (n < FirstOffsetNumber || n > maxoff)
{
ReleaseBuffer(b);
- if (so->s_stack == (RTSTACK *) NULL)
+ if (so->s_stack == NULL)
return false;
stk = so->s_stack;
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/rtree/rtproc.c,v 1.39 2003/11/29 19:51:40 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/access/rtree/rtproc.c,v 1.40 2004/01/07 18:56:24 neilc Exp $
*
*-------------------------------------------------------------------------
*/
/* NB: size is an output argument */
float *size = (float *) PG_GETARG_POINTER(1);
- if (a == (BOX *) NULL || a->high.x <= a->low.x || a->high.y <= a->low.y)
+ if (a == NULL || a->high.x <= a->low.x || a->high.y <= a->low.y)
*size = 0.0;
else
*size = (float) ((a->high.x - a->low.x) * (a->high.y - a->low.y));
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/rtree/rtree.c,v 1.81 2003/11/29 19:51:40 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/access/rtree/rtree.c,v 1.82 2004/01/07 18:56:24 neilc Exp $
*
*-------------------------------------------------------------------------
*/
if (IndexTupleHasNulls(itup))
{
pfree(itup);
- PG_RETURN_POINTER((InsertIndexResult) NULL);
+ PG_RETURN_POINTER(NULL);
}
initRtstate(&rtState, r);
blk = P_ROOT;
buffer = InvalidBuffer;
- stack = (RTSTACK *) NULL;
+ stack = NULL;
do
{
newd_size;
Buffer b;
- if (stk == (RTSTACK *) NULL)
+ if (stk == NULL)
return;
b = ReadBuffer(r, stk->rts_blk);
newdatum;
InsertIndexResult res;
- if (stk == (RTSTACK *) NULL)
+ if (stk == NULL)
{
rtnewroot(r, ltup, rtup);
return;
*/
/* to keep compiler quiet */
- cost_vector = (SPLITCOST *) NULL;
+ cost_vector = NULL;
if (num_tuples_without_seeds > 0)
{
{
RTSTACK *p;
- while (s != (RTSTACK *) NULL)
+ while (s != NULL)
{
p = s->rts_parent;
pfree(s);
*/
/* walk through the entire index */
- iscan = index_beginscan(NULL, rel, SnapshotAny, 0, (ScanKey) NULL);
+ iscan = index_beginscan(NULL, rel, SnapshotAny, 0, NULL);
/* including killed tuples */
iscan->ignore_killed_tuples = false;
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/rtree/rtscan.c,v 1.50 2003/11/29 19:51:40 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/access/rtree/rtscan.c,v 1.51 2004/01/07 18:56:24 neilc Exp $
*
*-------------------------------------------------------------------------
*/
typedef RTScanListData *RTScanList;
/* pointer to list of local scans on rtrees */
-static RTScanList RTScans = (RTScanList) NULL;
+static RTScanList RTScans = NULL;
Datum
rtbeginscan(PG_FUNCTION_ARGS)
ItemPointerSetInvalid(&s->currentMarkData);
p = (RTreeScanOpaque) s->opaque;
- if (p != (RTreeScanOpaque) NULL)
+ if (p != NULL)
{
/* rescan an existing indexscan --- reset state */
freestack(p->s_stack);
freestack(p->s_markstk);
- p->s_stack = p->s_markstk = (RTSTACK *) NULL;
+ p->s_stack = p->s_markstk = NULL;
p->s_flags = 0x0;
}
else
{
/* initialize opaque data */
p = (RTreeScanOpaque) palloc(sizeof(RTreeScanOpaqueData));
- p->s_stack = p->s_markstk = (RTSTACK *) NULL;
+ p->s_stack = p->s_markstk = NULL;
p->s_internalNKey = s->numberOfKeys;
p->s_flags = 0x0;
s->opaque = p;
else
p->s_flags &= ~RTS_MRKBEFORE;
- o = (RTSTACK *) NULL;
+ o = NULL;
n = p->s_stack;
/* copy the parent stack from the current item data */
- while (n != (RTSTACK *) NULL)
+ while (n != NULL)
{
tmp = (RTSTACK *) palloc(sizeof(RTSTACK));
tmp->rts_child = n->rts_child;
else
p->s_flags &= ~RTS_CURBEFORE;
- o = (RTSTACK *) NULL;
+ o = NULL;
n = p->s_markstk;
/* copy the parent stack from the current item data */
- while (n != (RTSTACK *) NULL)
+ while (n != NULL)
{
tmp = (RTSTACK *) palloc(sizeof(RTSTACK));
tmp->rts_child = n->rts_child;
p = (RTreeScanOpaque) s->opaque;
- if (p != (RTreeScanOpaque) NULL)
+ if (p != NULL)
{
freestack(p->s_stack);
freestack(p->s_markstk);
RTScanList l;
RTScanList prev;
- prev = (RTScanList) NULL;
+ prev = NULL;
for (l = RTScans;
- l != (RTScanList) NULL && l->rtsl_scan != s;
+ l != NULL && l->rtsl_scan != s;
l = l->rtsl_next)
prev = l;
- if (l == (RTScanList) NULL)
+ if (l == NULL)
elog(ERROR, "rtree scan list corrupted -- could not find 0x%p",
(void *) s);
- if (prev == (RTScanList) NULL)
+ if (prev == NULL)
RTScans = l->rtsl_next;
else
prev->rtsl_next = l->rtsl_next;
Oid relid;
relid = RelationGetRelid(r);
- for (l = RTScans; l != (RTScanList) NULL; l = l->rtsl_next)
+ for (l = RTScans; l != NULL; l = l->rtsl_next)
{
if (RelationGetRelid(l->rtsl_scan->indexRelation) == relid)
rtadjone(l->rtsl_scan, op, blkno, offnum);
* are looking at already in this transaction, we ignore the update
* request.
*/
-/*ARGSUSED*/
static void
-adjuststack(RTSTACK *stk,
- BlockNumber blkno)
+adjuststack(RTSTACK *stk, BlockNumber blkno)
{
- while (stk != (RTSTACK *) NULL)
+ while (stk != NULL)
{
if (stk->rts_blk == blkno)
stk->rts_child = FirstOffsetNumber;
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/transam/varsup.c,v 1.53 2003/11/29 19:51:40 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/varsup.c,v 1.54 2004/01/07 18:56:24 neilc Exp $
*
*-------------------------------------------------------------------------
*/
* (SInvalLock would then mean primarily that PROCs couldn't be added/
* removed while holding the lock.)
*/
- if (MyProc != (PGPROC *) NULL)
+ if (MyProc != NULL)
MyProc->xid = xid;
LWLockRelease(XidGenLock);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.158 2003/12/02 19:26:47 joe Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.159 2004/01/07 18:56:24 neilc Exp $
*
* NOTES
* Transaction aborts can now occur two ways:
* as running as well or it will see two tuple versions - one deleted
* by xid 1 and one inserted by xid 0. See notes in GetSnapshotData.
*/
- if (MyProc != (PGPROC *) NULL)
+ if (MyProc != NULL)
{
/* Lock SInvalLock because that's what GetSnapshotData uses. */
LWLockAcquire(SInvalLock, LW_EXCLUSIVE);
* this must be done _before_ releasing locks we hold and _after_
* RecordTransactionAbort.
*/
- if (MyProc != (PGPROC *) NULL)
+ if (MyProc != NULL)
{
/* Lock SInvalLock because that's what GetSnapshotData uses. */
LWLockAcquire(SInvalLock, LW_EXCLUSIVE);
}
void
- XactPushRollback(void (*func) (void *), void *data)
+XactPushRollback(void (*func) (void *), void *data)
{
#ifdef XLOG_II
if (_RollbackFunc != NULL)
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/bootstrap/bootparse.y,v 1.63 2003/11/29 19:51:41 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/bootstrap/bootparse.y,v 1.64 2004/01/07 18:56:25 neilc Exp $
*
*-------------------------------------------------------------------------
*/
if (num_columns_read != numattr)
elog(ERROR, "incorrect number of columns in row (expected %d, got %d)",
numattr, num_columns_read);
- if (boot_reldesc == (Relation) NULL)
+ if (boot_reldesc == NULL)
{
elog(ERROR, "relation not open");
err_out();
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.174 2004/01/06 23:55:18 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.175 2004/01/07 18:56:25 neilc Exp $
*
*-------------------------------------------------------------------------
*/
FormData_pg_type am_typ;
};
-static struct typmap **Typ = (struct typmap **) NULL;
-static struct typmap *Ap = (struct typmap *) NULL;
+static struct typmap **Typ = NULL;
+static struct typmap *Ap = NULL;
static int Warnings = 0;
static char Blanks[MAXATTR];
struct _IndexList *il_next;
} IndexList;
-static IndexList *ILHead = (IndexList *) NULL;
+static IndexList *ILHead = NULL;
/* ----------------------------------------------------------------
/* Initialize stuff for bootstrap-file processing */
for (i = 0; i < MAXATTR; i++)
{
- attrtypes[i] = (Form_pg_attribute) NULL;
+ attrtypes[i] = NULL;
Blanks[i] = ' ';
}
for (i = 0; i < STRTABLESIZE; ++i)
if (strlen(relname) >= NAMEDATALEN - 1)
relname[NAMEDATALEN - 1] = '\0';
- if (Typ == (struct typmap **) NULL)
+ if (Typ == NULL)
{
rel = heap_openr(TypeRelationName, NoLock);
- scan = heap_beginscan(rel, SnapshotNow, 0, (ScanKey) NULL);
+ scan = heap_beginscan(rel, SnapshotNow, 0, NULL);
i = 0;
while ((tup = heap_getnext(scan, ForwardScanDirection)) != NULL)
++i;
app = Typ = ALLOC(struct typmap *, i + 1);
while (i-- > 0)
*app++ = ALLOC(struct typmap, 1);
- *app = (struct typmap *) NULL;
- scan = heap_beginscan(rel, SnapshotNow, 0, (ScanKey) NULL);
+ *app = NULL;
+ scan = heap_beginscan(rel, SnapshotNow, 0, NULL);
app = Typ;
while ((tup = heap_getnext(scan, ForwardScanDirection)) != NULL)
{
{
elog(DEBUG4, "close relation %s", relname ? relname : "(null)");
heap_close(boot_reldesc, NoLock);
- boot_reldesc = (Relation) NULL;
+ boot_reldesc = NULL;
}
}
closerel(relname);
}
- if (attrtypes[attnum] == (Form_pg_attribute) NULL)
+ if (attrtypes[attnum] == NULL)
attrtypes[attnum] = AllocateAttribute();
MemSet(attrtypes[attnum], 0, ATTRIBUTE_TUPLE_SIZE);
typeoid = gettype(type);
- if (Typ != (struct typmap **) NULL)
+ if (Typ != NULL)
{
attrtypes[attnum]->atttypid = Ap->am_oid;
attlen = attrtypes[attnum]->attlen = Ap->am_typ.typlen;
elog(DEBUG4, "inserting column %d value \"%s\"", i, value);
- if (Typ != (struct typmap **) NULL)
+ if (Typ != NULL)
{
struct typmap *ap;
HeapTuple tup;
struct typmap **app;
- if (Typ != (struct typmap **) NULL)
+ if (Typ != NULL)
{
- for (app = Typ; *app != (struct typmap *) NULL; app++)
+ for (app = Typ; *app != NULL; app++)
{
if (strncmp(NameStr((*app)->am_typ.typname), type, NAMEDATALEN) == 0)
{
}
elog(DEBUG4, "external type: %s", type);
rel = heap_openr(TypeRelationName, NoLock);
- scan = heap_beginscan(rel, SnapshotNow, 0, (ScanKey) NULL);
+ scan = heap_beginscan(rel, SnapshotNow, 0, NULL);
i = 0;
while ((tup = heap_getnext(scan, ForwardScanDirection)) != NULL)
++i;
app = Typ = ALLOC(struct typmap *, i + 1);
while (i-- > 0)
*app++ = ALLOC(struct typmap, 1);
- *app = (struct typmap *) NULL;
- scan = heap_beginscan(rel, SnapshotNow, 0, (ScanKey) NULL);
+ *app = NULL;
+ scan = heap_beginscan(rel, SnapshotNow, 0, NULL);
app = Typ;
while ((tup = heap_getnext(scan, ForwardScanDirection)) != NULL)
{
*/
if (nogc == NULL)
- nogc = AllocSetContextCreate((MemoryContext) NULL,
+ nogc = AllocSetContextCreate(NULL,
"BootstrapNoGC",
ALLOCSET_DEFAULT_MINSIZE,
ALLOCSET_DEFAULT_INITSIZE,
}
void
-build_indices()
+build_indices(void)
{
- for (; ILHead != (IndexList *) NULL; ILHead = ILHead->il_next)
+ for (; ILHead != NULL; ILHead = ILHead->il_next)
{
Relation heap;
Relation ind;
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.224 2003/12/28 21:57:36 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.225 2004/01/07 18:56:25 neilc Exp $
*
*
* INTERFACE ROUTINES
scan = heap_beginscan(heapRelation, /* relation */
snapshot, /* seeself */
0, /* number of keys */
- (ScanKey) NULL); /* scan key */
+ NULL); /* scan key */
reltuples = 0;
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/catalog/pg_type.c,v 1.91 2003/11/29 19:51:46 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/pg_type.c,v 1.92 2004/01/07 18:56:25 neilc Exp $
*
*-------------------------------------------------------------------------
*/
baseType,
(defaultTypeBin ?
stringToNode(defaultTypeBin) :
- (void *) NULL),
+ NULL),
rebuildDeps);
/*
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.106 2003/12/12 18:45:08 petere Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.107 2004/01/07 18:56:25 neilc Exp $
*
*-------------------------------------------------------------------------
*/
lRel = heap_openr(ListenerRelationName, AccessExclusiveLock);
/* Detect whether we are already listening on this relname */
- scan = heap_beginscan(lRel, SnapshotNow, 0, (ScanKey) NULL);
+ scan = heap_beginscan(lRel, SnapshotNow, 0, NULL);
while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
{
Form_pg_listener listener = (Form_pg_listener) GETSTRUCT(tuple);
lRel = heap_openr(ListenerRelationName, AccessExclusiveLock);
- scan = heap_beginscan(lRel, SnapshotNow, 0, (ScanKey) NULL);
+ scan = heap_beginscan(lRel, SnapshotNow, 0, NULL);
while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
{
Form_pg_listener listener = (Form_pg_listener) GETSTRUCT(tuple);
lRel = heap_openr(ListenerRelationName, AccessExclusiveLock);
tdesc = RelationGetDescr(lRel);
- scan = heap_beginscan(lRel, SnapshotNow, 0, (ScanKey) NULL);
+ scan = heap_beginscan(lRel, SnapshotNow, 0, NULL);
while ((lTuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
{
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.129 2003/12/15 22:56:44 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.130 2004/01/07 18:56:25 neilc Exp $
*
*-------------------------------------------------------------------------
*/
datum = heap_getattr(tuple, Anum_pg_database_datconfig,
RelationGetDescr(rel), &isnull);
- a = isnull ? ((ArrayType *) NULL) : DatumGetArrayTypeP(datum);
+ a = isnull ? NULL : DatumGetArrayTypeP(datum);
if (valuestr)
a = GUCArrayAdd(a, stmt->variable, valuestr);
* Copyright (c) 2002-2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.24 2003/11/29 19:51:47 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.25 2004/01/07 18:56:25 neilc Exp $
*
*-------------------------------------------------------------------------
*/
* out-of-memory failure only wastes memory and doesn't leave us with
* an incomplete (ie corrupt) hashtable entry.
*/
- qstring = query_string ? pstrdup(query_string) : (char *) NULL;
+ qstring = query_string ? pstrdup(query_string) : NULL;
query_list = (List *) copyObject(query_list);
plan_list = (List *) copyObject(plan_list);
argtype_list = listCopy(argtype_list);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.106 2003/12/14 00:34:47 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.107 2004/01/07 18:56:25 neilc Exp $
*
*-------------------------------------------------------------------------
*/
}
/* INCREMENT BY */
- if (increment_by != (DefElem *) NULL)
+ if (increment_by != NULL)
{
new->increment_by = defGetInt64(increment_by);
if (new->increment_by == 0)
new->increment_by = 1;
/* CYCLE */
- if (is_cycled != (DefElem *) NULL)
+ if (is_cycled != NULL)
{
new->is_cycled = intVal(is_cycled->arg);
Assert(new->is_cycled == false || new->is_cycled == true);
new->is_cycled = false;
/* MAXVALUE (null arg means NO MAXVALUE) */
- if (max_value != (DefElem *) NULL && max_value->arg)
+ if (max_value != NULL && max_value->arg)
{
new->max_value = defGetInt64(max_value);
}
- else if (isInit || max_value != (DefElem *) NULL)
+ else if (isInit || max_value != NULL)
{
if (new->increment_by > 0)
new->max_value = SEQ_MAXVALUE; /* ascending seq */
}
/* MINVALUE (null arg means NO MINVALUE) */
- if (min_value != (DefElem *) NULL && min_value->arg)
+ if (min_value != NULL && min_value->arg)
{
new->min_value = defGetInt64(min_value);
}
- else if (isInit || min_value != (DefElem *) NULL)
+ else if (isInit || min_value != NULL)
{
if (new->increment_by > 0)
new->min_value = 1; /* ascending seq */
}
/* START WITH */
- if (last_value != (DefElem *) NULL)
+ if (last_value != NULL)
new->last_value = defGetInt64(last_value);
else if (isInit)
{
}
/* CACHE */
- if (cache_value != (DefElem *) NULL)
+ if (cache_value != NULL)
{
new->cache_value = defGetInt64(cache_value);
if (new->cache_value <= 0)
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.131 2003/11/29 19:51:47 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.132 2004/01/07 18:56:25 neilc Exp $
*
*-------------------------------------------------------------------------
*/
datum = SysCacheGetAttr(SHADOWNAME, oldtuple,
Anum_pg_shadow_useconfig, &isnull);
- array = isnull ? ((ArrayType *) NULL) : DatumGetArrayTypeP(datum);
+ array = isnull ? NULL : DatumGetArrayTypeP(datum);
if (valuestr)
array = GUCArrayAdd(array, stmt->variable, valuestr);
/* Fetch old group membership. */
datum = heap_getattr(group_tuple, Anum_pg_group_grolist,
pg_group_dsc, &null);
- oldarray = null ? ((IdList *) NULL) : DatumGetIdListP(datum);
+ oldarray = null ? NULL : DatumGetIdListP(datum);
/* initialize list with old array contents */
newlist = IdArrayToList(oldarray);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.270 2004/01/06 18:07:31 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.271 2004/01/07 18:56:25 neilc Exp $
*
*-------------------------------------------------------------------------
*/
vacrelstats->hasindex = true;
/* Clean/scan index relation(s) */
- if (Irel != (Relation *) NULL)
+ if (Irel != NULL)
{
if (vacuum_pages.num_pages > 0)
{
* removal of dead tuples. But note we are NOT changing
* the real page yet...
*/
- if (tempPage == (Page) NULL)
+ if (tempPage == NULL)
{
Size pageSize;
}
} /* scan along page */
- if (tempPage != (Page) NULL)
+ if (tempPage != NULL)
{
/* Some tuples are removable; figure free space after removal */
PageRepairFragmentation(tempPage, NULL);
if (Nvacpagelist.num_pages > 0)
{
/* vacuum indexes again if needed */
- if (Irel != (Relation *) NULL)
+ if (Irel != NULL)
{
VacPage *vpleft,
*vpright,
void
vac_close_indexes(int nindexes, Relation *Irel)
{
- if (Irel == (Relation *) NULL)
+ if (Irel == NULL)
return;
while (nindexes--)
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
* 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
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
*
* If EXPLAIN, skip creating the "into" relation.
*/
- intoRelationDesc = (Relation) NULL;
+ intoRelationDesc = NULL;
if (do_select_into && !explainOnly)
{
*
* 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;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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))
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))
* sanity checks
*/
if (projInfo == NULL)
- return (TupleTableSlot *) NULL;
+ return NULL;
/*
* get the projection info we want
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
/* 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;
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;
if (slot->ttc_shouldFree && oldtuple != NULL)
heap_freetuple(oldtuple);
- slot->val = (HeapTuple) NULL;
+ slot->val = NULL;
slot->ttc_shouldFree = true; /* probably useless code... */
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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)
/*
}
}
else
- argOidVect = (Oid *) NULL;
+ argOidVect = NULL;
tmp = SysCacheGetAttr(PROCOID,
procedureTuple,
if (es->qd->operation == CMD_UTILITY)
{
ProcessUtility(es->qd->parsetree->utilityStmt, es->qd->dest, NULL);
- return (TupleTableSlot *) NULL;
+ return NULL;
}
/*
paramLI[nargs].kind = PARAM_INVALID;
}
else
- paramLI = (ParamListInfo) NULL;
+ paramLI = NULL;
if (fcache->paramLI)
pfree(fcache->paramLI);
/*
* 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.
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
*/
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,
/* 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;
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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 *));
/*
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.163 2003/11/29 19:51:49 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.164 2004/01/07 18:56:26 neilc Exp $
*
* NOTES
* Path and Plan nodes do not have any readfuncs support, because we
#define strtobool(x) ((*(x) == 't') ? true : false)
#define nullable_string(token,length) \
- ((length) == 0 ? (char *) NULL : debackslash(token, length))
+ ((length) == 0 ? NULL : debackslash(token, length))
static Datum readDatum(bool typbyval);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.165 2004/01/06 04:31:01 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.166 2004/01/07 18:56:26 neilc Exp $
*
*-------------------------------------------------------------------------
*/
plan->qual = qual;
plan->targetlist = tlist;
plan->lefttree = lefttree;
- plan->righttree = (Plan *) NULL;
+ plan->righttree = NULL;
return node;
}
plan->qual = NIL;
plan->targetlist = tlist;
plan->lefttree = lefttree;
- plan->righttree = (Plan *) NULL;
+ plan->righttree = NULL;
return node;
}
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/util/tlist.c,v 1.61 2003/11/29 19:51:51 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/util/tlist.c,v 1.62 2004/01/07 18:56:26 neilc Exp $
*
*-------------------------------------------------------------------------
*/
if (tlentry)
return tlentry->expr;
- return (Node *) NULL;
+ return NULL;
}
#endif
if (tlentry)
return tlentry->resdom;
- return (Resdom *) NULL;
+ return NULL;
}
/*
*
*
* 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
/* 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;
| VariableShowStmt
| ViewStmt
| /*EMPTY*/
- { $$ = (Node *)NULL; }
+ { $$ = NULL; }
;
/*****************************************************************************
}
| NO MAXVALUE
{
- $$ = makeDefElem("maxvalue", (Node *)NULL);
+ $$ = makeDefElem("maxvalue", NULL);
}
| NO MINVALUE
{
- $$ = makeDefElem("minvalue", (Node *)NULL);
+ $$ = makeDefElem("minvalue", NULL);
}
| START opt_with NumericOnly
{
}
| ColLabel
{
- $$ = makeDefElem($1, (Node *)NULL);
+ $$ = makeDefElem($1, NULL);
}
;
/* 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;
RuleActionStmtOrEmpty:
RuleActionStmt { $$ = $1; }
- | /*EMPTY*/ { $$ = (Node *)NULL; }
+ | /*EMPTY*/ { $$ = NULL; }
;
/* change me to select, update, etc. some day */
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
else
{
arginh[i].nsupers = 0;
- arginh[i].supervec = (Oid *) NULL;
+ arginh[i].supervec = NULL;
}
}
}
}
else
- *supervec = (Oid *) NULL;
+ *supervec = NULL;
freeList(visited);
* available with a PostgreSQL-compatible license. Kudos Wilfredo
* Sánchez .
*
- * $PostgreSQL: pgsql/src/backend/port/dynloader/darwin.c,v 1.9 2003/11/29 19:51:54 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/port/dynloader/darwin.c,v 1.10 2004/01/07 18:56:27 neilc Exp $
*/
#include "postgres.h"
else
{
free(symname);
- return (PGFunction) NULL;
+ return NULL;
}
}
strcpy(ret, error_message);
error_message[0] = 0;
- return (ret[0] == 0) ? (char *) NULL : ret;
+ return (ret[0] == 0) ? NULL : ret;
}
void *
#else
void *vp;
- if ((vp = dlopen((char *) file, num)) == (void *) NULL)
+ if ((vp = dlopen((char *) file, num)) == NULL)
snprintf(error_message, sizeof(error_message),
"dlopen '%s' failed. (%s)", file, dlerror());
return vp;
name = buf;
}
#endif
- if ((vp = dlsym(handle, (char *) name)) == (void *) NULL)
+ if ((vp = dlsym(handle, (char *) name)) == NULL)
snprintf(error_message, sizeof(error_message),
"dlsym (%s) failed", name);
return vp;
strcpy(ret, error_message);
error_message[0] = 0;
- return (ret[0] == 0) ? (char *) NULL : ret;
+ return (ret[0] == 0) ? NULL : ret;
}
void *
#else
void *vp;
- if ((vp = dlopen((char *) file, num)) == (void *) NULL)
+ if ((vp = dlopen((char *) file, num)) == NULL)
snprintf(error_message, sizeof(error_message),
"dlopen (%s) failed", file);
return vp;
snprintf(buf, sizeof(buf), "_%s", name);
name = buf;
}
- if ((vp = dlsym(handle, (char *) name)) == (void *) NULL)
+ if ((vp = dlsym(handle, (char *) name)) == NULL)
snprintf(error_message, sizeof(error_message),
"dlsym (%s) failed", name);
return vp;
strcpy(ret, error_message);
error_message[0] = 0;
- return (ret[0] == 0) ? (char *) NULL : ret;
+ return (ret[0] == 0) ? NULL : ret;
}
void *
#else
void *vp;
- if ((vp = dlopen((char *) file, num)) == (void *) NULL)
+ if ((vp = dlopen((char *) file, num)) == NULL)
snprintf(error_message, sizeof(error_message),
"dlopen (%s) failed", file);
return vp;
snprintf(buf, sizeof(buf), "_%s", name);
name = buf;
}
- if ((vp = dlsym(handle, (char *) name)) == (void *) NULL)
+ if ((vp = dlsym(handle, (char *) name)) == NULL)
snprintf(error_message, sizeof(error_message),
"dlsym (%s) failed", name);
return vp;
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/port/dynloader/qnx4.c,v 1.5 2003/11/29 19:51:54 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/port/dynloader/qnx4.c,v 1.6 2004/01/07 18:56:27 neilc Exp $
*
* NOTES
*
void *
pg_dlopen(char *filename)
{
- return (void *) NULL;
+ return NULL;
}
PGFunction
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/port/sysv_shmem.c,v 1.27 2003/12/01 22:15:37 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/port/sysv_shmem.c,v 1.28 2004/01/07 18:56:27 neilc Exp $
*
*-------------------------------------------------------------------------
*/
static void
IpcMemoryDelete(int status, Datum shmId)
{
- if (shmctl(DatumGetInt32(shmId), IPC_RMID, (struct shmid_ds *) NULL) < 0)
+ if (shmctl(DatumGetInt32(shmId), IPC_RMID, NULL) < 0)
elog(LOG, "shmctl(%d, %d, 0) failed: %m",
DatumGetInt32(shmId), IPC_RMID);
}
* quietly.
*/
shmdt(memAddress);
- if (shmctl(shmid, IPC_RMID, (struct shmid_ds *) NULL) < 0)
+ if (shmctl(shmid, IPC_RMID, NULL) < 0)
continue;
/*
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.354 2004/01/06 23:15:22 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.355 2004/01/07 18:56:27 neilc Exp $
*
* NOTES
*
int ReservedBackends;
-static char *progname = (char *) NULL;
+static char *progname = NULL;
/* The socket(s) we're listening to. */
#define MAXLISTEN 10
PG_SETMASK(&UnBlockSig);
- if (select(nSockets, &rmask, (fd_set *) NULL,
- (fd_set *) NULL, &timeout) < 0)
+ if (select(nSockets, &rmask, NULL, NULL, &timeout) < 0)
{
PG_SETMASK(&BlockSig);
if (errno == EINTR || errno == EWOULDBLOCK)
if (port->cmdline_options)
split_opts(av, &ac, port->cmdline_options);
- av[ac] = (char *) NULL;
+ av[ac] = NULL;
Assert(ac < maxac);
av[ac++] = "template1";
#endif
- av[ac] = (char *) NULL;
+ av[ac] = NULL;
Assert(ac < lengthof(av));
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.150 2003/12/20 22:18:02 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.151 2004/01/07 18:56:27 neilc Exp $
*
*-------------------------------------------------------------------------
*/
* it to disk. Remember to unlock BufMgrLock while doing the IOs.
*/
inProgress = FALSE;
- for (buf = (BufferDesc *) NULL; buf == (BufferDesc *) NULL;)
+ for (buf = NULL; buf == NULL;)
{
buf = StrategyGetBuffer();
if ((buf->flags & BM_IO_ERROR) != 0)
{
UnpinBuffer(buf);
- buf = (BufferDesc *) NULL;
+ buf = NULL;
continue;
}
buf->flags &= ~BM_IO_IN_PROGRESS;
TerminateBufferIO(buf);
UnpinBuffer(buf);
- buf = (BufferDesc *) NULL;
+ buf = NULL;
}
else
{
buf->flags &= ~BM_IO_IN_PROGRESS;
TerminateBufferIO(buf);
UnpinBuffer(buf);
- buf = (BufferDesc *) NULL;
+ buf = NULL;
}
/*
bufHdr->flags &= ~BM_JUST_DIRTIED;
LWLockRelease(BufMgrLock);
- if (reln == (Relation) NULL)
+ if (reln == NULL)
{
status = smgrblindwrt(DEFAULT_SMGR,
bufHdr->tag.rnode,
LWLockRelease(BufMgrLock);
/* drop refcnt obtained by RelationNodeCacheGetRelation */
- if (reln != (Relation) NULL)
+ if (reln != NULL)
RelationDecrementReferenceCount(reln);
}
reln = RelationNodeCacheGetRelation(bufHdr->tag.rnode);
- if (reln != (Relation) NULL)
+ if (reln != NULL)
{
status = smgrwrite(DEFAULT_SMGR, reln,
bufHdr->tag.blockNum,
}
/* drop relcache refcnt incremented by RelationNodeCacheGetRelation */
- if (reln != (Relation) NULL)
+ if (reln != NULL)
RelationDecrementReferenceCount(reln);
/* Pop the error context stack */
* Note : We assume that nested buffer IO never occur.
* i.e at most one io_in_progress lock is held per proc.
*/
-static BufferDesc *InProgressBuf = (BufferDesc *) NULL;
+static BufferDesc *InProgressBuf = NULL;
static bool IsForInput;
/*
{
Assert(buf == InProgressBuf);
LWLockRelease(buf->io_in_progress_lock);
- InProgressBuf = (BufferDesc *) NULL;
+ InProgressBuf = NULL;
}
/*
void
InitBufferIO(void)
{
- InProgressBuf = (BufferDesc *) NULL;
+ InProgressBuf = NULL;
}
#endif
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/buffer/localbuf.c,v 1.50 2003/11/29 19:51:56 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/buffer/localbuf.c,v 1.51 2004/01/07 18:56:27 neilc Exp $
*
*-------------------------------------------------------------------------
*/
LocalBufferAlloc(Relation reln, BlockNumber blockNum, bool *foundPtr)
{
int i;
- BufferDesc *bufHdr = (BufferDesc *) NULL;
+ BufferDesc *bufHdr = NULL;
/* a low tech search for now -- not optimized for scans */
for (i = 0; i < NLocBuffer; i++)
Relation bufrel = RelationNodeCacheGetRelation(bufHdr->tag.rnode);
/* flush this page */
- if (bufrel == (Relation) NULL)
+ if (bufrel == NULL)
{
smgrblindwrt(DEFAULT_SMGR,
bufHdr->tag.rnode,
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/lmgr/proc.c,v 1.143 2003/12/25 03:52:51 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/lmgr/proc.c,v 1.144 2004/01/07 18:56:27 neilc Exp $
*
*-------------------------------------------------------------------------
*/
/* Proc should be sleeping ... */
if (proc->links.prev == INVALID_OFFSET ||
proc->links.next == INVALID_OFFSET)
- return (PGPROC *) NULL;
+ return NULL;
/* Save next process before we zap the list link */
retProc = (PGPROC *) MAKE_PTR(proc->links.next);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/smgr/md.c,v 1.100 2004/01/06 18:07:31 neilc Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/smgr/md.c,v 1.101 2004/01/07 18:56:27 neilc Exp $
*
*-------------------------------------------------------------------------
*/
} MdfdVec;
static int Nfds = 100; /* initial/current size of Md_fdvec array */
-static MdfdVec *Md_fdvec = (MdfdVec *) NULL;
+static MdfdVec *Md_fdvec = NULL;
static int Md_Free = -1; /* head of freelist of unused fdvec
* entries */
static int CurFd = 0; /* first never-used fdvec index */
Md_fdvec[vfd].mdfd_vfd = fd;
Md_fdvec[vfd].mdfd_flags = (uint16) 0;
#ifndef LET_OS_MANAGE_FILESIZE
- Md_fdvec[vfd].mdfd_chain = (MdfdVec *) NULL;
+ Md_fdvec[vfd].mdfd_chain = NULL;
#endif
return vfd;
Md_fdvec[vfd].mdfd_vfd = fd;
Md_fdvec[vfd].mdfd_flags = (uint16) 0;
#ifndef LET_OS_MANAGE_FILESIZE
- Md_fdvec[vfd].mdfd_chain = (MdfdVec *) NULL;
+ Md_fdvec[vfd].mdfd_chain = NULL;
Assert(_mdnblocks(fd, BLCKSZ) <= ((BlockNumber) RELSEG_SIZE));
#endif
MdfdVec *v;
#ifndef LET_OS_MANAGE_FILESIZE
- for (v = &Md_fdvec[fd]; v != (MdfdVec *) NULL;)
+ for (v = &Md_fdvec[fd]; v != NULL;)
{
MdfdVec *ov = v;
pfree(ov);
}
- Md_fdvec[fd].mdfd_chain = (MdfdVec *) NULL;
+ Md_fdvec[fd].mdfd_chain = NULL;
#else
v = &Md_fdvec[fd];
- if (v != (MdfdVec *) NULL)
+ if (v != NULL)
{
if (v->mdfd_vfd >= 0)
FileClose(v->mdfd_vfd);
* levels to handle that scenario by closing and re-opening the md
* fd.)
*/
- while (v->mdfd_chain != (MdfdVec *) NULL)
+ while (v->mdfd_chain != NULL)
{
segno++;
v = v->mdfd_chain;
*/
segno++;
- if (v->mdfd_chain == (MdfdVec *) NULL)
+ if (v->mdfd_chain == NULL)
{
/*
* Because we pass O_CREAT, we will create the next segment
* worth.
*/
v->mdfd_chain = _mdfd_openseg(reln, segno, O_CREAT);
- if (v->mdfd_chain == (MdfdVec *) NULL)
+ if (v->mdfd_chain == NULL)
elog(ERROR, "could not count blocks of \"%s\": %m",
RelationGetRelationName(reln));
}
#ifndef LET_OS_MANAGE_FILESIZE
priorblocks = 0;
- while (v != (MdfdVec *) NULL)
+ while (v != NULL)
{
MdfdVec *ov = v;
if (FileTruncate(v->mdfd_vfd, lastsegblocks * BLCKSZ) < 0)
return InvalidBlockNumber;
v = v->mdfd_chain;
- ov->mdfd_chain = (MdfdVec *) NULL;
+ ov->mdfd_chain = NULL;
}
else
{
pfree(fullpath);
if (fd < 0)
- return (MdfdVec *) NULL;
+ return NULL;
/* allocate an mdfdvec entry for it */
v = (MdfdVec *) MemoryContextAlloc(MdCxt, sizeof(MdfdVec));
v->mdfd_vfd = fd;
v->mdfd_flags = (uint16) 0;
#ifndef LET_OS_MANAGE_FILESIZE
- v->mdfd_chain = (MdfdVec *) NULL;
+ v->mdfd_chain = NULL;
Assert(_mdnblocks(fd, BLCKSZ) <= ((BlockNumber) RELSEG_SIZE));
#endif
i++, segno--)
{
- if (v->mdfd_chain == (MdfdVec *) NULL)
+ if (v->mdfd_chain == NULL)
{
/*
* We will create the next segment only if the target block is
*/
v->mdfd_chain = _mdfd_openseg(reln, i, (segno == 1) ? O_CREAT : 0);
- if (v->mdfd_chain == (MdfdVec *) NULL)
+ if (v->mdfd_chain == NULL)
elog(ERROR, "could not open segment %u of relation \"%s\" (target block %u): %m",
i, RelationGetRelationName(reln), blkno);
}
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/storage/smgr/mm.c,v 1.35 2003/11/29 19:51:57 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/storage/smgr/mm.c,v 1.36 2004/01/07 18:56:27 neilc Exp $
*
*-------------------------------------------------------------------------
*/
mmsize += MAXALIGN((MMNBUFFERS * sizeof(MMCacheTag)));
mmcacheblk = (char *) ShmemInitStruct("Main memory smgr", mmsize, &found);
- if (mmcacheblk == (char *) NULL)
+ if (mmcacheblk == NULL)
{
LWLockRelease(MMCacheLock);
return SM_FAIL;
MMNBUFFERS, MMNBUFFERS,
&info, (HASH_ELEM | HASH_FUNCTION));
- if (MMCacheHT == (HTAB *) NULL)
+ if (MMCacheHT == NULL)
{
LWLockRelease(MMCacheLock);
return SM_FAIL;
MMNRELATIONS, MMNRELATIONS,
&info, (HASH_ELEM | HASH_FUNCTION));
- if (MMRelCacheHT == (HTAB *) NULL)
+ if (MMRelCacheHT == NULL)
{
LWLockRelease(MMCacheLock);
return SM_FAIL;
(void *) &tag,
HASH_ENTER, &found);
- if (entry == (MMRelHashEntry *) NULL)
+ if (entry == NULL)
{
LWLockRelease(MMCacheLock);
ereport(FATAL,
entry = (MMHashEntry *) hash_search(MMCacheHT,
(void *) &MMBlockTags[i],
HASH_REMOVE, NULL);
- if (entry == (MMHashEntry *) NULL)
+ if (entry == NULL)
{
LWLockRelease(MMCacheLock);
elog(FATAL, "cache hash table corrupted");
(void *) &rtag,
HASH_REMOVE, NULL);
- if (rentry == (MMRelHashEntry *) NULL)
+ if (rentry == NULL)
{
LWLockRelease(MMCacheLock);
elog(FATAL, "rel cache hash table corrupted");
rentry = (MMRelHashEntry *) hash_search(MMRelCacheHT,
(void *) &rtag,
HASH_FIND, NULL);
- if (rentry == (MMRelHashEntry *) NULL)
+ if (rentry == NULL)
{
LWLockRelease(MMCacheLock);
elog(FATAL, "rel cache hash table corrupted");
entry = (MMHashEntry *) hash_search(MMCacheHT,
(void *) &tag,
HASH_ENTER, &found);
- if (entry == (MMHashEntry *) NULL || found)
+ if (entry == NULL || found)
{
LWLockRelease(MMCacheLock);
elog(FATAL, "cache hash table corrupted");
(void *) &tag,
HASH_FIND, NULL);
- if (entry == (MMHashEntry *) NULL)
+ if (entry == NULL)
{
/* reading nonexistent pages is defined to fill them with zeroes */
LWLockRelease(MMCacheLock);
(void *) &tag,
HASH_FIND, NULL);
- if (entry == (MMHashEntry *) NULL)
+ if (entry == NULL)
{
LWLockRelease(MMCacheLock);
elog(FATAL, "cache hash table missing requested page");
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/tcop/fastpath.c,v 1.70 2003/11/29 19:51:57 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/tcop/fastpath.c,v 1.71 2004/01/07 18:56:27 neilc Exp $
*
* NOTES
* This cruft is the server side of PQfn.
Form_pg_proc pp;
Assert(OidIsValid(func_id));
- Assert(fip != (struct fp_info *) NULL);
+ Assert(fip != NULL);
/*
* Since the validity of this structure is determined by whether the
#
#
# IDENTIFICATION
-# $PostgreSQL: pgsql/src/backend/utils/Gen_fmgrtab.sh,v 1.28 2004/01/04 05:57:21 tgl Exp $
+# $PostgreSQL: pgsql/src/backend/utils/Gen_fmgrtab.sh,v 1.29 2004/01/07 18:56:28 neilc Exp $
#
#-------------------------------------------------------------------------
/* dummy entry is easier than getting rid of comma after last real one */
/* (not that there has ever been anything wrong with *having* a
comma after the last field in an array initializer) */
- { 0, NULL, 0, false, false, (PGFunction) NULL }
+ { 0, NULL, 0, false, false, NULL }
};
/* Note fmgr_nbuiltins excludes the dummy entry */
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.101 2003/11/29 19:51:57 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.102 2004/01/07 18:56:28 neilc Exp $
*
*-------------------------------------------------------------------------
*/
retval->size = nbytes;
retval->ndim = ndim;
retval->elemtype = element_type;
- memcpy((char *) ARR_DIMS(retval), (char *) dim,
- ndim * sizeof(int));
- memcpy((char *) ARR_LBOUND(retval), (char *) lBound,
- ndim * sizeof(int));
+ memcpy(ARR_DIMS(retval), dim, ndim * sizeof(int));
+ memcpy(ARR_LBOUND(retval), lBound, ndim * sizeof(int));
CopyArrayEls(ARR_DATA_PTR(retval), dataPtr, nitems,
typlen, typbyval, typalign, true);
retval->size = nbytes;
retval->ndim = ndim;
retval->elemtype = element_type;
- memcpy((char *) ARR_DIMS(retval), (char *) dim,
- ndim * sizeof(int));
- memcpy((char *) ARR_LBOUND(retval), (char *) lBound,
- ndim * sizeof(int));
+ memcpy(ARR_DIMS(retval), dim, ndim * sizeof(int));
+ memcpy(ARR_LBOUND(retval), lBound, ndim * sizeof(int));
CopyArrayEls(ARR_DATA_PTR(retval), dataPtr, nitems,
typlen, typbyval, typalign, true);
char *arraydataptr,
*retptr;
- if (array == (ArrayType *) NULL)
+ if (array == NULL)
RETURN_NULL(Datum);
if (arraylen > 0)
int bytes,
span[MAXDIM];
- if (array == (ArrayType *) NULL)
+ if (array == NULL)
RETURN_NULL(ArrayType *);
if (arraylen > 0)
lenbefore,
lenafter;
- if (array == (ArrayType *) NULL)
+ if (array == NULL)
RETURN_NULL(ArrayType *);
if (arraylen > 0)
lenbefore,
lenafter;
- if (array == (ArrayType *) NULL)
+ if (array == NULL)
RETURN_NULL(ArrayType *);
- if (srcArray == (ArrayType *) NULL)
+ if (srcArray == NULL)
return array;
if (arraylen > 0)
result->ndim = ndims;
result->flags = 0;
result->elemtype = elmtype;
- memcpy((char *) ARR_DIMS(result), (char *) dims, ndims * sizeof(int));
- memcpy((char *) ARR_LBOUND(result), (char *) lbs, ndims * sizeof(int));
+ memcpy(ARR_DIMS(result), dims, ndims * sizeof(int));
+ memcpy(ARR_LBOUND(result), lbs, ndims * sizeof(int));
CopyArrayEls(ARR_DATA_PTR(result), elems, nelems,
elmlen, elmbyval, elmalign, false);
/* -----------------------------------------------------------------------
* formatting.c
*
- * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.71 2003/12/25 03:36:23 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.72 2004/01/07 18:56:28 neilc Exp $
*
*
* Portions Copyright (c) 1999-2003, PostgreSQL Global Development Group
int poz;
if (!KeyWord_INDEX_FILTER(*str))
- return (KeyWord *) NULL;
+ return NULL;
if ((poz = *(index + (*str - ' '))) > -1)
{
return k;
k++;
if (!k->name)
- return (KeyWord *) NULL;
+ return NULL;
} while (*str == *k->name);
}
- return (KeyWord *) NULL;
+ return NULL;
}
static KeySuffix *
if (!strncmp(str, s->name, s->len))
return s;
}
- return (KeySuffix *) NULL;
+ return NULL;
}
/* ----------
}
n->type = NODE_TYPE_CHAR;
n->character = *str;
- n->key = (KeyWord *) NULL;
+ n->key = NULL;
n->suffix = 0;
++n;
x = *str;
{
n->type = NODE_TYPE_CHAR;
n->character = *str;
- n->key = (KeyWord *) NULL;
+ n->key = NULL;
node_set = 1;
last = 0;
str++;
return ent;
}
- return (DCHCacheEntry *) NULL; /* never */
+ return NULL; /* never */
}
static DCHCacheEntry *
i++;
}
- return (DCHCacheEntry *) NULL;
+ return NULL;
}
static text *
i++;
}
- return (NUMCacheEntry *) NULL;
+ return NULL;
}
static void
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/numutils.c,v 1.59 2003/11/29 19:51:59 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/numutils.c,v 1.60 2004/01/07 18:56:28 neilc Exp $
*
*-------------------------------------------------------------------------
*/
* Some versions of strtol treat the empty string as an error, but
* some seem not to. Make an explicit test to be sure we catch it.
*/
- if (s == (char *) NULL)
+ if (s == NULL)
elog(ERROR, "NULL pointer");
if (*s == 0)
ereport(ERROR,
*
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/backend/utils/adt/ri_triggers.c,v 1.65 2003/11/29 19:51:59 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/ri_triggers.c,v 1.66 2004/01/07 18:56:28 neilc Exp $
*
* ----------
*/
* Local data
* ----------
*/
-static HTAB *ri_query_cache = (HTAB *) NULL;
+static HTAB *ri_query_cache = NULL;
/* ----------
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.153 2004/01/05 23:39:54 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.154 2004/01/07 18:56:28 neilc Exp $
*
*-------------------------------------------------------------------------
*/
if (workstr != NULL)
pfree(workstr);
- return (Const *) NULL;
+ return NULL;
}
/*
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.67 2003/11/29 19:52:01 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.68 2004/01/07 18:56:29 neilc Exp $
*
*-------------------------------------------------------------------------
*/
*/
} DynamicFileList;
-static DynamicFileList *file_list = (DynamicFileList *) NULL;
-static DynamicFileList *file_tail = (DynamicFileList *) NULL;
+static DynamicFileList *file_list = NULL;
+static DynamicFileList *file_tail = NULL;
#define SAME_INODE(A,B) ((A).st_ino == (B).inode && (A).st_dev == (B).device)
* Scan the list of loaded FILES to see if the file has been loaded.
*/
for (file_scanner = file_list;
- file_scanner != (DynamicFileList *) NULL &&
+ file_scanner != NULL &&
strcmp(fullname, file_scanner->filename) != 0;
file_scanner = file_scanner->next)
;
- if (file_scanner == (DynamicFileList *) NULL)
+ if (file_scanner == NULL)
{
/*
* Check for same files - different paths (ie, symlink or link)
fullname)));
for (file_scanner = file_list;
- file_scanner != (DynamicFileList *) NULL &&
+ file_scanner != NULL &&
!SAME_INODE(stat_buf, *file_scanner);
file_scanner = file_scanner->next)
;
}
- if (file_scanner == (DynamicFileList *) NULL)
+ if (file_scanner == NULL)
{
/*
* File not loaded yet.
strcpy(file_scanner->filename, fullname);
file_scanner->device = stat_buf.st_dev;
file_scanner->inode = stat_buf.st_ino;
- file_scanner->next = (DynamicFileList *) NULL;
+ file_scanner->next = NULL;
file_scanner->handle = pg_dlopen(fullname);
- if (file_scanner->handle == (void *) NULL)
+ if (file_scanner->handle == NULL)
{
load_error = (char *) pg_dlerror();
free((char *) file_scanner);
}
/* OK to link it into list */
- if (file_list == (DynamicFileList *) NULL)
+ if (file_list == NULL)
file_list = file_scanner;
else
file_tail->next = file_scanner;
/*
* If funcname is NULL, we only wanted to load the file.
*/
- if (funcname == (char *) NULL)
+ if (funcname == NULL)
{
pfree(fullname);
- return (PGFunction) NULL;
+ return NULL;
}
retval = pg_dlsym(file_scanner->handle, funcname);
- if (retval == (PGFunction) NULL && signalNotFound)
+ if (retval == NULL && signalNotFound)
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_FUNCTION),
errmsg("could not find function \"%s\" in file \"%s\"",
prv = file_scanner;
}
- load_external_function(fullname, (char *) NULL, false, (void *) NULL);
+ load_external_function(fullname, NULL, false, NULL);
pfree(fullname);
}
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.78 2004/01/06 23:55:19 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.79 2004/01/07 18:56:29 neilc Exp $
*
*-------------------------------------------------------------------------
*/
else
high = i - 1;
}
- return (const FmgrBuiltin *) NULL;
+ return NULL;
}
/*
if (strcmp(name, fmgr_builtins[i].funcName) == 0)
return fmgr_builtins + i;
}
- return (const FmgrBuiltin *) NULL;
+ return NULL;
}
/*
/* Try to look up the info function */
infofunc = (PGFInfoFunction) lookup_external_function(filehandle,
infofuncname);
- if (infofunc == (PGFInfoFunction) NULL)
+ if (infofunc == NULL)
{
/* Not found --- assume version 0 */
pfree(infofuncname);
-/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.30 2003/12/03 08:49:17 meskes Exp $ */
+/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.31 2004/01/07 18:56:29 neilc Exp $ */
/*
* The aim is to get a simpler inteface to the database routines.
{
struct variable *var_next;
- if (var == (struct variable *) NULL)
+ if (var == NULL)
return;
var_next = var->next;
ECPGfree(var);
static void
free_statement(struct statement * stmt)
{
- if (stmt == (struct statement *) NULL)
+ if (stmt == NULL)
return;
free_variable(stmt->inlist);
free_variable(stmt->outlist);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpgtcl/pgtcl.c,v 1.29 2003/11/29 19:52:11 pgsql Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpgtcl/pgtcl.c,v 1.30 2004/01/07 18:56:29 neilc Exp $
*
*-------------------------------------------------------------------------
*/
Tcl_CreateCommand(interp,
"pg_conndefaults",
Pg_conndefaults,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
Tcl_CreateCommand(interp,
"pg_connect",
Pg_connect,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
Tcl_CreateCommand(interp,
"pg_disconnect",
Pg_disconnect,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
Tcl_CreateCommand(interp,
"pg_exec",
Pg_exec,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
Tcl_CreateCommand(interp,
"pg_select",
Pg_select,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
Tcl_CreateCommand(interp,
"pg_result",
Pg_result,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
Tcl_CreateCommand(interp,
"pg_execute",
Pg_execute,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
Tcl_CreateCommand(interp,
"pg_lo_open",
Pg_lo_open,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
Tcl_CreateCommand(interp,
"pg_lo_close",
Pg_lo_close,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
#ifdef PGTCL_USE_TCLOBJ
Tcl_CreateObjCommand(interp,
"pg_lo_read",
Pg_lo_read,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
Tcl_CreateObjCommand(interp,
"pg_lo_write",
Pg_lo_write,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
#else
Tcl_CreateCommand(interp,
"pg_lo_read",
Pg_lo_read,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
Tcl_CreateCommand(interp,
"pg_lo_write",
Pg_lo_write,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
#endif
Tcl_CreateCommand(interp,
"pg_lo_lseek",
Pg_lo_lseek,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
Tcl_CreateCommand(interp,
"pg_lo_creat",
Pg_lo_creat,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
Tcl_CreateCommand(interp,
"pg_lo_tell",
Pg_lo_tell,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
Tcl_CreateCommand(interp,
"pg_lo_unlink",
Pg_lo_unlink,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
Tcl_CreateCommand(interp,
"pg_lo_import",
Pg_lo_import,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
Tcl_CreateCommand(interp,
"pg_lo_export",
Pg_lo_export,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
Tcl_CreateCommand(interp,
"pg_listen",
Pg_listen,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
Tcl_CreateCommand(interp,
"pg_on_connection_loss",
Pg_on_connection_loss,
- (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ NULL, NULL);
Tcl_PkgProvide(interp, "Pgtcl", "1.4");
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpgtcl/pgtclCmds.c,v 1.76 2003/11/29 19:52:11 pgsql Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpgtcl/pgtclCmds.c,v 1.77 2004/01/07 18:56:29 neilc Exp $
*
*-------------------------------------------------------------------------
*/
char *p;
if (!value)
- return (char *) NULL;
+ return NULL;
#ifdef TCL_ARRAYS_DEBUG
printf("pq_value = '%s'\n", value);
}
/* Check that it is a PG connection and not something else */
- conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
- if (conn == (PGconn *) NULL)
+ conn = PgGetConnectionId(interp, argv[1], NULL);
+ if (conn == NULL)
return TCL_ERROR;
return Tcl_UnregisterChannel(interp, conn_chan);
}
conn = PgGetConnectionId(interp, argv[1], &connid);
- if (conn == (PGconn *) NULL)
+ if (conn == NULL)
return TCL_ERROR;
if (connid->res_copyStatus != RES_COPY_NONE)
}
result = PgGetResultId(interp, argv[1]);
- if (result == (PGresult *) NULL)
+ if (result == NULL)
{
Tcl_AppendResult(interp, "\n",
argv[1], " is not a valid query result", 0);
* Get the connection and make sure no COPY command is pending
*/
conn = PgGetConnectionId(interp, argv[i++], &connid);
- if (conn == (PGconn *) NULL)
+ if (conn == NULL)
return TCL_ERROR;
if (connid->res_copyStatus != RES_COPY_NONE)
return TCL_ERROR;
}
- conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
- if (conn == (PGconn *) NULL)
+ conn = PgGetConnectionId(interp, argv[1], NULL);
+ if (conn == NULL)
return TCL_ERROR;
lobjId = atoi(argv[2]);
return TCL_ERROR;
}
- conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
- if (conn == (PGconn *) NULL)
+ conn = PgGetConnectionId(interp, argv[1], NULL);
+ if (conn == NULL)
return TCL_ERROR;
fd = atoi(argv[2]);
}
conn = PgGetConnectionId(interp, Tcl_GetStringFromObj(objv[1], NULL),
- (Pg_ConnectionId **) NULL);
- if (conn == (PGconn *) NULL)
+ NULL);
+ if (conn == NULL)
return TCL_ERROR;
if (Tcl_GetIntFromObj(interp, objv[2], &fd) != TCL_OK)
return TCL_ERROR;
}
- conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
- if (conn == (PGconn *) NULL)
+ conn = PgGetConnectionId(interp, argv[1], NULL);
+ if (conn == NULL)
return TCL_ERROR;
fd = atoi(argv[2]);
}
conn = PgGetConnectionId(interp, Tcl_GetStringFromObj(objv[1], NULL),
- (Pg_ConnectionId **) NULL);
- if (conn == (PGconn *) NULL)
+ NULL);
+ if (conn == NULL)
return TCL_ERROR;
if (Tcl_GetIntFromObj(interp, objv[2], &fd) != TCL_OK)
return TCL_ERROR;
}
- conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
- if (conn == (PGconn *) NULL)
+ conn = PgGetConnectionId(interp, argv[1], NULL);
+ if (conn == NULL)
return TCL_ERROR;
fd = atoi(argv[2]);
return TCL_ERROR;
}
- conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
- if (conn == (PGconn *) NULL)
+ conn = PgGetConnectionId(interp, argv[1], NULL);
+ if (conn == NULL)
return TCL_ERROR;
fd = atoi(argv[2]);
return TCL_ERROR;
}
- conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
- if (conn == (PGconn *) NULL)
+ conn = PgGetConnectionId(interp, argv[1], NULL);
+ if (conn == NULL)
return TCL_ERROR;
modeStr = strdup(argv[2]);
return TCL_ERROR;
}
- while ((modeWord = strtok((char *) NULL, "|")) != NULL)
+ while ((modeWord = strtok(NULL, "|")) != NULL)
{
if (strcmp(modeWord, "INV_READ") == 0)
mode |= INV_READ;
return TCL_ERROR;
}
- conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
- if (conn == (PGconn *) NULL)
+ conn = PgGetConnectionId(interp, argv[1], NULL);
+ if (conn == NULL)
return TCL_ERROR;
fd = atoi(argv[2]);
return TCL_ERROR;
}
- conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
- if (conn == (PGconn *) NULL)
+ conn = PgGetConnectionId(interp, argv[1], NULL);
+ if (conn == NULL)
return TCL_ERROR;
lobjId = atoi(argv[2]);
return TCL_ERROR;
}
- conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
- if (conn == (PGconn *) NULL)
+ conn = PgGetConnectionId(interp, argv[1], NULL);
+ if (conn == NULL)
return TCL_ERROR;
filename = argv[2];
return TCL_ERROR;
}
- conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
- if (conn == (PGconn *) NULL)
+ conn = PgGetConnectionId(interp, argv[1], NULL);
+ if (conn == NULL)
return TCL_ERROR;
lobjId = atoi(argv[2]);
}
conn = PgGetConnectionId(interp, argv[1], &connid);
- if (conn == (PGconn *) NULL)
+ if (conn == NULL)
return TCL_ERROR;
if ((result = PQexec(conn, argv[2])) == 0)
* allocated by us.
*/
conn = PgGetConnectionId(interp, argv[1], &connid);
- if (conn == (PGconn *) NULL)
+ if (conn == NULL)
return TCL_ERROR;
/*
* Get the command arguments.
*/
conn = PgGetConnectionId(interp, argv[1], &connid);
- if (conn == (PGconn *) NULL)
+ if (conn == NULL)
return TCL_ERROR;
if ((argc > 2) && *argv[2])
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpgtcl/pgtclId.c,v 1.44 2003/11/29 19:52:11 pgsql Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpgtcl/pgtclId.c,v 1.45 2004/01/07 18:56:29 neilc Exp $
*
*-------------------------------------------------------------------------
*/
Tcl_File
PgGetFileProc(ClientData cData, int direction)
{
- return (Tcl_File) NULL;
+ return NULL;
}
#endif
Tcl_AppendResult(interp, id, " is not a valid postgresql connection", 0);
if (connid_p)
*connid_p = NULL;
- return (PGconn *) NULL;
+ return NULL;
}
connid = (Pg_ConnectionId *) Tcl_GetChannelInstanceData(conn_chan);
* exceed INITIAL_EXPBUFFER_SIZE (currently 256 bytes).
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.88 2003/12/20 18:45:49 tgl Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.89 2004/01/07 18:56:29 neilc Exp $
*
*-------------------------------------------------------------------------
*/
snprintf(PQerrormsg, PQERRORMSG_LENGTH,
"pg_krb4_authname: krb_get_tf_fullname: %s\n",
krb_err_txt[status]);
- return (char *) NULL;
+ return NULL;
}
return name;
}
hostname,
realm,
(u_long) 0,
- (MSG_DAT *) NULL,
- (CREDENTIALS *) NULL,
+ NULL,
+ NULL,
NULL,
laddr,
raddr,
char *
fe_getauthname(char *PQerrormsg)
{
- const char *name = (char *) NULL;
- char *authn = (char *) NULL;
+ const char *name = NULL;
+ char *authn = NULL;
MsgType authsvc;
authsvc = fe_getauthsvc(PQerrormsg);
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.265 2003/12/19 21:50:54 momjian Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.266 2004/01/07 18:56:29 neilc Exp $
*
*-------------------------------------------------------------------------
*/
*/
conn = makeEmptyPGconn();
if (conn == NULL)
- return (PGconn *) NULL;
+ return NULL;
/*
* Parse the conninfo string
*/
conn = makeEmptyPGconn();
if (conn == NULL)
- return (PGconn *) NULL;
+ return NULL;
/*
* Parse an empty conninfo string in order to set up the same defaults
WSADATA wsaData;
if (WSAStartup(MAKEWORD(1, 1), &wsaData))
- return (PGconn *) NULL;
+ return NULL;
WSASetLastError(0);
#endif
return conn;
/* Zero all pointers and booleans */
- MemSet((char *) conn, 0, sizeof(PGconn));
+ MemSet(conn, 0, sizeof(PGconn));
conn->noticeHooks.noticeRec = defaultNoticeReceiver;
conn->noticeHooks.noticeProc = defaultNoticeProcessor;
PQdb(const PGconn *conn)
{
if (!conn)
- return (char *) NULL;
+ return NULL;
return conn->dbName;
}
PQuser(const PGconn *conn)
{
if (!conn)
- return (char *) NULL;
+ return NULL;
return conn->pguser;
}
PQpass(const PGconn *conn)
{
if (!conn)
- return (char *) NULL;
+ return NULL;
return conn->pgpass;
}
PQhost(const PGconn *conn)
{
if (!conn)
- return (char *) NULL;
+ return NULL;
return conn->pghost ? conn->pghost : conn->pgunixsocket;
}
PQport(const PGconn *conn)
{
if (!conn)
- return (char *) NULL;
+ return NULL;
return conn->pgport;
}
PQtty(const PGconn *conn)
{
if (!conn)
- return (char *) NULL;
+ return NULL;
return conn->pgtty;
}
PQoptions(const PGconn *conn)
{
if (!conn)
- return (char *) NULL;
+ return NULL;
return conn->pgoptions;
}
sprintf(qbuf, query, encoding);
res = PQexec(conn, qbuf);
- if (res == (PGresult *) NULL)
+ if (res == NULL)
return -1;
if (res->resultStatus != PGRES_COMMAND_OK)
status = -1;
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-lobj.c,v 1.45 2003/11/29 19:52:12 pgsql Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-lobj.c,v 1.46 2004/01/07 18:56:29 neilc Exp $
*
*-------------------------------------------------------------------------
*/
argv[1].len = 4;
argv[1].u.integer = mode;
- if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
+ if (conn->lobjfuncs == NULL)
{
if (lo_initialize(conn) < 0)
return -1;
int retval;
int result_len;
- if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
+ if (conn->lobjfuncs == NULL)
{
if (lo_initialize(conn) < 0)
return -1;
PGresult *res;
int result_len;
- if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
+ if (conn->lobjfuncs == NULL)
{
if (lo_initialize(conn) < 0)
return -1;
int result_len;
int retval;
- if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
+ if (conn->lobjfuncs == NULL)
{
if (lo_initialize(conn) < 0)
return -1;
int retval;
int result_len;
- if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
+ if (conn->lobjfuncs == NULL)
{
if (lo_initialize(conn) < 0)
return -1;
int retval;
int result_len;
- if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
+ if (conn->lobjfuncs == NULL)
{
if (lo_initialize(conn) < 0)
return InvalidOid;
PGresult *res;
int result_len;
- if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
+ if (conn->lobjfuncs == NULL)
{
if (lo_initialize(conn) < 0)
return -1;
int result_len;
int retval;
- if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
+ if (conn->lobjfuncs == NULL)
{
if (lo_initialize(conn) < 0)
return -1;
* Allocate the structure to hold the functions OID's
*/
lobjfuncs = (PGlobjfuncs *) malloc(sizeof(PGlobjfuncs));
- if (lobjfuncs == (PGlobjfuncs *) NULL)
+ if (lobjfuncs == NULL)
{
printfPQExpBuffer(&conn->errorMessage,
libpq_gettext("out of memory\n"));
or proname = 'lo_tell' \
or proname = 'loread' \
or proname = 'lowrite'");
- if (res == (PGresult *) NULL)
+ if (res == NULL)
{
free(lobjfuncs);
return -1;
* procedural language
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.72 2004/01/07 06:20:02 tgl Exp $
+ * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.73 2004/01/07 18:56:30 neilc Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
* Hash table for compiled functions
* ----------
*/
-static HTAB *plpgsql_HashTable = (HTAB *) NULL;
+static HTAB *plpgsql_HashTable = NULL;
typedef struct plpgsql_hashent
{
if (hentry)
return hentry->function;
else
- return (PLpgSQL_function *) NULL;
+ return NULL;
}
static void
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.44 2004/01/06 23:55:19 tgl Exp $
+ * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.45 2004/01/07 18:56:30 neilc Exp $
*
*********************************************************************
*/
PyDict_SetItemString(pltdata, "old", Py_None);
PyDict_SetItemString(pltdata, "new", Py_None);
- *rv = (HeapTuple) NULL;
+ *rv = NULL;
if (TRIGGER_FIRED_BY_INSERT(tdata->tg_event))
pltevent = PyString_FromString("INSERT");
{
fprintf(stderr, "DECLARE CURSOR command failed\n");
PQclear(res1);
- exit_nicely(conn1, (PGconn *) NULL);
+ exit_nicely(conn1, NULL);
}
PQclear(res1);
{
fprintf(stderr, "FETCH ALL command didn't return tuples properly\n");
PQclear(res1);
- exit_nicely(conn1, (PGconn *) NULL);
+ exit_nicely(conn1, NULL);
}
/* first, print out the attribute names */