Replace sprintf_s() and wsprintf() with StrFormat(). (PR #1041)

And these Debugger related:
. Improve FormatAddress() and GetSymbol().
. GetSymbol(), FindSymbolFromAddress(), FormatAddress() are changed to use std::string instead.
. Remove static variable (not nice) in FormatAddress().
. GetSymbol() returns std::string reference instead of pointer.
This commit is contained in:
Kelvin Lee
2022-02-27 04:54:06 +11:00
committed by GitHub
parent 9ad6b11cf9
commit 253a59fde6
21 changed files with 238 additions and 323 deletions
+2 -3
View File
@@ -175,9 +175,8 @@ void SSI263::Write(BYTE nReg, BYTE nValue)
//
{
bool H2L = (m_ctrlArtAmp & CONTROL_MASK) && !(nValue & CONTROL_MASK);
char newMode[20];
sprintf_s(newMode, sizeof(newMode), "(new mode=%d)", m_durationPhoneme>>6);
LogOutput("CTRL = %d->%d, ART = 0x%02X, AMP=0x%02X %s\n", m_ctrlArtAmp>>7, nValue>>7, (nValue&ARTICULATION_MASK)>>4, nValue&AMPLITUDE_MASK, H2L?newMode:"");
std::string newMode = StrFormat(" (new mode=%d)", m_durationPhoneme>>6);
LogOutput("CTRL = %d->%d, ART = 0x%02X, AMP=0x%02X%s\n", m_ctrlArtAmp>>7, nValue>>7, (nValue&ARTICULATION_MASK)>>4, nValue&AMPLITUDE_MASK, H2L?newMode.c_str() : "");
}
#endif
#if LOG_SSI263B