common, input_common, network: fix warnings

This commit is contained in:
SachinVin 2023-06-09 22:50:37 +05:30
parent 946a32d793
commit 7e134421d5
3 changed files with 8 additions and 8 deletions

View File

@ -170,7 +170,7 @@ static std::wstring CPToUTF16(u32 code_page, const std::string& input) {
MultiByteToWideChar(code_page, 0, input.data(), static_cast<int>(input.size()), nullptr, 0);
if (size == 0) {
return L"";
return {};
}
std::wstring output(size, L'\0');

View File

@ -1018,7 +1018,7 @@ public:
}
Common::ParamPackage GetNextInput() override {
SDL_Event event;
SDL_Event event{};
while (state.event_queue.Pop(event)) {
if (event.type != SDL_JOYAXISMOTION || std::abs(event.jaxis.value / 32767.0) < 0.5) {
continue;

View File

@ -85,42 +85,42 @@ Packet& Packet::operator>>(u8& out_data) {
}
Packet& Packet::operator>>(s16& out_data) {
s16 value;
s16 value = 0;
Read(&value, sizeof(value));
out_data = ntohs(value);
return *this;
}
Packet& Packet::operator>>(u16& out_data) {
u16 value;
u16 value = 0;
Read(&value, sizeof(value));
out_data = ntohs(value);
return *this;
}
Packet& Packet::operator>>(s32& out_data) {
s32 value;
s32 value = 0;
Read(&value, sizeof(value));
out_data = ntohl(value);
return *this;
}
Packet& Packet::operator>>(u32& out_data) {
u32 value;
u32 value = 0;
Read(&value, sizeof(value));
out_data = ntohl(value);
return *this;
}
Packet& Packet::operator>>(s64& out_data) {
s64 value;
s64 value = 0;
Read(&value, sizeof(value));
out_data = ntohll(value);
return *this;
}
Packet& Packet::operator>>(u64& out_data) {
u64 value;
u64 value = 0;
Read(&value, sizeof(value));
out_data = ntohll(value);
return *this;