Change lcons(x, NIL) to makeList(x) where appropriate.
This commit is contained in:
parent
8e9840383c
commit
5088f0748a
src/backend
bootstrap
commands
executor
nodes
optimizer
parser
@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.33 2000/11/21 21:15:59 petere Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.34 2001/01/17 17:26:44 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -254,7 +254,7 @@ Boot_BuildIndsStmt:
|
||||
|
||||
boot_index_params:
|
||||
boot_index_params COMMA boot_index_param { $$ = lappend($1, $3); }
|
||||
| boot_index_param { $$ = lcons($1, NIL); }
|
||||
| boot_index_param { $$ = makeList1($1); }
|
||||
;
|
||||
|
||||
boot_index_param:
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.70 2000/11/16 22:30:19 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.71 2001/01/17 17:26:44 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -311,7 +311,8 @@ CreateUser(CreateUserStmt *stmt)
|
||||
ags.name = strVal(lfirst(item)); /* the group name to add
|
||||
* this in */
|
||||
ags.action = +1;
|
||||
ags.listUsers = lcons((void *) makeInteger(havesysid ? stmt->sysid : max_id + 1), NIL);
|
||||
ags.listUsers = makeList1(makeInteger(havesysid ?
|
||||
stmt->sysid : max_id + 1));
|
||||
AlterGroup(&ags, "CREATE USER");
|
||||
}
|
||||
|
||||
@ -600,7 +601,7 @@ DropUser(DropUserStmt *stmt)
|
||||
datum = heap_getattr(tmp_tuple, Anum_pg_group_groname, pg_dsc, &null);
|
||||
ags.name = DatumGetCString(DirectFunctionCall1(nameout, datum));
|
||||
ags.action = -1;
|
||||
ags.listUsers = lcons((void *) makeInteger(usesysid), NIL);
|
||||
ags.listUsers = makeList1(makeInteger(usesysid));
|
||||
AlterGroup(&ags, "DROP USER");
|
||||
}
|
||||
heap_endscan(scan);
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.22 2000/01/26 05:56:21 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/executor/execJunk.c,v 1.23 2001/01/17 17:26:44 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -124,7 +124,7 @@ ExecInitJunkFilter(List *targetList, TupleDesc tupType)
|
||||
Fjoin *fjNode = (Fjoin *) tl_node(fjList);
|
||||
|
||||
cleanFjoin = (Fjoin) copyObject((Node) fjNode);
|
||||
cleanFjList = lcons(cleanFjoin, NIL);
|
||||
cleanFjList = makeList1(cleanFjoin);
|
||||
|
||||
resdom = (Resdom) lfirst(get_fj_innerNode(fjNode));
|
||||
expr = lsecond(get_fj_innerNode(fjNode));
|
||||
|
@ -15,7 +15,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.136 2001/01/05 06:34:17 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.137 2001/01/17 17:26:44 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -58,11 +58,11 @@ listCopy(List *list)
|
||||
if (list == NIL)
|
||||
return NIL;
|
||||
|
||||
newlist = nl = lcons(lfirst(list), NIL);
|
||||
newlist = nl = makeList1(lfirst(list));
|
||||
|
||||
foreach(l, lnext(list))
|
||||
{
|
||||
lnext(nl) = lcons(lfirst(l), NIL);
|
||||
lnext(nl) = makeList1(lfirst(l));
|
||||
nl = lnext(nl);
|
||||
}
|
||||
return newlist;
|
||||
@ -2745,12 +2745,12 @@ copyObject(void *from)
|
||||
|
||||
/* rather ugly coding for speed... */
|
||||
/* Note the input list cannot be NIL if we got here. */
|
||||
nl = lcons(copyObject(lfirst(list)), NIL);
|
||||
nl = makeList1(copyObject(lfirst(list)));
|
||||
retval = nl;
|
||||
|
||||
foreach(l, lnext(list))
|
||||
{
|
||||
lnext(nl) = lcons(copyObject(lfirst(l)), NIL);
|
||||
lnext(nl) = makeList1(copyObject(lfirst(l)));
|
||||
nl = lnext(nl);
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.36 2000/10/31 10:22:10 petere Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/list.c,v 1.37 2001/01/17 17:26:44 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* XXX a few of the following functions are duplicated to handle
|
||||
@ -127,7 +127,7 @@ lconsi(int datum, List *list)
|
||||
List *
|
||||
lappend(List *list, void *obj)
|
||||
{
|
||||
return nconc(list, lcons(obj, NIL));
|
||||
return nconc(list, makeList1(obj));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -138,7 +138,7 @@ lappend(List *list, void *obj)
|
||||
List *
|
||||
lappendi(List *list, int datum)
|
||||
{
|
||||
return nconc(list, lconsi(datum, NIL));
|
||||
return nconc(list, makeListi1(datum));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.23 2000/11/16 22:30:23 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.24 2001/01/17 17:26:44 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* Creator functions in POSTGRES 4.2 are generated automatically. Most of
|
||||
@ -178,7 +178,7 @@ makeAttr(char *relname, char *attname)
|
||||
a->relname = pstrdup(relname);
|
||||
a->paramNo = NULL;
|
||||
if (attname != NULL)
|
||||
a->attrs = lcons(makeString(pstrdup(attname)), NIL);
|
||||
a->attrs = makeList1(makeString(pstrdup(attname)));
|
||||
a->indirection = NULL;
|
||||
|
||||
return a;
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: geqo_eval.c,v 1.55 2000/09/19 18:42:33 tgl Exp $
|
||||
* $Id: geqo_eval.c,v 1.56 2001/01/17 17:26:44 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -122,7 +122,7 @@ gimme_tree(Query *root, List *initial_rels,
|
||||
else
|
||||
{
|
||||
/* tree main part */
|
||||
List *acceptable_rels = lcons(inner_rel, NIL);
|
||||
List *acceptable_rels = makeList1(inner_rel);
|
||||
List *new_rels;
|
||||
RelOptInfo *new_rel;
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/_deadcode/Attic/xfunc.c,v 1.13 2000/01/26 05:56:36 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/_deadcode/Attic/xfunc.c,v 1.14 2001/01/17 17:26:45 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -300,7 +300,7 @@ xfunc_pullup(Query *queryInfo,
|
||||
get_clause(cinfo), LispNil);
|
||||
xfunc_copyrel(get_parent(newkid), &newrel);
|
||||
set_parent(newkid, newrel);
|
||||
set_pathlist(newrel, lcons(newkid, NIL));
|
||||
set_pathlist(newrel, makeList1(newkid));
|
||||
set_unorderedpath(newrel, (PathPtr) newkid);
|
||||
set_cheapestpath(newrel, (PathPtr) newkid);
|
||||
set_size(newrel,
|
||||
|
@ -11,7 +11,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/pathkeys.c,v 1.28 2000/12/14 22:30:43 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/pathkeys.c,v 1.29 2001/01/17 17:26:45 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -119,7 +119,7 @@ add_equijoined_keys(Query *root, RestrictInfo *restrictinfo)
|
||||
|
||||
/* Build the new set only when we know we must */
|
||||
if (newset == NIL)
|
||||
newset = lcons(item1, lcons(item2, NIL));
|
||||
newset = makeList2(item1, item2);
|
||||
|
||||
/* Found a set to merge into our new set */
|
||||
newset = set_union(newset, curset);
|
||||
@ -135,7 +135,7 @@ add_equijoined_keys(Query *root, RestrictInfo *restrictinfo)
|
||||
|
||||
/* Build the new set only when we know we must */
|
||||
if (newset == NIL)
|
||||
newset = lcons(item1, lcons(item2, NIL));
|
||||
newset = makeList2(item1, item2);
|
||||
|
||||
root->equi_key_list = lcons(newset, root->equi_key_list);
|
||||
}
|
||||
@ -534,7 +534,7 @@ build_index_pathkeys(Query *root,
|
||||
/* Make a one-sublist pathkeys list for the function expression */
|
||||
item = makePathKeyItem((Node *) make_funcclause(funcnode, funcargs),
|
||||
sortop);
|
||||
retval = lcons(make_canonical_pathkey(root, item), NIL);
|
||||
retval = makeList1(make_canonical_pathkey(root, item));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -678,7 +678,7 @@ make_pathkeys_for_sortclauses(List *sortclauses,
|
||||
* canonicalize_pathkeys() might replace it with a longer sublist
|
||||
* later.
|
||||
*/
|
||||
pathkeys = lappend(pathkeys, lcons(pathkey, NIL));
|
||||
pathkeys = lappend(pathkeys, makeList1(pathkey));
|
||||
}
|
||||
return pathkeys;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.58 2000/12/14 22:30:44 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/prep/prepunion.c,v 1.59 2001/01/17 17:26:45 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -467,7 +467,7 @@ List *
|
||||
find_all_inheritors(Oid parentrel)
|
||||
{
|
||||
List *examined_relids = NIL;
|
||||
List *unexamined_relids = lconsi(parentrel, NIL);
|
||||
List *unexamined_relids = makeListi1(parentrel);
|
||||
|
||||
/*
|
||||
* While the queue of unexamined relids is nonempty, remove the first
|
||||
|
@ -11,7 +11,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.215 2001/01/15 20:36:36 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.216 2001/01/17 17:26:45 momjian Exp $
|
||||
*
|
||||
* HISTORY
|
||||
* AUTHOR DATE MAJOR EVENT
|
||||
@ -2918,7 +2918,7 @@ createdb_opt_item: LOCATION '=' Sconst
|
||||
}
|
||||
| LOCATION '=' DEFAULT
|
||||
{
|
||||
$$ = lconsi(1, makeList1((char *) NULL));
|
||||
$$ = lconsi(1, makeList1(NULL));
|
||||
}
|
||||
| TEMPLATE '=' name
|
||||
{
|
||||
@ -2926,7 +2926,7 @@ createdb_opt_item: LOCATION '=' Sconst
|
||||
}
|
||||
| TEMPLATE '=' DEFAULT
|
||||
{
|
||||
$$ = lconsi(2, makeList1((char *) NULL));
|
||||
$$ = lconsi(2, makeList1(NULL));
|
||||
}
|
||||
| ENCODING '=' Sconst
|
||||
{
|
||||
@ -3383,7 +3383,7 @@ simple_select: SELECT opt_distinct target_list
|
||||
|
||||
/* easy way to return two values. Can someone improve this? bjm */
|
||||
into_clause: INTO OptTempTableName { $$ = $2; }
|
||||
| /*EMPTY*/ { $$ = lcons(makeInteger(FALSE), NIL); }
|
||||
| /*EMPTY*/ { $$ = makeList1(makeInteger(FALSE)); }
|
||||
;
|
||||
|
||||
/*
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.52 2000/12/17 04:32:29 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.53 2001/01/17 17:26:45 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -128,7 +128,7 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId,
|
||||
FuncCall *n = makeNode(FuncCall);
|
||||
|
||||
n->funcname = typeidTypeName(targetTypeId);
|
||||
n->args = lcons(node, NIL);
|
||||
n->args = makeList1(node);
|
||||
n->agg_star = false;
|
||||
n->agg_distinct = false;
|
||||
|
||||
@ -304,7 +304,7 @@ coerce_type_typmod(ParseState *pstate, Node *node,
|
||||
cons->val.val.ival = atttypmod;
|
||||
|
||||
func->funcname = funcname;
|
||||
func->args = lappend(lcons(node, NIL), cons);
|
||||
func->args = makeList2(node, cons);
|
||||
func->agg_star = false;
|
||||
func->agg_distinct = false;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user