Replace StringCbPrintf() with StrFormat() (PR #1032)

This commit is contained in:
Kelvin Lee
2022-02-16 05:48:20 +11:00
committed by GitHub
parent 48dd638d33
commit 1a4e933778
16 changed files with 103 additions and 147 deletions
+3 -3
View File
@@ -611,7 +611,7 @@ static void GetAppleWinVersion(void)
delete [] pVerInfoBlock;
}
LogFileOutput("AppleWin version: %s\n", VERSIONSTRING);
LogFileOutput("AppleWin version: %s\n", g_VERSIONSTRING.c_str());
}
// DO ONE-TIME INITIALIZATION
@@ -830,9 +830,9 @@ static void RepeatInitialization(void)
if (bShowAboutDlg)
{
if (!AboutDlg())
g_cmdLine.bShutdown = true; // Close everything down
g_cmdLine.bShutdown = true; // Close everything down
else
RegSaveString(TEXT(REG_CONFIG), TEXT(REGVALUE_VERSION), 1, VERSIONSTRING); // Only save version after user accepts license
RegSaveString(REG_CONFIG, REGVALUE_VERSION, TRUE, g_VERSIONSTRING); // Only save version after user accepts license
}
if (g_bCapturePrintScreenKey)
+6 -7
View File
@@ -413,16 +413,15 @@ void Win32Frame::DisplayLogo(void)
SetTextAlign(hFrameDC, TA_RIGHT | TA_TOP);
SetBkMode(hFrameDC, TRANSPARENT);
TCHAR szVersion[64];
StringCbPrintf(szVersion, 64, "Version %s", VERSIONSTRING);
std::string strVersion = "Version " + g_VERSIONSTRING;
int xoff = GetFullScreenOffsetX(), yoff = GetFullScreenOffsetY();
#define DRAWVERSION(x,y,c) \
SetTextColor(hFrameDC,c); \
TextOut(hFrameDC, \
scale*540+x+xoff,scale*358+y+yoff, \
szVersion, \
strlen(szVersion));
strVersion.c_str(), \
strVersion.length());
if (GetDeviceCaps(hFrameDC, PLANES) * GetDeviceCaps(hFrameDC, BITSPIXEL) <= 4) {
DRAWVERSION(2, 2, RGB(0x00, 0x00, 0x00));
@@ -436,7 +435,7 @@ void Win32Frame::DisplayLogo(void)
}
#if _DEBUG
StringCbPrintf(szVersion, 64, "DEBUG");
strVersion = "DEBUG";
DRAWVERSION(2, -358 * scale, RGB(0x00, 0x00, 0x00));
DRAWVERSION(1, -357 * scale, RGB(0x00, 0x00, 0x00));
DRAWVERSION(0, -356 * scale, RGB(0xFF, 0x00, 0xFF));
@@ -621,8 +620,8 @@ BYTE* Win32Frame::GetResource(WORD id, LPCSTR lpType, DWORD dwExpectedSize)
return pResource;
}
std::string Win32Frame::Video_GetScreenShotFolder()
std::string Win32Frame::Video_GetScreenShotFolder() const
{
// save in current folder
return "";
return std::string();
}
+1 -1
View File
@@ -55,7 +55,7 @@ public:
virtual BYTE* GetResource(WORD id, LPCSTR lpType, DWORD expectedSize);
virtual void Restart();
virtual std::string Video_GetScreenShotFolder();
virtual std::string Video_GetScreenShotFolder() const;
bool GetFullScreenShowSubunitStatus(void);
int GetFullScreenOffsetX(void);