diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index c8257a343..2d4241484 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp @@ -170,7 +170,7 @@ static std::wstring CPToUTF16(u32 code_page, const std::string& input) { MultiByteToWideChar(code_page, 0, input.data(), static_cast(input.size()), nullptr, 0); if (size == 0) { - return L""; + return {}; } std::wstring output(size, L'\0'); diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp index d88bdd896..29fe97117 100644 --- a/src/input_common/sdl/sdl_impl.cpp +++ b/src/input_common/sdl/sdl_impl.cpp @@ -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; diff --git a/src/network/packet.cpp b/src/network/packet.cpp index 8fc5feabd..1b62fdf60 100644 --- a/src/network/packet.cpp +++ b/src/network/packet.cpp @@ -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;