[Scummvm-cvs-logs] CVS: scummvm/gob dataio.cpp,1.6,1.7 dataio.h,1.4,1.5
Torbjörn Andersson
eriktorbjorn at users.sourceforge.net
Tue May 3 01:37:41 CEST 2005
- Previous message: [Scummvm-cvs-logs] CVS: web/docs md5.inc,1.66,1.67
- Next message: [Scummvm-cvs-logs] CVS: scummvm/sword2 anims.cpp,1.69,1.70 function.cpp,1.82,1.83 logic.h,1.44,1.45 router.h,1.20,1.21 speech.cpp,1.73,1.74 walker.cpp,1.46,1.47
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/gob
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26800
Modified Files:
dataio.cpp dataio.h
Log Message:
Use File::size() instead of stat() to find the size of a file.
Index: dataio.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gob/dataio.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- dataio.cpp 9 Apr 2005 19:32:28 -0000 1.6
+++ dataio.cpp 3 May 2005 08:37:03 -0000 1.7
@@ -320,17 +320,20 @@
int32 data_getDataSize(const char *name) {
char buf[128];
int32 chunkSz;
- struct stat statBuf;
+ File file;
strcpy(buf, name);
chunkSz = data_getChunkSize(buf);
if (chunkSz >= 0)
return chunkSz;
- if (stat(buf, &statBuf) == -1)
- error("data_getDataSize: Can't find data (%s)", name);
+ if (!file.open(buf))
+ error("data_getDataSize: Can't find data(%s)", name);
- return statBuf.st_size;
+ chunkSz = file.size();
+ file.close();
+
+ return chunkSz;
}
char *data_getData(const char *path) {
@@ -359,7 +362,6 @@
data_readData(handle, ptr, size);
data_closeData(handle);
return data;
-
}
char *data_getSmallData(const char *path) {
Index: dataio.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gob/dataio.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- dataio.h 9 Apr 2005 19:19:53 -0000 1.4
+++ dataio.h 3 May 2005 08:37:04 -0000 1.5
@@ -23,7 +23,6 @@
#define GOB_DATAIO_H
#include "common/file.h"
-#include <sys/stat.h>
namespace Gob {
- Previous message: [Scummvm-cvs-logs] CVS: web/docs md5.inc,1.66,1.67
- Next message: [Scummvm-cvs-logs] CVS: scummvm/sword2 anims.cpp,1.69,1.70 function.cpp,1.82,1.83 logic.h,1.44,1.45 router.h,1.20,1.21 speech.cpp,1.73,1.74 walker.cpp,1.46,1.47
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list