mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 10:42:36 +01:00
Enable -Wdeprecated-copy
Some classes violated the Rule of 3(5) in their special operator definitions.
This commit is contained in:
parent
870224cde0
commit
deacf05769
@ -242,6 +242,18 @@ struct RSXFragmentProgram
|
||||
}
|
||||
|
||||
data_storage_helper(const data_storage_helper& other)
|
||||
{
|
||||
this->operator=(other);
|
||||
}
|
||||
|
||||
data_storage_helper(data_storage_helper&& other)
|
||||
: data_ptr(other.data_ptr)
|
||||
, local_storage(std::move(other.local_storage))
|
||||
{
|
||||
other.data_ptr = nullptr;
|
||||
}
|
||||
|
||||
data_storage_helper& operator=(const data_storage_helper& other)
|
||||
{
|
||||
if (other.data_ptr == other.local_storage.data())
|
||||
{
|
||||
@ -253,6 +265,20 @@ struct RSXFragmentProgram
|
||||
data_ptr = other.data_ptr;
|
||||
local_storage.clear();
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
data_storage_helper& operator=(data_storage_helper&& other)
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
data_ptr = other.data_ptr;
|
||||
local_storage = std::move(other.local_storage);
|
||||
other.data_ptr = nullptr;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
void deep_copy(u32 max_length)
|
||||
|
@ -390,11 +390,11 @@ namespace rsx
|
||||
|
||||
void thread::capture_frame(const std::string &name)
|
||||
{
|
||||
frame_trace_data::draw_state draw_state = {};
|
||||
frame_trace_data::draw_state draw_state{};
|
||||
|
||||
draw_state.programs = get_programs();
|
||||
draw_state.name = name;
|
||||
frame_debug.draw_calls.push_back(draw_state);
|
||||
frame_debug.draw_calls.emplace_back(std::move(draw_state));
|
||||
}
|
||||
|
||||
void thread::begin()
|
||||
|
@ -475,7 +475,7 @@ namespace rsx
|
||||
return decoded_type<opcode>(register_value);
|
||||
}
|
||||
|
||||
rsx_state &operator=(const rsx_state& in)
|
||||
rsx_state& operator=(const rsx_state& in)
|
||||
{
|
||||
registers = in.registers;
|
||||
transform_program = in.transform_program;
|
||||
@ -484,6 +484,15 @@ namespace rsx
|
||||
return *this;
|
||||
}
|
||||
|
||||
rsx_state& operator=(rsx_state&& in)
|
||||
{
|
||||
registers = std::move(in.registers);
|
||||
transform_program = std::move(in.transform_program);
|
||||
transform_constants = std::move(in.transform_constants);
|
||||
register_vertex_info = std::move(in.register_vertex_info);
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::array<fragment_texture, 16> fragment_textures;
|
||||
std::array<vertex_texture, 4> vertex_textures;
|
||||
|
||||
@ -521,13 +530,25 @@ namespace rsx
|
||||
}
|
||||
|
||||
public:
|
||||
rsx_state() :
|
||||
fragment_textures(fill_array<fragment_texture>(registers, std::make_index_sequence<16>())),
|
||||
vertex_textures(fill_array<vertex_texture>(registers, std::make_index_sequence<4>())),
|
||||
vertex_arrays_info(fill_array<data_array_format_info>(registers, std::make_index_sequence<16>()))
|
||||
rsx_state()
|
||||
: fragment_textures(fill_array<fragment_texture>(registers, std::make_index_sequence<16>()))
|
||||
, vertex_textures(fill_array<vertex_texture>(registers, std::make_index_sequence<4>()))
|
||||
, vertex_arrays_info(fill_array<data_array_format_info>(registers, std::make_index_sequence<16>()))
|
||||
{
|
||||
}
|
||||
|
||||
rsx_state(const rsx_state& other)
|
||||
: rsx_state()
|
||||
{
|
||||
this->operator=(other);
|
||||
}
|
||||
|
||||
rsx_state(rsx_state&& other)
|
||||
: rsx_state()
|
||||
{
|
||||
this->operator=(std::move(other));
|
||||
}
|
||||
|
||||
~rsx_state() = default;
|
||||
|
||||
void decode(u32 reg, u32 value);
|
||||
|
@ -36,7 +36,7 @@ else()
|
||||
add_compile_options(-Wignored-qualifiers)
|
||||
add_compile_options(-Wredundant-move)
|
||||
add_compile_options(-Wcast-qual)
|
||||
#add_compile_options(-Wdeprecated-copy)
|
||||
add_compile_options(-Wdeprecated-copy)
|
||||
add_compile_options(-Wtautological-compare)
|
||||
#add_compile_options(-Wshadow)
|
||||
#add_compile_options(-Wconversion)
|
||||
|
Loading…
Reference in New Issue
Block a user