Fix some warnings

This commit is contained in:
Megamouse 2025-04-25 09:21:39 +02:00
parent 85a4c5eb93
commit c2a5ac96cd
5 changed files with 7 additions and 7 deletions

View file

@ -274,7 +274,7 @@ std::optional<s32> lv2_socket_p2p::sendto(s32 flags, const std::vector<u8>& buf,
}
ensure(opt_sn_addr);
ensure(socket); // ensures it has been bound
ensure(native_socket); // ensures it has been bound
ensure(buf.size() <= static_cast<usz>(65535 - VPORT_P2P_HEADER_SIZE)); // catch games using full payload for future fragmentation implementation if necessary
const u16 p2p_port = reinterpret_cast<const sys_net_sockaddr_in*>(&*opt_sn_addr)->sin_port;
const u16 p2p_vport = reinterpret_cast<const sys_net_sockaddr_in_p2p*>(&*opt_sn_addr)->sin_vport;

View file

@ -174,7 +174,7 @@ namespace rsx
{
// Switch to heap storage
_data = static_cast<Ty*>(std::malloc(sizeof(Ty) * size));
std::memcpy(_data, _local_storage, size_bytes());
std::memcpy(static_cast<void*>(_data), _local_storage, size_bytes());
}
else
{

View file

@ -42,7 +42,7 @@ namespace vk
queue_submit_t(const queue_submit_t& other)
{
std::memcpy(this, &other, sizeof(queue_submit_t));
std::memcpy(static_cast<void*>(this), &other, sizeof(queue_submit_t));
}
inline queue_submit_t& wait_on(VkSemaphore semaphore, VkPipelineStageFlags stage)

View file

@ -23,7 +23,7 @@ namespace vk
graphics_pipeline_state()
{
// NOTE: Vk** structs have padding bytes
memset(this, 0, sizeof(graphics_pipeline_state));
std::memset(static_cast<void*>(this), 0, sizeof(graphics_pipeline_state));
ia.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
cs.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
@ -43,7 +43,7 @@ namespace vk
graphics_pipeline_state(const graphics_pipeline_state& other)
{
// NOTE: Vk** structs have padding bytes
memcpy(this, &other, sizeof(graphics_pipeline_state));
std::memcpy(static_cast<void*>(this), &other, sizeof(graphics_pipeline_state));
if (other.cs.pAttachments == other.att_state)
{
@ -59,7 +59,7 @@ namespace vk
if (this != &other)
{
// NOTE: Vk** structs have padding bytes
memcpy(this, &other, sizeof(graphics_pipeline_state));
std::memcpy(static_cast<void*>(this), &other, sizeof(graphics_pipeline_state));
if (other.cs.pAttachments == other.att_state)
{

View file

@ -1210,7 +1210,7 @@ constexpr void write_to_ptr(U&& array, const T& value)
{
static_assert(sizeof(T) % sizeof(array[0]) == 0);
if (!std::is_constant_evaluated())
std::memcpy(&array[0], &value, sizeof(value));
std::memcpy(static_cast<void*>(&array[0]), &value, sizeof(value));
else
ensure(!"Unimplemented");
}