Driveby cleanup: Remove use of legacy <tchar.h>

This commit is contained in:
Henrik Rydgård
2026-02-01 14:28:38 +01:00
parent 0b529c2316
commit 4007e973f3
10 changed files with 14 additions and 24 deletions
+1 -2
View File
@@ -24,10 +24,9 @@
#include "Common/Data/Encoding/Utf8.h"
#include "Common/System/Display.h"
#include <tchar.h>
#include <set>
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;
+1 -3
View File
@@ -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;
+1 -2
View File
@@ -1,5 +1,4 @@
#include <cmath>
#include <tchar.h>
#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;
+1 -3
View File
@@ -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;
+2 -3
View File
@@ -1,5 +1,4 @@
#include <algorithm>
#include <tchar.h>
#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);
+1 -3
View File
@@ -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;
+1 -1
View File
@@ -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;
+2 -2
View File
@@ -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);
+1 -1
View File
@@ -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
+3 -4
View File
@@ -41,12 +41,11 @@
#include <windowsx.h>
#include <process.h>
#include <tchar.h>
#include <stdio.h>
#include <cstdio>
#define _USE_MATH_DEFINES
#include <math.h>
#include <time.h>
#include <cmath>
#include <ctime>
#include <vector>
#include <map>
#include <string>