From 977509ac7fd1cf5d21dbddfff4980b3ec2ad7ccf Mon Sep 17 00:00:00 2001 From: tomascz Date: Sat, 4 Sep 2021 09:57:39 +0100 Subject: [PATCH] [#64] Internal FDD improvements and bugfixes (Part 4: Fixed logging) --- Main/src/Debug.cpp | 7 +++---- Main/src/Debug.h | 2 +- Main/src/FDD.cpp | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Main/src/Debug.cpp b/Main/src/Debug.cpp index c56a3ab9..7f227ce0 100644 --- a/Main/src/Debug.cpp +++ b/Main/src/Debug.cpp @@ -129,14 +129,13 @@ namespace Debug{ CLogFile &CLogFile::operator<<(const TSectorId &rsi){ // writes given SectorId to the LogFile - TCHAR buf[32]; - return operator<<( rsi.ToString(buf) ); + return operator<<( rsi.ToString() ); } CLogFile &CLogFile::operator<<(const TPhysicalAddress &rchs){ // writes given PhysicalAddress to the LogFile - TCHAR buf[64],si[32]; - ::wsprintf( buf, _T("[%d,%d,%s]"), rchs.cylinder, rchs.head, rchs.sectorId.ToString(si) ); + TCHAR buf[64]; + ::wsprintf( buf, _T("[%d,%d,%s]"), rchs.cylinder, rchs.head, (LPCTSTR)rchs.sectorId.ToString() ); return operator<<(buf); } diff --git a/Main/src/Debug.h b/Main/src/Debug.h index 0932cd6a..572b5f53 100644 --- a/Main/src/Debug.h +++ b/Main/src/Debug.h @@ -69,7 +69,7 @@ namespace Debug{ #define LOG_SECTOR_ACTION(pSectorId,name)\ TCHAR __sectorActionName[200];\ - ::wsprintf(__sectorActionName,_T("Sector %s %s"),(pSectorId)->ToString(__sectorActionName+160),name);\ + ::wsprintf(__sectorActionName,_T("Sector %s %s"),(LPCTSTR)(pSectorId)->ToString(),name);\ LOG_ACTION(__sectorActionName) #define LOG_DIALOG_DISPLAY(name)\ diff --git a/Main/src/FDD.cpp b/Main/src/FDD.cpp index 202b699c..e6673f07 100644 --- a/Main/src/FDD.cpp +++ b/Main/src/FDD.cpp @@ -801,7 +801,7 @@ error: switch (const TStdWinError err=::GetLastError()){ THead CFDD::GetHeadCount() const{ // determines and returns the actual number of Heads in the Image //EXCLUSIVELY_LOCK_THIS_IMAGE(); - LOG_CYLINDER_ACTION(cyl,_T("THead CFDD::GetHeadCount")); + LOG_ACTION(_T("THead CFDD::GetHeadCount")); return 2; // latest PC floppy drives had two Heads }