[Gridflow-cvs] [svn] commit: r3374 - in /trunk/format: dc1394.c main.c opengl.c quartz.m quicktimeapple.c x11.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Mon Mar 31 22:42:22 EDT 2008


Author: matju
Date: Mon Mar 31 22:42:22 2008
New Revision: 3374

Log:
stop using Ruby's Symbol and String

Modified:
    trunk/format/dc1394.c
    trunk/format/main.c
    trunk/format/opengl.c
    trunk/format/quartz.m
    trunk/format/quicktimeapple.c
    trunk/format/x11.c

Modified: trunk/format/dc1394.c
==============================================================================
--- trunk/format/dc1394.c (original)
+++ trunk/format/dc1394.c Mon Mar 31 22:42:22 2008
@@ -306,17 +306,17 @@
 ;
 
 \class FormatDC1394 : Format {
-	\decl void initialize (Symbol mode);
+	\decl void initialize (t_symbol *mode);
 	\decl 0 bang ();
 };
 
-\def void initialize(Symbol mode) {
+\def void initialize(t_symbol *mode) {
 	gfpost("DC1394: hello world");
 	RH rh = raw1394_new_handle();
 	int numPorts = raw1394_get_port_info(rh,0,0);
 	raw1394_destroy_handle(rh);
 	gfpost("there are %d Feuerweuer ports",numPorts);
-	if (mode!=SYM(in)) RAISE("sorry, read-only");
+	if (mode!="in") RAISE("sorry, read-only");
 	for(int port=0; port<numPorts; port++) {
 		gfpost("trying port #%d...",port);
 		RH rh = dc1394_create_handle(port);

Modified: trunk/format/main.c
==============================================================================
--- trunk/format/main.c (original)
+++ trunk/format/main.c Mon Mar 31 22:42:22 2008
@@ -189,8 +189,8 @@
 		//@stream.close if @stream
 		//GridFlow.hunt_zombies
 	}
-//	\decl void raw_open_gzip_in(String filename);
-//	\decl void raw_open_gzip_out(String filename);
+//	\decl void raw_open_gzip_in(string filename);
+//	\decl void raw_open_gzip_out(string filename);
 };
 
 \def void initialize(t_symbol *mode, string filename) {
@@ -263,11 +263,11 @@
 	this->nt = nt;
 }
 
-//\def void raw_open_gzip_in(String filename) {
+//\def void raw_open_gzip_in(string filename) {
 	//r,w = IO.pipe
 	//if (pid=fork) {GridFlow.subprocesses[pid]=true; w.close; @stream = r;}
 	//else {r.close; STDOUT.reopen w; STDIN.reopen filename, "r"; exec "gzip", "-dc";}
-//\def void raw_open_gzip_out(String filename) {
+//\def void raw_open_gzip_out(string filename) {
 	//r,w = IO.pipe
 	//if (pid=fork) {GridFlow.subprocesses[pid]=true; r.close; @stream = w;}
 	//else {w.close; STDIN.reopen r; STDOUT.reopen filename, "w"; exec "gzip", "-c";}

Modified: trunk/format/opengl.c
==============================================================================
--- trunk/format/opengl.c (original)
+++ trunk/format/opengl.c Mon Mar 31 22:42:22 2008
@@ -143,11 +143,11 @@
 	} GRID_FINISH {
 } GRID_END
 
-\def void initialize (Symbol mode) {
+\def void initialize (t_symbol *mode) {
 	SUPER;
 	if (in_use) RAISE("only one #io:opengl object at a time; sorry");
 	in_use=true;
-	if (mode!=SYM(out)) RAISE("write-only, sorry");
+	if (mode!="out") RAISE("write-only, sorry");
 	int dummy = 0;
 	glutInit(&dummy,0);
 	glutInitDisplayMode(GLUT_RGBA);

Modified: trunk/format/quartz.m
==============================================================================
--- trunk/format/quartz.m (original)
+++ trunk/format/quartz.m Mon Mar 31 22:42:22 2008
@@ -128,7 +128,7 @@
 		[window setReleasedWhenClosed: YES];
 		[window close];
 	}
-	\decl void initialize (Symbol mode);
+	\decl void initialize (t_symbol *mode);
 	\decl 0 call ();
 	\grin 0
 };
@@ -190,7 +190,7 @@
 	GFView_display(widget);
 } GRID_END
 
-\def void initialize (Symbol mode) {
+\def void initialize (t_symbol *mode) {
 	SUPER;
 	NSRect r = {{0,0}, {320,240}};
 	window = [[NSWindow alloc]

Modified: trunk/format/quicktimeapple.c
==============================================================================
--- trunk/format/quicktimeapple.c (original)
+++ trunk/format/quicktimeapple.c Mon Mar 31 22:42:22 2008
@@ -344,8 +344,8 @@
 		}
 	}
 	\decl void initialize (t_symbol *mode, string filename);
-	\decl 0 codec_m (String c);
-	\decl 0 colorspace_m (Symbol c);
+	\decl 0 codec_m (string c);
+	\decl 0 colorspace_m (string c);
 	\decl 0 bang ();
 	\decl 0 seek (int frame);
 	\grin 0
@@ -406,8 +406,8 @@
 } GRID_FINISH {
 } GRID_END
 
-\def 0 codec_m      (String c) { RAISE("Unimplemented. Sorry."); }
-\def 0 colorspace_m (Symbol c) { RAISE("Unimplemented. Sorry."); }
+\def 0 codec_m      (string c) { RAISE("Unimplemented. Sorry."); }
+\def 0 colorspace_m (string c) { RAISE("Unimplemented. Sorry."); }
 
 \def void initialize (t_symbol *mode, string filename) {
 	int err;

Modified: trunk/format/x11.c
==============================================================================
--- trunk/format/x11.c (original)
+++ trunk/format/x11.c Mon Mar 31 22:42:22 2008
@@ -114,7 +114,7 @@
 	\decl 0 hidecursor ();
 	\decl 0 set_geometry (int y, int x, int sy, int sx);
 	\decl 0 move (int y, int x);
-	\decl 0 transfer (Symbol s);
+	\decl 0 transfer (string s);
 	\decl 0 title (string title="");
 	\decl 0 warp (int y, int x);
 	\grin 0 int
@@ -220,7 +220,7 @@
 		}break;
 		case DestroyNotify:{
 			post("This window is being closed, so this handler will close too!");
-			rb_funcall(rself,SI(close),0);
+			delete this; /* really! what else could i do here anyway? */
 			return;
 		}break;
 		case ConfigureNotify:break; // as if we cared
@@ -537,10 +537,10 @@
 	XFlush(display);
 }
 
-\def 0 transfer (Symbol s) {
-	if (s==SYM(plain))       transfer=0;
-	else if (s==SYM(xshm))   transfer=1;
-	else if (s==SYM(xvideo)) transfer=2;
+\def 0 transfer (string s) {
+	if (s=="plain")       transfer=0;
+	else if (s=="xshm")   transfer=1;
+	else if (s=="xvideo") transfer=2;
 	else RAISE("unknown transfer mode (possible: plain xshm xvideo)");
 }
 



More information about the Gridflow-cvs mailing list