From 2cd774fe425f7b345c6e46be9a322d227b66d8cb Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Fri, 2 Nov 2012 20:08:37 +0000 Subject: [PATCH] - gcc 4.5 compatibility --- lib/CArtHandler.cpp | 4 ++-- lib/CArtHandler.h | 2 +- lib/JsonNode.cpp | 4 ++-- lib/StartInfo.h | 1 - 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/CArtHandler.cpp b/lib/CArtHandler.cpp index 5e4f094bd..60b1ecf4d 100644 --- a/lib/CArtHandler.cpp +++ b/lib/CArtHandler.cpp @@ -527,7 +527,7 @@ void CArtHandler::getAllowedArts(std::vector > &ou } } -Bonus *createBonus(Bonus::BonusType type, int val, int subtype, int valType, shared_ptr limiter = nullptr, int additionalInfo = 0) +Bonus *createBonus(Bonus::BonusType type, int val, int subtype, int valType, shared_ptr limiter = shared_ptr(), int additionalInfo = 0) { Bonus *added = new Bonus(Bonus::PERMANENT,type,Bonus::ARTIFACT,val,-1,subtype); added->additionalInfo = additionalInfo; @@ -536,7 +536,7 @@ Bonus *createBonus(Bonus::BonusType type, int val, int subtype, int valType, sha return added; } -Bonus *createBonus(Bonus::BonusType type, int val, int subtype, shared_ptr propagator = nullptr, int additionalInfo = 0) +Bonus *createBonus(Bonus::BonusType type, int val, int subtype, shared_ptr propagator = shared_ptr(), int additionalInfo = 0) { Bonus *added = new Bonus(Bonus::PERMANENT,type,Bonus::ARTIFACT,val,-1,subtype); added->additionalInfo = additionalInfo; diff --git a/lib/CArtHandler.h b/lib/CArtHandler.h index a43d5630c..617811d62 100644 --- a/lib/CArtHandler.h +++ b/lib/CArtHandler.h @@ -198,7 +198,7 @@ public: class DLL_LINKAGE CArtHandler //handles artifacts { - void giveArtBonus(TArtifactID aid, Bonus::BonusType type, int val, int subtype = -1, int valType = Bonus::BASE_NUMBER, shared_ptr limiter = NULL, int additionalinfo = 0); + void giveArtBonus(TArtifactID aid, Bonus::BonusType type, int val, int subtype = -1, int valType = Bonus::BASE_NUMBER, shared_ptr limiter = shared_ptr(), int additionalinfo = 0); void giveArtBonus(TArtifactID aid, Bonus::BonusType type, int val, int subtype, shared_ptr propagator, int additionalinfo = 0); void giveArtBonus(TArtifactID aid, Bonus *bonus); public: diff --git a/lib/JsonNode.cpp b/lib/JsonNode.cpp index e75a6cb0e..d968b140e 100644 --- a/lib/JsonNode.cpp +++ b/lib/JsonNode.cpp @@ -1042,11 +1042,11 @@ DLL_LINKAGE void UnparseBonus( JsonNode &node, const Bonus * bonus ) node["effectRange"].String() = reverseMapFirst(bonus->effectRange, bonusLimitEffect); node["duration"].String() = reverseMapFirst(bonus->duration, bonusDurationMap); node["source"].String() = reverseMapFirst(bonus->source, bonusSourceMap); - if(bonus->limiter != nullptr) + if(bonus->limiter) { node["limiter"].String() = reverseMapFirst(bonus->limiter, bonusLimiterMap); } - if(bonus->propagator != nullptr) + if(bonus->propagator) { node["propagator"].String() = reverseMapFirst(bonus->propagator, bonusPropagatorMap); } diff --git a/lib/StartInfo.h b/lib/StartInfo.h index d6d9d73cf..15be2e9bf 100644 --- a/lib/StartInfo.h +++ b/lib/StartInfo.h @@ -103,6 +103,5 @@ struct StartInfo { mapfileChecksum = seedPostInit = seedToBeUsed = 0; mode = INVALID; - campState = nullptr; } };