From 888ceb55d5c08c6c88cf738bc64f03f224d6f2da Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 19 Jun 2020 20:23:03 -0400 Subject: [PATCH] CScriptLoader: Make use of in-class initializers Same behavior, less code. --- src/Core/Resource/Factory/CScriptLoader.cpp | 7 +------ src/Core/Resource/Factory/CScriptLoader.h | 12 ++++++------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/Core/Resource/Factory/CScriptLoader.cpp b/src/Core/Resource/Factory/CScriptLoader.cpp index 50fee575..36b709c8 100644 --- a/src/Core/Resource/Factory/CScriptLoader.cpp +++ b/src/Core/Resource/Factory/CScriptLoader.cpp @@ -7,17 +7,12 @@ #include "Core/Resource/Script/Property/CEnumProperty.h" #include "Core/Resource/Script/Property/CFlagsProperty.h" #include -#include #include // Whether to ensure the values of enum/flag properties are valid #define VALIDATE_PROPERTY_VALUES 1 -CScriptLoader::CScriptLoader() - : mpObj(nullptr) - , mpCurrentData(nullptr) -{ -} +CScriptLoader::CScriptLoader() = default; void CScriptLoader::ReadProperty(IProperty *pProp, uint32 Size, IInputStream& rSCLY) { diff --git a/src/Core/Resource/Factory/CScriptLoader.h b/src/Core/Resource/Factory/CScriptLoader.h index 2d4421c6..a308d32e 100644 --- a/src/Core/Resource/Factory/CScriptLoader.h +++ b/src/Core/Resource/Factory/CScriptLoader.h @@ -10,14 +10,14 @@ class CScriptLoader { - EGame mVersion; - CScriptObject* mpObj; - CScriptLayer* mpLayer; - CGameArea* mpArea; - CGameTemplate *mpGameTemplate; + EGame mVersion{}; + CScriptObject* mpObj = nullptr; + CScriptLayer* mpLayer = nullptr; + CGameArea* mpArea = nullptr; + CGameTemplate *mpGameTemplate = nullptr; // Current data pointer - void* mpCurrentData; + void* mpCurrentData = nullptr; CScriptLoader(); void ReadProperty(IProperty* pProp, uint32 Size, IInputStream& rSCLY);