mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-06-02 04:36:57 -06:00
Fix some gcc warnings
This commit is contained in:
parent
8c82ce8bed
commit
1bd246d2d3
@ -39,7 +39,7 @@ namespace aarch64
|
||||
|
||||
if (head->magic == ESR_CTX_MAGIC)
|
||||
{
|
||||
return reinterpret_cast<const aarch64_esr_ctx*>(head);
|
||||
return utils::bless<const aarch64_esr_ctx>(head);
|
||||
}
|
||||
|
||||
offset += head->size;
|
||||
|
||||
@ -81,6 +81,8 @@
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#pragma push_macro("FORCE_INLINE")
|
||||
#pragma push_macro("ALIGN_STRUCT")
|
||||
#undef FORCE_INLINE
|
||||
#undef ALIGN_STRUCT
|
||||
#define FORCE_INLINE static inline __attribute__((always_inline))
|
||||
#define ALIGN_STRUCT(x) __attribute__((aligned(x)))
|
||||
#define _sse2neon_likely(x) __builtin_expect(!!(x), 1)
|
||||
|
||||
@ -336,7 +336,7 @@ namespace vm
|
||||
|
||||
// Perform reinterpret cast
|
||||
template <typename CT, typename T, typename AT>
|
||||
requires requires(T* t) { reinterpret_cast<to_be_t<CT>*>(t); }
|
||||
requires std::is_object_v<T> && std::is_object_v<to_be_t<CT>>
|
||||
inline _ptr_base<to_be_t<CT>, u32> unsafe_ptr_cast(const _ptr_base<T, AT>& other)
|
||||
{
|
||||
return vm::cast(other.addr());
|
||||
|
||||
@ -199,7 +199,10 @@ namespace rsx
|
||||
if (!is_compiled())
|
||||
{
|
||||
auto renderer = get_font();
|
||||
const auto& [caret_x, caret_y] = renderer->get_char_offset(text.c_str(), caret_position, clip_text ? w : -1, wrap_text);
|
||||
|
||||
f32 caret_x {};
|
||||
f32 caret_y {};
|
||||
renderer->get_char_offset(caret_x, caret_y, text.c_str(), caret_position, clip_text ? w : -1, wrap_text);
|
||||
|
||||
overlay_element caret;
|
||||
caret.set_pos(static_cast<u16>(caret_x) + padding_left + x, static_cast<u16>(caret_y) + padding_top + y);
|
||||
|
||||
@ -457,12 +457,9 @@ namespace rsx
|
||||
return render_text_ex(unused_x, unused_y, text, -1, max_width, wrap);
|
||||
}
|
||||
|
||||
std::pair<f32, f32> font::get_char_offset(const char32_t* text, usz max_length, u16 max_width, bool wrap)
|
||||
void font::get_char_offset(f32& loc_x, f32& loc_y, const char32_t* text, usz max_length, u16 max_width, bool wrap)
|
||||
{
|
||||
f32 loc_x, loc_y;
|
||||
|
||||
render_text_ex(loc_x, loc_y, text, max_length, max_width, wrap);
|
||||
return {loc_x, loc_y};
|
||||
}
|
||||
|
||||
const std::vector<u8>& font::get_glyph_data() const
|
||||
|
||||
@ -78,7 +78,7 @@ namespace rsx
|
||||
|
||||
std::vector<vertex> render_text(const char32_t* text, u16 max_width = -1, bool wrap = false);
|
||||
|
||||
std::pair<f32, f32> get_char_offset(const char32_t* text, usz max_length, u16 max_width = -1, bool wrap = false);
|
||||
void get_char_offset(f32& loc_x, f32& loc_y, const char32_t* text, usz max_length, u16 max_width = -1, bool wrap = false);
|
||||
|
||||
bool matches(std::string_view name, int size) const { return static_cast<int>(size_pt) == size && font_name == name; }
|
||||
std::string_view get_name() const { return font_name; }
|
||||
|
||||
@ -171,7 +171,7 @@ namespace rsx::assembler
|
||||
|
||||
for (const auto& inst : m_instructions)
|
||||
{
|
||||
const auto src = reinterpret_cast<const be_t<u16>*>(inst.bytecode);
|
||||
const auto src = utils::bless<const be_t<u16>>(&inst.bytecode[0]);
|
||||
for (u32 j = 0; j < inst.length; ++j)
|
||||
{
|
||||
const u16 low = src[j * 2];
|
||||
|
||||
@ -859,14 +859,14 @@ static std::optional<iso_fs_metadata> iso_read_directory_entry(fs::file& entry,
|
||||
else if (names_in_ucs2) // For strings in joliet descriptor
|
||||
{
|
||||
// Characters are stored in big endian format
|
||||
const u16* raw = reinterpret_cast<const u16*>(file_name.data());
|
||||
const be_t<u16>* raw = utils::bless<const be_t<u16>>(file_name.data());
|
||||
std::u16string utf16;
|
||||
|
||||
utf16.resize(header.file_name_length / 2);
|
||||
|
||||
for (usz i = 0; i < utf16.size(); i++, raw++)
|
||||
for (usz i = 0; i < utf16.size(); i++)
|
||||
{
|
||||
utf16[i] = *reinterpret_cast<const be_t<u16>*>(raw);
|
||||
utf16[i] = raw[i];
|
||||
}
|
||||
|
||||
file_name = utf16_to_utf8(utf16);
|
||||
|
||||
@ -1,10 +1,13 @@
|
||||
#include "gamemode_control.h"
|
||||
|
||||
#ifdef GAMEMODE_AVAILABLE
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wold-style-cast"
|
||||
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
||||
extern "C" {
|
||||
#include "3rdparty/feralinteractive/feralinteractive/lib/gamemode_client.h"
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
// Enables and Disables GameMode based on user settings and system
|
||||
|
||||
@ -418,8 +418,12 @@ namespace rsx
|
||||
{
|
||||
auto ptr = rsx::aligned_allocator::malloc<256>(16);
|
||||
auto ptr2 = rsx::aligned_allocator::realloc<256>(ptr, 16, 8);
|
||||
|
||||
const auto ptr_value = reinterpret_cast<uintptr_t>(ptr);
|
||||
const auto ptr2_value = reinterpret_cast<uintptr_t>(ptr2);
|
||||
|
||||
rsx::aligned_allocator::free(ptr2);
|
||||
|
||||
EXPECT_EQ(ptr, ptr2);
|
||||
EXPECT_EQ(ptr_value, ptr2_value);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user