Add/fix warning -Wignored-qualifiers (GCC/clang)

Fix simple_array::const_iterator as a part of it.
This commit is contained in:
Nekotekina 2021-03-07 18:49:42 +03:00
parent 5bdd1cf837
commit 53af2dbb3f
11 changed files with 25 additions and 23 deletions

View File

@ -71,5 +71,5 @@ public:
~AudioDumper(); ~AudioDumper();
void WriteData(const void* buffer, u32 size); void WriteData(const void* buffer, u32 size);
const u16 GetCh() const { return m_header.FMT.NumChannels; } u16 GetCh() const { return m_header.FMT.NumChannels; }
}; };

View File

@ -97,7 +97,7 @@ DECLARE(spu_runtime::tr_interpreter) = []
DECLARE(spu_runtime::g_dispatcher) = [] DECLARE(spu_runtime::g_dispatcher) = []
{ {
// Allocate 2^20 positions in data area // Allocate 2^20 positions in data area
const auto ptr = reinterpret_cast<decltype(g_dispatcher)>(jit_runtime::alloc(sizeof(*g_dispatcher), 64, false)); const auto ptr = reinterpret_cast<std::remove_const_t<decltype(spu_runtime::g_dispatcher)>>(jit_runtime::alloc(sizeof(*g_dispatcher), 64, false));
for (auto& x : *ptr) for (auto& x : *ptr)
{ {

View File

@ -3037,12 +3037,12 @@ namespace rsx
} }
} }
virtual const u32 get_unreleased_textures_count() const virtual u32 get_unreleased_textures_count() const
{ {
return m_storage.m_unreleased_texture_objects; return m_storage.m_unreleased_texture_objects;
} }
const u64 get_texture_memory_in_use() const u64 get_texture_memory_in_use() const
{ {
return m_storage.m_texture_memory_in_use; return m_storage.m_texture_memory_in_use;
} }

View File

@ -255,12 +255,12 @@ namespace vk
g_num_total_frames++; g_num_total_frames++;
} }
const u64 get_current_frame_id() u64 get_current_frame_id()
{ {
return g_num_total_frames; return g_num_total_frames;
} }
const u64 get_last_completed_frame_id() u64 get_last_completed_frame_id()
{ {
return (g_num_processed_frames > 0)? g_num_processed_frames - 1: 0; return (g_num_processed_frames > 0)? g_num_processed_frames - 1: 0;
} }

View File

@ -106,8 +106,8 @@ namespace vk
void advance_completed_frame_counter(); void advance_completed_frame_counter();
void advance_frame_counter(); void advance_frame_counter();
const u64 get_current_frame_id(); u64 get_current_frame_id();
const u64 get_last_completed_frame_id(); u64 get_last_completed_frame_id();
// Handle unexpected submit with dangling occlusion query // Handle unexpected submit with dangling occlusion query
// TODO: Move queries out of the renderer! // TODO: Move queries out of the renderer!

View File

@ -366,7 +366,7 @@ namespace vk
block_size = tex.get_section_size(); block_size = tex.get_section_size();
} }
const bool test(u64 ref_frame) const bool test(u64 ref_frame) const
{ {
return ref_frame > 0 && frame_tag <= ref_frame; return ref_frame > 0 && frame_tag <= ref_frame;
} }
@ -1258,12 +1258,12 @@ namespace vk
return false; return false;
} }
const u32 get_unreleased_textures_count() const override u32 get_unreleased_textures_count() const override
{ {
return baseclass::get_unreleased_textures_count() + ::size32(m_temporary_storage); return baseclass::get_unreleased_textures_count() + ::size32(m_temporary_storage);
} }
const u32 get_temporary_memory_in_use() u32 get_temporary_memory_in_use()
{ {
return m_temporary_memory_size; return m_temporary_memory_size;
} }

View File

@ -117,12 +117,12 @@ namespace vk
return dev; return dev;
} }
const VkFormat get_surface_format() VkFormat get_surface_format()
{ {
return m_surface_format; return m_surface_format;
} }
const bool is_headless() const bool is_headless() const
{ {
return (dev.get_present_queue() == VK_NULL_HANDLE); return (dev.get_present_queue() == VK_NULL_HANDLE);
} }

View File

@ -578,12 +578,12 @@ namespace rsx
} }
} }
static inline const f32 get_resolution_scale() static inline f32 get_resolution_scale()
{ {
return g_cfg.video.strict_rendering_mode ? 1.f : (g_cfg.video.resolution_scale_percent / 100.f); return g_cfg.video.strict_rendering_mode ? 1.f : (g_cfg.video.resolution_scale_percent / 100.f);
} }
static inline const int get_resolution_scale_percent() static inline int get_resolution_scale_percent()
{ {
return g_cfg.video.strict_rendering_mode ? 100 : g_cfg.video.resolution_scale_percent; return g_cfg.video.strict_rendering_mode ? 100 : g_cfg.video.resolution_scale_percent;
} }
@ -951,8 +951,8 @@ namespace rsx
struct simple_array struct simple_array
{ {
public: public:
using iterator = Ty * ; using iterator = Ty*;
using const_iterator = Ty * const; using const_iterator = const Ty*;
private: private:
u32 _capacity = 0; u32 _capacity = 0;

View File

@ -465,7 +465,7 @@ namespace
}; };
} }
const bool Emulator::SetUsr(const std::string& user) bool Emulator::SetUsr(const std::string& user)
{ {
if (user.empty()) if (user.empty())
{ {
@ -485,7 +485,7 @@ const bool Emulator::SetUsr(const std::string& user)
return true; return true;
} }
const std::string Emulator::GetBackgroundPicturePath() const std::string Emulator::GetBackgroundPicturePath() const
{ {
// Try to find a custom icon first // Try to find a custom icon first
std::string path = fs::get_config_dir() + "/Icons/game_icons/" + Emu.GetTitleID() + "/PIC1.PNG"; std::string path = fs::get_config_dir() + "/Icons/game_icons/" + Emu.GetTitleID() + "/PIC1.PNG";
@ -1661,7 +1661,7 @@ game_boot_result Emulator::Load(const std::string& title_id, bool add_only, bool
extern const std::map<std::string_view, int> g_prx_list; extern const std::map<std::string_view, int> g_prx_list;
// Check if there are any firmware SPRX which may be LLEd during emulation // Check if there are any firmware SPRX which may be LLEd during emulation
// Don't prompt GUI confirmation if there aren't any // Don't prompt GUI confirmation if there aren't any
if (std::any_of(g_prx_list.begin(), g_prx_list.end(), [&libs](auto& lib) if (std::any_of(g_prx_list.begin(), g_prx_list.end(), [&libs](auto& lib)
{ {

View File

@ -192,14 +192,14 @@ public:
} }
// u32 for cell. // u32 for cell.
const u32 GetUsrId() const u32 GetUsrId() const
{ {
return m_usrid; return m_usrid;
} }
const bool SetUsr(const std::string& user); bool SetUsr(const std::string& user);
const std::string GetBackgroundPicturePath() const; std::string GetBackgroundPicturePath() const;
u64 GetPauseTime() u64 GetPauseTime()
{ {

View File

@ -33,6 +33,8 @@ else()
add_compile_options(-Werror=return-type) add_compile_options(-Werror=return-type)
add_compile_options(-Werror=overloaded-virtual) add_compile_options(-Werror=overloaded-virtual)
add_compile_options(-Wunused-parameter) add_compile_options(-Wunused-parameter)
add_compile_options(-Wignored-qualifiers)
#add_compile_options(-Wdeprecated-copy)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Werror=inconsistent-missing-override) add_compile_options(-Werror=inconsistent-missing-override)