Skip to content

Commit

Permalink
Add and fix -Wredundant-decls (GCC)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekotekina committed Mar 23, 2021
1 parent 5dc3467 commit b3fb6d7
Show file tree
Hide file tree
Showing 34 changed files with 105 additions and 115 deletions.
1 change: 1 addition & 0 deletions Utilities/JIT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions Utilities/JIT.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions rpcs3/Emu/Cell/Modules/cellMsgDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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)
{
Expand Down
3 changes: 1 addition & 2 deletions rpcs3/Emu/Cell/Modules/sysPrxForUser.cpp
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/Cell/PPUInterpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 1 addition & 3 deletions rpcs3/Emu/Cell/PPUThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions rpcs3/Emu/Cell/SPUASMJITRecompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "Emu/system_config.h"
#include "Emu/IdManager.h"
#include "Emu/Cell/timers.hpp"

#include "SPUDisAsm.h"
#include "SPUThread.h"
Expand All @@ -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>();
Expand Down
3 changes: 1 addition & 2 deletions rpcs3/Emu/Cell/SPURecompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
{
Expand Down
4 changes: 1 addition & 3 deletions rpcs3/Emu/Cell/SPUThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions rpcs3/Emu/Cell/lv2/lv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 1 addition & 3 deletions rpcs3/Emu/Cell/lv2/sys_rsx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
3 changes: 1 addition & 2 deletions rpcs3/Emu/Cell/lv2/sys_spu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
{
Expand Down
3 changes: 1 addition & 2 deletions rpcs3/Emu/Cell/lv2/sys_sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -304,8 +305,6 @@ struct lv2_obj
// Clamp
usec = std::min<u64>(usec, max_timeout);

extern u64 get_system_time();

u64 passed = 0;
u64 remaining;

Expand Down
3 changes: 1 addition & 2 deletions rpcs3/Emu/Cell/lv2/sys_timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@

#include "Emu/Cell/ErrorCodes.h"
#include "Emu/Cell/PPUThread.h"
#include "Emu/Cell/timers.hpp"
#include "sys_event.h"
#include "sys_process.h"

#include <thread>

LOG_CHANNEL(sys_timer);

extern u64 get_guest_system_time();

void lv2_timer_context::operator()()
{
while (thread_ctrl::state() != thread_state::aborting)
Expand Down
3 changes: 1 addition & 2 deletions rpcs3/Emu/Cell/lv2/sys_vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions rpcs3/Emu/Cell/timers.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma once

#include "util/types.hpp"

u64 get_timebased_time();
u64 get_system_time();
u64 get_guest_system_time();
2 changes: 1 addition & 1 deletion rpcs3/Emu/RSX/Common/texture_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <unordered_map>

extern u64 get_system_time();
#include "Emu/Cell/timers.hpp"

#define RSX_GCM_FORMAT_IGNORED 0

Expand Down
46 changes: 46 additions & 0 deletions rpcs3/Emu/RSX/GL/GLTextureCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
50 changes: 2 additions & 48 deletions rpcs3/Emu/RSX/GL/GLTextureCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
{
Expand Down
3 changes: 1 addition & 2 deletions rpcs3/Emu/RSX/Overlays/overlay_controls.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "overlay_fonts.h"

#include "Emu/localized_string.h"
#include "Emu/Cell/timers.hpp"

#include <string>
#include <vector>
Expand All @@ -30,8 +31,6 @@
#include <sys/sysctl.h>
#endif

extern u64 get_system_time();

// Definitions for common UI controls and their routines
namespace rsx
{
Expand Down
3 changes: 1 addition & 2 deletions rpcs3/Emu/RSX/Overlays/overlays.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
#include "overlay_controls.h"

#include "Emu/IdManager.h"
#include "Emu/Cell/timers.hpp"

#include "Utilities/mutex.h"
#include "Utilities/Timer.h"

#include <list>
#include <mutex>

// Utils
extern u64 get_system_time();

// Definition of user interface implementations
namespace rsx
Expand Down
Loading

0 comments on commit b3fb6d7

Please sign in to comment.