From 4007e973f3cebbf74dcc21466579a47d56874515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 1 Feb 2026 14:28:38 +0100 Subject: [PATCH] Driveby cleanup: Remove use of legacy --- Windows/Debugger/CtrlDisAsmView.cpp | 3 +-- Windows/Debugger/CtrlDisAsmView.h | 4 +--- Windows/Debugger/CtrlRegisterList.cpp | 3 +-- Windows/Debugger/CtrlRegisterList.h | 4 +--- Windows/GEDebugger/CtrlDisplayListView.cpp | 5 ++--- Windows/GEDebugger/CtrlDisplayListView.h | 4 +--- Windows/GEDebugger/GEDebugger.cpp | 2 +- Windows/MainWindow.cpp | 4 ++-- Windows/TouchInputHandler.cpp | 2 +- Windows/stdafx.h | 7 +++---- 10 files changed, 14 insertions(+), 24 deletions(-) diff --git a/Windows/Debugger/CtrlDisAsmView.cpp b/Windows/Debugger/CtrlDisAsmView.cpp index d6c932db9d..0c4f361008 100644 --- a/Windows/Debugger/CtrlDisAsmView.cpp +++ b/Windows/Debugger/CtrlDisAsmView.cpp @@ -24,10 +24,9 @@ #include "Common/Data/Encoding/Utf8.h" #include "Common/System/Display.h" -#include #include -TCHAR CtrlDisAsmView::szClassName[] = _T("CtrlDisAsmView"); +constexpr wchar_t *szClassName = L"CtrlDisAsmView"; static constexpr UINT_PTR IDT_REDRAW = 0xC0DE0001; static constexpr UINT REDRAW_DELAY = 1000 / 60; diff --git a/Windows/Debugger/CtrlDisAsmView.h b/Windows/Debugger/CtrlDisAsmView.h index fe908ddad0..d0432c0274 100644 --- a/Windows/Debugger/CtrlDisAsmView.h +++ b/Windows/Debugger/CtrlDisAsmView.h @@ -25,8 +25,7 @@ #include "Core/MIPS/MIPSDebugInterface.h" #include "Core/Debugger/DisassemblyManager.h" -class CtrlDisAsmView -{ +class CtrlDisAsmView { HWND wnd; HFONT font; HFONT boldfont; @@ -41,7 +40,6 @@ class CtrlDisAsmView bool hasFocus; bool showHex; MIPSDebugInterface *debugger; - static TCHAR szClassName[]; u32 windowStart; int visibleRows; diff --git a/Windows/Debugger/CtrlRegisterList.cpp b/Windows/Debugger/CtrlRegisterList.cpp index 0e1d634002..21c69d2499 100644 --- a/Windows/Debugger/CtrlRegisterList.cpp +++ b/Windows/Debugger/CtrlRegisterList.cpp @@ -1,5 +1,4 @@ #include -#include #include "Common/System/Display.h" #include "Common/Data/Encoding/Utf8.h" @@ -21,7 +20,7 @@ enum { REGISTER_PC = 32, REGISTER_HI, REGISTER_LO, REGISTERS_END }; -TCHAR CtrlRegisterList::szClassName[] = _T("CtrlRegisterList"); +constexpr wchar_t *szClassName = L"CtrlRegisterList"; static constexpr UINT_PTR IDT_REDRAW = 0xC0DE0001; static constexpr UINT REDRAW_DELAY = 1000 / 60; diff --git a/Windows/Debugger/CtrlRegisterList.h b/Windows/Debugger/CtrlRegisterList.h index 41fa19c91f..211e6203c7 100644 --- a/Windows/Debugger/CtrlRegisterList.h +++ b/Windows/Debugger/CtrlRegisterList.h @@ -18,8 +18,7 @@ #include "Core/MIPS/MIPSDebugInterface.h" -class CtrlRegisterList -{ +class CtrlRegisterList { HWND wnd; HFONT font; RECT rect; @@ -33,7 +32,6 @@ class CtrlRegisterList bool selecting = false; bool hasFocus = false; MIPSDebugInterface *cpu = nullptr; - static TCHAR szClassName[]; u32 lastPC = 0; u32 *lastCat0Values = nullptr; diff --git a/Windows/GEDebugger/CtrlDisplayListView.cpp b/Windows/GEDebugger/CtrlDisplayListView.cpp index 6c0f41961f..c7a59ada2e 100644 --- a/Windows/GEDebugger/CtrlDisplayListView.cpp +++ b/Windows/GEDebugger/CtrlDisplayListView.cpp @@ -1,5 +1,4 @@ #include -#include #include "Common/Data/Encoding/Utf8.h" #include "Common/StringUtils.h" #include "Common/System/Display.h" @@ -13,14 +12,14 @@ #include "GPU/Debugger/Breakpoints.h" #include "GPU/GPUState.h" -LPCTSTR CtrlDisplayListView::windowClass = _T("CtrlDisplayListView"); +constexpr wchar_t *szWindowClass = L"CtrlDisplayListView"; void CtrlDisplayListView::registerClass() { WNDCLASSEX wndClass; wndClass.cbSize = sizeof(wndClass); - wndClass.lpszClassName = windowClass; + wndClass.lpszClassName = szWindowClass; wndClass.hInstance = GetModuleHandle(0); wndClass.lpfnWndProc = wndProc; wndClass.hCursor = LoadCursor (NULL, IDC_ARROW); diff --git a/Windows/GEDebugger/CtrlDisplayListView.h b/Windows/GEDebugger/CtrlDisplayListView.h index 92244bb96c..048f57adf3 100644 --- a/Windows/GEDebugger/CtrlDisplayListView.h +++ b/Windows/GEDebugger/CtrlDisplayListView.h @@ -4,11 +4,9 @@ #include "Common/CommonWindows.h" #include "GPU/GPUDefinitions.h" -class CtrlDisplayListView -{ +class CtrlDisplayListView { HWND wnd; RECT rect; - static LPCTSTR windowClass; DisplayList list; HFONT font; diff --git a/Windows/GEDebugger/GEDebugger.cpp b/Windows/GEDebugger/GEDebugger.cpp index 26f68a475c..fe7de3734e 100644 --- a/Windows/GEDebugger/GEDebugger.cpp +++ b/Windows/GEDebugger/GEDebugger.cpp @@ -437,7 +437,7 @@ void CGEDebugger::DescribeSecondPreview(const GPUgstate &state, char desc[256]) } void CGEDebugger::PreviewExport(const GPUDebugBuffer *dbgBuffer) { - const TCHAR *filter = L"PNG Image (*.png)\0*.png\0JPEG Image (*.jpg)\0*.jpg\0All files\0*.*\0\0"; + constexpr wchar_t *filter = L"PNG Image (*.png)\0*.png\0JPEG Image (*.jpg)\0*.jpg\0All files\0*.*\0\0"; std::string fn; if (W32Util::BrowseForFileName(false, GetDlgHandle(), L"Save Preview Image...", nullptr, filter, L"png", fn)) { ScreenshotFormat fmt = fn.find(".jpg") != fn.npos ? ScreenshotFormat::JPG : ScreenshotFormat::PNG; diff --git a/Windows/MainWindow.cpp b/Windows/MainWindow.cpp index e94bb16f71..fbe19b48f5 100644 --- a/Windows/MainWindow.cpp +++ b/Windows/MainWindow.cpp @@ -153,7 +153,7 @@ namespace MainWindow bool noFocusPause = false; // TOGGLE_PAUSE state to override pause on lost focus bool trapMouse = true; // Handles some special cases(alt+tab, win menu) when game is running and mouse is confined - static const TCHAR szWindowClass[] = L"PPSSPPWnd"; + static constexpr wchar_t *szWindowClass = L"PPSSPPWnd"; static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); @@ -174,7 +174,7 @@ namespace MainWindow wcex.lpfnWndProc = (WNDPROC)WndProc; wcex.hInstance = hInstance; wcex.hCursor = LoadCursor(NULL, IDC_ARROW); - wcex.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); + wcex.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); // or NULL? wcex.lpszMenuName = (LPCWSTR)IDR_MENU1; wcex.lpszClassName = szWindowClass; wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_PPSSPP); diff --git a/Windows/TouchInputHandler.cpp b/Windows/TouchInputHandler.cpp index 2f7b5ec644..2bedf608f2 100644 --- a/Windows/TouchInputHandler.cpp +++ b/Windows/TouchInputHandler.cpp @@ -99,7 +99,7 @@ void TouchInputHandler::handleTouchEvent(HWND hWnd, UINT message, WPARAM wParam, // disable the press and hold gesture for the given window void TouchInputHandler::disablePressAndHold(HWND hWnd) { // The atom identifier and Tablet PC atom - LPCTSTR tabletAtom = _T("MicrosoftTabletPenServiceProperty"); + wchar_t *tabletAtom = L"MicrosoftTabletPenServiceProperty"; ATOM atomID = GlobalAddAtom(tabletAtom); // If getting the ID failed, return false diff --git a/Windows/stdafx.h b/Windows/stdafx.h index 95352445fb..4950ad043c 100644 --- a/Windows/stdafx.h +++ b/Windows/stdafx.h @@ -41,12 +41,11 @@ #include #include -#include -#include +#include #define _USE_MATH_DEFINES -#include -#include +#include +#include #include #include #include