[Commit] nickle ChangeLog,1.115,1.116 array.c,1.27,1.28

Keith Packard commit at keithp.com
Fri Dec 17 23:12:43 PST 2004


Committed by: keithp

Update of /local/src/CVS/nickle
In directory home.keithp.com:/tmp/cvs-serv5820

Modified Files:
	ChangeLog array.c 
Log Message:
2004-12-17  Keith Packard  <keithp at keithp.com>

	* array.c: (BuildArrayType):
	Create and initialize dimension vector in BuildArrayType.


Index: ChangeLog
===================================================================
RCS file: /local/src/CVS/nickle/ChangeLog,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -d -r1.115 -r1.116
--- ChangeLog	17 Dec 2004 05:49:33 -0000	1.115
+++ ChangeLog	18 Dec 2004 07:12:40 -0000	1.116
@@ -1,3 +1,8 @@
+2004-12-17  Keith Packard  <keithp at keithp.com>
+
+	* array.c: (BuildArrayType):
+	Create and initialize dimension vector in BuildArrayType.
+
 2004-12-16  Keith Packard  <keithp at keithp.com>
 
 	* float.c: (FloatPrint):

Index: array.c
===================================================================
RCS file: /local/src/CVS/nickle/array.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- array.c	17 Dec 2004 02:05:20 -0000	1.27
+++ array.c	18 Dec 2004 07:12:40 -0000	1.28
@@ -424,21 +424,33 @@
 }
 
 Type *
-BuildArrayType (Type *type, int ndim, ...)
+BuildArrayType (Type *subtype, int ndim, ...)
 {
     ENTER ();
     Expr    *dims = 0;
     int	    i;
     int	    dim;
     va_list ap;
+    Type    *type;
+    Value   dimArray;
 
+    dimArray = NewArray (True, False, typePrim[rep_integer], 1, &ndim);
     va_start (ap, ndim);
     for (i = 0; i < ndim; i++)
     {
 	dim = va_arg (ap, int);
+	ArrayValueSet(&dimArray->array, i, NewInt (dim));
 	dims = NewExprTree (COMMA, NewExprConst (TEN_FLOAT, NewInt (dim)),
 			    dims);
     }
     va_end (ap);
-    RETURN (NewTypeArray (type, dims, False));
+    type = NewTypeArray (subtype, dims, False);
+    /*
+     * Create an array to hold the dimension information and
+     * fill it in
+     */
+    type->array.storage = DimStorageGlobal;
+    type->array.u.global = NewBox (True, False, 1, typeArrayInt);
+    BoxValueSet (type->array.u.global, 0, dimArray);
+    RETURN (type);
 }




More information about the Commit mailing list