Coding style issues fixes

Thanks @Megamouse
This commit is contained in:
DH 2025-03-01 01:02:01 +03:00 committed by Megamouse
parent 976b0a8f1d
commit 95d0cb18e4
10 changed files with 20 additions and 19 deletions

View file

@ -1693,7 +1693,8 @@ fs::file fs::file::from_native_handle(void *handle)
return result; return result;
} }
#else #else
fs::file fs::file::from_native_handle(int fd) { fs::file fs::file::from_native_handle(int fd)
{
fs::file result; fs::file result;
result.m_file = std::make_unique<unix_file>(fd); result.m_file = std::make_unique<unix_file>(fd);
return result; return result;

View file

@ -2172,8 +2172,8 @@ void thread_base::start()
void thread_base::initialize(void (*error_cb)()) void thread_base::initialize(void (*error_cb)())
{ {
#ifndef _WIN32 #ifndef _WIN32
#ifdef ANDROID #ifdef ANDROID
m_thread.release(pthread_self()); m_thread.release(pthread_self());
#else #else
m_thread.release(reinterpret_cast<u64>(pthread_self())); m_thread.release(reinterpret_cast<u64>(pthread_self()));
#endif #endif
@ -2622,7 +2622,7 @@ thread_base::~thread_base() noexcept
WaitForSingleObject(handle0, INFINITE); WaitForSingleObject(handle0, INFINITE);
CloseHandle(handle0); CloseHandle(handle0);
#elif defined(ANDROID) #elif defined(ANDROID)
pthread_join(m_thread.load(), nullptr); pthread_join(m_thread.load(), nullptr);
#else #else
pthread_join(reinterpret_cast<pthread_t>(m_thread.load()), nullptr); pthread_join(reinterpret_cast<pthread_t>(m_thread.load()), nullptr);
#endif #endif
@ -2697,11 +2697,10 @@ u64 thread_base::get_cycles()
#else #else
clockid_t _clock; clockid_t _clock;
struct timespec thread_time; struct timespec thread_time;
pthread_t thread_id;
#ifdef ANDROID #ifdef ANDROID
thread_id = handle; pthread_t thread_id = handle;
#else #else
thread_id = reinterpret_cast<pthread_t>(handle); pthread_t thread_id = reinterpret_cast<pthread_t>(handle);
#endif #endif
if (!pthread_getcpuclockid(thread_id, &_clock) && !clock_gettime(_clock, &thread_time)) if (!pthread_getcpuclockid(thread_id, &_clock) && !clock_gettime(_clock, &thread_time))
{ {
@ -3326,7 +3325,7 @@ u64 thread_ctrl::get_tid()
#ifdef _WIN32 #ifdef _WIN32
return GetCurrentThreadId(); return GetCurrentThreadId();
#elif defined(ANDROID) #elif defined(ANDROID)
return static_cast<u64>(pthread_self()); return static_cast<u64>(pthread_self());
#elif defined(__linux__) #elif defined(__linux__)
return syscall(SYS_gettid); return syscall(SYS_gettid);
#else #else

View file

@ -155,7 +155,7 @@ namespace aarch64
return {}; return {};
} }
const cpu_entry_t *lowest_part_info = nullptr; const cpu_entry_t* lowest_part_info = nullptr;
for (const auto& [midr, count] : core_layout) for (const auto& [midr, count] : core_layout)
{ {
const auto implementer_id = (midr >> 24) & 0xff; const auto implementer_id = (midr >> 24) & 0xff;
@ -167,12 +167,13 @@ namespace aarch64
return {}; return {};
} }
if (lowest_part_info == nullptr || lowest_part_info > part_info) { if (lowest_part_info == nullptr || lowest_part_info > part_info)
{
lowest_part_info = part_info; lowest_part_info = part_info;
} }
} }
return lowest_part_info == nullptr ? "" : lowest_part_info->name; return lowest_part_info ? lowest_part_info->name : "";
} }
std::string get_cpu_brand() std::string get_cpu_brand()

View file

@ -133,7 +133,7 @@ sys_net_sockaddr native_addr_to_sys_net_addr(const ::sockaddr_storage& native_ad
sys_net_sockaddr sn_addr; sys_net_sockaddr sn_addr;
sys_net_sockaddr_in* paddr = reinterpret_cast<sys_net_sockaddr_in*>(&sn_addr); sys_net_sockaddr_in* paddr = reinterpret_cast<sys_net_sockaddr_in*>(&sn_addr);
*paddr = {}; *paddr = {};
paddr->sin_len = sizeof(sys_net_sockaddr_in); paddr->sin_len = sizeof(sys_net_sockaddr_in);
paddr->sin_family = SYS_NET_AF_INET; paddr->sin_family = SYS_NET_AF_INET;

View file

@ -3,7 +3,7 @@
#include "Utilities/Thread.h" #include "Utilities/Thread.h"
#include "util/logs.hpp" #include "util/logs.hpp"
#include "Emu/Memory/vm.h" #include "Emu/Memory/vm.h"
#include "pine/pine_server.h" #include "3rdparty/pine/pine_server.h"
LOG_CHANNEL(IPC); LOG_CHANNEL(IPC);

View file

@ -8,8 +8,8 @@
#include "Utilities/File.h" #include "Utilities/File.h"
#ifndef WITHOUT_OPENGL #ifndef WITHOUT_OPENGL
#include "Emu/RSX/GL/GLVertexProgram.h" #include "Emu/RSX/GL/GLVertexProgram.h"
#include "Emu/RSX/GL/GLFragmentProgram.h" #include "Emu/RSX/GL/GLFragmentProgram.h"
#endif #endif
using CGprofile = u32; using CGprofile = u32;

View file

@ -121,7 +121,7 @@ struct cfg_root : cfg::node
cfg::_enum<video_renderer> renderer{ this, "Renderer", cfg::_enum<video_renderer> renderer{ this, "Renderer",
#if defined(ANDROID) || defined(__APPLE__) #if defined(ANDROID) || defined(__APPLE__)
video_renderer::vulkan video_renderer::vulkan
#else #else
video_renderer::opengl // TODO: Is it still actual? video_renderer::opengl // TODO: Is it still actual?
#endif #endif

View file

@ -180,7 +180,7 @@ void pad_thread::Init()
keyptr->SetTargetWindow(static_cast<QWindow*>(m_curwindow)); keyptr->SetTargetWindow(static_cast<QWindow*>(m_curwindow));
cur_pad_handler = keyptr; cur_pad_handler = keyptr;
#else #else
cur_pad_handler = nullpad; cur_pad_handler = nullpad;
#endif #endif
} }
else else

View file

@ -173,7 +173,7 @@ namespace
#ifdef _WIN32 #ifdef _WIN32
tid = GetCurrentThreadId(); tid = GetCurrentThreadId();
#elif defined(ANDROID) #elif defined(ANDROID)
tid = pthread_self(); tid = pthread_self();
#else #else
tid = reinterpret_cast<u64>(pthread_self()); tid = reinterpret_cast<u64>(pthread_self());
#endif #endif

View file

@ -687,7 +687,7 @@ namespace utils
#ifdef __linux__ #ifdef __linux__
#ifdef ANDROID #ifdef ANDROID
if constexpr (char c = '?'; true) if constexpr (constexpr char c = '?')
#else #else
if (const char c = fs::file("/proc/sys/vm/overcommit_memory").read<char>(); c == '0' || c == '1') if (const char c = fs::file("/proc/sys/vm/overcommit_memory").read<char>(); c == '0' || c == '1')
#endif #endif