[Gridflow-cvs] [svn] commit: r3570 - /trunk/base/grid.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Wed Apr 16 17:00:44 EDT 2008


Author: matju
Date: Wed Apr 16 17:00:44 2008
New Revision: 3570

Log:
fix typos

Modified:
    trunk/base/grid.c

Modified: trunk/base/grid.c
==============================================================================
--- trunk/base/grid.c (original)
+++ trunk/base/grid.c Wed Apr 16 17:00:44 2008
@@ -85,8 +85,6 @@
 	else RAISE("expected Float (or at least Integer)");}
 EACH_FLOAT_TYPE(FOO)
 #undef FOO
-
-static inline void NUM(Ruby x, ruby &y) { y.r=x; }
 
 void Grid::init_from_list(int n, t_atom *aa, NumberTypeE nt) {
 	t_atom2 *a = (t_atom2 *)aa;
@@ -116,7 +114,7 @@
 	T *p = (T *)*this; \
 	if (n==0) CLEAR(p,nn); \
 	else { \
-		for (int i=0; i<n; i++) NUM(a[i],p[i]); \
+		for (int i=0; i<n; i++) p[i] = a[i]; \
 		for (int i=n; i<nn; i+=n) COPY(p+i,p,min(n,nn-i)); }}
 	TYPESWITCH(nt,FOO,)
 #undef FOO
@@ -149,7 +147,7 @@
 	T *p = (T *)*this; \
 	if (n==0) CLEAR(p,nn); \
 	else { \
-		for (int i=0; i<n; i++) NUM(a[i],p[i]); \
+		for (int i=0; i<n; i++) p[i] = a[i]; \
 		for (int i=n; i<nn; i+=n) COPY(p+i,p,min(n,nn-i)); }}
 	TYPESWITCH(nt,FOO,)
 #undef FOO
@@ -157,12 +155,12 @@
 
 void Grid::init_from_atom(const t_atom &x) {
 	if (x.a_type==A_LIST) {
-		t_binbuf *b = (t_binbuf *)x->a_w.w_gpointer;
-		init_from_list(binbuf_getnatom(x),binbuf_getvec(x));
+		t_binbuf *b = (t_binbuf *)x.a_gpointer;
+		init_from_list(binbuf_getnatom(b),binbuf_getvec(b));
 	} else if (x.a_type==A_FLOAT) {
 		init(new Dim(),int32_e);
 		CHECK_ALIGN2(this->data,nt);
-		((int32 *)*this)[0] = x.a_w.w_float;
+		((int32 *)*this)[0] = x.a_float;
 	} else {
 		rb_funcall(
 		EVAL("proc{|x| raise \"can't convert to grid: #{x.inspect}\"}"),



More information about the Gridflow-cvs mailing list