=================================================================== RCS file: /home/cvs/OpenXM/src/kan96xx/Kan/list.c,v retrieving revision 1.4 retrieving revision 1.6 diff -u -p -r1.4 -r1.6 --- OpenXM/src/kan96xx/Kan/list.c 2004/09/09 11:42:22 1.4 +++ OpenXM/src/kan96xx/Kan/list.c 2005/06/16 05:07:23 1.6 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM/src/kan96xx/Kan/list.c,v 1.3 2001/05/04 01:06:24 takayama Exp $ */ +/* $OpenXM: OpenXM/src/kan96xx/Kan/list.c,v 1.5 2004/09/11 01:00:42 takayama Exp $ */ /* list.c */ #include #include "datatype.h" @@ -27,6 +27,7 @@ struct object *newList(objp) /* Warning!! Make a copy of the object. It is important. */ *(op->lc.op) = *(objp); op->rc.op = (struct object *)NULL; + op->attr = NULL; return(op); } @@ -48,7 +49,7 @@ struct object listToArray(objp) /* This function copies only the top level of the list */ { int n; - struct object ans; + struct object ans = OINIT; int i; if (objp->tag != Slist) { warningList("use objectListToObjectArray() for object-list."); @@ -136,20 +137,28 @@ struct object *cdr(list) } -void printObjectList(op) - struct object *op; +static void printObjectList0(op,br) + struct object *op; int br; { if (op == NULL) return; if (isNullList(op)) return; if (op->tag == Slist) { - printObjectList(op->lc.op); + if (br) printf("<"); + printObjectList0(op->lc.op,1); printf(", "); - printObjectList(op->rc.op); + printObjectList0(op->rc.op,0); + if (br) printf(">"); }else { printObject(*op,0,stdout); } } +void printObjectList(op) + struct object *op; +{ + printObjectList0(op,1); +} + memberQ(list1,obj2) struct object *list1; struct object obj2; @@ -181,7 +190,7 @@ static warningList(str) } struct object KvJoin(struct object listo1,struct object listo2) { - struct object rob; + struct object rob = OINIT; struct object *op1,*op2; if (listo1.tag == Snull) return listo2; if (listo2.tag == Snull) return listo1; @@ -206,7 +215,7 @@ struct object Kcar(struct object listo) { } struct object Kcdr(struct object listo) { struct object *op; - struct object rob; + struct object rob = OINIT; if (listo.tag == Snull) return listo; if (listo.tag == Slist) { op = cdr(&listo);