[Scummvm-cvs-logs] scummvm master -> 4e592c724904bb0bc597e5bc7fe7707c1f858dab

digitall dgturner at iee.org
Sun Jan 12 03:55:57 CET 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
4e592c7249 CGE: Remove unecessary void pointer usage in resource file I/O.


Commit: 4e592c724904bb0bc597e5bc7fe7707c1f858dab
    https://github.com/scummvm/scummvm/commit/4e592c724904bb0bc597e5bc7fe7707c1f858dab
Author: D G Turner (digitall at scummvm.org)
Date: 2014-01-11T18:59:21-08:00

Commit Message:
CGE: Remove unecessary void pointer usage in resource file I/O.

Changed paths:
    engines/cge/fileio.cpp
    engines/cge/fileio.h



diff --git a/engines/cge/fileio.cpp b/engines/cge/fileio.cpp
index c08cb43..8ee726c 100644
--- a/engines/cge/fileio.cpp
+++ b/engines/cge/fileio.cpp
@@ -93,8 +93,8 @@ ResourceManager::~ResourceManager() {
 		delete _buff[i]._page;
 }
 
-uint16 ResourceManager::XCrypt(void *buf, uint16 length) {
-	byte *b = static_cast<byte *>(buf);
+uint16 ResourceManager::XCrypt(byte *buf, uint16 length) {
+	byte *b = buf;
 
 	for (uint16 i = 0; i < length; i++)
 		*b++ ^= kCryptSeed;
@@ -106,7 +106,7 @@ bool ResourceManager::seek(int32 offs, int whence) {
 	return _datFile->seek(offs, whence);
 }
 
-uint16 ResourceManager::read(void *buf, uint16 length) {
+uint16 ResourceManager::read(byte *buf, uint16 length) {
 	if (!_datFile->isOpen())
 		return 0;
 
@@ -178,7 +178,7 @@ bool ResourceManager::exist(const char *name) {
 	return scumm_stricmp(find(name)->_key, name) == 0;
 }
 
-uint16 ResourceManager::catRead(void *buf, uint16 length) {
+uint16 ResourceManager::catRead(byte *buf, uint16 length) {
 	if (!_catFile->isOpen())
 		return 0;
 
@@ -225,7 +225,7 @@ EncryptedStream::EncryptedStream(CGEEngine *vm, const char *name) : _vm(vm) {
 	_readStream = new Common::MemoryReadStream(dataBuffer, bufSize, DisposeAfterUse::YES);
 }
 
-uint32 EncryptedStream::read(void *dataPtr, uint32 dataSize) {
+uint32 EncryptedStream::read(byte *dataPtr, uint32 dataSize) {
 	return _readStream->read(dataPtr, dataSize);
 }
 
diff --git a/engines/cge/fileio.h b/engines/cge/fileio.h
index cee1fa7..653aaba 100644
--- a/engines/cge/fileio.h
+++ b/engines/cge/fileio.h
@@ -83,15 +83,15 @@ class ResourceManager {
 	} _buff[kBtLevel];
 
 	BtPage *getPage(int level, uint16 pageId);
-	uint16 catRead(void *buf, uint16 length);
+	uint16 catRead(byte *buf, uint16 length);
 	Common::File *_catFile;
 	Common::File *_datFile;
-	uint16  XCrypt(void *buf, uint16 length);
+	uint16  XCrypt(byte *buf, uint16 length);
 public:
 
 	ResourceManager();
 	~ResourceManager();
-	uint16 read(void *buf, uint16 length);
+	uint16 read(byte *buf, uint16 length);
 	bool seek(int32 offs, int whence = 0);
 
 	BtKeypack *find(const char *key);
@@ -111,7 +111,7 @@ public:
 	bool seek(int32 offset);
 	int32 pos();
 	int32 size();
-	uint32 read(void *dataPtr, uint32 dataSize);
+	uint32 read(byte *dataPtr, uint32 dataSize);
 	Common::String readLine();
 };
 






More information about the Scummvm-git-logs mailing list