Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit72b6ad6

Browse files
author
Neil Conway
committed
Use the new List API function names throughout the backend, and disable the
list compatibility API by default. While doing this, I decided to keepthe llast() macro around and introduce llast_int() and llast_oid() variants.
1 parentec0b1f2 commit72b6ad6

File tree

83 files changed

+798
-828
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+798
-828
lines changed

‎contrib/tsearch2/tsvector.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,10 +779,10 @@ findFunc(char *fname)
779779
FuncCandidateListclist,
780780
ptr;
781781
Oidfuncid=InvalidOid;
782-
List*names=makeList1(makeString(fname));
782+
List*names=list_make1(makeString(fname));
783783

784784
ptr=clist=FuncnameGetCandidates(names,1);
785-
freeList(names);
785+
list_free(names);
786786

787787
if (!ptr)
788788
returnfuncid;

‎src/backend/access/common/tupdesc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/common/tupdesc.c,v 1.103 2004/05/26 04:41:03 neilc Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/common/tupdesc.c,v 1.104 2004/05/30 23:40:25 neilc Exp $
1212
*
1313
* NOTES
1414
* some of the executor utility code such as "ExecTypeFromTL" should be
@@ -484,7 +484,7 @@ BuildDescForRelation(List *schema)
484484
/*
485485
* allocate a new tuple descriptor
486486
*/
487-
natts=length(schema);
487+
natts=list_length(schema);
488488
desc=CreateTemplateTupleDesc(natts, false);
489489
constr->has_not_null= false;
490490

@@ -503,7 +503,7 @@ BuildDescForRelation(List *schema)
503503

504504
attname=entry->colname;
505505
atttypmod=entry->typename->typmod;
506-
attdim=length(entry->typename->arrayBounds);
506+
attdim=list_length(entry->typename->arrayBounds);
507507

508508
if (entry->typename->setof)
509509
ereport(ERROR,
@@ -624,15 +624,15 @@ TypeGetTupleDesc(Oid typeoid, List *colaliases)
624624
intvarattno;
625625

626626
/* does the list length match the number of attributes? */
627-
if (length(colaliases)!=natts)
627+
if (list_length(colaliases)!=natts)
628628
ereport(ERROR,
629629
(errcode(ERRCODE_DATATYPE_MISMATCH),
630630
errmsg("number of aliases does not match number of columns")));
631631

632632
/* OK, use the aliases instead */
633633
for (varattno=0;varattno<natts;varattno++)
634634
{
635-
char*label=strVal(nth(varattno,colaliases));
635+
char*label=strVal(list_nth(colaliases,varattno));
636636

637637
if (label!=NULL)
638638
namestrcpy(&(tupdesc->attrs[varattno]->attname),label);
@@ -655,7 +655,7 @@ TypeGetTupleDesc(Oid typeoid, List *colaliases)
655655
errmsg("no column alias was provided")));
656656

657657
/* the alias list length must be 1 */
658-
if (length(colaliases)!=1)
658+
if (list_length(colaliases)!=1)
659659
ereport(ERROR,
660660
(errcode(ERRCODE_DATATYPE_MISMATCH),
661661
errmsg("number of aliases does not match number of columns")));

‎src/backend/access/nbtree/nbtxlog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.11 2004/05/26 04:41:05 neilc Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.12 2004/05/30 23:40:25 neilc Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -81,7 +81,7 @@ forget_matching_split(Relation reln, RelFileNode node,
8181
{
8282
if (is_root!=split->is_root)
8383
elog(LOG,"forget_matching_split: fishy is_root data");
84-
incomplete_splits=lremove(split,incomplete_splits);
84+
incomplete_splits=list_delete_ptr(incomplete_splits,split);
8585
break;/* need not look further */
8686
}
8787
}

‎src/backend/executor/execMain.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
*
2828
* IDENTIFICATION
29-
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.232 2004/05/26 04:41:14 neilc Exp $
29+
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.233 2004/05/30 23:40:26 neilc Exp $
3030
*
3131
*-------------------------------------------------------------------------
3232
*/
@@ -524,7 +524,7 @@ InitPlan(QueryDesc *queryDesc, bool explainOnly)
524524
ResultRelInfo*resultRelInfo;
525525
ListCell*l;
526526

527-
numResultRelations=length(resultRelations);
527+
numResultRelations=list_length(resultRelations);
528528
resultRelInfos= (ResultRelInfo*)
529529
palloc(numResultRelations*sizeof(ResultRelInfo));
530530
resultRelInfo=resultRelInfos;
@@ -590,7 +590,7 @@ InitPlan(QueryDesc *queryDesc, bool explainOnly)
590590

591591
foreach(l,parseTree->rowMarks)
592592
{
593-
Indexrti=lfirsti(l);
593+
Indexrti=lfirst_int(l);
594594
Oidrelid=getrelid(rti,rangeTable);
595595
Relationrelation;
596596
execRowMark*erm;
@@ -614,7 +614,7 @@ InitPlan(QueryDesc *queryDesc, bool explainOnly)
614614
intnSlots=ExecCountSlotsNode(plan);
615615

616616
if (parseTree->resultRelations!=NIL)
617-
nSlots+=length(parseTree->resultRelations);
617+
nSlots+=list_length(parseTree->resultRelations);
618618
else
619619
nSlots+=1;
620620
estate->es_tupleTable=ExecCreateTupleTable(nSlots);
@@ -2067,7 +2067,7 @@ EvalPlanQualStart(evalPlanQual *epq, EState *estate, evalPlanQual *priorepq)
20672067
intrtsize;
20682068
MemoryContextoldcontext;
20692069

2070-
rtsize=length(estate->es_range_table);
2070+
rtsize=list_length(estate->es_range_table);
20712071

20722072
epq->estate=epqstate=CreateExecutorState();
20732073

‎src/backend/executor/execQual.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.160 2004/05/26 04:41:15 neilc Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.161 2004/05/30 23:40:26 neilc Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -760,7 +760,7 @@ init_fcache(Oid foid, FuncExprState *fcache, MemoryContext fcacheCxt)
760760
aclcheck_error(aclresult,ACL_KIND_PROC,get_func_name(foid));
761761

762762
/* Safety check (should never fail, as parser should check sooner) */
763-
if (length(fcache->args)>FUNC_MAX_ARGS)
763+
if (list_length(fcache->args)>FUNC_MAX_ARGS)
764764
elog(ERROR,"too many arguments");
765765

766766
/* Set up the primary fmgr lookup information */
@@ -1958,7 +1958,7 @@ ExecEvalArray(ArrayExprState *astate, ExprContext *econtext,
19581958
inti=0;
19591959

19601960
ndims=1;
1961-
nelems=length(astate->elements);
1961+
nelems=list_length(astate->elements);
19621962

19631963
/* Shouldn't happen here, but if length is 0, return NULL */
19641964
if (nelems==0)
@@ -1999,7 +1999,7 @@ ExecEvalArray(ArrayExprState *astate, ExprContext *econtext,
19991999
char*dat=NULL;
20002000
Sizendatabytes=0;
20012001
intnbytes;
2002-
intouter_nelems=length(astate->elements);
2002+
intouter_nelems=list_length(astate->elements);
20032003
intelem_ndims=0;
20042004
int*elem_dims=NULL;
20052005
int*elem_lbs=NULL;
@@ -2128,7 +2128,7 @@ ExecEvalRow(RowExprState *rstate,
21282128
*isDone=ExprSingleResult;
21292129

21302130
/* Allocate workspace */
2131-
nargs=length(rstate->args);
2131+
nargs=list_length(rstate->args);
21322132
if (nargs==0)/* avoid palloc(0) if no fields */
21332133
nargs=1;
21342134
values= (Datum*)palloc(nargs*sizeof(Datum));
@@ -3170,7 +3170,7 @@ int
31703170
ExecTargetListLength(List*targetlist)
31713171
{
31723172
/* This used to be more complex, but fjoins are dead */
3173-
returnlength(targetlist);
3173+
returnlist_length(targetlist);
31743174
}
31753175

31763176
/*

‎src/backend/executor/execTuples.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*
1717
* IDENTIFICATION
18-
* $PostgreSQL: pgsql/src/backend/executor/execTuples.c,v 1.78 2004/05/26 04:41:15 neilc Exp $
18+
* $PostgreSQL: pgsql/src/backend/executor/execTuples.c,v 1.79 2004/05/30 23:40:26 neilc Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -610,7 +610,7 @@ ExecTypeFromExprList(List *exprList)
610610
intcur_resno=1;
611611
charfldname[NAMEDATALEN];
612612

613-
typeInfo=CreateTemplateTupleDesc(length(exprList), false);
613+
typeInfo=CreateTemplateTupleDesc(list_length(exprList), false);
614614

615615
foreach(l,exprList)
616616
{

‎src/backend/executor/execUtils.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.111 2004/05/26 04:41:15 neilc Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.112 2004/05/30 23:40:26 neilc Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -249,7 +249,7 @@ FreeExecutorState(EState *estate)
249249
while (estate->es_exprcontexts)
250250
{
251251
/* XXX: seems there ought to be a faster way to implement this
252-
* than repeatedlremove(), no?
252+
* than repeatedlist_delete(), no?
253253
*/
254254
FreeExprContext((ExprContext*)linitial(estate->es_exprcontexts));
255255
/* FreeExprContext removed the list link for us */
@@ -355,7 +355,7 @@ FreeExprContext(ExprContext *econtext)
355355
MemoryContextDelete(econtext->ecxt_per_tuple_memory);
356356
/* Unlink self from owning EState */
357357
estate=econtext->ecxt_estate;
358-
estate->es_exprcontexts=lremove(econtext,estate->es_exprcontexts);
358+
estate->es_exprcontexts=list_delete_ptr(estate->es_exprcontexts,econtext);
359359
/* And delete the ExprContext node */
360360
pfree(econtext);
361361
}
@@ -656,7 +656,7 @@ ExecOpenIndices(ResultRelInfo *resultRelInfo)
656656
* Get cached list of index OIDs
657657
*/
658658
indexoidlist=RelationGetIndexList(resultRelation);
659-
len=length(indexoidlist);
659+
len=list_length(indexoidlist);
660660
if (len==0)
661661
return;
662662

@@ -676,7 +676,7 @@ ExecOpenIndices(ResultRelInfo *resultRelInfo)
676676
i=0;
677677
foreach(l,indexoidlist)
678678
{
679-
OidindexOid=lfirsto(l);
679+
OidindexOid=lfirst_oid(l);
680680
RelationindexDesc;
681681
IndexInfo*ii;
682682

@@ -713,7 +713,7 @@ ExecOpenIndices(ResultRelInfo *resultRelInfo)
713713
i++;
714714
}
715715

716-
freeList(indexoidlist);
716+
list_free(indexoidlist);
717717
}
718718

719719
/* ----------------------------------------------------------------

‎src/backend/executor/nodeAgg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
* Portions Copyright (c) 1994, Regents of the University of California
4646
*
4747
* IDENTIFICATION
48-
* $PostgreSQL: pgsql/src/backend/executor/nodeAgg.c,v 1.120 2004/05/26 04:41:15 neilc Exp $
48+
* $PostgreSQL: pgsql/src/backend/executor/nodeAgg.c,v 1.121 2004/05/30 23:40:26 neilc Exp $
4949
*
5050
*-------------------------------------------------------------------------
5151
*/
@@ -1120,7 +1120,7 @@ ExecInitAgg(Agg *node, EState *estate)
11201120
* get the count of aggregates in targetlist and quals
11211121
*/
11221122
numaggs=aggstate->numaggs;
1123-
Assert(numaggs==length(aggstate->aggs));
1123+
Assert(numaggs==list_length(aggstate->aggs));
11241124
if (numaggs <=0)
11251125
{
11261126
/*

‎src/backend/executor/nodeAppend.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/nodeAppend.c,v 1.57 2004/05/26 04:41:15 neilc Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/nodeAppend.c,v 1.58 2004/05/30 23:40:26 neilc Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -155,7 +155,7 @@ ExecInitAppend(Append *node, EState *estate)
155155
/*
156156
* Set up empty vector of subplan states
157157
*/
158-
nplans=length(node->appendplans);
158+
nplans=list_length(node->appendplans);
159159

160160
appendplanstates= (PlanState**)palloc0(nplans*sizeof(PlanState*));
161161

@@ -215,7 +215,7 @@ ExecInitAppend(Append *node, EState *estate)
215215
appendstate->as_whichplan=i;
216216
exec_append_initialize_next(appendstate);
217217

218-
initNode= (Plan*)nth(i,node->appendplans);
218+
initNode= (Plan*)list_nth(node->appendplans,i);
219219
appendplanstates[i]=ExecInitNode(initNode,estate);
220220
}
221221

‎src/backend/executor/nodeHash.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/nodeHash.c,v 1.84 2004/05/26 04:41:15 neilc Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/nodeHash.c,v 1.85 2004/05/30 23:40:26 neilc Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -240,17 +240,17 @@ ExecHashTableCreate(Hash *node, List *hashOperators)
240240
/*
241241
* Get info about the hash functions to be used for each hash key.
242242
*/
243-
nkeys=length(hashOperators);
243+
nkeys=list_length(hashOperators);
244244
hashtable->hashfunctions= (FmgrInfo*)palloc(nkeys*sizeof(FmgrInfo));
245245
i=0;
246246
foreach(ho,hashOperators)
247247
{
248248
Oidhashfn;
249249

250-
hashfn=get_op_hash_function(lfirsto(ho));
250+
hashfn=get_op_hash_function(lfirst_oid(ho));
251251
if (!OidIsValid(hashfn))
252252
elog(ERROR,"could not find hash function for hash operator %u",
253-
lfirsto(ho));
253+
lfirst_oid(ho));
254254
fmgr_info(hashfn,&hashtable->hashfunctions[i]);
255255
i++;
256256
}

‎src/backend/executor/nodeHashjoin.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/nodeHashjoin.c,v 1.61 2004/05/26 04:41:15 neilc Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/nodeHashjoin.c,v 1.62 2004/05/30 23:40:26 neilc Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -429,7 +429,7 @@ ExecInitHashJoin(HashJoin *node, EState *estate)
429429
Assert(IsA(hclause,OpExpr));
430430
lclauses=lappend(lclauses,linitial(fstate->args));
431431
rclauses=lappend(rclauses,lsecond(fstate->args));
432-
hoperators=lappendo(hoperators,hclause->opno);
432+
hoperators=lappend_oid(hoperators,hclause->opno);
433433
}
434434
hjstate->hj_OuterHashKeys=lclauses;
435435
hjstate->hj_InnerHashKeys=rclauses;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp