trdwll / SteamBridge

An Unreal Engine implementation of the Steamworks API.
https://trdwll.com/experiments/steambridge/
MIT License
134 stars 20 forks source link

Fixed uninitialized struct member warnings #9

Closed Drakynfly closed 3 years ago

Drakynfly commented 3 years ago

Fixed warnings in log caused by struct members with no default value or default constructor.

For most of them I used a zero value, or the first enum value, or false, but for FSteamPartyBeaconLocation.LocationID I used INDEX_NONE because 0 might be a valid ID, I didn't know. Lemme know if you have a better solution.

For reference these were the warnings:

Display      LogClass             17 Uninitialized script struct members found
Warning      LogAutomationTest    FSteamItemPriceData::CurrentPrice is not initialized properly. Module:SteamBridge File:Public/SteamStructs.h
Warning      LogAutomationTest    FSteamItemPriceData::BasePrice is not initialized properly. Module:SteamBridge File:Public/SteamStructs.h
Warning      LogAutomationTest    FSteamLeaderboardEntry::GlobalRank is not initialized properly. Module:SteamBridge File:Public/SteamStructs.h
Warning      LogAutomationTest    FSteamLeaderboardEntry::Score is not initialized properly. Module:SteamBridge File:Public/SteamStructs.h
Warning      LogAutomationTest    FSteamLeaderboardEntry::Details is not initialized properly. Module:SteamBridge File:Public/SteamStructs.h
Warning      LogAutomationTest    FSteamPartyBeaconLocation::Type is not initialized properly. Module:SteamBridge File:Public/SteamStructs.h
Warning      LogAutomationTest    FSteamPartyBeaconLocation::LocationID is not initialized properly. Module:SteamBridge File:Public/SteamStructs.h
Warning      LogAutomationTest    FSteamItemDetails::Quantity is not initialized properly. Module:SteamBridge File:Public/SteamStructs.h
Warning      LogAutomationTest    FSteamInputMotionData::RotQuat is not initialized properly. Module:SteamBridge File:Public/SteamStructs.h
Warning      LogAutomationTest    FSteamInputMotionData::PosAccel is not initialized properly. Module:SteamBridge File:Public/SteamStructs.h
Warning      LogAutomationTest    FSteamInputMotionData::RotVel is not initialized properly. Module:SteamBridge File:Public/SteamStructs.h
Warning      LogAutomationTest    BoolProperty FSteamInputDigitalActionData::bState is not initialized properly. Module:SteamBridge File:Public/SteamStructs.h
Warning      LogAutomationTest    BoolProperty FSteamInputDigitalActionData::bActive is not initialized properly. Module:SteamBridge File:Public/SteamStructs.h
Warning      LogAutomationTest    FSteamInputAnalogActionData::Mode is not initialized properly. Module:SteamBridge File:Public/SteamStructs.h
Warning      LogAutomationTest    FSteamInputAnalogActionData::X is not initialized properly. Module:SteamBridge File:Public/SteamStructs.h
Warning      LogAutomationTest    FSteamInputAnalogActionData::Y is not initialized properly. Module:SteamBridge File:Public/SteamStructs.h
Warning      LogAutomationTest    BoolProperty FSteamInputAnalogActionData::bActive is not initialized properly. Module:SteamBridge File:Public/SteamStructs.h
Drakynfly commented 3 years ago

Whoops, I forgot that FQuats cant use {} to initialize, gotta use Identity instead. Fixed in second commit

trdwll commented 3 years ago

Cool thanks. For future PR's if you don't mind using the constructors to initialize members instead of directly.

MyClass() : Val(0) {}