Review fixes + warning fixes

This commit is contained in:
Megamouse 2025-03-31 09:44:38 +02:00
parent 80b6315bb2
commit 1b05c744e7
9 changed files with 19 additions and 16 deletions

View file

@ -195,7 +195,7 @@ struct audio_port
// Handle copy ctor of atomic var
audio_port(const audio_port& r)
{
std::memcpy(this, &r, sizeof(r));
std::memcpy(static_cast<void*>(this), &r, sizeof(r));
}
ENABLE_BITWISE_SERIALIZATION;

View file

@ -4956,9 +4956,9 @@ bool ppu_initialize(const ppu_module<lv2_obj>& info, bool check_only, u64 file_s
return +code_ptr;
}
constexpr auto abs_diff = [](u64 a, u64 b) { return a <= b ? b - a : a - b; };
[[maybe_unused]] constexpr auto abs_diff = [](u64 a, u64 b) { return a <= b ? b - a : a - b; };
auto write_le = [](u8*& code, auto value)
[[maybe_unused]] auto write_le = [](u8*& code, auto value)
{
write_to_ptr<le_t<std::remove_cvref_t<decltype(value)>>>(code, value);
code += sizeof(value);
@ -5823,7 +5823,7 @@ static void ppu_initialize2(jit_compiler& jit, const ppu_module<lv2_obj>& module
min_addr = std::min<u32>(min_addr, mod_func.addr);
// Translate
if (const auto func = translator.Translate(mod_func))
if ([[maybe_unused]] const auto func = translator.Translate(mod_func))
{
#ifdef ARCH_X64 // TODO
// Run optimization passes
@ -5841,7 +5841,7 @@ static void ppu_initialize2(jit_compiler& jit, const ppu_module<lv2_obj>& module
// Run this only in one module for all functions compiled
if (module_part.jit_bounds)
{
if (const auto func = translator.GetSymbolResolver(module_part))
if ([[maybe_unused]] const auto func = translator.GetSymbolResolver(module_part))
{
#ifdef ARCH_X64 // TODO
// Run optimization passes

View file

@ -1237,7 +1237,7 @@ void spu_thread::dump_regs(std::string& ret, std::any& /*custom_data*/) const
if (const_value != r)
{
// Expectation of pretictable code path has not been met (such as a branch directly to the instruction)
// Expectation of predictable code path has not been met (such as a branch directly to the instruction)
is_const = false;
}
@ -1447,7 +1447,7 @@ std::vector<std::pair<u32, u32>> spu_thread::dump_callstack_list() const
if (v != v128::from32r(addr))
{
// 1) Non-zero lower words are invalid (because BRSL-like instructions generate only zeroes)
// 2) Bits normally masked out by indirect braches are considered invalid
// 2) Bits normally masked out by indirect branches are considered invalid
return true;
}

View file

@ -36,6 +36,8 @@ namespace rsx
int bpp = 0;
bool dirty = false;
image_info_base() {}
virtual ~image_info_base() {}
virtual const u8* get_data() const = 0;
};
@ -46,10 +48,11 @@ namespace rsx
std::vector<u8> data_grey;
public:
using image_info_base::image_info_base;
image_info(image_info&) = delete;
image_info(const std::string& filename, bool grayscaled = false);
image_info(const std::vector<u8>& bytes, bool grayscaled = false);
~image_info();
virtual ~image_info();
void load_data(const std::vector<u8>& bytes, bool grayscaled = false);
const u8* get_data() const override { return channels == 4 ? data : data_grey.empty() ? nullptr : data_grey.data(); }

View file

@ -9,8 +9,11 @@ namespace rsx
{
struct video_info : public image_info_base
{
std::vector<u8> data;
using image_info_base::image_info_base;
virtual ~video_info() {}
const u8* get_data() const override { return data.empty() ? nullptr : data.data(); }
std::vector<u8> data;
};
class video_view final : public image_view

View file

@ -23,10 +23,6 @@
#endif
#endif
#ifdef ARCH_ARM64
#define AVX512_ICL_FUNC
#endif
#ifdef _MSC_VER
#define AVX512_ICL_FUNC
#else

View file

@ -402,7 +402,8 @@ namespace vk
upload_heap.unmap();
const VkImageSubresourceRange range = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, layers };
VkBufferImageCopy region {
VkBufferImageCopy region
{
.bufferOffset = offset,
.bufferRowLength = w,
.bufferImageHeight = h,

View file

@ -23,7 +23,7 @@ public:
void get_image(std::vector<u8>& data, int& w, int& h, int& ch, int& bpp) override;
bool has_new() const override { return m_has_new; }
virtual void set_active(bool active);
void set_active(bool active) override;
bool get_active() const override { return m_active; }
void start_movie();

View file

@ -1192,7 +1192,7 @@ constexpr void write_to_ptr(U&& array, usz pos, const T& value)
{
static_assert(sizeof(T) % sizeof(array[0]) == 0);
if (!std::is_constant_evaluated())
std::memcpy(&array[pos], &value, sizeof(value));
std::memcpy(static_cast<void*>(&array[pos]), &value, sizeof(value));
else
ensure(!"Unimplemented");
}