1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-21 18:22:33 +01:00

Add and fix -Wredundant-decls (GCC)

This commit is contained in:
Nekotekina 2021-03-23 22:32:50 +03:00
parent 5dc3467337
commit b3fb6d7d18
34 changed files with 105 additions and 115 deletions

View File

@ -283,6 +283,7 @@ asmjit::Runtime& asmjit::get_global_runtime()
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic ignored "-Wredundant-decls"
#endif
#include "llvm/Support/TargetSelect.h"
#include "llvm/Support/FormattedStream.h"

View File

@ -15,6 +15,7 @@
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic ignored "-Wredundant-decls"
#ifndef __clang__
#pragma GCC diagnostic ignored "-Wduplicated-branches"
#endif

View File

@ -3,6 +3,7 @@
#include "Emu/Cell/PPUModule.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/Cell/lv2/sys_sync.h"
#include "Emu/Cell/timers.hpp"
#include "Emu/Io/interception.h"
#include "Emu/RSX/Overlays/overlay_message_dialog.h"
@ -15,8 +16,6 @@
LOG_CHANNEL(cellSysutil);
extern u64 get_guest_system_time();
template<>
void fmt_class_string<CellMsgDialogError>::format(std::string& out, u64 arg)
{

View File

@ -1,5 +1,6 @@
#include "stdafx.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/Cell/timers.hpp"
#include "Emu/Cell/lv2/sys_mutex.h"
#include "Emu/Cell/lv2/sys_interrupt.h"
@ -10,8 +11,6 @@
LOG_CHANNEL(sysPrxForUser);
extern u64 get_guest_system_time();
vm::gvar<s32> sys_prx_version; // ???
vm::gvar<vm::ptr<void()>> g_ppu_atexitspawn;
vm::gvar<vm::ptr<void()>> g_ppu_at_Exitspawn;

View File

@ -6,6 +6,7 @@
#include "PPUThread.h"
#include "Emu/Cell/Common.h"
#include "Emu/Cell/PPUFunction.h"
#include "Emu/Cell/timers.hpp"
#include <bit>
#include <cmath>
@ -387,7 +388,6 @@ static add_flags_result_t<u64> add64_flags(u64 a, u64 b, bool c)
return{ a, b, c };
}
extern u64 get_timebased_time();
extern void ppu_execute_syscall(ppu_thread& ppu, u64 code);
extern u32 ppu_lwarx(ppu_thread& ppu, u32 addr);

View File

@ -16,6 +16,7 @@
#include "PPUModule.h"
#include "PPUDisAsm.h"
#include "SPURecompiler.h"
#include "timers.hpp"
#include "lv2/sys_sync.h"
#include "lv2/sys_prx.h"
#include "lv2/sys_overlay.h"
@ -76,8 +77,6 @@
const bool s_use_ssse3 = utils::has_ssse3();
extern u64 get_guest_system_time();
extern atomic_t<u64> g_watchdog_hold_ctr;
extern atomic_t<const char*> g_progr;
@ -1293,7 +1292,6 @@ void ppu_thread::stack_pop_verbose(u32 addr, u32 size) noexcept
ppu_log.error("Invalid thread");
}
extern u64 get_timebased_time();
extern ppu_function_t ppu_get_syscall(u64 code);
extern __m128 sse_exp2_ps(__m128 A);

View File

@ -3,6 +3,7 @@
#include "Emu/system_config.h"
#include "Emu/IdManager.h"
#include "Emu/Cell/timers.hpp"
#include "SPUDisAsm.h"
#include "SPUThread.h"
@ -28,8 +29,6 @@
extern const spu_decoder<spu_interpreter_fast> g_spu_interpreter_fast{}; // TODO: avoid
const spu_decoder<spu_recompiler> s_spu_decoder;
extern u64 get_timebased_time();
std::unique_ptr<spu_recompiler_base> spu_recompiler_base::make_asmjit_recompiler()
{
return std::make_unique<spu_recompiler>();

View File

@ -4,6 +4,7 @@
#include "Emu/System.h"
#include "Emu/system_config.h"
#include "Emu/IdManager.h"
#include "Emu/Cell/timers.hpp"
#include "Crypto/sha1.h"
#include "Utilities/StrUtil.h"
#include "Utilities/JIT.h"
@ -32,8 +33,6 @@ const spu_decoder<spu_iflag> s_spu_iflag;
extern const spu_decoder<spu_interpreter_precise> g_spu_interpreter_precise{};
extern const spu_decoder<spu_interpreter_fast> g_spu_interpreter_fast;
extern u64 get_timebased_time();
// Move 4 args for calling native function from a GHC calling convention function
static u8* move_args_ghc_to_native(u8* raw)
{

View File

@ -23,6 +23,7 @@
#include "Emu/Cell/SPUInterpreter.h"
#include "Emu/Cell/SPURecompiler.h"
#include "Emu/Cell/RawSPUThread.h"
#include "Emu/Cell/timers.hpp"
#include <cmath>
#include <cfenv>
@ -282,9 +283,6 @@ extern void mov_rdata_nt(spu_rdata_t& _dst, const spu_rdata_t& _src)
_mm_stream_si128(reinterpret_cast<__m128i*>(_dst + 112), v3);
}
extern u64 get_timebased_time();
extern u64 get_system_time();
void do_cell_atomic_128_store(u32 addr, const void* to_write);
extern thread_local u64 g_tls_fault_spu;

View File

@ -1106,8 +1106,6 @@ std::string ppu_get_syscall_name(u64 code)
return fmt::format("syscall_%u", code);
}
extern u64 get_guest_system_time();
DECLARE(lv2_obj::g_mutex);
DECLARE(lv2_obj::g_ppu);
DECLARE(lv2_obj::g_pending);

View File

@ -3,15 +3,13 @@
#include "Emu/Cell/PPUModule.h"
#include "Emu/Cell/ErrorCodes.h"
#include "Emu/Cell/timers.hpp"
#include "Emu/Memory/vm_locking.h"
#include "Emu/RSX/RSXThread.h"
#include "sys_event.h"
LOG_CHANNEL(sys_rsx);
extern u64 get_timebased_time();
// Unknown error code returned by sys_rsx_context_attribute
enum sys_rsx_error : s32
{

View File

@ -14,6 +14,7 @@
#include "Emu/Cell/PPUThread.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/Cell/RawSPUThread.h"
#include "Emu/Cell/timers.hpp"
#include "sys_interrupt.h"
#include "sys_process.h"
#include "sys_memory.h"
@ -25,8 +26,6 @@
LOG_CHANNEL(sys_spu);
extern u64 get_timebased_time();
template <>
void fmt_class_string<spu_group_status>::format(std::string& out, u64 arg)
{

View File

@ -5,6 +5,7 @@
#include "Emu/CPU/CPUThread.h"
#include "Emu/Cell/ErrorCodes.h"
#include "Emu/Cell/timers.hpp"
#include "Emu/IdManager.h"
#include "Emu/IPC.h"
#include "Emu/system_config.h"
@ -304,8 +305,6 @@ public:
// Clamp
usec = std::min<u64>(usec, max_timeout);
extern u64 get_system_time();
u64 passed = 0;
u64 remaining;

View File

@ -5,6 +5,7 @@
#include "Emu/Cell/ErrorCodes.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/Cell/timers.hpp"
#include "sys_event.h"
#include "sys_process.h"
@ -12,8 +13,6 @@
LOG_CHANNEL(sys_timer);
extern u64 get_guest_system_time();
void lv2_timer_context::operator()()
{
while (thread_ctrl::state() != thread_state::aborting)

View File

@ -4,10 +4,9 @@
#include "Emu/IdManager.h"
#include "Emu/Cell/ErrorCodes.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/Cell/timers.hpp"
#include "Emu/Memory/vm_locking.h"
extern u64 get_timebased_time();
sys_vm_t::sys_vm_t(u32 _addr, u32 vsize, lv2_memory_container* ct, u32 psize)
: ct(ct)
, addr(_addr)

View File

@ -0,0 +1,7 @@
#pragma once
#include "util/types.hpp"
u64 get_timebased_time();
u64 get_system_time();
u64 get_guest_system_time();

View File

@ -6,7 +6,7 @@
#include <unordered_map>
extern u64 get_system_time();
#include "Emu/Cell/timers.hpp"
#define RSX_GCM_FORMAT_IGNORED 0

View File

@ -89,6 +89,52 @@ namespace gl
}
}
gl::texture_view* texture_cache::create_temporary_subresource_impl(gl::command_context& cmd, gl::texture* src, GLenum sized_internal_fmt, GLenum dst_type,
u32 gcm_format, u16 x, u16 y, u16 width, u16 height, u16 depth, u8 mipmaps, const rsx::texture_channel_remap_t& remap, bool copy)
{
if (sized_internal_fmt == GL_NONE)
{
sized_internal_fmt = gl::get_sized_internal_format(gcm_format);
}
std::unique_ptr<gl::texture> dst = std::make_unique<gl::viewable_image>(dst_type, width, height, depth, mipmaps, sized_internal_fmt, rsx::classify_format(gcm_format));
if (copy)
{
std::vector<copy_region_descriptor> region =
{{
src,
rsx::surface_transform::coordinate_transform,
0,
x, y, 0, 0, 0,
width, height, width, height
}};
copy_transfer_regions_impl(cmd, dst.get(), region);
}
std::array<GLenum, 4> swizzle;
if (!src || static_cast<GLenum>(src->get_internal_format()) != sized_internal_fmt)
{
// Apply base component map onto the new texture if a data cast has been done
swizzle = get_component_mapping(gcm_format, rsx::texture_create_flags::default_component_order);
}
else
{
swizzle = src->get_native_component_layout();
}
if (memcmp(remap.first.data(), rsx::default_remap_vector.first.data(), 4) ||
memcmp(remap.second.data(), rsx::default_remap_vector.second.data(), 4))
swizzle = apply_swizzle_remap(swizzle, remap);
auto view = std::make_unique<gl::texture_view>(dst.get(), dst_type, sized_internal_fmt, swizzle.data());
auto result = view.get();
m_temporary_surfaces.emplace_back(dst, view);
return result;
}
void texture_cache::copy_transfer_regions_impl(gl::command_context& cmd, gl::texture* dst_image, const std::vector<copy_region_descriptor>& sources) const
{
const auto dst_bpp = dst_image->pitch() / dst_image->width();

View File

@ -14,10 +14,7 @@ namespace gl
{
class blitter;
extern GLenum get_sized_internal_format(u32);
extern GLenum get_target(rsx::texture_dimension_extended type);
extern void copy_typeless(texture*, const texture*, const coord3u&, const coord3u&);
extern blitter *g_hw_blitter;
extern blitter* g_hw_blitter;
class cached_texture_section;
class texture_cache;
@ -471,50 +468,7 @@ namespace gl
}
gl::texture_view* create_temporary_subresource_impl(gl::command_context& cmd, gl::texture* src, GLenum sized_internal_fmt, GLenum dst_type, u32 gcm_format,
u16 x, u16 y, u16 width, u16 height, u16 depth, u8 mipmaps, const rsx::texture_channel_remap_t& remap, bool copy)
{
if (sized_internal_fmt == GL_NONE)
{
sized_internal_fmt = gl::get_sized_internal_format(gcm_format);
}
std::unique_ptr<gl::texture> dst = std::make_unique<gl::viewable_image>(dst_type, width, height, depth, mipmaps, sized_internal_fmt, rsx::classify_format(gcm_format));
if (copy)
{
std::vector<copy_region_descriptor> region =
{{
src,
rsx::surface_transform::coordinate_transform,
0,
x, y, 0, 0, 0,
width, height, width, height
}};
copy_transfer_regions_impl(cmd, dst.get(), region);
}
std::array<GLenum, 4> swizzle;
if (!src || static_cast<GLenum>(src->get_internal_format()) != sized_internal_fmt)
{
// Apply base component map onto the new texture if a data cast has been done
swizzle = get_component_mapping(gcm_format, rsx::texture_create_flags::default_component_order);
}
else
{
swizzle = src->get_native_component_layout();
}
if (memcmp(remap.first.data(), rsx::default_remap_vector.first.data(), 4) ||
memcmp(remap.second.data(), rsx::default_remap_vector.second.data(), 4))
swizzle = apply_swizzle_remap(swizzle, remap);
auto view = std::make_unique<gl::texture_view>(dst.get(), dst_type, sized_internal_fmt, swizzle.data());
auto result = view.get();
m_temporary_surfaces.emplace_back(dst, view);
return result;
}
u16 x, u16 y, u16 width, u16 height, u16 depth, u8 mipmaps, const rsx::texture_channel_remap_t& remap, bool copy);
std::array<GLenum, 4> get_component_mapping(u32 gcm_format, rsx::texture_create_flags flags) const
{

View File

@ -8,6 +8,7 @@
#include "overlay_fonts.h"
#include "Emu/localized_string.h"
#include "Emu/Cell/timers.hpp"
#include <string>
#include <vector>
@ -30,8 +31,6 @@
#include <sys/sysctl.h>
#endif
extern u64 get_system_time();
// Definitions for common UI controls and their routines
namespace rsx
{

View File

@ -3,6 +3,7 @@
#include "overlay_controls.h"
#include "Emu/IdManager.h"
#include "Emu/Cell/timers.hpp"
#include "Utilities/mutex.h"
#include "Utilities/Timer.h"
@ -10,8 +11,6 @@
#include <list>
#include <mutex>
// Utils
extern u64 get_system_time();
// Definition of user interface implementations
namespace rsx

View File

@ -2,6 +2,7 @@
#include "RSXThread.h"
#include "Emu/Cell/PPUCallback.h"
#include "Emu/Cell/timers.hpp"
#include "Common/BufferUtils.h"
#include "Common/GLSLCommon.h"
@ -12,6 +13,7 @@
#include "rsx_utils.h"
#include "gcm_printing.h"
#include "Emu/Cell/lv2/sys_event.h"
#include "Emu/Cell/lv2/sys_time.h"
#include "Emu/Cell/Modules/cellGcmSys.h"
#include "Overlays/overlay_perf_metrics.h"
#include "Utilities/date_time.h"
@ -36,8 +38,6 @@ rsx::frame_capture_data frame_capture;
extern CellGcmOffsetTable offsetTable;
extern thread_local std::string(*g_tls_log_prefix)();
extern u64 sys_time_get_timebase_frequency();
extern u64 get_timebased_time();
namespace rsx
{

View File

@ -22,12 +22,10 @@
#include "Capture/rsx_replay.h"
#include "Emu/Cell/lv2/sys_rsx.h"
#include "Emu/Cell/timers.hpp"
#include "Emu/IdManager.h"
#include "Emu/system_config.h"
extern u64 get_guest_system_time();
extern u64 get_system_time();
extern atomic_t<bool> g_user_asked_for_frame_capture;
extern rsx::frame_trace_data frame_debug;
extern rsx::frame_capture_data frame_capture;

View File

@ -1,5 +1,6 @@
#pragma once
#include "Emu/RSX/GSRender.h"
#include "Emu/Cell/timers.hpp"
#include "vkutils/descriptors.hpp"
#include "vkutils/data_heap.h"
@ -55,7 +56,6 @@ namespace vk
#define VK_MAX_ASYNC_FRAMES 2
using rsx::flags32_t;
extern u64 get_system_time();
namespace vk
{

View File

@ -59,7 +59,6 @@ namespace vk
template<class T>
T* get_compute_task();
void reset_compute_tasks();
void destroy_global_resources();
void reset_global_resources();

View File

@ -541,8 +541,8 @@ namespace vk
}
};
void resolve_image(vk::command_buffer& cmd, vk::viewable_image* dst, vk::viewable_image* src);
void unresolve_image(vk::command_buffer& cmd, vk::viewable_image* dst, vk::viewable_image* src);
//void resolve_image(vk::command_buffer& cmd, vk::viewable_image* dst, vk::viewable_image* src);
//void unresolve_image(vk::command_buffer& cmd, vk::viewable_image* dst, vk::viewable_image* src);
void reset_resolve_resources();
void clear_resolve_helpers();
}

View File

@ -7,12 +7,11 @@
#include "vkutils/image_helpers.h"
#include "../Common/texture_cache.h"
#include "Emu/Cell/timers.hpp"
#include <memory>
#include <vector>
extern u64 get_system_time();
namespace vk
{
class cached_texture_section;

View File

@ -5,11 +5,11 @@
#include "sync.h"
#include "shared.h"
#include "Emu/Cell/timers.hpp"
#include "util/sysinfo.hpp"
#include "util/asm.hpp"
extern u64 get_system_time();
namespace vk
{
#ifdef _MSC_VER

View File

@ -2625,6 +2625,22 @@ namespace rsx
return registers[reg] == value;
}
void draw_clause::reset(primitive_type type)
{
current_range_index = ~0u;
last_execution_barrier_index = 0;
command = draw_command::none;
primitive = type;
primitive_barrier_enable = false;
draw_command_ranges.clear();
draw_command_barriers.clear();
inline_vertex_array.clear();
is_disjoint_primitive = is_primitive_disjointed(primitive);
}
u32 draw_clause::execute_pipeline_dependencies() const
{
u32 result = 0;

View File

@ -12,9 +12,7 @@
#include "rsx_vertex_data.h"
#include "rsx_utils.h"
#include "Utilities/geometry.h"
extern u64 get_system_time();
extern bool is_primitive_disjointed(rsx::primitive_type);
#include "Emu/Cell/timers.hpp"
namespace rsx
{
@ -297,21 +295,7 @@ namespace rsx
return count;
}
void reset(rsx::primitive_type type)
{
current_range_index = ~0u;
last_execution_barrier_index = 0;
command = draw_command::none;
primitive = type;
primitive_barrier_enable = false;
draw_command_ranges.clear();
draw_command_barriers.clear();
inline_vertex_array.clear();
is_disjoint_primitive = is_primitive_disjointed(primitive);
}
void reset(rsx::primitive_type type);
void begin()
{

View File

@ -8,8 +8,7 @@
#include <vector>
#include <set>
u64 get_system_time();
u64 get_guest_system_time();
#include "Emu/Cell/timers.hpp"
enum class localized_string_id;
enum class video_renderer;

View File

@ -42,6 +42,7 @@ else()
#add_compile_options(-Wconversion)
#add_compile_options(-Wpadded)
add_compile_options(-Wempty-body)
add_compile_options(-Wredundant-decls)
add_compile_options(-Wstrict-aliasing=1)
#add_compile_options(-Wnull-dereference)
@ -54,7 +55,6 @@ else()
add_compile_options(-Wcast-function-type)
add_compile_options(-Wduplicated-branches)
add_compile_options(-Wduplicated-cond)
#add_compile_options(-Wredundant-decls)
endif()
#TODO Clean the code so these are removed

View File

@ -686,6 +686,7 @@
<ClInclude Include="Emu\Cell\SPUOpcodes.h" />
<ClInclude Include="Emu\Cell\SPURecompiler.h" />
<ClInclude Include="Emu\Cell\SPUThread.h" />
<ClInclude Include="Emu\Cell\timers.hpp" />
<ClInclude Include="Emu\CPU\CPUDisAsm.h" />
<ClInclude Include="Emu\CPU\CPUThread.h" />
<ClInclude Include="Emu\RSX\Capture\rsx_capture.h" />

View File

@ -722,6 +722,9 @@
<ClCompile Include="Emu\Cell\PPUTranslator.cpp">
<Filter>Emu\Cell</Filter>
</ClCompile>
<ClCompile Include="Emu\Cell\timers.hpp">
<Filter>Emu\Cell</Filter>
</ClCompile>
<ClCompile Include="Emu\CPU\CPUTranslator.cpp">
<Filter>Emu\CPU</Filter>
</ClCompile>