Modified:
/branches/1.0/lib/uwarray.g
=======================================
--- /branches/1.0/lib/uwarray.g Sun Jun 12 09:40:51 2011
+++ /branches/1.0/lib/uwarray.g Wed Aug 3 09:12:32 2011
@@ -16,7 +16,7 @@
: Fun(spec A:type)(n:word)(#untracked a:A).#unique <uwarray A n> :=
fun(spec A:type)(n:word)(a:A). (mkvec A a (word_to_nat n)) <<END
void *guwarray_new(unsigned int n, int a) {
- void **h = (void **)guru_malloc(sizeof(int)*n);
+ int *h = (int *)guru_malloc(sizeof(int)*n);
// fprintf(stdout,"gmk_uwarray(%x).\n", h);
unsigned int c;
for (c = 0; c < n; c++)
@@ -31,7 +31,7 @@
fun(spec A:type)(spec n:word)(l:<uwarray A n>)(i:word)(u:{(ltword i n) =
tt}).
abbrev p = hypjoin (lt (to_nat i) (to_nat n)) tt by u end in
(vec_get A (word_to_nat n) l (word_to_nat i) p) <<END
-inline void* guwarray_get(void **l, unsigned int i) { return l[i]; }
+inline int* guwarray_get(int *l, unsigned int i) { return l[i]; }
END.
Define primitive uwarray_set
@@ -43,8 +43,8 @@
(u:{(ltword i n) = tt}).
abbrev p = hypjoin (lt (to_nat i) (to_nat n)) tt by u end in
(vec_update A (word_to_nat n) l (word_to_nat i) a p) <<END
-void *guwarray_set(void *l, unsigned int c, void *d) {
- ((void **)l)[c] = d;
+int guwarray_set(int *l, unsigned int c, int d) {
+ ((int *)l)[c] = d;
return l;
}
END.