Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4a39057

Browse files
committed
Back out makeNode() patch to fix gcc 3.3.1 warning.
1 parent 014a0a3 commit 4a39057

File tree

3 files changed

+44
-46
lines changed

3 files changed

+44
-46
lines changed

src/backend/commands/tablecmds.c

+9-10
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.90 2003/10/13 20:02:52 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/commands/tablecmds.c,v 1.91 2003/10/13 22:47:15 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -3397,7 +3397,6 @@ validateForeignKeyConstraint(FkConstraint *fkconstraint,
33973397
Relation pkrel)
33983398
{
33993399
HeapScanDesc scan;
3400-
TriggerData *trigdata = makeNode(TriggerData); /* must be Node aligned */
34013400
HeapTuple tuple;
34023401
Trigger trig;
34033402
List *list;
@@ -3455,6 +3454,7 @@ validateForeignKeyConstraint(FkConstraint *fkconstraint,
34553454
while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
34563455
{
34573456
FunctionCallInfoData fcinfo;
3457+
TriggerData trigdata;
34583458

34593459
/*
34603460
* Make a call to the trigger function
@@ -3466,21 +3466,20 @@ validateForeignKeyConstraint(FkConstraint *fkconstraint,
34663466
/*
34673467
* We assume RI_FKey_check_ins won't look at flinfo...
34683468
*/
3469-
trigdata->type = T_TriggerData;
3470-
trigdata->tg_event = TRIGGER_EVENT_INSERT | TRIGGER_EVENT_ROW;
3471-
trigdata->tg_relation = rel;
3472-
trigdata->tg_trigtuple = tuple;
3473-
trigdata->tg_newtuple = NULL;
3474-
trigdata->tg_trigger = &trig;
3469+
trigdata.type = T_TriggerData;
3470+
trigdata.tg_event = TRIGGER_EVENT_INSERT | TRIGGER_EVENT_ROW;
3471+
trigdata.tg_relation = rel;
3472+
trigdata.tg_trigtuple = tuple;
3473+
trigdata.tg_newtuple = NULL;
3474+
trigdata.tg_trigger = &trig;
34753475

3476-
fcinfo.context = (Node *) trigdata;
3476+
fcinfo.context = (Node *) &trigdata;
34773477

34783478
RI_FKey_check_ins(&fcinfo);
34793479
}
34803480

34813481
heap_endscan(scan);
34823482

3483-
pfree(trigdata);
34843483
pfree(trig.tgargs);
34853484
}
34863485

src/backend/executor/execQual.c

+33-34
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.149 2003/10/12 23:19:21 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/executor/execQual.c,v 1.150 2003/10/13 22:47:15 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -699,8 +699,7 @@ ExecMakeFunctionResult(FuncExprState *fcache,
699699
List *arguments = fcache->args;
700700
Datum result;
701701
FunctionCallInfoData fcinfo;
702-
/* for functions returning sets, must be aligned as Node, so use makeNode */
703-
ReturnSetInfo *rsinfo = makeNode(ReturnSetInfo);
702+
ReturnSetInfo rsinfo; /* for functions returning sets */
704703
ExprDoneCond argDone;
705704
bool hasSetArg;
706705
int i;
@@ -747,15 +746,15 @@ ExecMakeFunctionResult(FuncExprState *fcache,
747746
*/
748747
if (fcache->func.fn_retset)
749748
{
750-
fcinfo.resultinfo = (Node *) rsinfo;
751-
rsinfo->type = T_ReturnSetInfo;
752-
rsinfo->econtext = econtext;
753-
rsinfo->expectedDesc = NULL;
754-
rsinfo->allowedModes = (int) SFRM_ValuePerCall;
755-
rsinfo->returnMode = SFRM_ValuePerCall;
749+
fcinfo.resultinfo = (Node *) &rsinfo;
750+
rsinfo.type = T_ReturnSetInfo;
751+
rsinfo.econtext = econtext;
752+
rsinfo.expectedDesc = NULL;
753+
rsinfo.allowedModes = (int) SFRM_ValuePerCall;
754+
rsinfo.returnMode = SFRM_ValuePerCall;
756755
/* isDone is filled below */
757-
rsinfo->setResult = NULL;
758-
rsinfo->setDesc = NULL;
756+
rsinfo.setResult = NULL;
757+
rsinfo.setDesc = NULL;
759758
}
760759

761760
/*
@@ -804,10 +803,10 @@ ExecMakeFunctionResult(FuncExprState *fcache,
804803
if (callit)
805804
{
806805
fcinfo.isnull = false;
807-
rsinfo->isDone = ExprSingleResult;
806+
rsinfo.isDone = ExprSingleResult;
808807
result = FunctionCallInvoke(&fcinfo);
809808
*isNull = fcinfo.isnull;
810-
*isDone = rsinfo->isDone;
809+
*isDone = rsinfo.isDone;
811810
}
812811
else
813812
{
@@ -904,7 +903,7 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
904903
TupleDesc tupdesc = NULL;
905904
Oid funcrettype;
906905
FunctionCallInfoData fcinfo;
907-
ReturnSetInfo *rsinfo = makeNode(ReturnSetInfo); /* must be Node aligned */
906+
ReturnSetInfo rsinfo;
908907
MemoryContext callerContext;
909908
MemoryContext oldcontext;
910909
TupleTableSlot *slot;
@@ -993,15 +992,15 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
993992
* doesn't actually get to see the resultinfo, but set it up anyway
994993
* because we use some of the fields as our own state variables.
995994
*/
996-
fcinfo.resultinfo = (Node *) rsinfo;
997-
rsinfo->type = T_ReturnSetInfo;
998-
rsinfo->econtext = econtext;
999-
rsinfo->expectedDesc = expectedDesc;
1000-
rsinfo->allowedModes = (int) (SFRM_ValuePerCall | SFRM_Materialize);
1001-
rsinfo->returnMode = SFRM_ValuePerCall;
995+
fcinfo.resultinfo = (Node *) &rsinfo;
996+
rsinfo.type = T_ReturnSetInfo;
997+
rsinfo.econtext = econtext;
998+
rsinfo.expectedDesc = expectedDesc;
999+
rsinfo.allowedModes = (int) (SFRM_ValuePerCall | SFRM_Materialize);
1000+
rsinfo.returnMode = SFRM_ValuePerCall;
10021001
/* isDone is filled below */
1003-
rsinfo->setResult = NULL;
1004-
rsinfo->setDesc = NULL;
1002+
rsinfo.setResult = NULL;
1003+
rsinfo.setDesc = NULL;
10051004

10061005
/*
10071006
* Switch to short-lived context for calling the function or
@@ -1029,17 +1028,17 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
10291028
if (direct_function_call)
10301029
{
10311030
fcinfo.isnull = false;
1032-
rsinfo->isDone = ExprSingleResult;
1031+
rsinfo.isDone = ExprSingleResult;
10331032
result = FunctionCallInvoke(&fcinfo);
10341033
}
10351034
else
10361035
{
10371036
result = ExecEvalExpr(funcexpr, econtext,
1038-
&fcinfo.isnull, &rsinfo->isDone);
1037+
&fcinfo.isnull, &rsinfo.isDone);
10391038
}
10401039

10411040
/* Which protocol does function want to use? */
1042-
if (rsinfo->returnMode == SFRM_ValuePerCall)
1041+
if (rsinfo.returnMode == SFRM_ValuePerCall)
10431042
{
10441043
/*
10451044
* Check for end of result set.
@@ -1048,7 +1047,7 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
10481047
* tupdesc or tuplestore (since we can't get a tupdesc in the
10491048
* function-returning-tuple case)
10501049
*/
1051-
if (rsinfo->isDone == ExprEndResult)
1050+
if (rsinfo.isDone == ExprEndResult)
10521051
break;
10531052

10541053
/*
@@ -1094,8 +1093,8 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
10941093
}
10951094
tupstore = tuplestore_begin_heap(true, false, SortMem);
10961095
MemoryContextSwitchTo(oldcontext);
1097-
rsinfo->setResult = tupstore;
1098-
rsinfo->setDesc = tupdesc;
1096+
rsinfo.setResult = tupstore;
1097+
rsinfo.setDesc = tupdesc;
10991098
}
11001099

11011100
/*
@@ -1128,13 +1127,13 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
11281127
/*
11291128
* Are we done?
11301129
*/
1131-
if (rsinfo->isDone != ExprMultipleResult)
1130+
if (rsinfo.isDone != ExprMultipleResult)
11321131
break;
11331132
}
1134-
else if (rsinfo->returnMode == SFRM_Materialize)
1133+
else if (rsinfo.returnMode == SFRM_Materialize)
11351134
{
11361135
/* check we're on the same page as the function author */
1137-
if (!first_time || rsinfo->isDone != ExprSingleResult)
1136+
if (!first_time || rsinfo.isDone != ExprSingleResult)
11381137
ereport(ERROR,
11391138
(errcode(ERRCODE_E_R_I_E_SRF_PROTOCOL_VIOLATED),
11401139
errmsg("table-function protocol for materialize mode was not followed")));
@@ -1145,16 +1144,16 @@ ExecMakeTableFunctionResult(ExprState *funcexpr,
11451144
ereport(ERROR,
11461145
(errcode(ERRCODE_E_R_I_E_SRF_PROTOCOL_VIOLATED),
11471146
errmsg("unrecognized table-function returnMode: %d",
1148-
(int) rsinfo->returnMode)));
1147+
(int) rsinfo.returnMode)));
11491148

11501149
first_time = false;
11511150
}
11521151

11531152
MemoryContextSwitchTo(callerContext);
11541153

11551154
/* The returned pointers are those in rsinfo */
1156-
*returnDesc = rsinfo->setDesc;
1157-
return rsinfo->setResult;
1155+
*returnDesc = rsinfo.setDesc;
1156+
return rsinfo.setResult;
11581157
}
11591158

11601159

src/backend/port/sysv_shmem.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Portions Copyright (c) 1994, Regents of the University of California
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/port/sysv_shmem.c,v 1.20 2003/10/12 23:19:21 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/port/sysv_shmem.c,v 1.21 2003/10/13 22:47:15 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -365,7 +365,7 @@ PGSharedMemoryAttach(IpcMemoryKey key, IpcMemoryId *shmid)
365365

366366
if (hdr->magic != PGShmemMagic)
367367
{
368-
shmdt((void *)hdr);
368+
shmdt(hdr);
369369
return NULL; /* segment belongs to a non-Postgres app */
370370
}
371371

0 commit comments

Comments
 (0)