From 9b6bdf3ae8ddae20b95261134412612407411745 Mon Sep 17 00:00:00 2001 From: Koncord Date: Thu, 3 Jan 2019 12:23:23 +0800 Subject: [PATCH] [General] Fix minor warnings found by PVS --- components/CMakeLists.txt | 5 +++++ components/openmw-mp/Master/PacketMasterAnnounce.cpp | 2 ++ components/openmw-mp/Master/PacketMasterQuery.cpp | 1 + components/openmw-mp/Master/PacketMasterUpdate.cpp | 1 + components/openmw-mp/Packets/Actor/ActorPacket.cpp | 1 + components/openmw-mp/Packets/Object/ObjectPacket.cpp | 1 + components/openmw-mp/Packets/PacketPreInit.cpp | 1 + components/openmw-mp/Packets/Player/PlayerPacket.cpp | 1 + components/openmw-mp/Packets/Worldstate/WorldstatePacket.cpp | 1 + 9 files changed, 14 insertions(+) diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 9c916ca7d..77298434f 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -306,3 +306,8 @@ endif() # Make the variable accessible for other subdirectories set(COMPONENT_FILES ${COMPONENT_FILES} PARENT_SCOPE) + +pvs_studio_add_target(TARGET components.analyze ALL + OUTPUT FORMAT errorfile + ANALYZE components + LOG target_components.err) diff --git a/components/openmw-mp/Master/PacketMasterAnnounce.cpp b/components/openmw-mp/Master/PacketMasterAnnounce.cpp index ff22b6465..86f9c39d9 100644 --- a/components/openmw-mp/Master/PacketMasterAnnounce.cpp +++ b/components/openmw-mp/Master/PacketMasterAnnounce.cpp @@ -13,6 +13,8 @@ using namespace std; PacketMasterAnnounce::PacketMasterAnnounce(RakNet::RakPeerInterface *peer) : BasePacket(peer) { + server = nullptr; + func = 0; packetID = ID_MASTER_ANNOUNCE; orderChannel = CHANNEL_MASTER; reliability = RELIABLE_ORDERED_WITH_ACK_RECEIPT; diff --git a/components/openmw-mp/Master/PacketMasterQuery.cpp b/components/openmw-mp/Master/PacketMasterQuery.cpp index c14e32d3e..93e54d6b9 100644 --- a/components/openmw-mp/Master/PacketMasterQuery.cpp +++ b/components/openmw-mp/Master/PacketMasterQuery.cpp @@ -15,6 +15,7 @@ using namespace RakNet; PacketMasterQuery::PacketMasterQuery(RakNet::RakPeerInterface *peer) : BasePacket(peer) { + servers = nullptr; packetID = ID_MASTER_QUERY; orderChannel = CHANNEL_MASTER; reliability = RELIABLE_ORDERED_WITH_ACK_RECEIPT; diff --git a/components/openmw-mp/Master/PacketMasterUpdate.cpp b/components/openmw-mp/Master/PacketMasterUpdate.cpp index 33ef10ec4..8f0d65d4c 100644 --- a/components/openmw-mp/Master/PacketMasterUpdate.cpp +++ b/components/openmw-mp/Master/PacketMasterUpdate.cpp @@ -12,6 +12,7 @@ using namespace RakNet; PacketMasterUpdate::PacketMasterUpdate(RakNet::RakPeerInterface *peer) : BasePacket(peer) { + server = nullptr; packetID = ID_MASTER_UPDATE; orderChannel = CHANNEL_MASTER; reliability = RELIABLE_ORDERED_WITH_ACK_RECEIPT; diff --git a/components/openmw-mp/Packets/Actor/ActorPacket.cpp b/components/openmw-mp/Packets/Actor/ActorPacket.cpp index 2e767c3d9..a30b68fdc 100644 --- a/components/openmw-mp/Packets/Actor/ActorPacket.cpp +++ b/components/openmw-mp/Packets/Actor/ActorPacket.cpp @@ -7,6 +7,7 @@ using namespace mwmp; ActorPacket::ActorPacket(RakNet::RakPeerInterface *peer) : BasePacket(peer) { + actorList = nullptr; packetID = 0; priority = HIGH_PRIORITY; reliability = RELIABLE_ORDERED; diff --git a/components/openmw-mp/Packets/Object/ObjectPacket.cpp b/components/openmw-mp/Packets/Object/ObjectPacket.cpp index 3ed21fe44..0e22cfc7b 100644 --- a/components/openmw-mp/Packets/Object/ObjectPacket.cpp +++ b/components/openmw-mp/Packets/Object/ObjectPacket.cpp @@ -7,6 +7,7 @@ using namespace mwmp; ObjectPacket::ObjectPacket(RakNet::RakPeerInterface *peer) : BasePacket(peer) { + objectList = nullptr; hasCellData = false; packetID = 0; priority = HIGH_PRIORITY; diff --git a/components/openmw-mp/Packets/PacketPreInit.cpp b/components/openmw-mp/Packets/PacketPreInit.cpp index ad04c5280..d51d61b39 100644 --- a/components/openmw-mp/Packets/PacketPreInit.cpp +++ b/components/openmw-mp/Packets/PacketPreInit.cpp @@ -4,6 +4,7 @@ mwmp::PacketPreInit::PacketPreInit(RakNet::RakPeerInterface *peer) : BasePacket(peer) { + checksums = nullptr; packetID = ID_GAME_PREINIT; } diff --git a/components/openmw-mp/Packets/Player/PlayerPacket.cpp b/components/openmw-mp/Packets/Player/PlayerPacket.cpp index a0544809d..9f4d436be 100644 --- a/components/openmw-mp/Packets/Player/PlayerPacket.cpp +++ b/components/openmw-mp/Packets/Player/PlayerPacket.cpp @@ -7,6 +7,7 @@ using namespace mwmp; PlayerPacket::PlayerPacket(RakNet::RakPeerInterface *peer) : BasePacket(peer) { + player = nullptr; packetID = 0; priority = HIGH_PRIORITY; reliability = RELIABLE_ORDERED; diff --git a/components/openmw-mp/Packets/Worldstate/WorldstatePacket.cpp b/components/openmw-mp/Packets/Worldstate/WorldstatePacket.cpp index 328eae26d..e09c78bb1 100644 --- a/components/openmw-mp/Packets/Worldstate/WorldstatePacket.cpp +++ b/components/openmw-mp/Packets/Worldstate/WorldstatePacket.cpp @@ -7,6 +7,7 @@ using namespace mwmp; WorldstatePacket::WorldstatePacket(RakNet::RakPeerInterface *peer) : BasePacket(peer) { + worldstate = nullptr; packetID = 0; priority = HIGH_PRIORITY; reliability = RELIABLE_ORDERED;