diff --git a/app/ArchiveInfoDialog.cpp b/app/ArchiveInfoDialog.cpp index f608162..5e7b60d 100644 --- a/app/ArchiveInfoDialog.cpp +++ b/app/ArchiveInfoDialog.cpp @@ -183,9 +183,8 @@ void DiskArchiveInfoDialog::AddSubVolumes(const DiskFS* pDiskFS, /* * Add the current DiskFS. */ - CStringA volumeIdA(pDiskFS->GetVolumeID()); CString tmpStr(prefix); - tmpStr += Charset::ConvertMORToUNI(volumeIdA); + tmpStr += Charset::ConvertMORToUNI(pDiskFS->GetVolumeID()); pCombo->AddString(tmpStr); pCombo->SetItemData(*pIdx, (unsigned long) pDiskFS); (*pIdx)++; diff --git a/app/DiskArchive.cpp b/app/DiskArchive.cpp index 8acce85..4c1906d 100644 --- a/app/DiskArchive.cpp +++ b/app/DiskArchive.cpp @@ -892,8 +892,7 @@ CString DiskArchive::GetDescription() const CString str = L"Disk Image"; if (fpPrimaryDiskFS != NULL && fpPrimaryDiskFS->GetVolumeID() != NULL) { - CStringA volumeIdA(fpPrimaryDiskFS->GetVolumeID()); - CString volumeId(Charset::ConvertMORToUNI(volumeIdA)); + CString volumeId(Charset::ConvertMORToUNI(fpPrimaryDiskFS->GetVolumeID())); str.Format(L"Disk Image - %ls", (LPCWSTR) volumeId); } return str; @@ -1090,12 +1089,11 @@ int DiskArchive::LoadDiskFSContents(DiskFS* pDiskFS, const WCHAR* volName) */ pSubVol = pDiskFS->GetNextSubVolume(NULL); while (pSubVol != NULL) { - CStringA subVolNameMOR; CString concatSubVolName; int ret; - subVolNameMOR = pSubVol->GetDiskFS()->GetVolumeName(); - if (subVolNameMOR.IsEmpty()) { + const char* subVolNameMOR = pSubVol->GetDiskFS()->GetVolumeName(); + if (subVolNameMOR == NULL) { subVolNameMOR = "+++"; // call it *something* } CString subVolName(Charset::ConvertMORToUNI(subVolNameMOR)); diff --git a/app/DiskEditDialog.cpp b/app/DiskEditDialog.cpp index feaa6d5..126c23f 100644 --- a/app/DiskEditDialog.cpp +++ b/app/DiskEditDialog.cpp @@ -132,8 +132,7 @@ BOOL DiskEditDialog::OnInitDialog(void) title += fFileName; if (fpDiskFS->GetVolumeID() != NULL) { title += " ("; - CStringA volumeIdA(fpDiskFS->GetVolumeID()); - title += Charset::ConvertMORToUNI(volumeIdA); + title += Charset::ConvertMORToUNI(fpDiskFS->GetVolumeID()); title += ")"; } SetWindowText(title); @@ -280,8 +279,7 @@ void DiskEditDialog::OnSubVolume(void) pEditDialog = &blockEdit; else pEditDialog = §orEdit; - CStringA volumeIdA(fpDiskFS->GetVolumeID()); - CString volumeId(Charset::ConvertMORToUNI(volumeIdA)); + CString volumeId(Charset::ConvertMORToUNI(fpDiskFS->GetVolumeID())); pEditDialog->Setup(pSubVol->GetDiskFS(), volumeId); pEditDialog->SetPositionShift(8); (void) pEditDialog->DoModal(); diff --git a/app/DiskFSTree.cpp b/app/DiskFSTree.cpp index 395e3d3..d0c6184 100644 --- a/app/DiskFSTree.cpp +++ b/app/DiskFSTree.cpp @@ -43,8 +43,7 @@ bool DiskFSTree::AddDiskFS(CTreeCtrl* pTree, HTREEITEM parent, pTarget->pDiskFS = pDiskFS; pTarget->pFile = NULL; // could also use volume dir for ProDOS tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM; - CStringA volumeIdA(pDiskFS->GetVolumeID()); - CString volumeId(Charset::ConvertMORToUNI(volumeIdA)); + CString volumeId(Charset::ConvertMORToUNI(pDiskFS->GetVolumeID())); int index = fStringHolder.Add(volumeId); tvi.pszText = (LPWSTR)(LPCWSTR) fStringHolder.GetAt(index); tvi.cchTextMax = 0; // not needed for insertitem diff --git a/app/MyApp.h b/app/MyApp.h index f2baa5c..30f66d4 100644 --- a/app/MyApp.h +++ b/app/MyApp.h @@ -15,7 +15,7 @@ #define kAppMajorVersion 4 #define kAppMinorVersion 0 #define kAppBugVersion 0 -#define kAppDevString L"b3" +#define kAppDevString L"-b3" /* * Windows application object. diff --git a/app/SubVolumeDialog.cpp b/app/SubVolumeDialog.cpp index 9a222e7..dfb0b46 100644 --- a/app/SubVolumeDialog.cpp +++ b/app/SubVolumeDialog.cpp @@ -34,8 +34,7 @@ BOOL SubVolumeDialog::OnInitDialog(void) DiskFS::SubVolume* pSubVol = fpDiskFS->GetNextSubVolume(NULL); ASSERT(pSubVol != NULL); // shouldn't be here otherwise while (pSubVol != NULL) { - CStringA volumeIdA(pSubVol->GetDiskFS()->GetVolumeID()); - CString volumeId(Charset::ConvertMORToUNI(volumeIdA)); + CString volumeId(Charset::ConvertMORToUNI(pSubVol->GetDiskFS()->GetVolumeID())); pListBox->AddString(volumeId); // makes a copy of the string pSubVol = fpDiskFS->GetNextSubVolume(pSubVol); diff --git a/app/VolumeCopyDialog.cpp b/app/VolumeCopyDialog.cpp index a852272..a4f2ffb 100644 --- a/app/VolumeCopyDialog.cpp +++ b/app/VolumeCopyDialog.cpp @@ -334,8 +334,7 @@ void VolumeCopyDialog::AddToList(CListCtrl* pListView, DiskImg* pDiskImg, long numBlocks = pDiskImg->GetNumBlocks(); - CStringA volNameA = pDiskFS->GetVolumeName(); - CString volName(Charset::ConvertMORToUNI(volNameA)); + CString volName(Charset::ConvertMORToUNI(pDiskFS->GetVolumeName())); CString format = DiskImg::ToString(pDiskImg->GetFSFormat()); blocksStr.Format(L"%ld", pDiskImg->GetNumBlocks()); if (numBlocks > 1024*1024*2) @@ -400,8 +399,7 @@ void VolumeCopyDialog::OnCopyToFile(void) assert(pSrcImg != NULL); assert(pSrcFS != NULL); - CStringA srcNameA = pSrcFS->GetVolumeName(); - CString srcName(Charset::ConvertMORToUNI(srcNameA)); + CString srcName(Charset::ConvertMORToUNI(pSrcFS->GetVolumeName())); /* force the format to be generic ProDOS-ordered blocks */ originalFormat = pSrcImg->GetFSFormat(); @@ -586,8 +584,7 @@ void VolumeCopyDialog::OnCopyFromFile(void) if (!result) return; - CStringA targetNameA = pDstFS->GetVolumeName(); - CString targetName(Charset::ConvertMORToUNI(targetNameA)); + CString targetName(Charset::ConvertMORToUNI(pDstFS->GetVolumeName())); /* diff --git a/reformat/Charset.h b/reformat/Charset.h index 94808c3..d130e31 100644 --- a/reformat/Charset.h +++ b/reformat/Charset.h @@ -28,14 +28,14 @@ public: } // Simple Mac OS Roman to Unicode string conversion. - static CString ConvertMORToUNI(const CStringA& strMOR) + static CString ConvertMORToUNI(const char* strMOR) { // We know that all MOR characters are represented in Unicode with a // single BMP code point, so we know that strlen(MOR) == wcslen(UNI). - const int len = strMOR.GetLength(); + const size_t len = strlen(strMOR); CString strUNI; WCHAR* uniBuf = strUNI.GetBuffer(len); - for (int i = 0; i < len; i++) { + for (size_t i = 0; i < len; i++) { uniBuf[i] = Charset::ConvertMacRomanToUTF16(strMOR[i]); } strUNI.ReleaseBuffer(len);