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
u32 GetLanguage();
}; // namespace Config
} // namespace Config

View File

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

View File

@ -11,4 +11,4 @@
[[nodiscard]] inline u32 HashCombine(const u32 seed, const u32 hash) {
return seed ^ (hash + 0x9e3779b9 + (seed << 6) + (seed >> 2));
}
}

View File

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

View File

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

View File

@ -39,4 +39,4 @@ struct fmt::formatter<fmt::UTF<std::string_view>, char> : formatter<std::string_
auto format(const UTF<std::string_view>& wrapper, FormatContext& ctx) const {
return formatter<std::string_view>::format(wrapper.data, ctx);
}
};
};

View File

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

View File

@ -45,4 +45,4 @@ void PatchMemory(std::string modNameStr, std::string offsetStr, std::string valu
static std::vector<int32_t> PatternToByte(const std::string& pattern);
uintptr_t PatternScan(const std::string& signature);
} // namespace MemoryPatcher
} // namespace MemoryPatcher

View File

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

View File

@ -158,4 +158,4 @@ float S16ToSnorm(s16 val) {
return float(val * c);
}
} // namespace NumberUtils
} // namespace NumberUtils

View File

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

View File

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

View File

@ -6,7 +6,7 @@
#include "common/signal_context.h"
#ifdef _WIN32
#include <windows.h>
#include <Windows.h>
#else
#include <sys/ucontext.h>
#endif
@ -89,4 +89,4 @@ bool IsWriteError(void* ctx) {
#endif
#endif
}
} // namespace Common
} // namespace Common

View File

@ -15,4 +15,4 @@ void IncrementRip(void* ctx, u64 length);
bool IsWriteError(void* ctx);
} // namespace Common
} // namespace Common

View File

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

View File

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

View File

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

View File

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

View File

@ -302,4 +302,4 @@ public:
0xC7, 0x42, 0x82, 0x4B, 0x2E, 0xDC, 0x8E, 0x8D, 0x73, 0xCE, 0xB1, 0xCC, 0x01, 0xD9, 0x08,
0x70, 0x87, 0x3C, 0x44, 0x08, 0xEC, 0x49, 0x8F, 0x81, 0x5A, 0xE2, 0x40, 0xFF, 0x77, 0xFC,
0x0D};
};
};

View File

@ -43,4 +43,4 @@ private:
std::array<u8, 16> esfmIv{};
std::filesystem::path trpFilesPath;
static constexpr int iv_len = 16;
};
};

View File

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

View File

@ -17,4 +17,4 @@ int PS4_SYSV_ABI Func_8A828CAEE7EDD5E9();
int PS4_SYSV_ABI Func_E7EBCE96E92F91F8();
void RegisterlibSceDiscMap(Core::Loader::SymbolsResolver* sym);
} // namespace Libraries::DiscMap
} // namespace Libraries::DiscMap

View File

@ -8,7 +8,7 @@
#include "common/types.h"
#ifdef _WIN64
#include <windows.h>
#include <Windows.h>
#else
#include <mutex>
#endif
@ -77,4 +77,4 @@ private:
#endif
};
} // namespace Libraries::Kernel
} // namespace Libraries::Kernel

View File

@ -10,7 +10,7 @@
#include "common/types.h"
#ifdef _WIN64
#include <windows.h>
#include <Windows.h>
#elif defined(__APPLE__)
#include <dispatch/dispatch.h>
#else
@ -161,4 +161,4 @@ private:
using BinarySemaphore = Semaphore<1>;
using CountingSemaphore = Semaphore<0x7FFFFFFF /*ORBIS_KERNEL_SEM_VALUE_MAX*/>;
} // namespace Libraries::Kernel
} // namespace Libraries::Kernel

View File

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

View File

@ -15,4 +15,4 @@ namespace Libraries::LibcInternal {
// so everything is just in the .cpp file
void RegisterlibSceLibcInternal(Core::Loader::SymbolsResolver* sym);
} // namespace Libraries::LibcInternal
} // namespace Libraries::LibcInternal

View File

@ -226,4 +226,4 @@ int PS4_SYSV_ABI Func_F8EF6F5350A91990();
int PS4_SYSV_ABI Func_FA7A2DD770447552();
void RegisterlibSceNpTrophy(Core::Loader::SymbolsResolver* sym);
} // namespace Libraries::NpTrophy
} // namespace Libraries::NpTrophy

View File

@ -8,7 +8,7 @@
#include "core/signals.h"
#ifdef _WIN32
#include <windows.h>
#include <Windows.h>
#else
#include <csignal>
#ifdef ARCH_X86_64
@ -161,4 +161,4 @@ bool SignalDispatch::DispatchIllegalInstruction(void* context) const {
return false;
}
} // namespace Core
} // namespace Core

View File

@ -53,4 +53,4 @@ private:
using Signals = Common::Singleton<SignalDispatch>;
} // namespace Core
} // namespace Core

View File

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

View File

@ -42,4 +42,4 @@ private:
u64 tid;
};
} // namespace Core
} // namespace Core

View File

@ -10,7 +10,7 @@
#include "core/tls.h"
#ifdef _WIN32
#include <windows.h>
#include <Windows.h>
#elif defined(__APPLE__) && defined(ARCH_X86_64)
#include <architecture/i386/table.h>
#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 title;
std::string app_version;
u32 fw_version;
u32 fw_version = 0;
Common::PSFAttributes psf_attributes{};
const auto param_sfo_path = mnt->GetHostPath("/app0/sce_sys/param.sfo");

View File

@ -38,4 +38,4 @@ using ImTextureID = ::ImGui::Texture*;
#ifdef IMGUI_USE_WCHAR32
#error "This project uses 16 bits wchar standard like Orbis"
#endif
#endif

View File

@ -14,4 +14,4 @@ public:
virtual void Draw() = 0;
};
} // namespace ImGui
} // namespace ImGui

View File

@ -42,4 +42,4 @@ public:
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);
// SDL_EVENT_MOUSE_MOTION isn't triggered before the first frame is rendered
// force update the prev_cursor coords
if (mouse_x_global != bd->prev_mouse_pos.x || mouse_y_global != bd->prev_mouse_pos.y &&
bd->prev_mouse_pos.y == 0 &&
bd->prev_mouse_pos.x == 0) {
if (mouse_x_global != bd->prev_mouse_pos.x ||
(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 = mouse_x_global;
bd->prev_mouse_pos.y = mouse_y_global;
bd->lastCursorMoveTime = bd->time;

View File

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

View File

@ -250,4 +250,4 @@ void Submit() {
}
} // namespace Core::TextureManager
} // namespace ImGui
} // namespace ImGui

View File

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

View File

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

View File

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

View File

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

View File

@ -85,4 +85,4 @@ private:
QNetworkAccessManager* m_network_manager;
QString m_compatibility_filename;
QJsonObject m_compatibility_database;
};
};

View File

@ -93,4 +93,4 @@ void ElfViewer::OpenElfFiles() {
i++;
}
this->resizeColumnsToContents();
}
}

View File

@ -29,4 +29,4 @@ private:
private:
QLineEdit* m_gamesDirectory;
QLineEdit* m_addonsDirectory;
};
};

View File

@ -418,4 +418,4 @@ QString GameListFrame::GetPlayTime(const std::string& serial) {
QTableWidgetItem* GameListFrame::GetCurrentItem() {
return m_current_item;
}
}

View File

@ -173,4 +173,4 @@ You can find these here, with detailed comments, examples and suggestions for mo
Devices: leftjoystick, rightjoystick, l2, r2
)";
}
};
};

View File

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

View File

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

View File

@ -405,4 +405,4 @@ public:
namespace Ui {
class MainWindow : public Ui_MainWindow {};
} // namespace Ui
} // namespace Ui

View File

@ -214,4 +214,4 @@ void PKGViewer::ProcessPKGInfo() {
int numPkgs = m_pkg_list.size();
QString statusMessage = QString::number(numPkgs) + " " + tr("Package");
statusBar->showMessage(statusMessage);
}
}

View File

@ -59,4 +59,4 @@ private:
QStringList dir_list;
std::vector<std::string> dir_list_std;
QTreeWidget* treeWidget = nullptr;
};
};

View File

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

View File

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

View File

@ -35,4 +35,4 @@ enum class TessConstantAttribute : u32 {
FirstEdgeTessFactorIndex,
};
} // namespace Shader
} // namespace Shader

View File

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

View File

@ -18,4 +18,4 @@ union DebugPrintFlags {
BitField<0, 32, u32> num_args;
};
} // namespace Shader::IR
} // namespace Shader::IR

View File

@ -103,7 +103,7 @@ static inline void PushPtr(Xbyak::CodeGenerator& c, u32 off_dw) {
static inline void PopPtr(Xbyak::CodeGenerator& c) {
c.pop(rdi);
};
}
static void VisitPointer(u32 off_dw, IR::Inst* subtree, PassInfo& pass_info,
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;
}
}; // namespace
} // namespace
void FlattenExtendedUserdataPass(IR::Program& program) {
Shader::Info& info = program.info;

View File

@ -34,4 +34,4 @@ struct PersistentSrtInfo {
}
};
} // namespace Shader
} // namespace Shader

View File

@ -124,4 +124,4 @@ inline auto MakeInstPattern(Args&&... args) {
#define M_COMPOSITECONSTRUCTU32X4(...) \
MakeInstPattern<IR::Opcode::CompositeConstructU32x4>(__VA_ARGS__)
} // namespace Shader::Optimiation::PatternMatching
} // namespace Shader::Optimiation::PatternMatching

View File

@ -122,4 +122,4 @@ private:
std::unordered_map<InstVector, u32, HashInstVector> iv_to_vn;
};
} // namespace Shader::Optimization
} // namespace Shader::Optimization

View File

@ -123,7 +123,7 @@ struct HullRuntimeInfo {
// output control points and attributes that shouldnt be read by the TES anyways
bool IsPassthrough() const {
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
// isn't exactly the number of output control points.

View File

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

View File

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