From af4d23f76260658b1b5e0e9ae40f00f6245bfa4f Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Wed, 6 May 2009 09:12:24 +0000 Subject: Const correctness svn-id: r40346 --- engines/sword2/saveload.cpp | 4 ++-- engines/sword2/sword2.cpp | 2 +- engines/sword2/sword2.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/sword2') diff --git a/engines/sword2/saveload.cpp b/engines/sword2/saveload.cpp index e9d184f9d6..4a8b0e9ab6 100644 --- a/engines/sword2/saveload.cpp +++ b/engines/sword2/saveload.cpp @@ -70,14 +70,14 @@ uint32 Sword2Engine::findBufferSize() { * 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); diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index e9ad1dba4a..54c646c326 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -832,7 +832,7 @@ uint32 Sword2Engine::getMillis() { } 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; diff --git a/engines/sword2/sword2.h b/engines/sword2/sword2.h index 7168e7ae47..84530fc4f2 100644 --- a/engines/sword2/sword2.h +++ b/engines/sword2/sword2.h @@ -219,7 +219,7 @@ public: 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(); -- cgit v1.2.3