mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 02:32:36 +01:00
Fix almost all GCC warnings
This commit is contained in:
parent
6786734d95
commit
038148bf06
@ -96,6 +96,11 @@ namespace fs
|
||||
struct dir_entry : stat_t
|
||||
{
|
||||
std::string name;
|
||||
|
||||
dir_entry()
|
||||
: stat_t{}
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
// Directory handle base
|
||||
|
@ -1198,7 +1198,7 @@ usz get_x64_access_size(x64_context* context, x64_op_t op, x64_reg_t reg, usz d_
|
||||
|
||||
if (reg != X64_NOT_SET) // get "full" access size from RCX register
|
||||
{
|
||||
u64 counter;
|
||||
u64 counter = 1;
|
||||
if (!get_x64_reg_value(context, reg, 8, i_size, counter))
|
||||
{
|
||||
return -1;
|
||||
@ -1445,7 +1445,7 @@ bool handle_access_violation(u32 addr, bool is_writing, x64_context* context) no
|
||||
// We notify the game that a page fault occurred so it can rectify it.
|
||||
// Note, for data3, were the memory readable AND we got a page fault, it must be due to a write violation since reads are allowed.
|
||||
u64 data1 = addr;
|
||||
u64 data2;
|
||||
u64 data2 = 0;
|
||||
|
||||
if (cpu->id_type() == 1)
|
||||
{
|
||||
|
@ -971,6 +971,7 @@ void cell_audio_thread::mix(float *out_buffer, s32 offset)
|
||||
const float left = buf[in + 0] * m;
|
||||
const float right = buf[in + 1] * m;
|
||||
const float center = buf[in + 2] * m;
|
||||
[[maybe_unused]]
|
||||
const float low_freq = buf[in + 3] * m;
|
||||
const float rear_left = buf[in + 4] * m;
|
||||
const float rear_right = buf[in + 5] * m;
|
||||
|
@ -1133,13 +1133,13 @@ void spursSysServiceUpdateShutdownCompletionEvents(spu_thread& spu, SpursKernelC
|
||||
// Mark the workloads in wklShutdownBitSet as completed and also generate a bit set of the completed
|
||||
// workloads that have a shutdown completion hook registered
|
||||
u32 wklNotifyBitSet;
|
||||
u8 spuPort;
|
||||
[[maybe_unused]] u8 spuPort;
|
||||
//vm::reservation_op(ctxt->spurs.ptr(&CellSpurs::wklState1).addr(), 128, [&]()
|
||||
{
|
||||
auto spurs = ctxt->spurs.get_ptr();
|
||||
|
||||
wklNotifyBitSet = 0;
|
||||
spuPort = spurs->spuPort;;
|
||||
spuPort = spurs->spuPort;
|
||||
for (u32 i = 0; i < CELL_SPURS_MAX_WORKLOAD; i++)
|
||||
{
|
||||
if (wklShutdownBitSet & (0x80000000u >> i))
|
||||
|
@ -955,7 +955,7 @@ error_code cellVdecGetPicItem(u32 handle, vm::pptr<CellVdecPicItem> picItem)
|
||||
u64 pts;
|
||||
u64 dts;
|
||||
u64 usrd;
|
||||
u32 frc;
|
||||
u32 frc = 0;
|
||||
vm::ptr<CellVdecPicItem> info;
|
||||
{
|
||||
std::lock_guard lock(vdec->mutex);
|
||||
|
@ -200,7 +200,7 @@ error_code _sys_lwcond_signal_all(ppu_thread& ppu, u32 lwcond_id, u32 lwmutex_id
|
||||
|
||||
const auto cond = idm::check<lv2_obj, lv2_lwcond>(lwcond_id, [&](lv2_lwcond& cond) -> s32
|
||||
{
|
||||
lv2_lwmutex* mutex;
|
||||
lv2_lwmutex* mutex{};
|
||||
|
||||
if (mode != 2)
|
||||
{
|
||||
|
@ -419,7 +419,7 @@ bool rpcn_client::manage_connection()
|
||||
addr_sig = reinterpret_cast<const le_t<u32>&>(msg[0]);
|
||||
port_sig = reinterpret_cast<const be_t<u16>&>(msg[4]);
|
||||
|
||||
in_addr orig{};
|
||||
[[maybe_unused]] in_addr orig{};
|
||||
orig.s_addr = addr_sig;
|
||||
|
||||
last_pong_time = now;
|
||||
|
@ -1883,8 +1883,8 @@ namespace rsx
|
||||
|
||||
options.is_compressed_format = helpers::is_compressed_gcm_format(attributes.gcm_format);
|
||||
|
||||
u32 tex_size = 0, required_surface_height;
|
||||
u8 subsurface_count;
|
||||
u32 tex_size = 0, required_surface_height = 1;
|
||||
u8 subsurface_count = 1;
|
||||
size2f scale{ 1.f, 1.f };
|
||||
|
||||
if (is_unnormalized)
|
||||
@ -2530,20 +2530,6 @@ namespace rsx
|
||||
if (cached_dest && cached_dest->get_context() != texture_upload_context::dma)
|
||||
{
|
||||
// NOTE: DMA sections are plain memory blocks with no format!
|
||||
if (src_is_render_target || is_format_convert)
|
||||
{
|
||||
bool src_is_depth;
|
||||
if (is_format_convert)
|
||||
{
|
||||
src_is_depth = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
ensure(src_is_render_target);
|
||||
src_is_depth = (typeless_info.src_is_typeless) ? false : src_subres.is_depth;
|
||||
}
|
||||
}
|
||||
|
||||
if (cached_dest) [[likely]]
|
||||
{
|
||||
typeless_info.dst_gcm_format = cached_dest->get_gcm_format();
|
||||
|
@ -542,7 +542,7 @@ namespace gl
|
||||
|
||||
save_binding_state(target target_)
|
||||
{
|
||||
GLenum pname;
|
||||
GLenum pname{};
|
||||
switch (target_)
|
||||
{
|
||||
case target::pixel_pack: pname = GL_PIXEL_PACK_BUFFER_BINDING; break;
|
||||
@ -552,6 +552,7 @@ namespace gl
|
||||
case target::uniform: pname = GL_UNIFORM_BUFFER_BINDING; break;
|
||||
case target::texture: pname = GL_TEXTURE_BUFFER_BINDING; break;
|
||||
case target::ssbo: pname = GL_SHADER_STORAGE_BUFFER_BINDING; break;
|
||||
default: fmt::throw_exception("Invalid binding state target (0x%x)", static_cast<int>(target_));
|
||||
}
|
||||
|
||||
glGetIntegerv(pname, &m_last_binding);
|
||||
@ -2288,7 +2289,7 @@ public:
|
||||
type = type_;
|
||||
source = src;
|
||||
|
||||
GLenum shader_type;
|
||||
GLenum shader_type{};
|
||||
switch (type)
|
||||
{
|
||||
case ::glsl::program_domain::glsl_vertex_program:
|
||||
@ -2301,7 +2302,8 @@ public:
|
||||
shader_type = GL_COMPUTE_SHADER;
|
||||
break;
|
||||
default:
|
||||
rsx_log.fatal("gl::glsl::shader::compile(): Unhandled shader type");
|
||||
rsx_log.fatal("gl::glsl::shader::compile(): Unhandled shader type (%d)", +type_);
|
||||
return;
|
||||
}
|
||||
|
||||
m_id = glCreateShader(shader_type);
|
||||
|
@ -194,7 +194,7 @@ namespace gl
|
||||
}
|
||||
}
|
||||
|
||||
::glsl::shader_properties properties{};
|
||||
[[maybe_unused]] ::glsl::shader_properties properties{};
|
||||
properties.domain = ::glsl::program_domain::glsl_fragment_program;
|
||||
properties.require_depth_conversion = true;
|
||||
properties.require_wpos = true;
|
||||
|
@ -84,7 +84,7 @@ namespace vk
|
||||
|
||||
glsl::shader* shader_interpreter::build_fs(u64 compiler_options)
|
||||
{
|
||||
::glsl::shader_properties properties{};
|
||||
[[maybe_unused]] ::glsl::shader_properties properties{};
|
||||
properties.domain = ::glsl::program_domain::glsl_fragment_program;
|
||||
properties.require_depth_conversion = true;
|
||||
properties.require_wpos = true;
|
||||
|
@ -771,7 +771,7 @@ namespace vk
|
||||
|
||||
// Define desirable attributes based on type
|
||||
VkImageType image_type;
|
||||
VkImageViewType image_view_type;
|
||||
[[maybe_unused]] VkImageViewType image_view_type;
|
||||
VkImageUsageFlags usage_flags = VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_SAMPLED_BIT;
|
||||
u8 layer = 0;
|
||||
|
||||
|
@ -1069,7 +1069,7 @@ namespace rsx
|
||||
u32 dst_dma = 0;
|
||||
rsx::blit_engine::transfer_destination_format dst_color_format;
|
||||
u32 out_pitch = 0;
|
||||
u32 out_alignment = 64;
|
||||
[[maybe_unused]] u32 out_alignment = 64;
|
||||
bool is_block_transfer = false;
|
||||
|
||||
switch (method_registers.blit_engine_context_surface())
|
||||
|
@ -695,7 +695,7 @@ namespace rsx
|
||||
{
|
||||
// Converts a stream e.g [1, 2, 3, -1, 4, 5, 6] to a stream with degenerate splits
|
||||
// Output is e.g [1, 2, 3, 3, 3, 4, 4, 5, 6] (5 bogus triangles)
|
||||
T last_index, index;
|
||||
T last_index{}, index;
|
||||
u32 dst_index = 0;
|
||||
for (int n = 0; n < count;)
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ else()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options(-Werror=inconsistent-missing-override)
|
||||
else()
|
||||
elseif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_compile_options(-Werror=suggest-override)
|
||||
endif()
|
||||
|
||||
@ -52,9 +52,7 @@ else()
|
||||
add_compile_options(-Wno-delete-non-virtual-dtor)
|
||||
add_compile_options(-Wno-unused-command-line-argument)
|
||||
elseif(CMAKE_COMPILER_IS_GNUCXX)
|
||||
add_compile_options(-Wno-maybe-uninitialized)
|
||||
add_compile_options(-Wno-strict-aliasing)
|
||||
add_compile_options(-Wno-unused-but-set-variable)
|
||||
add_compile_options(-Wno-class-memaccess)
|
||||
endif()
|
||||
|
||||
|
@ -319,7 +319,7 @@ void msg_dialog_frame::ProgressBarSetLimit(u32 index, u32 limit)
|
||||
m_gauge2->setMaximum(limit);
|
||||
}
|
||||
|
||||
bool set_taskbar_limit = false;
|
||||
[[maybe_unused]] bool set_taskbar_limit = false;
|
||||
|
||||
if (index == taskbar_index + 0u)
|
||||
{
|
||||
|
@ -550,7 +550,7 @@ void logs::file_writer::log(const char* text, usz size)
|
||||
// TODO: write bigger fragment directly in blocking manner
|
||||
while (size && size <= 0xffffff)
|
||||
{
|
||||
u64 bufv;
|
||||
u64 bufv = 0;
|
||||
|
||||
const auto pos = m_buf.atomic_op([&](u64& v) -> uchar*
|
||||
{
|
||||
|
@ -779,7 +779,7 @@ namespace stx
|
||||
}
|
||||
|
||||
// Result temp storage
|
||||
std::conditional_t<std::is_void_v<RT>, int, RT> result;
|
||||
[[maybe_unused]] std::conditional_t<std::is_void_v<RT>, int, RT> result;
|
||||
|
||||
// Invoke
|
||||
if constexpr (std::is_void_v<RT>)
|
||||
|
@ -347,7 +347,7 @@ ullong utils::get_tsc_freq()
|
||||
constexpr int samples = 40;
|
||||
ullong rdtsc_data[samples];
|
||||
ullong timer_data[samples];
|
||||
ullong error_data[samples];
|
||||
[[maybe_unused]] ullong error_data[samples];
|
||||
|
||||
// Narrow thread affinity to a single core
|
||||
const u64 old_aff = thread_ctrl::get_thread_affinity_mask();
|
||||
|
Loading…
Reference in New Issue
Block a user