diff --git a/scripting/erm/ERMInterpreter.cpp b/scripting/erm/ERMInterpreter.cpp index 76de8520e..d60511024 100644 --- a/scripting/erm/ERMInterpreter.cpp +++ b/scripting/erm/ERMInterpreter.cpp @@ -464,8 +464,8 @@ void ERMInterpreter::scanScripts() ERMInterpreter::ERMInterpreter() { erm = this; - curFunc = NULL; - curTrigger = NULL; + curFunc = nullptr; + curTrigger = nullptr; globalEnv = new Environment(); topDyn = globalEnv; } @@ -496,7 +496,7 @@ void ERMInterpreter::executeTrigger( VERMInterpreter::Trigger & trig, int funNum executeLine(lp); } - curFunc = NULL; + curFunc = nullptr; } bool ERMInterpreter::isATrigger( const ERM::TLine & line ) @@ -686,8 +686,8 @@ struct HE_BPerformer : StandardBodyOptionItemVisitor {} using StandardBodyOptionItemVisitor::operator(); - void operator()(TIexp const& cmp) const OVERRIDE; - void operator()(TVarpExp const& cmp) const OVERRIDE; + void operator()(TIexp const& cmp) const override; + void operator()(TVarpExp const& cmp) const override; }; template @@ -703,8 +703,8 @@ struct HE_CPerformer : StandardBodyOptionItemVisitor {} using StandardBodyOptionItemVisitor::operator(); - void operator()(TIexp const& cmp) const OVERRIDE; - void operator()(TVarpExp const& cmp) const OVERRIDE; + void operator()(TIexp const& cmp) const override; + void operator()(TVarpExp const& cmp) const override; }; template @@ -719,7 +719,7 @@ struct HEPerformer : StandardReceiverVisitor {} using StandardReceiverVisitor::operator(); - void operator()(TNormalBodyOption const& trig) const OVERRIDE + void operator()(TNormalBodyOption const& trig) const override { switch(trig.optionCode) { @@ -780,7 +780,7 @@ struct IF_MPerformer : StandardBodyOptionItemVisitor explicit IF_MPerformer(IFPerformer & _owner) : StandardBodyOptionItemVisitor(_owner){} using StandardBodyOptionItemVisitor::operator(); - void operator()(TStringConstant const& cmp) const OVERRIDE; + void operator()(TStringConstant const& cmp) const override; }; @@ -802,7 +802,7 @@ struct StringFormatter { int pos; int tokenLength; - int percentPos; + size_t percentPos; int charsToReplace; std::string &msg; @@ -821,7 +821,7 @@ struct StringFormatter { int toAdd = 0; int numStart = percentPos + 2; - int numEnd = msg.find_first_not_of("1234567890", numStart); + size_t numEnd = msg.find_first_not_of("1234567890", numStart); if(numEnd == std::string::npos) toAdd = msg.size() - numStart; @@ -887,7 +887,7 @@ struct IFPerformer : StandardReceiverVisitor using StandardReceiverVisitor::operator(); - void operator()(TNormalBodyOption const& trig) const OVERRIDE + void operator()(TNormalBodyOption const& trig) const override { std::string message; //to be shown switch(trig.optionCode) @@ -932,8 +932,8 @@ struct MA_PPerformer : StandardBodyOptionItemVisitor explicit MA_PPerformer(MAPerformer & _owner); using StandardBodyOptionItemVisitor::operator(); - void operator()(TIexp const& cmp) const OVERRIDE; - void operator()(TVarpExp const& cmp) const OVERRIDE; + void operator()(TIexp const& cmp) const override; + void operator()(TVarpExp const& cmp) const override; }; struct MAPerformer : StandardReceiverVisitor @@ -942,7 +942,7 @@ struct MAPerformer : StandardReceiverVisitor {} using StandardReceiverVisitor::operator(); - void operator()(TNormalBodyOption const& trig) const OVERRIDE + void operator()(TNormalBodyOption const& trig) const override { switch(trig.optionCode) { @@ -981,8 +981,8 @@ struct MO_GPerformer : StandardBodyOptionItemVisitor {} using StandardBodyOptionItemVisitor::operator(); - void operator()(TVarpExp const& cmp) const OVERRIDE; - void operator()(TIexp const& cmp) const OVERRIDE; + void operator()(TVarpExp const& cmp) const override; + void operator()(TIexp const& cmp) const override; }; struct MOPerformer: StandardReceiverVisitor @@ -991,7 +991,7 @@ struct MOPerformer: StandardReceiverVisitor {} using StandardReceiverVisitor::operator(); - void operator()(TNormalBodyOption const& trig) const OVERRIDE + void operator()(TNormalBodyOption const& trig) const override { switch(trig.optionCode) { @@ -1116,8 +1116,8 @@ struct VR_SPerformer : StandardBodyOptionItemVisitor explicit VR_SPerformer(VRPerformer & _owner); using StandardBodyOptionItemVisitor::operator(); - void operator()(TStringConstant const& cmp) const OVERRIDE; - void operator()(TIexp const& cmp) const OVERRIDE; + void operator()(TStringConstant const& cmp) const override; + void operator()(TIexp const& cmp) const override; }; struct VRPerformer : StandardReceiverVisitor @@ -1125,7 +1125,7 @@ struct VRPerformer : StandardReceiverVisitor VRPerformer(ERMInterpreter * _interpr, IexpValStr ident) : StandardReceiverVisitor(_interpr, ident) {} - void operator()(TVRLogic const& trig) const OVERRIDE + void operator()(TVRLogic const& trig) const override { int valr = interp->getIexp(trig.var).getInt(); switch (trig.opcode) @@ -1144,7 +1144,7 @@ struct VRPerformer : StandardReceiverVisitor break; } } - void operator()(TVRArithmetic const& trig) const OVERRIDE + void operator()(TVRArithmetic const& trig) const override { IexpValStr rhs = interp->getIexp(trig.rhs); switch (trig.opcode) @@ -1169,7 +1169,7 @@ struct VRPerformer : StandardReceiverVisitor break; } } - void operator()(TNormalBodyOption const& trig) const OVERRIDE + void operator()(TNormalBodyOption const& trig) const override { switch(trig.optionCode) { @@ -1380,7 +1380,7 @@ struct ERMExpDispatch : boost::static_visitor<> } else if(trig.name == "HE") { - const CGHeroInstance * hero = NULL; + const CGHeroInstance * hero = nullptr; if(trig.identifier.is_initialized()) { ERM::Tidentifier tid = trig.identifier.get(); @@ -1754,11 +1754,11 @@ struct LVL3BodyOptionItemVisitor : StandardBodyOptionItemVisitor {} using StandardBodyOptionItemVisitor::operator(); - void operator()(TIexp const& cmp) const OVERRIDE + void operator()(TIexp const& cmp) const override { owner = erm->getIexp(cmp); } - void operator()(TVarpExp const& cmp) const OVERRIDE + void operator()(TVarpExp const& cmp) const override { owner = erm->getIexp(cmp); } @@ -2717,7 +2717,7 @@ struct VEvaluator : boost::static_visitor } }; -VOption ERMInterpreter::eval( VOption line, Environment * env /*= NULL*/ ) +VOption ERMInterpreter::eval( VOption line, Environment * env /*= nullptr*/ ) { // if(line.children.isNil()) // return; @@ -2729,7 +2729,7 @@ VOption ERMInterpreter::eval( VOption line, Environment * env /*= NULL*/ ) } -VOptionList ERMInterpreter::evalEach( VermTreeIterator list, Environment * env /*= NULL*/ ) +VOptionList ERMInterpreter::evalEach( VermTreeIterator list, Environment * env /*= nullptr*/ ) { VOptionList ret; for(int g=0; g > TIDPattern; @@ -839,13 +839,13 @@ public: int getRealLine(const VERMInterpreter::LinePointer &lp); //overload CScriptingModule - virtual void heroVisit(const CGHeroInstance *visitor, const CGObjectInstance *visitedObj, bool start) OVERRIDE; - virtual void init() OVERRIDE;//sets up environment etc. - virtual void executeUserCommand(const std::string &cmd) OVERRIDE; - virtual void giveInfoCB(CPrivilagedInfoCallback *cb) OVERRIDE; - virtual void giveActionCB(IGameEventRealizer *cb) OVERRIDE; + virtual void heroVisit(const CGHeroInstance *visitor, const CGObjectInstance *visitedObj, bool start) override; + virtual void init() override;//sets up environment etc. + virtual void executeUserCommand(const std::string &cmd) override; + virtual void giveInfoCB(CPrivilagedInfoCallback *cb) override; + virtual void giveActionCB(IGameEventRealizer *cb) override; - virtual void battleStart(const CCreatureSet *army1, const CCreatureSet *army2, int3 tile, const CGHeroInstance *hero1, const CGHeroInstance *hero2, bool side) OVERRIDE; + virtual void battleStart(const CCreatureSet *army1, const CCreatureSet *army2, int3 tile, const CGHeroInstance *hero1, const CGHeroInstance *hero2, bool side) override; const CGObjectInstance *getObjFrom(int3 pos); template diff --git a/scripting/erm/ERMParser.cpp b/scripting/erm/ERMParser.cpp index 74d078881..f3a3e5768 100644 --- a/scripting/erm/ERMParser.cpp +++ b/scripting/erm/ERMParser.cpp @@ -1,10 +1,6 @@ #include "StdInc.h" #include "ERMParser.h" -//To make compilation with older boost versions possible -//Don't know exact version - 1.46 works while 1.42 not -#if BOOST_VERSION >= 104600 - /* * ERMParser.cpp, part of VCMI engine * @@ -67,7 +63,7 @@ std::string CERMPreprocessor::retreiveCommandLine() getline(line); //reading line - int dash = line.find_first_of('^'); + size_t dash = line.find_first_of('^'); bool inTheMiddle = openedBraces || openedString; if(!inTheMiddle) @@ -547,10 +543,4 @@ void ERMParser::repairEncoding( char * str, int len ) const for(int g=0; g ERMParser::parseFile() {std::vector dummy; return dummy;} //compile fix - -#endif +} \ No newline at end of file