mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-06-02 04:36:57 -06:00
utils: Make utils::serial::operator T() explicit
This commit is contained in:
parent
b08e805020
commit
db474c292f
@ -398,7 +398,7 @@ cell_audio_thread::cell_audio_thread(utils::serial& ar)
|
||||
|
||||
ar(key_count, event_period);
|
||||
|
||||
keys.resize(ar);
|
||||
keys.resize(ar.pop<u64>());
|
||||
|
||||
for (key_info& k : keys)
|
||||
{
|
||||
@ -421,7 +421,7 @@ void cell_audio_thread::save(utils::serial& ar)
|
||||
USING_SERIALIZATION_VERSION(cellAudio);
|
||||
|
||||
ar(key_count, event_period);
|
||||
ar(keys.size());
|
||||
ar(static_cast<u64>(keys.size()));
|
||||
|
||||
for (const key_info& k : keys)
|
||||
{
|
||||
|
||||
@ -56,9 +56,9 @@ void fmt_class_string<CellPadFilterError>::format(std::string& out, u64 arg)
|
||||
extern void sys_io_serialize(utils::serial& ar);
|
||||
|
||||
pad_info::pad_info(utils::serial& ar)
|
||||
: max_connect(ar)
|
||||
, port_setting(ar)
|
||||
, reported_info(ar)
|
||||
: max_connect(ar.pop<u32>())
|
||||
, port_setting(ar.pop<decltype(port_setting)>())
|
||||
, reported_info(ar.pop<decltype(reported_info)>())
|
||||
{
|
||||
//reported_info = {};
|
||||
sys_io_serialize(ar);
|
||||
|
||||
@ -166,7 +166,7 @@ struct sce_np_trophy_manager
|
||||
sce_np_trophy_manager() = default;
|
||||
|
||||
sce_np_trophy_manager(utils::serial& ar)
|
||||
: is_initialized(ar)
|
||||
: is_initialized(ar.pop<bool>())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -161,7 +161,7 @@ bool serialize<ppu_thread::cr_bits>(utils::serial& ar, typename ppu_thread::cr_b
|
||||
}
|
||||
else
|
||||
{
|
||||
o.unpack(ar);
|
||||
o.unpack(ar.pop<u32>());
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -2529,7 +2529,7 @@ ppu_thread::ppu_thread(utils::serial& ar)
|
||||
, stack_size(ar)
|
||||
, stack_addr(ar)
|
||||
, joiner(ar.pop<ppu_join_status>())
|
||||
, entry_func(std::bit_cast<ppu_func_opd_t, u64>(ar))
|
||||
, entry_func(std::bit_cast<ppu_func_opd_t>(ar.pop<u64>()))
|
||||
, is_interrupt_thread(ar)
|
||||
{
|
||||
[[maybe_unused]] const s32 version = GET_SERIALIZATION_VERSION(ppu);
|
||||
|
||||
@ -1812,7 +1812,7 @@ void spu_thread::serialize_common(utils::serial& ar)
|
||||
}
|
||||
else
|
||||
{
|
||||
const u8 count = ar;
|
||||
const u8 count{ar};
|
||||
ar(std::span(vals, count));
|
||||
ch_in_mbox.set_values(count, vals[0], vals[1], vals[2], vals[3]);
|
||||
}
|
||||
|
||||
@ -465,7 +465,7 @@ lv2_fs_object::lv2_fs_object(std::string_view filename)
|
||||
}
|
||||
|
||||
lv2_fs_object::lv2_fs_object(utils::serial& ar, bool)
|
||||
: name(ar)
|
||||
: name(ar.pop<decltype(name)>())
|
||||
, mp(g_fxo->get<lv2_fs_mount_info_map>().lookup(name.data()))
|
||||
{
|
||||
}
|
||||
@ -569,7 +569,7 @@ lv2_file::lv2_file(utils::serial& ar)
|
||||
|
||||
if (ar.pop<bool>()) // see lv2_file::save in_mem
|
||||
{
|
||||
const fs::stat_t stat = ar;
|
||||
const fs::stat_t stat = ar.pop<fs::stat_t>();
|
||||
|
||||
std::vector<u8> buf(stat.size);
|
||||
ar(std::span<u8>(buf.data(), buf.size()));
|
||||
@ -589,7 +589,7 @@ lv2_file::lv2_file(utils::serial& ar)
|
||||
sys_fs.success("Loaded file descriptor \'%s\' file for savestates (vpath=\'%s\', type=%s, flags=0x%x, id=%d)", name.data(), retrieve_real, type, flags, idm::last_id());
|
||||
}
|
||||
|
||||
file.seek(ar);
|
||||
file.seek(ar.pop<s64>());
|
||||
}
|
||||
|
||||
void lv2_file::save(utils::serial& ar)
|
||||
@ -682,7 +682,7 @@ lv2_dir::lv2_dir(utils::serial& ar)
|
||||
|
||||
return entries;
|
||||
}())
|
||||
, pos(ar)
|
||||
, pos(ar.pop<u64>())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ lv2_int_tag::lv2_int_tag(utils::serial& ar) noexcept
|
||||
, id(idm::last_id())
|
||||
, handler([&]()
|
||||
{
|
||||
const u32 id = ar;
|
||||
const u32 id{ar};
|
||||
|
||||
auto ptr = idm::get_unlocked<lv2_obj, lv2_int_serv>(id);
|
||||
|
||||
@ -56,7 +56,7 @@ lv2_int_serv::lv2_int_serv(shared_ptr<named_thread<ppu_thread>> thread, u64 arg1
|
||||
lv2_int_serv::lv2_int_serv(utils::serial& ar) noexcept
|
||||
: lv2_obj(1)
|
||||
, id(idm::last_id())
|
||||
, thread(idm::get_unlocked<named_thread<ppu_thread>>(ar))
|
||||
, thread(idm::get_unlocked<named_thread<ppu_thread>>(ar.pop<u32>()))
|
||||
, arg1(ar)
|
||||
, arg2(ar)
|
||||
{
|
||||
|
||||
@ -36,7 +36,7 @@ lv2_memory_container::lv2_memory_container(u32 size, bool from_idm) noexcept
|
||||
lv2_memory_container::lv2_memory_container(utils::serial& ar, bool from_idm) noexcept
|
||||
: size(ar)
|
||||
, id{from_idm ? idm::last_id() : SYS_MEMORY_CONTAINER_ID_INVALID}
|
||||
, used(ar)
|
||||
, used(ar.pop<s32>())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ lv2_memory::lv2_memory(utils::serial& ar)
|
||||
|
||||
return null_ptr;
|
||||
}(ar.pop<u32>()))
|
||||
, counter(ar)
|
||||
, counter(ar.pop<u32>())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -310,8 +310,8 @@ std::function<void(void*)> lv2_prx::load(utils::serial& ar)
|
||||
[[maybe_unused]] const s32 version = GET_SERIALIZATION_VERSION(lv2_prx_overlay);
|
||||
|
||||
const std::string path = vfs::get(ar.pop<std::string>());
|
||||
const s64 offset = ar;
|
||||
const u32 state = ar;
|
||||
const s64 offset{ar};
|
||||
const u32 state{ar};
|
||||
|
||||
usz seg_count = 0;
|
||||
ar.deserialize_vle(seg_count);
|
||||
@ -358,7 +358,7 @@ std::function<void(void*)> lv2_prx::load(utils::serial& ar)
|
||||
for (usz i = 0; i < seg_count; i++)
|
||||
{
|
||||
auto& seg = prx->segs.emplace_back();
|
||||
seg.addr = ar;
|
||||
ar(seg.addr);
|
||||
seg.size = 1; // TODO
|
||||
}
|
||||
}
|
||||
|
||||
@ -233,10 +233,10 @@ lv2_spu_group::lv2_spu_group(utils::serial& ar) noexcept
|
||||
, max_num(ar)
|
||||
, mem_size(ar)
|
||||
, type(ar) // SPU Thread Group Type
|
||||
, ct(lv2_memory_container::search(ar))
|
||||
, ct(lv2_memory_container::search(ar.pop<u32>()))
|
||||
, has_scheduler_context(ar.pop<u8>())
|
||||
, max_run(ar)
|
||||
, init(ar)
|
||||
, init(ar.pop<u32>())
|
||||
, prio([&ar]()
|
||||
{
|
||||
std::common_type_t<decltype(lv2_spu_group::prio)> prio{};
|
||||
@ -246,7 +246,7 @@ lv2_spu_group::lv2_spu_group(utils::serial& ar) noexcept
|
||||
return prio;
|
||||
}())
|
||||
, run_state(ar.pop<spu_group_status>())
|
||||
, exit_status(ar)
|
||||
, exit_status(ar.pop<s32>())
|
||||
{
|
||||
for (auto& thread : threads)
|
||||
{
|
||||
|
||||
@ -32,13 +32,13 @@ struct lv2_timer_thread
|
||||
|
||||
lv2_timer::lv2_timer(utils::serial& ar)
|
||||
: lv2_obj(1)
|
||||
, state(ar)
|
||||
, state(ar.pop<u32>())
|
||||
, port(lv2_event_queue::load_ptr(ar, port, "timer"))
|
||||
, source(ar)
|
||||
, data1(ar)
|
||||
, data2(ar)
|
||||
, expire(ar)
|
||||
, period(ar)
|
||||
, expire(ar.pop<u32>())
|
||||
, period(ar.pop<u32>())
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -37,10 +37,10 @@ struct sys_vm_global_t
|
||||
};
|
||||
|
||||
sys_vm_t::sys_vm_t(utils::serial& ar)
|
||||
: ct(lv2_memory_container::search(ar))
|
||||
: ct(lv2_memory_container::search(ar.pop<u32>()))
|
||||
, addr(ar)
|
||||
, size(ar)
|
||||
, psize(ar)
|
||||
, psize(ar.pop<u32>())
|
||||
{
|
||||
g_ids[addr >> 28].release(idm::last_id());
|
||||
g_fxo->need<sys_vm_global_t>();
|
||||
|
||||
@ -1811,7 +1811,7 @@ namespace vm
|
||||
|
||||
while (true)
|
||||
{
|
||||
const u8 flags0 = ar;
|
||||
const u8 flags0{ar};
|
||||
|
||||
if (!(flags0 & page_allocated))
|
||||
{
|
||||
@ -1819,8 +1819,8 @@ namespace vm
|
||||
break;
|
||||
}
|
||||
|
||||
const u32 addr0 = ar;
|
||||
const u32 size0 = ar;
|
||||
const u32 addr0{ar};
|
||||
const u32 size0{ar};
|
||||
|
||||
u64 pflags = 0;
|
||||
|
||||
|
||||
@ -680,7 +680,7 @@ namespace rsx
|
||||
ar(u32{0});
|
||||
}
|
||||
}
|
||||
else if (u32 count = ar)
|
||||
else if (u32 count{ar})
|
||||
{
|
||||
restore_fifo_count = count;
|
||||
ar(restore_fifo_cmd);
|
||||
|
||||
@ -551,7 +551,7 @@ public:
|
||||
|
||||
template <typename T> requires (std::is_copy_constructible_v<std::remove_const_t<T>>) && (std::is_constructible_v<std::remove_const_t<T>> || Bitcopy<std::remove_const_t<T>> ||
|
||||
std::is_constructible_v<std::remove_const_t<T>, stx::exact_t<serial&>> || TupleAlike<std::remove_const_t<T>>)
|
||||
operator T() noexcept
|
||||
explicit operator T() noexcept
|
||||
{
|
||||
AUDIT(!is_writing());
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user