Remove Unused Semicolons, Fix Windows.h includes and Minor Warnings Fixes

This commit is contained in:
Xphalnos 2025-03-05 20:20:00 +01:00
parent 96560ed3ca
commit b6e212a378
65 changed files with 74 additions and 77 deletions

View File

@ -175,4 +175,4 @@ std::filesystem::path GetFoolproofKbmConfigFile(const std::string& game_id = "")
// settings // settings
u32 GetLanguage(); u32 GetLanguage();
}; // namespace Config } // namespace Config

View File

@ -4,7 +4,7 @@
#include <cstddef> #include <cstddef>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <Windows.h>
#else #else
#include <cerrno> #include <cerrno>
#include <cstring> #include <cstring>

View File

@ -13,9 +13,9 @@
#ifdef _WIN32 #ifdef _WIN32
#include "common/ntapi.h" #include "common/ntapi.h"
#include <Windows.h>
#include <io.h> #include <io.h>
#include <share.h> #include <share.h>
#include <windows.h>
#else #else
#include <unistd.h> #include <unistd.h>
#endif #endif

View File

@ -8,7 +8,7 @@
#include <fmt/format.h> #include <fmt/format.h>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> // For OutputDebugStringW #include <Windows.h> // For OutputDebugStringW
#endif #endif
#include "common/bounded_threadsafe_queue.h" #include "common/bounded_threadsafe_queue.h"

View File

@ -5,7 +5,7 @@
#include <cstdio> #include <cstdio>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <Windows.h>
#endif #endif
#include "common/assert.h" #include "common/assert.h"

View File

@ -5,7 +5,7 @@
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <Windows.h>
#include "common/types.h" #include "common/types.h"
typedef enum _FILE_INFORMATION_CLASS { typedef enum _FILE_INFORMATION_CLASS {

View File

@ -17,8 +17,8 @@
#ifdef _WIN32 #ifdef _WIN32
// This is the maximum number of UTF-16 code units permissible in Windows file paths // This is the maximum number of UTF-16 code units permissible in Windows file paths
#define MAX_PATH 260 #define MAX_PATH 260
#include <Shlobj.h> #include <ShlObj.h>
#include <windows.h> #include <Windows.h>
#else #else
// This is the maximum number of UTF-8 code units permissible in all other OSes' file paths // This is the maximum number of UTF-8 code units permissible in all other OSes' file paths
#define MAX_PATH 1024 #define MAX_PATH 1024

View File

@ -6,7 +6,7 @@
#include "common/uint128.h" #include "common/uint128.h"
#ifdef _WIN64 #ifdef _WIN64
#include <windows.h> #include <Windows.h>
#endif #endif
namespace Common { namespace Common {

View File

@ -6,7 +6,7 @@
#include "common/signal_context.h" #include "common/signal_context.h"
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <Windows.h>
#else #else
#include <sys/ucontext.h> #include <sys/ucontext.h>
#endif #endif

View File

@ -9,7 +9,7 @@
#include "common/types.h" #include "common/types.h"
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <Windows.h>
#endif #endif
namespace Common { namespace Common {

View File

@ -14,7 +14,7 @@
#include <mach/mach_time.h> #include <mach/mach_time.h>
#include <pthread.h> #include <pthread.h>
#elif defined(_WIN32) #elif defined(_WIN32)
#include <windows.h> #include <Windows.h>
#include "common/string_util.h" #include "common/string_util.h"
#else #else
#if defined(__Bitrig__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) #if defined(__Bitrig__) || defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__)

View File

@ -13,7 +13,7 @@
#include "libraries/error_codes.h" #include "libraries/error_codes.h"
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <Windows.h>
#else #else
#include <fcntl.h> #include <fcntl.h>
#include <sys/mman.h> #include <sys/mman.h>

View File

@ -19,7 +19,7 @@
#include "cpu_patches.h" #include "cpu_patches.h"
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <Windows.h>
#else #else
#include <pthread.h> #include <pthread.h>
#ifdef __APPLE__ #ifdef __APPLE__

View File

@ -6,9 +6,9 @@
#include "core/file_sys/file.h" #include "core/file_sys/file.h"
#ifdef _WIN64 #ifdef _WIN64
#include <Windows.h>
#include <io.h> #include <io.h>
#include <share.h> #include <share.h>
#include <windows.h>
#include "common/ntapi.h" #include "common/ntapi.h"
#endif #endif

View File

@ -8,7 +8,7 @@
#include "common/types.h" #include "common/types.h"
#ifdef _WIN64 #ifdef _WIN64
#include <windows.h> #include <Windows.h>
#else #else
#include <mutex> #include <mutex>
#endif #endif

View File

@ -10,7 +10,7 @@
#include "common/types.h" #include "common/types.h"
#ifdef _WIN64 #ifdef _WIN64
#include <windows.h> #include <Windows.h>
#elif defined(__APPLE__) #elif defined(__APPLE__)
#include <dispatch/dispatch.h> #include <dispatch/dispatch.h>
#else #else

View File

@ -10,8 +10,8 @@
#include "core/libraries/libs.h" #include "core/libraries/libs.h"
#ifdef _WIN64 #ifdef _WIN64
#include <Windows.h>
#include <pthread_time.h> #include <pthread_time.h>
#include <windows.h>
#include "common/ntapi.h" #include "common/ntapi.h"

View File

@ -8,7 +8,7 @@
#include "core/signals.h" #include "core/signals.h"
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <Windows.h>
#else #else
#include <csignal> #include <csignal>
#ifdef ARCH_X86_64 #ifdef ARCH_X86_64

View File

@ -6,7 +6,7 @@
#include "thread.h" #include "thread.h"
#ifdef _WIN64 #ifdef _WIN64
#include <windows.h> #include <Windows.h>
#include "common/ntapi.h" #include "common/ntapi.h"
#else #else
#include <csignal> #include <csignal>

View File

@ -10,7 +10,7 @@
#include "core/tls.h" #include "core/tls.h"
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <Windows.h>
#elif defined(__APPLE__) && defined(ARCH_X86_64) #elif defined(__APPLE__) && defined(ARCH_X86_64)
#include <architecture/i386/table.h> #include <architecture/i386/table.h>
#include <boost/icl/interval_set.hpp> #include <boost/icl/interval_set.hpp>

View File

@ -103,7 +103,7 @@ void Emulator::Run(const std::filesystem::path& file, const std::vector<std::str
std::string id; std::string id;
std::string title; std::string title;
std::string app_version; std::string app_version;
u32 fw_version; u32 fw_version = 0;
Common::PSFAttributes psf_attributes{}; Common::PSFAttributes psf_attributes{};
const auto param_sfo_path = mnt->GetHostPath("/app0/sce_sys/param.sfo"); const auto param_sfo_path = mnt->GetHostPath("/app0/sce_sys/param.sfo");

View File

@ -42,4 +42,4 @@ public:
explicit(false) operator bool() const; explicit(false) operator bool() const;
}; };
}; // namespace ImGui } // namespace ImGui

View File

@ -632,9 +632,9 @@ static void UpdateMouseData() {
io.AddMousePosEvent(mouse_x_global, mouse_y_global); io.AddMousePosEvent(mouse_x_global, mouse_y_global);
// SDL_EVENT_MOUSE_MOTION isn't triggered before the first frame is rendered // SDL_EVENT_MOUSE_MOTION isn't triggered before the first frame is rendered
// force update the prev_cursor coords // force update the prev_cursor coords
if (mouse_x_global != bd->prev_mouse_pos.x || mouse_y_global != bd->prev_mouse_pos.y && if (mouse_x_global != bd->prev_mouse_pos.x ||
bd->prev_mouse_pos.y == 0 && (mouse_y_global != bd->prev_mouse_pos.y && bd->prev_mouse_pos.y == 0 &&
bd->prev_mouse_pos.x == 0) { bd->prev_mouse_pos.x == 0)) {
bd->prev_mouse_pos.x = mouse_x_global; bd->prev_mouse_pos.x = mouse_x_global;
bd->prev_mouse_pos.y = mouse_y_global; bd->prev_mouse_pos.y = mouse_y_global;
bd->lastCursorMoveTime = bd->time; bd->lastCursorMoveTime = bd->time;

View File

@ -28,4 +28,4 @@ enum GamepadMode {
void SetGamepadMode(GamepadMode mode, SDL_Gamepad** manual_gamepads_array = NULL, void SetGamepadMode(GamepadMode mode, SDL_Gamepad** manual_gamepads_array = NULL,
int manual_gamepads_count = -1); int manual_gamepads_count = -1);
}; // namespace ImGui::Sdl } // namespace ImGui::Sdl

View File

@ -27,4 +27,4 @@ void DecodePngFile(std::filesystem::path path, Inner* core);
void Submit(); void Submit();
}; // namespace ImGui::Core::TextureManager } // namespace ImGui::Core::TextureManager

View File

@ -15,7 +15,7 @@
#include "emulator.h" #include "emulator.h"
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <Windows.h>
#endif #endif
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {

View File

@ -1,8 +1,7 @@
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later // SPDX-License-Identifier: GPL-2.0-or-later
#ifndef CHEATS_PATCHES_H #pragma once
#define CHEATS_PATCHES_H
#include <QCheckBox> #include <QCheckBox>
#include <QComboBox> #include <QComboBox>
@ -116,5 +115,3 @@ private:
QString CheatsDownloadedSuccessfully_MSG; QString CheatsDownloadedSuccessfully_MSG;
QString DownloadComplete_MSG; QString DownloadComplete_MSG;
}; };
#endif // CHEATS_PATCHES_H

View File

@ -15,7 +15,7 @@ CompatibilityInfoClass::CompatibilityInfoClass()
std::filesystem::path compatibility_file_path = std::filesystem::path compatibility_file_path =
Common::FS::GetUserPath(Common::FS::PathType::MetaDataDir) / "compatibility_data.json"; Common::FS::GetUserPath(Common::FS::PathType::MetaDataDir) / "compatibility_data.json";
Common::FS::PathToQString(m_compatibility_filename, compatibility_file_path); Common::FS::PathToQString(m_compatibility_filename, compatibility_file_path);
}; }
CompatibilityInfoClass::~CompatibilityInfoClass() = default; CompatibilityInfoClass::~CompatibilityInfoClass() = default;
void CompatibilityInfoClass::UpdateCompatibilityDatabase(QWidget* parent, bool forced) { void CompatibilityInfoClass::UpdateCompatibilityDatabase(QWidget* parent, bool forced) {

View File

@ -13,7 +13,7 @@
#include "main_window.h" #include "main_window.h"
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <Windows.h>
#endif #endif
// Custom message handler to ignore Qt logs // Custom message handler to ignore Qt logs

View File

@ -730,7 +730,7 @@ void MainWindow::ShowGameList() {
m_game_grid_frame->clearContents(); m_game_grid_frame->clearContents();
m_game_list_frame->clearContents(); m_game_list_frame->clearContents();
} }
}; }
void MainWindow::RefreshGameTable() { void MainWindow::RefreshGameTable() {
// m_game_info->m_games.clear(); // m_game_info->m_games.clear();

View File

@ -702,7 +702,7 @@ EmitContext::BufferSpv EmitContext::DefineBuffer(bool is_storage, bool is_writte
} }
interfaces.push_back(id); interfaces.push_back(id);
return {id, pointer_type}; return {id, pointer_type};
}; }
void EmitContext::DefineBuffers() { void EmitContext::DefineBuffers() {
if (!profile.supports_robust_buffer_access && !info.has_readconst) { if (!profile.supports_robust_buffer_access && !info.has_readconst) {

View File

@ -66,7 +66,7 @@ private:
if (it == labels.end()) { if (it == labels.end()) {
labels.push_back(address); labels.push_back(address);
} }
}; }
size_t GetIndex(Label label) { size_t GetIndex(Label label) {
if (label == 0) { if (label == 0) {
@ -75,7 +75,7 @@ private:
const auto it_index = std::ranges::lower_bound(index_to_pc, label); const auto it_index = std::ranges::lower_bound(index_to_pc, label);
ASSERT(it_index != index_to_pc.end() || label > index_to_pc.back()); ASSERT(it_index != index_to_pc.end() || label > index_to_pc.back());
return std::distance(index_to_pc.begin(), it_index); return std::distance(index_to_pc.begin(), it_index);
}; }
public: public:
Common::ObjectPool<Block>& block_pool; Common::ObjectPool<Block>& block_pool;

View File

@ -197,7 +197,7 @@ IR::VectorReg Translator::GetScratchVgpr(u32 offset) {
it->second = new_vgpr; it->second = new_vgpr;
} }
return it->second; return it->second;
}; }
template <typename T> template <typename T>
T Translator::GetSrc(const InstOperand& operand) { T Translator::GetSrc(const InstOperand& operand) {

View File

@ -103,7 +103,7 @@ static inline void PushPtr(Xbyak::CodeGenerator& c, u32 off_dw) {
static inline void PopPtr(Xbyak::CodeGenerator& c) { static inline void PopPtr(Xbyak::CodeGenerator& c) {
c.pop(rdi); c.pop(rdi);
}; }
static void VisitPointer(u32 off_dw, IR::Inst* subtree, PassInfo& pass_info, static void VisitPointer(u32 off_dw, IR::Inst* subtree, PassInfo& pass_info,
Xbyak::CodeGenerator& c) { Xbyak::CodeGenerator& c) {
@ -182,7 +182,7 @@ static void GenerateSrtProgram(Info& info, PassInfo& pass_info) {
info.srt_info.flattened_bufsize_dw = pass_info.dst_off_dw; info.srt_info.flattened_bufsize_dw = pass_info.dst_off_dw;
} }
}; // namespace } // namespace
void FlattenExtendedUserdataPass(IR::Program& program) { void FlattenExtendedUserdataPass(IR::Program& program) {
Shader::Info& info = program.info; Shader::Info& info = program.info;

View File

@ -123,7 +123,7 @@ struct HullRuntimeInfo {
// output control points and attributes that shouldnt be read by the TES anyways // output control points and attributes that shouldnt be read by the TES anyways
bool IsPassthrough() const { bool IsPassthrough() const {
return hs_output_base == 0 && ls_stride == hs_output_cp_stride && num_threads == 1; return hs_output_base == 0 && ls_stride == hs_output_cp_stride && num_threads == 1;
}; }
// regs.ls_hs_config.hs_output_control_points contains the number of threads, which // regs.ls_hs_config.hs_output_control_points contains the number of threads, which
// isn't exactly the number of output control points. // isn't exactly the number of output control points.

View File

@ -21,7 +21,7 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#endif #endif
#else #else
#include <windows.h> #include <Windows.h>
#endif #endif
namespace VideoCore { namespace VideoCore {

View File

@ -8,7 +8,7 @@
#include <renderdoc_app.h> #include <renderdoc_app.h>
#ifdef _WIN32 #ifdef _WIN32
#include <windows.h> #include <Windows.h>
#else #else
#include <dlfcn.h> #include <dlfcn.h>
#endif #endif