Change lcons(x, NIL) to makeList(x) where appropriate.
authorBruce Momjian
Wed, 17 Jan 2001 17:26:45 +0000 (17:26 +0000)
committerBruce Momjian
Wed, 17 Jan 2001 17:26:45 +0000 (17:26 +0000)
12 files changed:
src/backend/bootstrap/bootparse.y
src/backend/commands/user.c
src/backend/executor/execJunk.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/list.c
src/backend/nodes/makefuncs.c
src/backend/optimizer/geqo/geqo_eval.c
src/backend/optimizer/path/_deadcode/xfunc.c
src/backend/optimizer/path/pathkeys.c
src/backend/optimizer/prep/prepunion.c
src/backend/parser/gram.y
src/backend/parser/parse_coerce.c

index d0b0c0c5a8c7d2363f5fc3222f6a352755a2574e..68e122373eb886feb4f9170aff17e847dc1d0cdf 100644 (file)
@@ -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:
index a33098b2e0b96bbc2dcabef1c4bbe591a2d7e65d..27f1d3c2e16114ab84cc6ffdf5dd2d5304137af3 100644 (file)
@@ -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);
index f035f0c09d6317228a8833a1d4325a5fe4313bb1..d45497d154629ee0df1b35d08057cb57678d8afd 100644 (file)
@@ -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));
index 89574db471e9aabd5ef2d970a5670e5448a5a3c3..025d11e9607ee6a4b6557b813946c5c3af1de44a 100644 (file)
@@ -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);
                }
            }
index c106a131120b1ea96f7a97e7ac5a59b77ef1d166..a3668ed0dc4d2d42abbbc19c1e08035cfe0742cc 100644 (file)
@@ -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));
 }
 
 /*
index 95bf730963f403fb88496c0cf8690212c92c7a93..05376a3510c669b34d73d9430871d1601416178c 100644 (file)
@@ -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;
index 1970ca9a43ad2aff60b6a5492fa70ca447fa4c5b..bd6fa801a43ea27ab32c4fe5d03419ce6d9d55ca 100644 (file)
@@ -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;
 
index fecd4444ae9b2460ef6ce2ea341e5073dedf1fde..2de9d39b9c469cb3d99ad7c9bc1449717cec6732 100644 (file)
@@ -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,
index 9c4e537d557265eb505e6e87dd5c95adb7e19e74..2b1bf60d07b9d486f54472839fcc72a2af215912 100644 (file)
@@ -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;
 }
index 5da3c1e7388e9f9d276c4e2cbfb82273146c7678..3ba756f6a8e0fcefbcda2caa997ede54226b9d16 100644 (file)
@@ -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
index 8da450499ee7f3c9ae4529f7b8ea8483e50f9a07..c608a927d1ffc0e92bfe3df46429eb1fbc3ffc5c 100644 (file)
@@ -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)); }
        ;
 
 /*
index 97b3d239406349d9d7cd3d927ce18c68e6cc163b..de004ee52cbf40a97e7d527b1414a4514feaea9b 100644 (file)
@@ -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;