[Scummvm-cvs-logs] SF.net SVN: scummvm:[40346] scummvm/trunk/engines

sev at users.sourceforge.net sev at users.sourceforge.net
Wed May 6 11:12:25 CEST 2009


Revision: 40346
          http://scummvm.svn.sourceforge.net/scummvm/?rev=40346&view=rev
Author:   sev
Date:     2009-05-06 09:12:24 +0000 (Wed, 06 May 2009)

Log Message:
-----------
Const correctness

Modified Paths:
--------------
    scummvm/trunk/engines/gob/saveload.cpp
    scummvm/trunk/engines/sword2/saveload.cpp
    scummvm/trunk/engines/sword2/sword2.cpp
    scummvm/trunk/engines/sword2/sword2.h

Modified: scummvm/trunk/engines/gob/saveload.cpp
===================================================================
--- scummvm/trunk/engines/gob/saveload.cpp	2009-05-06 08:24:53 UTC (rev 40345)
+++ scummvm/trunk/engines/gob/saveload.cpp	2009-05-06 09:12:24 UTC (rev 40346)
@@ -91,7 +91,7 @@
 }
 
 bool TempSprite::savePalette(const Video::Color *palette) {
-	memcpy((byte *) _palette, (byte *) palette, 768);
+	memcpy((byte *) _palette, (const byte *) palette, 768);
 	return true;
 }
 
@@ -126,7 +126,7 @@
 	}
 
 	if (palette) {
-		memcpy(buffer, (byte *) _palette, 768);
+		memcpy(buffer, (const byte *) _palette, 768);
 		buffer += 768;
 	}
 

Modified: scummvm/trunk/engines/sword2/saveload.cpp
===================================================================
--- scummvm/trunk/engines/sword2/saveload.cpp	2009-05-06 08:24:53 UTC (rev 40345)
+++ scummvm/trunk/engines/sword2/saveload.cpp	2009-05-06 09:12:24 UTC (rev 40346)
@@ -70,14 +70,14 @@
  * Save the game.
  */
 
-uint32 Sword2Engine::saveGame(uint16 slotNo, byte *desc) {
+uint32 Sword2Engine::saveGame(uint16 slotNo, const byte *desc) {
 	char description[SAVE_DESCRIPTION_LEN];
 	uint32 bufferSize = findBufferSize();
 	byte *saveBuffer = (byte *)malloc(bufferSize);
 	ScreenInfo *screenInfo = _screen->getScreenInfo();
 
 	memset(description, 0, sizeof(description));
-	strncpy(description, (char *)desc, SAVE_DESCRIPTION_LEN - 1);
+	strncpy(description, (const char *)desc, SAVE_DESCRIPTION_LEN - 1);
 
 	Common::MemoryWriteStream writeS(saveBuffer, bufferSize);
 

Modified: scummvm/trunk/engines/sword2/sword2.cpp
===================================================================
--- scummvm/trunk/engines/sword2/sword2.cpp	2009-05-06 08:24:53 UTC (rev 40345)
+++ scummvm/trunk/engines/sword2/sword2.cpp	2009-05-06 09:12:24 UTC (rev 40346)
@@ -832,7 +832,7 @@
 }
 
 Common::Error Sword2Engine::saveGameState(int slot, const char *desc) {
-	uint32 saveVal = saveGame(slot, (byte *)desc);
+	uint32 saveVal = saveGame(slot, (const byte *)desc);
 
 	if (saveVal == SR_OK)
 		return Common::kNoError;

Modified: scummvm/trunk/engines/sword2/sword2.h
===================================================================
--- scummvm/trunk/engines/sword2/sword2.h	2009-05-06 08:24:53 UTC (rev 40345)
+++ scummvm/trunk/engines/sword2/sword2.h	2009-05-06 09:12:24 UTC (rev 40346)
@@ -219,7 +219,7 @@
 	bool checkTextLine(byte *file, uint32 text_line);
 	byte *fetchPaletteMatchTable(byte *screenFile);
 	
-	uint32 saveGame(uint16 slotNo, byte *description);
+	uint32 saveGame(uint16 slotNo, const byte *description);
 	uint32 restoreGame(uint16 slotNo);
 	uint32 getSaveDescription(uint16 slotNo, byte *description);
 	bool saveExists();


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list