diff --git a/source/CmdLine.h b/source/CmdLine.h index 842ca45b..7c974550 100644 --- a/source/CmdLine.h +++ b/source/CmdLine.h @@ -54,9 +54,9 @@ struct CmdLine bool bSwapButtons0and1; bool bRemoveNoSlotClock; SS_CARDTYPE slotInsert[NUM_SLOTS]; - LPSTR szImageName_drive[NUM_SLOTS][NUM_DRIVES]; + LPCSTR szImageName_drive[NUM_SLOTS][NUM_DRIVES]; bool driveConnected[NUM_SLOTS][NUM_DRIVES]; - LPSTR szImageName_harddisk[NUM_HARDDISKS]; + LPCSTR szImageName_harddisk[NUM_HARDDISKS]; LPSTR szSnapshotName; LPSTR szScreenshotFilename; UINT uRamWorksExPages; diff --git a/source/Disk.cpp b/source/Disk.cpp index 39ed0d0c..6bc1e988 100644 --- a/source/Disk.cpp +++ b/source/Disk.cpp @@ -2057,7 +2057,7 @@ bool Disk2InterfaceCard::LoadSnapshotFloppy(YamlLoadHelper& yamlLoadHelper, UINT bImageError = (dwAttributes == INVALID_FILE_ATTRIBUTES); if (!bImageError) { - if (InsertDisk(unit, filename.c_str(), dwAttributes & FILE_ATTRIBUTE_READONLY, IMAGE_DONT_CREATE) != eIMAGE_ERROR_NONE) + if (InsertDisk(unit, filename, dwAttributes & FILE_ATTRIBUTE_READONLY, IMAGE_DONT_CREATE) != eIMAGE_ERROR_NONE) bImageError = true; // InsertDisk() zeros m_floppyDrive[unit], then sets up: diff --git a/source/Harddisk.cpp b/source/Harddisk.cpp index ae55f048..b9759ccb 100644 --- a/source/Harddisk.cpp +++ b/source/Harddisk.cpp @@ -859,7 +859,7 @@ static bool HD_LoadSnapshotHDDUnit(YamlLoadHelper& yamlLoadHelper, UINT unit) return bResSelectImage; } -bool HD_LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version, const std::string strSaveStatePath) +bool HD_LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version, const std::string & strSaveStatePath) { if (slot != 7) // fixme throw std::string("Card: wrong slot"); diff --git a/source/Harddisk.h b/source/Harddisk.h index 61df86b1..3ca13688 100644 --- a/source/Harddisk.h +++ b/source/Harddisk.h @@ -55,4 +55,4 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA std::string HD_GetSnapshotCardName(void); void HD_SaveSnapshot(class YamlSaveHelper& yamlSaveHelper); - bool HD_LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version, const std::string strSaveStatePath); + bool HD_LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT slot, UINT version, const std::string & strSaveStatePath); diff --git a/source/Utilities.cpp b/source/Utilities.cpp index f511fd54..249fdce0 100644 --- a/source/Utilities.cpp +++ b/source/Utilities.cpp @@ -336,7 +336,7 @@ static std::string GetFullPath(LPCSTR szFileName) return strPathName; } -static void SetCurrentDir(std::string pathname) +static void SetCurrentDir(const std::string & pathname) { // Due to the order HDDs/disks are inserted, then s7 insertions take priority over s6 & s5; and d2 takes priority over d1: // . if -s6[dN] and -hN are specified, then g_sCurrentDir will be set to the HDD image's path @@ -362,7 +362,7 @@ static bool DoDiskInsert(const UINT slot, const int nDrive, LPCSTR szFileName) std::string strPathName = GetFullPath(szFileName); if (strPathName.empty()) return false; - ImageError_e Error = disk2Card.InsertDisk(nDrive, strPathName.c_str(), IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE); + ImageError_e Error = disk2Card.InsertDisk(nDrive, strPathName, IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE); bool res = (Error == eIMAGE_ERROR_NONE); if (res) SetCurrentDir(strPathName); @@ -380,14 +380,14 @@ static bool DoHardDiskInsert(const int nDrive, LPCSTR szFileName) std::string strPathName = GetFullPath(szFileName); if (strPathName.empty()) return false; - BOOL bRes = HD_Insert(nDrive, strPathName.c_str()); + BOOL bRes = HD_Insert(nDrive, strPathName); bool res = (bRes == TRUE); if (res) SetCurrentDir(strPathName); return res; } -void InsertFloppyDisks(const UINT slot, LPSTR szImageName_drive[NUM_DRIVES], bool driveConnected[NUM_DRIVES], bool& bBoot) +void InsertFloppyDisks(const UINT slot, LPCSTR szImageName_drive[NUM_DRIVES], bool driveConnected[NUM_DRIVES], bool& bBoot) { _ASSERT(slot == 5 || slot == 6); @@ -419,7 +419,7 @@ void InsertFloppyDisks(const UINT slot, LPSTR szImageName_drive[NUM_DRIVES], boo GetFrame().FrameMessageBox("Failed to insert floppy disk(s) - see log file", "Warning", MB_ICONASTERISK | MB_OK); } -void InsertHardDisks(LPSTR szImageName_harddisk[NUM_HARDDISKS], bool& bBoot) +void InsertHardDisks(LPCSTR szImageName_harddisk[NUM_HARDDISKS], bool& bBoot) { if (!szImageName_harddisk[HARDDISK_1] && !szImageName_harddisk[HARDDISK_2]) return; diff --git a/source/Utilities.h b/source/Utilities.h index c5f7586b..43ac6a01 100644 --- a/source/Utilities.h +++ b/source/Utilities.h @@ -5,8 +5,8 @@ void LoadConfiguration(); -void InsertFloppyDisks(const UINT slot, LPSTR szImageName_drive[NUM_DRIVES], bool driveConnected[NUM_DRIVES], bool& bBoot); -void InsertHardDisks(LPSTR szImageName_harddisk[NUM_HARDDISKS], bool& bBoot); +void InsertFloppyDisks(const UINT slot, LPCSTR szImageName_drive[NUM_DRIVES], bool driveConnected[NUM_DRIVES], bool& bBoot); +void InsertHardDisks(LPCSTR szImageName_harddisk[NUM_HARDDISKS], bool& bBoot); void UnplugHardDiskControllerCard(void); void GetAppleWindowTitle();