[Scummvm-cvs-logs] CVS: scummvm/bs2 tony_gsdk.cpp,1.5,1.6
Marcus Comstedt
marcus_c at users.sourceforge.net
Sun Aug 3 08:39:04 CEST 2003
Update of /cvsroot/scummvm/scummvm/bs2
In directory sc8-pr-cvs1:/tmp/cvs-serv2704
Modified Files:
tony_gsdk.cpp
Log Message:
Don't use level 1 I/O, it's not part of the C++ standard...
Index: tony_gsdk.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/tony_gsdk.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- tony_gsdk.cpp 31 Jul 2003 18:35:00 -0000 1.5
+++ tony_gsdk.cpp 3 Aug 2003 15:38:27 -0000 1.6
@@ -27,7 +27,7 @@
//general odds and ends
#include <sys/stat.h>
-#include <fcntl.h>
+//#include <fcntl.h>
//#include <io.h>
#include <stdarg.h>
#include <stdio.h>
@@ -118,22 +118,21 @@
int32 Direct_write_file(const char *name, char *ad, uint32 total_bytes) //Tony1May96
{
//load the file directly into the memory location passed
- int fh;
+ FILE *fh;
- //fh = open(name, _O_RDWR | _O_CREAT); //open for reading
- fh = open(name, O_RDWR | O_CREAT); //open for reading
+ fh = fopen(name, "wb"); //open for writing
- if (fh==-1)
+ if (fh==NULL)
{ Zdebug("Direct_write_file open fail %d", name);
return(-1);
}
- if (write( fh, ad, total_bytes)==-1)
+ if (fwrite( ad, 1, total_bytes, fh)!=total_bytes)
{ Zdebug("Direct_write_file write fail %d", name);
return(-1);
}
- close(fh);
+ fclose(fh);
return(0); //ok, done it
}
More information about the Scummvm-git-logs
mailing list