[Gridflow-cvs] [svn] commit: r3305 - in /trunk/format: jpeg.c main.c netpbm.c png.c

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Thu Mar 27 12:58:37 EDT 2008


Author: matju
Date: Thu Mar 27 12:58:36 2008
New Revision: 3305

Log:
remove conflicting f,fd fields from those Format classes (those fields were moved to the Format superclass)

Modified:
    trunk/format/jpeg.c
    trunk/format/main.c
    trunk/format/netpbm.c
    trunk/format/png.c

Modified: trunk/format/jpeg.c
==============================================================================
--- trunk/format/jpeg.c (original)
+++ trunk/format/jpeg.c Thu Mar 27 12:58:36 2008
@@ -38,8 +38,6 @@
 	struct jpeg_compress_struct cjpeg;
 	struct jpeg_decompress_struct djpeg;
 	struct jpeg_error_mgr jerr;
-	int fd;
-	FILE *f;
 	\decl void initialize (Symbol mode, String filename);
 	\decl 0 bang ();
 	\decl 0 quality (short quality);

Modified: trunk/format/main.c
==============================================================================
--- trunk/format/main.c (original)
+++ trunk/format/main.c Thu Mar 27 12:58:36 2008
@@ -24,6 +24,7 @@
 #include "../base/grid.h.fcs"
 #include <string>
 #include <map>
+#define L _L_
 
 /* API (version 0.9.1)
 	mode is :in or :out
@@ -104,8 +105,8 @@
 	if (f) _0_close(0,0);
 	if (mode==SYM(in)) {filename = rb_funcall(mGridFlow,SI(find_file),1,filename);}
 	f = fopen(rb_str_ptr(filename),fmode);
+	if (!f) RAISE("can't open file '%s': %s",rb_str_ptr(filename),strerror(errno));
 	fd = fileno(f);
-	//@stream = File.open(filename,fmode); break;
 //	case gzfile:
 //		if (mode==SYM(in)) {filename = GridFlow.find_file(filename);}
 //		if (mode==:in) {raw_open_gzip_in filename; else raw_open_gzip_out filename;}
@@ -158,8 +159,6 @@
 
 \class FormatGrid : Format {
 	GridHeader head;
-	int fd;
-	FILE *f;
 	int endian;
 	NumberTypeE nt;
 	P<Dim> headerless; // if null: headerful; if Dim: it is the assumed dimensions of received grids

Modified: trunk/format/netpbm.c
==============================================================================
--- trunk/format/netpbm.c (original)
+++ trunk/format/netpbm.c Thu Mar 27 12:58:36 2008
@@ -28,8 +28,6 @@
 
 \class FormatNetPBM : Format {
 	struct pam inpam, outpam;
-	int fd;
-	FILE *f;
 	\grin 0
 	\decl void initialize(String mode, String filename);
 	\decl 0 bang ();

Modified: trunk/format/png.c
==============================================================================
--- trunk/format/png.c (original)
+++ trunk/format/png.c Thu Mar 27 12:58:36 2008
@@ -33,9 +33,7 @@
 	P<BitPacking> bit_packing;
 	png_structp png;
 	png_infop info;
-	int fd;
-	FILE *f;
-	FormatPNG () : bit_packing(0), png(0), f(0) {}
+	FormatPNG () : bit_packing(0), png(0) {}
 	\decl void initialize (Symbol mode, String filename);
 	\decl 0 bang ();
 	\grin 0 int



More information about the Gridflow-cvs mailing list