From 0370d628e488c0878223a722b9ac97401b63ea84 Mon Sep 17 00:00:00 2001 From: DH Date: Sat, 4 Oct 2025 17:37:21 +0300 Subject: [PATCH] Update clang-format --- .github/workflows/format.yml | 2 +- .github/workflows/rpcsx.yml | 2 +- android/src/rpcsx-android.cpp | 2 +- kernel/cellos/include/cellos/sys_timer.h | 102 +++++++++++------------ 4 files changed, 51 insertions(+), 57 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 34f1cd5bc..03b8aca33 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -24,4 +24,4 @@ jobs: uses: jidicula/clang-format-action@v4.15.0 with: exclude-regex: (libspirv|3rdparty) - clang-format-version: 20 + clang-format-version: 21 diff --git a/.github/workflows/rpcsx.yml b/.github/workflows/rpcsx.yml index 081ed984f..b37363e3b 100644 --- a/.github/workflows/rpcsx.yml +++ b/.github/workflows/rpcsx.yml @@ -23,7 +23,7 @@ jobs: run: | sudo apt update sudo apt install -y cmake build-essential libunwind-dev \ - libsox-dev g++-14 ninja-build libasound2-dev nasm libudev-dev libxcb1-dev libx11-dev + libsox-dev g++-14 ninja-build libasound2-dev nasm libudev-dev libxcb1-dev libx11-dev libwayland-dev cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-14 -DCMAKE_INSTALL_PREFIX=/usr cmake --build build -j$(($(nproc) + 2)) sudo cmake --build build diff --git a/android/src/rpcsx-android.cpp b/android/src/rpcsx-android.cpp index 49df82b3f..f1359005e 100644 --- a/android/src/rpcsx-android.cpp +++ b/android/src/rpcsx-android.cpp @@ -4,7 +4,6 @@ #include "Emu/Audio/Null/NullAudioBackend.h" #include "Emu/Cell/PPUAnalyser.h" #include "Emu/Cell/SPURecompiler.h" -#include "cellos/sys_sync.h" #include "Emu/IdManager.h" #include "Emu/Io/KeyboardHandler.h" #include "Emu/Io/Null/NullKeyboardHandler.h" @@ -34,6 +33,7 @@ #include "Loader/PSF.h" #include "Loader/PUP.h" #include "Loader/TAR.h" +#include "cellos/sys_sync.h" #include "dev/block_dev.hpp" #include "dev/iso.hpp" #include "hidapi_libusb.h" diff --git a/kernel/cellos/include/cellos/sys_timer.h b/kernel/cellos/include/cellos/sys_timer.h index 854ba9977..69826942f 100644 --- a/kernel/cellos/include/cellos/sys_timer.h +++ b/kernel/cellos/include/cellos/sys_timer.h @@ -1,76 +1,70 @@ #pragma once -#include "sys_event.h" #include "Emu/Memory/vm_ptr.h" +#include "sys_event.h" // Timer State -enum : u32 -{ - SYS_TIMER_STATE_STOP = 0, - SYS_TIMER_STATE_RUN = 1, +enum : u32 { + SYS_TIMER_STATE_STOP = 0, + SYS_TIMER_STATE_RUN = 1, }; -struct sys_timer_information_t -{ - be_t next_expire; // system_time_t - be_t period; - be_t timer_state; - be_t pad; +struct sys_timer_information_t { + be_t next_expire; // system_time_t + be_t period; + be_t timer_state; + be_t pad; }; -struct lv2_timer : lv2_obj -{ - static const u32 id_base = 0x11000000; +struct lv2_timer : lv2_obj { + static const u32 id_base = 0x11000000; - shared_mutex mutex; - atomic_t state{SYS_TIMER_STATE_STOP}; + shared_mutex mutex; + atomic_t state{SYS_TIMER_STATE_STOP}; - shared_ptr port; - u64 source; - u64 data1; - u64 data2; + shared_ptr port; + u64 source; + u64 data1; + u64 data2; - atomic_t expire{0}; // Next expiration time - atomic_t period{0}; // Period (oneshot if 0) + atomic_t expire{0}; // Next expiration time + atomic_t period{0}; // Period (oneshot if 0) - u64 check(u64 _now) noexcept; - u64 check_unlocked(u64 _now) noexcept; + u64 check(u64 _now) noexcept; + u64 check_unlocked(u64 _now) noexcept; - lv2_timer() noexcept - : lv2_obj(1) - { - } + lv2_timer() noexcept : lv2_obj(1) {} - void get_information(sys_timer_information_t& info) const - { - if (state == SYS_TIMER_STATE_RUN) - { - info.timer_state = state; - info.next_expire = expire; - info.period = period; - } - else - { - info.timer_state = SYS_TIMER_STATE_STOP; - info.next_expire = 0; - info.period = 0; - } - } + void get_information(sys_timer_information_t &info) const { + if (state == SYS_TIMER_STATE_RUN) { + info.timer_state = state; + info.next_expire = expire; + info.period = period; + } else { + info.timer_state = SYS_TIMER_STATE_STOP; + info.next_expire = 0; + info.period = 0; + } + } - lv2_timer(utils::serial& ar); - void save(utils::serial& ar); + lv2_timer(utils::serial &ar); + void save(utils::serial &ar); }; class ppu_thread; // Syscalls -error_code sys_timer_create(ppu_thread&, vm::ptr timer_id); -error_code sys_timer_destroy(ppu_thread&, u32 timer_id); -error_code sys_timer_get_information(ppu_thread&, u32 timer_id, vm::ptr info); -error_code _sys_timer_start(ppu_thread&, u32 timer_id, u64 basetime, u64 period); // basetime type changed from s64 -error_code sys_timer_stop(ppu_thread&, u32 timer_id); -error_code sys_timer_connect_event_queue(ppu_thread&, u32 timer_id, u32 queue_id, u64 name, u64 data1, u64 data2); -error_code sys_timer_disconnect_event_queue(ppu_thread&, u32 timer_id); -error_code sys_timer_sleep(ppu_thread&, u32 sleep_time); -error_code sys_timer_usleep(ppu_thread&, u64 sleep_time); +error_code sys_timer_create(ppu_thread &, vm::ptr timer_id); +error_code sys_timer_destroy(ppu_thread &, u32 timer_id); +error_code sys_timer_get_information(ppu_thread &, u32 timer_id, + vm::ptr info); +error_code _sys_timer_start(ppu_thread &, u32 timer_id, u64 basetime, + u64 period); // basetime type changed from s64 +error_code sys_timer_stop(ppu_thread &, u32 timer_id); +error_code sys_timer_connect_event_queue(ppu_thread &, u32 timer_id, + u32 queue_id, u64 name, u64 data1, + u64 data2); +error_code sys_timer_disconnect_event_queue(ppu_thread &, u32 timer_id); +error_code sys_timer_sleep(ppu_thread &, u32 sleep_time); +error_code sys_timer_usleep(ppu_thread &, u64 sleep_time);