mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-24 03:32:50 +01:00
Warning fixes
This commit is contained in:
parent
e7fd84e031
commit
b49a1f27eb
@ -793,7 +793,8 @@ namespace fs
|
||||
|
||||
if (write)
|
||||
{
|
||||
m_stat.mtime = std::max(m_stat.atime, ++m_stat.mtime);
|
||||
m_stat.mtime++;
|
||||
m_stat.mtime = std::max(m_stat.atime, m_stat.mtime);
|
||||
m_stat.ctime = m_stat.mtime;
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,9 @@
|
||||
#include <process.h>
|
||||
#include <sysinfoapi.h>
|
||||
#else
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
#define _XOPEN_SOURCE
|
||||
#define __USE_GNU
|
||||
|
@ -30,7 +30,8 @@ namespace utils
|
||||
|
||||
if (lo())
|
||||
{
|
||||
version += "." + std::to_string(lo());
|
||||
version += '.';
|
||||
version += std::to_string(lo());
|
||||
}
|
||||
|
||||
if (type() != version_type::release)
|
||||
@ -40,7 +41,8 @@ namespace utils
|
||||
version += "-" + postfix();
|
||||
}
|
||||
|
||||
version += " " + utils::to_string(type());
|
||||
version += ' ';
|
||||
version += utils::to_string(type());
|
||||
|
||||
if (type_index() > 1)
|
||||
{
|
||||
|
@ -55,6 +55,7 @@ void fmt_class_string<cpu_flag>::format(std::string& out, u64 arg)
|
||||
case cpu_flag::memory: return "mem";
|
||||
case cpu_flag::pending: return "pend";
|
||||
case cpu_flag::pending_recheck: return "pend-re";
|
||||
case cpu_flag::notify: return "ntf";
|
||||
case cpu_flag::yield: return "y";
|
||||
case cpu_flag::preempt: return "PREEMPT";
|
||||
case cpu_flag::dbg_global_pause: return "G-PAUSE";
|
||||
@ -648,7 +649,7 @@ bool cpu_thread::check_state() noexcept
|
||||
{
|
||||
bool cpu_sleep_called = false;
|
||||
bool cpu_can_stop = true;
|
||||
bool escape, retval;
|
||||
bool escape{}, retval{};
|
||||
|
||||
while (true)
|
||||
{
|
||||
|
@ -454,30 +454,8 @@ public:
|
||||
if (adecIsAtracX(type)) last_pts -= 0x10000; // hack
|
||||
}
|
||||
|
||||
struct AVPacketHolder : AVPacket
|
||||
{
|
||||
AVPacketHolder(u32 data_size)
|
||||
{
|
||||
av_init_packet(this);
|
||||
|
||||
if (data_size)
|
||||
{
|
||||
this->data = static_cast<u8*>(av_calloc(1, data_size + AV_INPUT_BUFFER_PADDING_SIZE));
|
||||
this->size = data_size + AV_INPUT_BUFFER_PADDING_SIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->data = nullptr;
|
||||
this->size = 0;
|
||||
}
|
||||
}
|
||||
|
||||
~AVPacketHolder()
|
||||
{
|
||||
av_free(data);
|
||||
}
|
||||
|
||||
} au(0);
|
||||
AVPacket* packet = av_packet_alloc();
|
||||
std::unique_ptr<AVPacket, decltype([](AVPacket* p){av_packet_unref(p);})> packet_(packet);
|
||||
|
||||
if (just_started && just_finished)
|
||||
{
|
||||
@ -544,8 +522,6 @@ public:
|
||||
just_started = false;
|
||||
}
|
||||
|
||||
bool last_frame = false;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (Emu.IsStopped() || is_closed)
|
||||
@ -554,14 +530,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
last_frame = av_read_frame(fmt, &au) < 0;
|
||||
if (last_frame)
|
||||
{
|
||||
//break;
|
||||
av_free(au.data);
|
||||
au.data = NULL;
|
||||
au.size = 0;
|
||||
}
|
||||
av_read_frame(fmt, packet);
|
||||
|
||||
struct AdecFrameHolder : AdecFrame
|
||||
{
|
||||
|
@ -175,7 +175,7 @@ static error_code check_camera_info(const VariantOfCellCameraInfo& info)
|
||||
return CELL_CAMERA_ERROR_BAD_FRAMERATE;
|
||||
}
|
||||
|
||||
auto check_fps = [fps = info.framerate](const std::vector<s32>& range)
|
||||
auto check_fps = [fps = info.framerate](std::initializer_list<s32> range)
|
||||
{
|
||||
return std::find(range.begin(), range.end(), fps) != range.end();
|
||||
};
|
||||
|
@ -477,5 +477,3 @@ struct gem_camera_shared
|
||||
atomic_t<s32> size{0};
|
||||
atomic_t<CellCameraFormat> format{CELL_CAMERA_RAW8};
|
||||
};
|
||||
|
||||
static inline s32 get_video_buffer_size(s32 width, s32 height);
|
||||
|
@ -52,7 +52,7 @@ struct cross_controller
|
||||
|
||||
close_msg_dialog();
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
sysutil_register_cb([this, status](ppu_thread& ppu) -> s32
|
||||
{
|
||||
callback(ppu, CELL_CROSS_CONTROLLER_STATUS_FINALIZED, status, vm::null, userdata);
|
||||
return CELL_OK;
|
||||
@ -74,9 +74,9 @@ struct cross_controller
|
||||
// TODO: Show icons from comboplay_plugin.rco in dialog. Maybe use a new dialog or add an optional icon to this one.
|
||||
error_code res = open_msg_dialog(false, CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_OFF, vm::make_str(msg), msg_dialog_callback, userdata);
|
||||
|
||||
sysutil_register_cb([=](ppu_thread& ppu) -> s32
|
||||
sysutil_register_cb([this, res](ppu_thread& ppu) -> s32
|
||||
{
|
||||
callback(ppu, CELL_CROSS_CONTROLLER_STATUS_INITIALIZED, res == CELL_OK ? CELL_OK : CELL_CROSS_CONTROLLER_ERROR_INTERNAL, vm::null, userdata);
|
||||
callback(ppu, CELL_CROSS_CONTROLLER_STATUS_INITIALIZED, res == CELL_OK ? +CELL_OK : +CELL_CROSS_CONTROLLER_ERROR_INTERNAL, vm::null, userdata);
|
||||
return CELL_OK;
|
||||
});
|
||||
|
||||
|
@ -1531,7 +1531,8 @@ error_code cellGameContentErrorDialog(s32 type, s32 errNeedSizeKB, vm::cptr<char
|
||||
return CELL_GAME_ERROR_PARAM;
|
||||
}
|
||||
|
||||
error_msg += "\n" + get_localized_string(localized_string_id::CELL_GAME_ERROR_DIR_NAME, fmt::format("%s", dirName).c_str());
|
||||
error_msg += '\n';
|
||||
error_msg += get_localized_string(localized_string_id::CELL_GAME_ERROR_DIR_NAME, fmt::format("%s", dirName).c_str());
|
||||
}
|
||||
|
||||
return open_exit_dialog(error_msg, type > CELL_GAME_ERRDIALOG_NOSPACE);
|
||||
|
@ -1314,8 +1314,6 @@ void _cellGcmSetFlipCommandWithWaitLabel(ppu_thread& ppu, vm::ptr<CellGcmContext
|
||||
{
|
||||
cellGcmSys.warning("cellGcmSetFlipCommandWithWaitLabel(ctx=*0x%x, id=0x%x, label_index=0x%x, label_value=0x%x)", ctx, id, label_index, label_value);
|
||||
|
||||
auto& gcm_cfg = g_fxo->get<gcm_config>();
|
||||
|
||||
rsx::make_command(ctx->current, NV406E_SEMAPHORE_OFFSET, { label_index * 0x10, label_value });
|
||||
|
||||
if (auto error = gcmSetPrepareFlip<true>(ppu, ctx, id); error < 0)
|
||||
|
@ -446,7 +446,7 @@ static bool check_gem_num(const u32 gem_num)
|
||||
return gem_num < CELL_GEM_MAX_NUM;
|
||||
}
|
||||
|
||||
static inline void draw_overlay_cursor(u32 gem_num, const gem_config::gem_controller& controller, s32 x_pos, s32 y_pos, s32 x_max, s32 y_max)
|
||||
static inline void draw_overlay_cursor(u32 gem_num, const gem_config::gem_controller&, s32 x_pos, s32 y_pos, s32 x_max, s32 y_max)
|
||||
{
|
||||
const u16 x = static_cast<u16>(x_pos / (x_max / static_cast<f32>(rsx::overlays::overlay::virtual_width)));
|
||||
const u16 y = static_cast<u16>(y_pos / (y_max / static_cast<f32>(rsx::overlays::overlay::virtual_height)));
|
||||
|
@ -1120,7 +1120,7 @@ error_code cellHttpAuthCacheExport(vm::ptr<u32> buf, u32 len, vm::ptr<u32> outsi
|
||||
// TODO
|
||||
}
|
||||
|
||||
u32 size = 0;
|
||||
[[maybe_unused]] u32 size = 0;
|
||||
|
||||
// TODO
|
||||
|
||||
|
@ -230,7 +230,7 @@ error_code cellHttpUtilBuildRequestLine(vm::cptr<CellHttpRequestLine> req, vm::p
|
||||
std::string path = fmt::format("%s", req->path);
|
||||
if (path.empty())
|
||||
{
|
||||
path = "/";
|
||||
path += '/';
|
||||
}
|
||||
|
||||
// TODO: are the numbers properly formatted ?
|
||||
|
@ -43,10 +43,9 @@ bool ime_jp_manager::addChar(u16 c)
|
||||
if (!c || cursor >= (CELL_IMEJP_STRING_MAXLENGTH - 1) || cursor > input_string.length())
|
||||
return false;
|
||||
|
||||
std::u16string tmp;
|
||||
tmp += c;
|
||||
input_string.insert(cursor++, tmp);
|
||||
cursor_end = cursor;
|
||||
input_string += c; // resize
|
||||
std::memmove(input_string.data() + cursor + 1, input_string.data() + cursor, sizeof(u16) * (input_string.size() - 1 - cursor));
|
||||
cursor_end = ++cursor;
|
||||
input_state = CELL_IMEJP_BEFORE_CONVERT;
|
||||
return true;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ KeyboardHandlerBase::KeyboardHandlerBase(utils::serial* ar)
|
||||
Emu.DeferDeserialization([this]()
|
||||
{
|
||||
Init(m_info.max_connect);
|
||||
init.init();
|
||||
auto lk = init.init();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -56,5 +56,3 @@ struct CellKbConfig
|
||||
be_t<u32> read_mode;
|
||||
be_t<u32> code_type;
|
||||
};
|
||||
|
||||
u16 cellKbCnvRawCode(u32 arrange, u32 mkey, u32 led, u16 rawcode);
|
||||
|
@ -49,7 +49,7 @@ MouseHandlerBase::MouseHandlerBase(utils::serial* ar)
|
||||
Emu.DeferDeserialization([this]()
|
||||
{
|
||||
Init(m_info.max_connect);
|
||||
init.init();
|
||||
auto lk = init.init();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ bool check_config(vm::cptr<CellPngEncConfig> config)
|
||||
if (!config ||
|
||||
config->maxWidth == 0u || config->maxWidth > 1000000u ||
|
||||
config->maxHeight == 0u || config->maxHeight > 1000000u ||
|
||||
config->maxBitDepth != 8u && config->maxBitDepth != 16u ||
|
||||
(config->maxBitDepth != 8u && config->maxBitDepth != 16u) ||
|
||||
static_cast<s32>(config->addMemSize) < 0 ||
|
||||
config->exParamNum != 0u)
|
||||
{
|
||||
|
@ -148,7 +148,7 @@ int check_filename(std::string_view file_path, bool disallow_system_files, bool
|
||||
return 70;
|
||||
}
|
||||
|
||||
char name[CELL_SAVEDATA_FILENAME_SIZE - 3];
|
||||
char name[CELL_SAVEDATA_FILENAME_SIZE + 3];
|
||||
|
||||
if (dotpos)
|
||||
{
|
||||
|
@ -315,7 +315,7 @@ error_code cellSysutilAvc2EstimateMemoryContainerSize(vm::cptr<CellSysutilAvc2In
|
||||
val += static_cast<s32>(static_cast<f64>(window_count) * 1258291.2) + 0x1ed846;
|
||||
}
|
||||
|
||||
estimated_size = (estimated_size + ((static_cast<int>(val) >> 7) + static_cast<u32>(static_cast<int>(val) < 0 && (val & 0x7f) != 0)) * 0x80 + 0x80080 & 0xfff00000) + 0x100000;
|
||||
estimated_size = ((estimated_size + ((static_cast<int>(val) >> 7) + static_cast<u32>(static_cast<int>(val) < 0 && (val & 0x7f) != 0)) * 0x80 + 0x80080) & 0xfff00000) + 0x100000;
|
||||
|
||||
*size = estimated_size;
|
||||
}
|
||||
|
@ -636,14 +636,12 @@ struct vdec_creation_lock
|
||||
|
||||
vdec_creation_lock()
|
||||
{
|
||||
locked.init();
|
||||
auto lk = locked.init();
|
||||
}
|
||||
};
|
||||
|
||||
extern bool try_lock_vdec_context_creation()
|
||||
{
|
||||
bool exist = false;
|
||||
|
||||
auto& lock = g_fxo->get<vdec_creation_lock>();
|
||||
auto reset = lock.locked.reset();
|
||||
|
||||
|
@ -69,7 +69,7 @@ struct sce_np_util_manager
|
||||
}
|
||||
};
|
||||
|
||||
error_code sceNpUtilBandwidthTestInitStart(ppu_thread& ppu, u32 prio, u32 stack)
|
||||
error_code sceNpUtilBandwidthTestInitStart([[maybe_unused]] ppu_thread& ppu, u32 prio, u32 stack)
|
||||
{
|
||||
sceNpUtil.todo("sceNpUtilBandwidthTestInitStart(prio=%d, stack=%d)", prio, stack);
|
||||
|
||||
@ -101,7 +101,7 @@ error_code sceNpUtilBandwidthTestGetStatus()
|
||||
return not_an_error(util_manager.bandwidth_test_thread->status);
|
||||
}
|
||||
|
||||
error_code sceNpUtilBandwidthTestShutdown(ppu_thread& ppu, vm::ptr<SceNpUtilBandwidthTestResult> result)
|
||||
error_code sceNpUtilBandwidthTestShutdown([[maybe_unused]] ppu_thread& ppu, vm::ptr<SceNpUtilBandwidthTestResult> result)
|
||||
{
|
||||
sceNpUtil.warning("sceNpUtilBandwidthTestShutdown(result=*0x%x)", result);
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
#if !defined(_MSC_VER)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wold-style-cast"
|
||||
#pragma GCC diagnostic ignored "-Wuninitialized"
|
||||
#endif
|
||||
|
||||
extern bool is_debugger_present();
|
||||
|
@ -38,7 +38,7 @@ extern void sys_initialize_tls(ppu_thread&, u64, u32, u32, u32);
|
||||
// HLE function name cache
|
||||
std::vector<std::string> g_ppu_function_names;
|
||||
|
||||
extern atomic_t<u32> liblv2_begin = 0, liblv2_end = 0;
|
||||
atomic_t<u32> liblv2_begin = 0, liblv2_end = 0;
|
||||
|
||||
extern u32 ppu_generate_id(std::string_view name)
|
||||
{
|
||||
|
@ -1712,7 +1712,7 @@ ppu_thread::ppu_thread(utils::serial& ar)
|
||||
{
|
||||
cmd_list
|
||||
({
|
||||
{ppu_cmd::ptr_call, 0}, +[](ppu_thread& ppu) -> bool
|
||||
{ppu_cmd::ptr_call, 0}, +[](ppu_thread&) -> bool
|
||||
{
|
||||
while (!Emu.IsStopped() && !g_fxo->get<init_pushed>().inited)
|
||||
{
|
||||
@ -2888,7 +2888,7 @@ extern void ppu_precompile(std::vector<std::string>& dir_queue, std::vector<ppu_
|
||||
std::string upper = fmt::to_upper(entry.name);
|
||||
|
||||
// Skip already loaded modules or HLEd ones
|
||||
auto is_ignored = [&](s64 offset) -> bool
|
||||
auto is_ignored = [&](s64 /*offset*/) -> bool
|
||||
{
|
||||
if (dir_queue[i] != firmware_sprx_path)
|
||||
{
|
||||
|
@ -291,7 +291,7 @@ struct spu_itype
|
||||
// Test for constant loading instruction
|
||||
friend constexpr bool operator &(type value, constant_tag)
|
||||
{
|
||||
return value >= CBD && value <= FSMBI;
|
||||
return value >= ILH && value <= FSMBI;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -3411,7 +3411,7 @@ spu_program spu_recompiler_base::analyse(const be_t<u32>* ls, u32 entry_point)
|
||||
}
|
||||
case spu_itype::OR:
|
||||
{
|
||||
bb.reg_const[op.rt] = bb.reg_const[op.ra] & bb.reg_const[op.rb];
|
||||
bb.reg_const[op.rt] = bb.reg_const[op.ra] && bb.reg_const[op.rb];
|
||||
bb.reg_val32[op.rt] = bb.reg_val32[op.ra] | bb.reg_val32[op.rb];
|
||||
break;
|
||||
}
|
||||
@ -3423,7 +3423,7 @@ spu_program spu_recompiler_base::analyse(const be_t<u32>* ls, u32 entry_point)
|
||||
}
|
||||
case spu_itype::A:
|
||||
{
|
||||
bb.reg_const[op.rt] = bb.reg_const[op.ra] & bb.reg_const[op.rb];
|
||||
bb.reg_const[op.rt] = bb.reg_const[op.ra] && bb.reg_const[op.rb];
|
||||
bb.reg_val32[op.rt] = bb.reg_val32[op.ra] + bb.reg_val32[op.rb];
|
||||
break;
|
||||
}
|
||||
@ -3435,7 +3435,7 @@ spu_program spu_recompiler_base::analyse(const be_t<u32>* ls, u32 entry_point)
|
||||
}
|
||||
case spu_itype::SF:
|
||||
{
|
||||
bb.reg_const[op.rt] = bb.reg_const[op.ra] & bb.reg_const[op.rb];
|
||||
bb.reg_const[op.rt] = bb.reg_const[op.ra] && bb.reg_const[op.rb];
|
||||
bb.reg_val32[op.rt] = bb.reg_val32[op.rb] - bb.reg_val32[op.ra];
|
||||
break;
|
||||
}
|
||||
|
@ -1906,3 +1906,9 @@ bool lv2_obj::wait_timeout(u64 usec, ppu_thread* cpu, bool scale, bool is_usleep
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void lv2_obj::prepare_for_sleep(cpu_thread& cpu)
|
||||
{
|
||||
vm::temporary_unlock(cpu);
|
||||
cpu_counter::remove(&cpu);
|
||||
}
|
||||
|
@ -1156,7 +1156,7 @@ error_code sys_fs_opendir(ppu_thread& ppu, vm::cptr<char> path, vm::ptr<u32> fd)
|
||||
}
|
||||
else
|
||||
{
|
||||
data.emplace_back().name = ".";
|
||||
data.emplace_back().name += '.';
|
||||
data.back().is_directory = true;
|
||||
data.emplace_back().name = "..";
|
||||
data.back().is_directory = true;
|
||||
|
@ -256,7 +256,8 @@ std::optional<s32> lv2_socket_p2p::sendto(s32 flags, const std::vector<u8>& buf,
|
||||
sys_net.trace("[P2P] Sending a packet to %s:%d:%d", ip_str, p2p_port, p2p_vport);
|
||||
|
||||
std::vector<u8> p2p_data(buf.size() + sizeof(u16));
|
||||
reinterpret_cast<le_t<u16>&>(p2p_data[0]) = p2p_vport;
|
||||
const le_t<u16> p2p_vport_le = p2p_vport;
|
||||
memcpy(p2p_data.data(), &p2p_vport_le, sizeof(u16));
|
||||
memcpy(p2p_data.data() + sizeof(u16), buf.data(), buf.size());
|
||||
|
||||
int native_flags = 0;
|
||||
|
@ -206,8 +206,9 @@ std::vector<u8> generate_u2s_packet(const p2ps_encapsulated_tcp& header, const u
|
||||
ensure(packet_size < 65535); // packet size shouldn't be bigger than possible UDP payload
|
||||
std::vector<u8> packet(packet_size);
|
||||
u8* packet_data = packet.data();
|
||||
le_t<u16> dst_port_le = +header.dst_port;
|
||||
|
||||
*reinterpret_cast<le_t<u16>*>(packet_data) = header.dst_port;
|
||||
memcpy(packet_data, &dst_port_le, sizeof(u16));
|
||||
memcpy(packet_data + sizeof(u16), &header, sizeof(p2ps_encapsulated_tcp));
|
||||
if (datasize)
|
||||
memcpy(packet_data + sizeof(u16) + sizeof(p2ps_encapsulated_tcp), data, datasize);
|
||||
|
@ -84,7 +84,7 @@ std::shared_ptr<void> lv2_overlay::load(utils::serial& ar)
|
||||
ensure(g_cfg.savestate.state_inspection_mode.get());
|
||||
}
|
||||
|
||||
return std::move(ovlm);
|
||||
return ovlm;
|
||||
}
|
||||
|
||||
void lv2_overlay::save(utils::serial& ar)
|
||||
|
@ -10,7 +10,7 @@ struct lv2_overlay final : lv2_obj, ppu_module
|
||||
u32 entry;
|
||||
|
||||
lv2_overlay() = default;
|
||||
lv2_overlay(utils::serial& ar){}
|
||||
lv2_overlay(utils::serial&){}
|
||||
static std::shared_ptr<void> load(utils::serial& ar);
|
||||
void save(utils::serial& ar);
|
||||
};
|
||||
|
@ -343,7 +343,7 @@ std::shared_ptr<void> lv2_prx::load(utils::serial& ar)
|
||||
}
|
||||
|
||||
prx->state = state;
|
||||
return std::move(prx);
|
||||
return prx;
|
||||
}
|
||||
|
||||
void lv2_prx::save(utils::serial& ar)
|
||||
|
@ -437,17 +437,13 @@ public:
|
||||
auto operator<=>(const port_config&) const = default;
|
||||
};
|
||||
|
||||
union avport_bit
|
||||
struct avport_bit
|
||||
{
|
||||
struct
|
||||
{
|
||||
bool hdmi_0 : 1;
|
||||
bool hdmi_1 : 1;
|
||||
bool avmulti : 1;
|
||||
bool spdif_0 : 1;
|
||||
bool spdif_1 : 1;
|
||||
};
|
||||
u8 raw : 5 = 0;
|
||||
bool hdmi_0 : 1;
|
||||
bool hdmi_1 : 1;
|
||||
bool avmulti : 1;
|
||||
bool spdif_0 : 1;
|
||||
bool spdif_1 : 1;
|
||||
};
|
||||
|
||||
rsxaudio_backend_thread();
|
||||
|
@ -61,16 +61,6 @@ enum
|
||||
|
||||
enum ppu_thread_status : u32;
|
||||
|
||||
namespace vm
|
||||
{
|
||||
bool temporary_unlock(cpu_thread& cpu) noexcept;
|
||||
}
|
||||
|
||||
namespace cpu_counter
|
||||
{
|
||||
void remove(cpu_thread*) noexcept;
|
||||
}
|
||||
|
||||
// Base class for some kernel objects (shared set of 8192 objects).
|
||||
struct lv2_obj
|
||||
{
|
||||
@ -432,11 +422,7 @@ public:
|
||||
}
|
||||
|
||||
// Can be called before the actual sleep call in order to move it out of mutex scope
|
||||
static inline void prepare_for_sleep(cpu_thread& cpu)
|
||||
{
|
||||
vm::temporary_unlock(cpu);
|
||||
cpu_counter::remove(&cpu);
|
||||
}
|
||||
static void prepare_for_sleep(cpu_thread& cpu);
|
||||
|
||||
struct notify_all_t
|
||||
{
|
||||
|
@ -180,7 +180,7 @@ void initialize_timebased_time(u64 timebased_init, bool reset)
|
||||
}
|
||||
|
||||
const u64 current = get_timebased_time();
|
||||
timebased_init = get_timebased_time() - timebased_init;
|
||||
timebased_init = current - timebased_init;
|
||||
|
||||
timebase_offset = timebased_init;
|
||||
systemtime_offset = timebased_init / (g_timebase_freq / 1000000);
|
||||
|
@ -756,7 +756,8 @@ bool gdb_thread::cmd_vcont(gdb_cmd& cmd)
|
||||
// we have to remove dbg_pause from thread that paused execution, otherwise
|
||||
// it will be paused forever (Emu.Resume only removes dbg_global_pause)
|
||||
ppu = std::static_pointer_cast<named_thread<ppu_thread>>(selected_thread.lock());
|
||||
ppu->state -= cpu_flag::dbg_pause;
|
||||
if (ppu)
|
||||
ppu->state -= cpu_flag::dbg_pause;
|
||||
return send_reason();
|
||||
}
|
||||
return send_cmd_ack("");
|
||||
|
@ -47,7 +47,7 @@ namespace IPC_socket
|
||||
vm::write64(addr, value);
|
||||
}
|
||||
|
||||
const int IPC_impl::get_port()
|
||||
int IPC_impl::get_port()
|
||||
{
|
||||
return g_cfg_ipc.get_port();
|
||||
}
|
||||
@ -85,7 +85,7 @@ namespace IPC_socket
|
||||
return Emu.GetAppVersion();
|
||||
}
|
||||
|
||||
const std::string IPC_impl::get_version_and_branch()
|
||||
std::string IPC_impl::get_version_and_branch()
|
||||
{
|
||||
return rpcs3::get_version_and_branch();
|
||||
}
|
||||
|
@ -33,13 +33,13 @@ namespace IPC_socket
|
||||
IPC.error(fmt, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
static const int get_port();
|
||||
static int get_port();
|
||||
static pine::EmuStatus get_status();
|
||||
static const std::string& get_title();
|
||||
static const std::string& get_title_ID();
|
||||
static const std::string& get_executable_hash();
|
||||
static const std::string& get_app_version();
|
||||
static const std::string get_version_and_branch();
|
||||
static std::string get_version_and_branch();
|
||||
|
||||
public:
|
||||
static auto constexpr thread_name = "IPC Server"sv;
|
||||
|
@ -59,13 +59,10 @@ namespace id_manager
|
||||
{
|
||||
static_assert(IdmCompatible<T>, "ID object must specify: id_base, id_step, id_count");
|
||||
|
||||
enum : u32
|
||||
{
|
||||
base = T::id_base, // First ID (N = 0)
|
||||
step = T::id_step, // Any ID: N * id_setp + id_base
|
||||
count = T::id_count, // Limit: N < id_count
|
||||
invalid = -+!base, // Invalid ID sample
|
||||
};
|
||||
static constexpr u32 base = T::id_base; // First ID (N = 0)
|
||||
static constexpr u32 step = T::id_step; // Any ID: N * id_setp + id_base
|
||||
static constexpr u32 count = T::id_count; // Limit: N < id_count
|
||||
static constexpr u32 invalid = -+!base; // Invalid ID sample
|
||||
|
||||
static constexpr std::pair<u32, u32> invl_range = get_invl_range<T>();
|
||||
static constexpr bool uses_lowest_id = get_force_lowest_id<T>();
|
||||
@ -492,7 +489,7 @@ class idm
|
||||
using traits = id_manager::id_traits<Type>;
|
||||
|
||||
// Ensure make_typeinfo() is used for this type
|
||||
stx::typedata<id_manager::typeinfo, Type>();
|
||||
[[maybe_unused]] auto& td = stx::typedata<id_manager::typeinfo, Type>();
|
||||
|
||||
// Allocate new id
|
||||
std::lock_guard lock(id_manager::g_mutex);
|
||||
@ -703,7 +700,7 @@ public:
|
||||
{
|
||||
static_assert((PtrSame<T, Get> && ...), "Invalid ID type combination");
|
||||
|
||||
std::conditional_t<static_cast<bool>(Lock()), reader_lock, const shared_mutex&> lock(id_manager::g_mutex);
|
||||
[[maybe_unused]] std::conditional_t<!!Lock(), reader_lock, const shared_mutex&> lock(id_manager::g_mutex);
|
||||
|
||||
using func_traits = function_traits<decltype(&decltype(std::function(std::declval<F>()))::operator())>;
|
||||
using object_type = typename func_traits::object_type;
|
||||
|
@ -206,3 +206,5 @@ enum CellKbMappingType : s32
|
||||
CELL_KB_MAPPING_PORTUGUESE_BRAZIL = 23,
|
||||
CELL_KB_MAPPING_TURKISH_TURKEY = 24
|
||||
};
|
||||
|
||||
u16 cellKbCnvRawCode(u32 arrange, u32 mkey, u32 led, u16 rawcode);
|
||||
|
@ -7,8 +7,6 @@
|
||||
|
||||
#include "util/init_mutex.hpp"
|
||||
|
||||
extern u16 cellKbCnvRawCode(u32 arrange, u32 mkey, u32 led, u16 rawcode); // (TODO: Can it be problematic to place SysCalls in middle of nowhere?)
|
||||
|
||||
enum QtKeys
|
||||
{
|
||||
Key_Shift = 0x01000020,
|
||||
|
@ -108,8 +108,8 @@ void usb_device_usio::translate_input()
|
||||
const auto handler = pad::get_current_handler();
|
||||
|
||||
std::vector<u8> input_buf = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
constexpr u16 SMALL_HIT = 0x4A0;
|
||||
constexpr u16 BIG_HIT = 0xA40;
|
||||
constexpr le_t<u16> c_small_hit = 0x4A0;
|
||||
constexpr le_t<u16> c_big_hit = 0xA40;
|
||||
|
||||
auto translate_from_pad = [&](u8 pad_number, u8 player)
|
||||
{
|
||||
@ -136,35 +136,35 @@ void usb_device_usio::translate_input()
|
||||
{
|
||||
case CELL_PAD_CTRL_SQUARE:
|
||||
// Strong hit side left
|
||||
*reinterpret_cast<le_t<u16>*>(&input_buf[32 + offset]) = BIG_HIT;
|
||||
std::memcpy(input_buf.data() + 32 + offset, &c_big_hit, sizeof(u16));
|
||||
break;
|
||||
case CELL_PAD_CTRL_CROSS:
|
||||
// Strong hit center right
|
||||
*reinterpret_cast<le_t<u16>*>(&input_buf[36 + offset]) = BIG_HIT;
|
||||
std::memcpy(input_buf.data() + 36 + offset, &c_big_hit, sizeof(u16));
|
||||
break;
|
||||
case CELL_PAD_CTRL_CIRCLE:
|
||||
// Strong hit side right
|
||||
*reinterpret_cast<le_t<u16>*>(&input_buf[38 + offset]) = BIG_HIT;
|
||||
std::memcpy(input_buf.data() + 38 + offset, &c_big_hit, sizeof(u16));
|
||||
break;
|
||||
case CELL_PAD_CTRL_TRIANGLE:
|
||||
// Strong hit center left
|
||||
*reinterpret_cast<le_t<u16>*>(&input_buf[34 + offset]) = BIG_HIT;
|
||||
std::memcpy(input_buf.data() + 34 + offset, &c_big_hit, sizeof(u16));
|
||||
break;
|
||||
case CELL_PAD_CTRL_L1:
|
||||
// Small hit center left
|
||||
*reinterpret_cast<le_t<u16>*>(&input_buf[34 + offset]) = SMALL_HIT;
|
||||
std::memcpy(input_buf.data() + 34 + offset, &c_small_hit, sizeof(u16));
|
||||
break;
|
||||
case CELL_PAD_CTRL_R1:
|
||||
// Small hit center right
|
||||
*reinterpret_cast<le_t<u16>*>(&input_buf[36 + offset]) = SMALL_HIT;
|
||||
std::memcpy(input_buf.data() + 36 + offset, &c_small_hit, sizeof(u16));
|
||||
break;
|
||||
case CELL_PAD_CTRL_L2:
|
||||
// Small hit side left
|
||||
*reinterpret_cast<le_t<u16>*>(&input_buf[32 + offset]) = SMALL_HIT;
|
||||
std::memcpy(input_buf.data() + 32 + offset, &c_small_hit, sizeof(u16));
|
||||
break;
|
||||
case CELL_PAD_CTRL_R2:
|
||||
// Small hit side right
|
||||
*reinterpret_cast<le_t<u16>*>(&input_buf[38 + offset]) = SMALL_HIT;
|
||||
std::memcpy(input_buf.data() + 38 + offset, &c_small_hit, sizeof(u16));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -1613,8 +1613,6 @@ namespace vm
|
||||
m_common->map_critical(vm::get_super_ptr(addr));
|
||||
}
|
||||
|
||||
auto& m_map = (m.*block_map)();
|
||||
|
||||
std::shared_ptr<utils::shm> null_shm;
|
||||
|
||||
while (true)
|
||||
|
@ -27,34 +27,34 @@
|
||||
|
||||
#if defined(__AVX512F__) && defined(__AVX512VL__) && defined(__AVX512DQ__) && defined(__AVX512CD__) && defined(__AVX512BW__)
|
||||
[[maybe_unused]] constexpr bool s_use_ssse3 = true;
|
||||
constexpr bool s_use_sse4_1 = true;
|
||||
constexpr bool s_use_avx2 = true;
|
||||
constexpr bool s_use_avx3 = true;
|
||||
[[maybe_unused]] constexpr bool s_use_sse4_1 = true;
|
||||
[[maybe_unused]] constexpr bool s_use_avx2 = true;
|
||||
[[maybe_unused]] constexpr bool s_use_avx3 = true;
|
||||
#elif defined(__AVX2__)
|
||||
[[maybe_unused]] constexpr bool s_use_ssse3 = true;
|
||||
constexpr bool s_use_sse4_1 = true;
|
||||
constexpr bool s_use_avx2 = true;
|
||||
constexpr bool s_use_avx3 = false;
|
||||
[[maybe_unused]] constexpr bool s_use_sse4_1 = true;
|
||||
[[maybe_unused]] constexpr bool s_use_avx2 = true;
|
||||
[[maybe_unused]] constexpr bool s_use_avx3 = false;
|
||||
#elif defined(__SSE4_1__)
|
||||
[[maybe_unused]] constexpr bool s_use_ssse3 = true;
|
||||
constexpr bool s_use_sse4_1 = true;
|
||||
constexpr bool s_use_avx2 = false;
|
||||
constexpr bool s_use_avx3 = false;
|
||||
[[maybe_unused]] constexpr bool s_use_sse4_1 = true;
|
||||
[[maybe_unused]] constexpr bool s_use_avx2 = false;
|
||||
[[maybe_unused]] constexpr bool s_use_avx3 = false;
|
||||
#elif defined(__SSSE3__)
|
||||
[[maybe_unused]] constexpr bool s_use_ssse3 = true;
|
||||
constexpr bool s_use_sse4_1 = false;
|
||||
constexpr bool s_use_avx2 = false;
|
||||
constexpr bool s_use_avx3 = false;
|
||||
[[maybe_unused]] constexpr bool s_use_sse4_1 = false;
|
||||
[[maybe_unused]] constexpr bool s_use_avx2 = false;
|
||||
[[maybe_unused]] constexpr bool s_use_avx3 = false;
|
||||
#elif defined(ARCH_X64)
|
||||
[[maybe_unused]] const bool s_use_ssse3 = utils::has_ssse3();
|
||||
const bool s_use_sse4_1 = utils::has_sse41();
|
||||
const bool s_use_avx2 = utils::has_avx2();
|
||||
const bool s_use_avx3 = utils::has_avx512();
|
||||
[[maybe_unused]] const bool s_use_sse4_1 = utils::has_sse41();
|
||||
[[maybe_unused]] const bool s_use_avx2 = utils::has_avx2();
|
||||
[[maybe_unused]] const bool s_use_avx3 = utils::has_avx512();
|
||||
#else
|
||||
[[maybe_unused]] constexpr bool s_use_ssse3 = true; // Non x86
|
||||
constexpr bool s_use_sse4_1 = true; // Non x86
|
||||
constexpr bool s_use_avx2 = false;
|
||||
constexpr bool s_use_avx3 = false;
|
||||
[[maybe_unused]] constexpr bool s_use_sse4_1 = true; // Non x86
|
||||
[[maybe_unused]] constexpr bool s_use_avx2 = false;
|
||||
[[maybe_unused]] constexpr bool s_use_avx3 = false;
|
||||
#endif
|
||||
|
||||
const v128 s_bswap_u32_mask = v128::from32(0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f);
|
||||
|
@ -87,7 +87,7 @@ namespace rsx
|
||||
address += BlockSize;
|
||||
}
|
||||
|
||||
auto unified = Traits::merge_bo_list<BlockSize>(cmd, bo_list);
|
||||
auto unified = Traits::template merge_bo_list<BlockSize>(cmd, bo_list);
|
||||
ensure(unified);
|
||||
|
||||
m_buffer_list[block_for(start_address)].acquire(unified);
|
||||
|
@ -435,7 +435,7 @@ namespace rsx
|
||||
if (!pitch_compatible)
|
||||
{
|
||||
// This object should be pitch-converted and re-intersected with
|
||||
if (old_surface_storage = Traits::convert_pitch(command_list, surface, pitch))
|
||||
if (old_surface_storage = Traits::convert_pitch(command_list, surface, pitch); old_surface_storage)
|
||||
{
|
||||
old_surface = Traits::get(old_surface_storage);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ namespace gl
|
||||
{
|
||||
blitter* g_hw_blitter = nullptr;
|
||||
|
||||
void blitter::copy_image(gl::command_context& cmd, const texture* src, const texture* dst, int src_level, int dst_level, const position3i& src_offset, const position3i& dst_offset, const size3i& size) const
|
||||
void blitter::copy_image(gl::command_context&, const texture* src, const texture* dst, int src_level, int dst_level, const position3i& src_offset, const position3i& dst_offset, const size3i& size) const
|
||||
{
|
||||
ensure(src_level == 0);
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
#pragma once
|
||||
#include "state_tracker.hpp"
|
||||
#include "vao.hpp"
|
||||
|
||||
|
@ -62,7 +62,7 @@ std::string CgBinaryDisasm::GetMask() const
|
||||
|
||||
std::string CgBinaryDisasm::AddRegDisAsm(u32 index, int fp16) const
|
||||
{
|
||||
return std::string(fp16 ? "H" : "R") + std::to_string(index);
|
||||
return (fp16 ? 'H' : 'R') + std::to_string(index);
|
||||
}
|
||||
|
||||
std::string CgBinaryDisasm::AddConstDisAsm()
|
||||
|
@ -124,7 +124,8 @@ std::string CgBinaryDisasm::GetSRCDisasm(const u32 n)
|
||||
switch (src[n].reg_type)
|
||||
{
|
||||
case 1: //temp
|
||||
ret += "R" + std::to_string(src[n].tmp_src);
|
||||
ret += 'R';
|
||||
ret += std::to_string(src[n].tmp_src);
|
||||
break;
|
||||
case 2: //input
|
||||
if (d1.input_src < reg_table.size())
|
||||
|
@ -848,7 +848,7 @@ namespace rsx
|
||||
}
|
||||
}
|
||||
|
||||
void ZCULL_control::disable_optimizations(::rsx::thread* ptimer, u32 location)
|
||||
void ZCULL_control::disable_optimizations(::rsx::thread*, u32 location)
|
||||
{
|
||||
// Externally synchronized
|
||||
rsx_log.warning("Reports area at location %s was accessed. ZCULL optimizations will be disabled.", location_tostring(location));
|
||||
|
@ -47,7 +47,7 @@ namespace vk
|
||||
VkPipelineStageFlags dst_stage,
|
||||
const rsx::sampled_image_descriptor_base* sampler_state)
|
||||
{
|
||||
switch (auto raw = view->image(); raw->current_layout)
|
||||
switch (auto raw = view->image(); +raw->current_layout)
|
||||
{
|
||||
default:
|
||||
//case VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL:
|
||||
|
@ -31,7 +31,7 @@ namespace vk
|
||||
// Internal utils
|
||||
static u64 encode_layout(VkImageLayout layout)
|
||||
{
|
||||
switch (layout)
|
||||
switch (+layout)
|
||||
{
|
||||
case VK_IMAGE_LAYOUT_GENERAL:
|
||||
case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL:
|
||||
@ -77,7 +77,7 @@ namespace vk
|
||||
// Encoders
|
||||
inline void set_layout(u32 index, VkImageLayout layout)
|
||||
{
|
||||
switch (layout)
|
||||
switch (+layout)
|
||||
{
|
||||
case VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT:
|
||||
case VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL:
|
||||
|
@ -78,7 +78,7 @@ namespace vk
|
||||
VkPipelineStageFlags src_stage = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT;
|
||||
VkPipelineStageFlags dst_stage = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT;
|
||||
|
||||
switch (new_layout)
|
||||
switch (+new_layout)
|
||||
{
|
||||
case VK_IMAGE_LAYOUT_GENERAL:
|
||||
// Avoid this layout as it is unoptimized
|
||||
@ -127,7 +127,7 @@ namespace vk
|
||||
fmt::throw_exception("Attempted to transition to an invalid layout");
|
||||
}
|
||||
|
||||
switch (current_layout)
|
||||
switch (+current_layout)
|
||||
{
|
||||
case VK_IMAGE_LAYOUT_GENERAL:
|
||||
// Avoid this layout as it is unoptimized
|
||||
|
@ -750,17 +750,17 @@ namespace rsx
|
||||
rsx->enable_conditional_rendering(address_ptr);
|
||||
}
|
||||
|
||||
void set_zcull_render_enable(thread* rsx, u32, u32 arg)
|
||||
void set_zcull_render_enable(thread* rsx, u32, u32)
|
||||
{
|
||||
rsx->notify_zcull_info_changed();
|
||||
}
|
||||
|
||||
void set_zcull_stats_enable(thread* rsx, u32, u32 arg)
|
||||
void set_zcull_stats_enable(thread* rsx, u32, u32)
|
||||
{
|
||||
rsx->notify_zcull_info_changed();
|
||||
}
|
||||
|
||||
void set_zcull_pixel_count_enable(thread* rsx, u32, u32 arg)
|
||||
void set_zcull_pixel_count_enable(thread* rsx, u32, u32)
|
||||
{
|
||||
rsx->notify_zcull_info_changed();
|
||||
}
|
||||
@ -1006,7 +1006,7 @@ namespace rsx
|
||||
}
|
||||
|
||||
// Get position of the current command arg
|
||||
const u32 src_offset = rsx->fifo_ctrl->get_pos();
|
||||
[[maybe_unused]] const u32 src_offset = rsx->fifo_ctrl->get_pos();
|
||||
|
||||
// FIFO args count including this one
|
||||
const u32 fifo_args_cnt = rsx->fifo_ctrl->get_remaining_args_count() + 1;
|
||||
@ -1088,7 +1088,7 @@ namespace rsx
|
||||
|
||||
const auto dst_address = get_address(dst_offset + (x * 2) + (y * out_pitch), dst_dma, data_length);
|
||||
const auto dst = vm::_ptr<u16>(dst_address);
|
||||
const auto src = reinterpret_cast<const be_t<u32>*>(fifo_span.data());
|
||||
const auto src = utils::bless<const be_t<u32>>(fifo_span.data());
|
||||
|
||||
if (!dst_address)
|
||||
{
|
||||
@ -1825,7 +1825,7 @@ namespace rsx
|
||||
template<u32 index>
|
||||
struct driver_flip
|
||||
{
|
||||
static void impl(thread* rsx, u32 /*reg*/, u32 arg)
|
||||
static void impl(thread*, u32 /*reg*/, u32 arg)
|
||||
{
|
||||
sys_rsx_context_attribute(0x55555555, 0x102, index, arg, 0, 0);
|
||||
}
|
||||
|
@ -317,7 +317,8 @@ std::string vfs::get(std::string_view vpath, std::vector<std::string>* out_dir,
|
||||
// Handle /host_root (not escaped, not processed)
|
||||
if (out_path)
|
||||
{
|
||||
*out_path = "/";
|
||||
out_path->clear();
|
||||
*out_path += '/';
|
||||
*out_path += fmt::merge(name_list, "/");
|
||||
*out_path += vpath;
|
||||
}
|
||||
@ -339,7 +340,8 @@ std::string vfs::get(std::string_view vpath, std::vector<std::string>* out_dir,
|
||||
// Merge path fragments
|
||||
if (out_path)
|
||||
{
|
||||
*out_path = "/";
|
||||
out_path->clear();
|
||||
*out_path += '/';
|
||||
*out_path += fmt::merge(name_list, "/");
|
||||
}
|
||||
|
||||
@ -456,7 +458,8 @@ std::string vfs::retrieve(std::string_view path, const vfs_directory* node, std:
|
||||
{
|
||||
// If failed to find mount point for path and /host_root is mounted
|
||||
// Prepend "/host_root" to path and return the constructed string
|
||||
result = "/";
|
||||
result.clear();
|
||||
result += '/';
|
||||
|
||||
for (const auto& name : *mount_path)
|
||||
{
|
||||
|
@ -537,7 +537,7 @@ int main(int argc, char** argv)
|
||||
std::string argument_str;
|
||||
for (int i = 0; i < argc; i++)
|
||||
{
|
||||
argument_str += "'" + std::string(argv[i]) + "'";
|
||||
argument_str += '\'' + std::string(argv[i]) + '\'';
|
||||
if (i != argc - 1) argument_str += " ";
|
||||
}
|
||||
sys_log.notice("argc: %d, argv: %s", argc, argument_str);
|
||||
|
@ -97,7 +97,7 @@ u32 debugger_list::GetStartAddress(u32 address)
|
||||
|
||||
void debugger_list::ShowAddress(u32 addr, bool select_addr, bool direct)
|
||||
{
|
||||
const decltype(spu_thread::local_breakpoints)* spu_bps_list;
|
||||
const decltype(spu_thread::local_breakpoints)* spu_bps_list{};
|
||||
|
||||
if (m_cpu && m_cpu->id_type() == 2)
|
||||
{
|
||||
@ -161,7 +161,7 @@ void debugger_list::ShowAddress(u32 addr, bool select_addr, bool direct)
|
||||
const u32 address_limits = (is_spu ? 0x3fffc : ~3);
|
||||
const u32 current_pc = m_cpu->get_pc();
|
||||
m_start_addr &= address_limits;
|
||||
u32 pc = m_start_addr;
|
||||
pc = m_start_addr;
|
||||
|
||||
for (uint i = 0, count = 4; i < m_item_count; ++i, pc = (pc + count) & address_limits)
|
||||
{
|
||||
|
@ -359,13 +359,13 @@ namespace utils
|
||||
|
||||
duration_ms = stream->duration / 1000;
|
||||
|
||||
AVPacket packet{};
|
||||
av_init_packet(&packet);
|
||||
AVPacket* packet = av_packet_alloc();
|
||||
std::unique_ptr<AVPacket, decltype([](AVPacket* p){av_packet_unref(p);})> packet_(packet);
|
||||
|
||||
// Iterate through frames
|
||||
while (thread_ctrl::state() != thread_state::aborting && av_read_frame(av.format, &packet) >= 0)
|
||||
while (thread_ctrl::state() != thread_state::aborting && av_read_frame(av.format, packet) >= 0)
|
||||
{
|
||||
if (int err = avcodec_send_packet(av.context, &packet); err < 0)
|
||||
if (int err = avcodec_send_packet(av.context, packet); err < 0)
|
||||
{
|
||||
media_log.error("audio_decoder: Queuing error: %d='%s'", err, av_error_to_string(err));
|
||||
has_error = true;
|
||||
|
@ -2591,7 +2591,7 @@ inline v128 gv_extend_lo_s8(const v128& vec)
|
||||
#if defined(__SSE4_1__)
|
||||
return _mm_cvtepi8_epi16(vec);
|
||||
#elif defined(ARCH_X64)
|
||||
return _mm_srai_epi16(_mm_unpacklo_epi8(_mm_undefined_si128(), vec), 8);
|
||||
return _mm_srai_epi16(_mm_unpacklo_epi8(vec, vec), 8);
|
||||
#elif defined(ARCH_ARM64)
|
||||
return int16x8_t(vmovl_s8(vget_low_s8(vec)));
|
||||
#endif
|
||||
@ -2613,7 +2613,7 @@ inline v128 gv_extend_hi_s8(const v128& vec)
|
||||
#if defined(__SSE4_1__)
|
||||
return _mm_cvtepi8_epi16(_mm_loadu_si64(vec._bytes + 8));
|
||||
#elif defined(ARCH_X64)
|
||||
return _mm_srai_epi16(_mm_unpackhi_epi8(_mm_undefined_si128(), vec), 8);
|
||||
return _mm_srai_epi16(_mm_unpackhi_epi8(vec, vec), 8);
|
||||
#elif defined(ARCH_ARM64)
|
||||
return int16x8_t(vmovl_s8(vget_high_s8(vec)));
|
||||
#endif
|
||||
@ -2642,7 +2642,7 @@ inline v128 gv_extend_lo_s16(const v128& vec)
|
||||
#if defined(__SSE4_1__)
|
||||
return _mm_cvtepi16_epi32(vec);
|
||||
#elif defined(ARCH_X64)
|
||||
return _mm_srai_epi32(_mm_unpacklo_epi16(_mm_undefined_si128(), vec), 16);
|
||||
return _mm_srai_epi32(_mm_unpacklo_epi16(vec, vec), 16);
|
||||
#elif defined(ARCH_ARM64)
|
||||
return int32x4_t(vmovl_s16(vget_low_s16(vec)));
|
||||
#endif
|
||||
@ -2664,7 +2664,7 @@ inline v128 gv_extend_hi_s16(const v128& vec)
|
||||
#if defined(__SSE4_1__)
|
||||
return _mm_cvtepi16_epi32(_mm_loadu_si64(vec._bytes + 8));
|
||||
#elif defined(ARCH_X64)
|
||||
return _mm_srai_epi32(_mm_unpackhi_epi16(_mm_undefined_si128(), vec), 16);
|
||||
return _mm_srai_epi32(_mm_unpackhi_epi16(vec, vec), 16);
|
||||
#elif defined(ARCH_ARM64)
|
||||
return int32x4_t(vmovl_s16(vget_high_s16(vec)));
|
||||
#endif
|
||||
|
@ -229,7 +229,7 @@ namespace utils
|
||||
return _prot;
|
||||
}
|
||||
|
||||
void* memory_reserve(usz size, void* use_addr, bool is_memory_mapping)
|
||||
void* memory_reserve(usz size, void* use_addr, [[maybe_unused]] bool is_memory_mapping)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (is_memory_mapping && has_win10_memory_mapping_api())
|
||||
|
Loading…
Reference in New Issue
Block a user