From b75c969e666b9f262a05e0d1e54d56f7d3e45441 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 10 May 2005 22:56:25 +0000 Subject: Moved class File and the MD5 stuff to namespace Common svn-id: r18037 --- gob/dataio.cpp | 10 +++++----- gob/dataio.h | 6 +++--- gob/global.cpp | 2 +- gob/global.h | 2 +- gob/gob.cpp | 2 +- gob/inter.cpp | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) (limited to 'gob') diff --git a/gob/dataio.cpp b/gob/dataio.cpp index c01c36083e..a3ffabbf6c 100644 --- a/gob/dataio.cpp +++ b/gob/dataio.cpp @@ -30,7 +30,7 @@ int16 file_write(int16 handle, char *buf, int16 size) { return filesHandles[handle].write(buf, size); } -int16 file_open(const char *path, File::AccessMode mode) { +int16 file_open(const char *path, Common::File::AccessMode mode) { int16 i; for (i = 0; i < MAX_FILES; i++) { @@ -48,7 +48,7 @@ int16 file_open(const char *path, File::AccessMode mode) { return -1; } -File *file_getHandle(int16 handle) { +Common::File *file_getHandle(int16 handle) { return &filesHandles[handle]; } @@ -284,10 +284,10 @@ void data_closeData(int16 handle) { file_getHandle(handle)->close(); } -int16 data_openData(const char *path, File::AccessMode mode) { +int16 data_openData(const char *path, Common::File::AccessMode mode) { int16 handle; - if (mode != File::kFileReadMode) + if (mode != Common::File::kFileReadMode) return file_open(path, mode); handle = data_getChunk(path); @@ -320,7 +320,7 @@ void data_seekData(int16 handle, int32 pos, int16 from) { int32 data_getDataSize(const char *name) { char buf[128]; int32 chunkSz; - File file; + Common::File file; strcpy(buf, name); chunkSz = data_getChunkSize(buf); diff --git a/gob/dataio.h b/gob/dataio.h index d7d5917016..c5699b9cfa 100644 --- a/gob/dataio.h +++ b/gob/dataio.h @@ -36,8 +36,8 @@ struct ChunkDesc { byte packed; }; -int16 file_open(const char *path, File::AccessMode mode = File::kFileReadMode); -File *file_getHandle(int16 handle); +int16 file_open(const char *path, Common::File::AccessMode mode = Common::File::kFileReadMode); +Common::File *file_getHandle(int16 handle); int16 data_getChunk(const char *chunkName); char data_freeChunk(int16 handle); int32 data_readChunk(int16 handle, char *buf, int16 size); @@ -47,7 +47,7 @@ void data_openDataFile(const char *src); void data_closeDataFile(void); char *data_getUnpackedData(const char *name); void data_closeData(int16 handle); -int16 data_openData(const char *path, File::AccessMode mode = File::kFileReadMode); +int16 data_openData(const char *path, Common::File::AccessMode mode = Common::File::kFileReadMode); int32 data_readData(int16 handle, char *buf, int16 size); void data_seekData(int16 handle, int32 pos, int16 from); int32 data_getDataSize(const char *name); diff --git a/gob/global.cpp b/gob/global.cpp index 16605777a9..9ec7410d57 100644 --- a/gob/global.cpp +++ b/gob/global.cpp @@ -92,7 +92,7 @@ char useJoystick = 1; /* Files */ int16 filesCount = 0; -File filesHandles[MAX_FILES]; +Common::File filesHandles[MAX_FILES]; /* Data files */ struct ChunkDesc *dataFiles[MAX_DATA_FILES]; diff --git a/gob/global.h b/gob/global.h index fac456f2fc..35611392f7 100644 --- a/gob/global.h +++ b/gob/global.h @@ -116,7 +116,7 @@ extern char useJoystick; #define MAX_FILES 30 extern int16 filesCount; -extern File filesHandles[MAX_FILES]; +extern Common::File filesHandles[MAX_FILES]; /* Data files */ extern struct ChunkDesc *dataFiles[MAX_DATA_FILES]; diff --git a/gob/gob.cpp b/gob/gob.cpp index 4348728384..43a21d61d8 100644 --- a/gob/gob.cpp +++ b/gob/gob.cpp @@ -97,7 +97,7 @@ DetectedGameList Engine_GOB_detectGames(const FSList &fslist) { uint8 md5sum[16]; char md5str[32 + 1]; - if (md5_file(file->path().c_str(), md5sum, NULL, kMD5FileSizeLimit)) { + if (Common::md5_file(file->path().c_str(), md5sum, NULL, kMD5FileSizeLimit)) { for (int i = 0; i < 16; i++) { sprintf(md5str + i * 2, "%02x", (int)md5sum[i]); } diff --git a/gob/inter.cpp b/gob/inter.cpp index 733f3ea94e..4bc314125e 100644 --- a/gob/inter.cpp +++ b/gob/inter.cpp @@ -489,7 +489,7 @@ void inter_writeData(void) { offset = parse_parseValExpr(); WRITE_VAR(1, 1); - handle = data_openData(inter_resStr, File::kFileWriteMode); + handle = data_openData(inter_resStr, Common::File::kFileWriteMode); if (handle < 0) return; -- cgit v1.2.3