1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Code style: remove void from constructors without arguments

This commit is contained in:
Arseniy Shestakov 2018-01-13 11:43:26 +03:00
parent 759416ed88
commit da117e9255
19 changed files with 34 additions and 33 deletions

View File

@ -16,12 +16,12 @@
#define LOGL(text) print(text)
#define LOGFL(text, formattingEl) print(boost::str(boost::format(text) % formattingEl))
CBattleAI::CBattleAI(void)
CBattleAI::CBattleAI()
: side(-1), wasWaitingForRealize(false), wasUnlockingGs(false)
{
}
CBattleAI::~CBattleAI(void)
CBattleAI::~CBattleAI()
{
if(cb)
{

View File

@ -61,8 +61,8 @@ class CBattleAI : public CBattleGameInterface
bool wasWaitingForRealize, wasUnlockingGs;
public:
CBattleAI(void);
~CBattleAI(void);
CBattleAI();
~CBattleAI();
void init(std::shared_ptr<CBattleCallback> CB) override;
void attemptCastingSpell();

View File

@ -16,14 +16,14 @@
static std::shared_ptr<CBattleCallback> cbc;
CStupidAI::CStupidAI(void)
CStupidAI::CStupidAI()
: side(-1)
{
print("created");
}
CStupidAI::~CStupidAI(void)
CStupidAI::~CStupidAI()
{
print("destroyed");
}

View File

@ -18,8 +18,8 @@ class CStupidAI : public CBattleGameInterface
void print(const std::string &text) const;
public:
CStupidAI(void);
~CStupidAI(void);
CStupidAI();
~CStupidAI();
void init(std::shared_ptr<CBattleCallback> CB) override;
void actionFinished(const BattleAction &action) override;//occurs AFTER every action taken by any stack or by the hero

View File

@ -81,7 +81,7 @@ struct ObjInfo
std::map<const CGObjectInstance *, ObjInfo> helperObjInfo;
VCAI::VCAI(void)
VCAI::VCAI()
{
LOG_TRACE(logAi);
makingTurn = nullptr;
@ -89,7 +89,7 @@ VCAI::VCAI(void)
destinationTeleportPos = int3(-1);
}
VCAI::~VCAI(void)
VCAI::~VCAI()
{
LOG_TRACE(logAi);
finish();

View File

@ -165,8 +165,8 @@ public:
std::unique_ptr<boost::thread> makingTurn;
VCAI(void);
virtual ~VCAI(void);
VCAI();
virtual ~VCAI();
//TODO: use only smart pointers?
void tryRealize(Goals::Explore & g);

View File

@ -191,7 +191,7 @@ void init()
}
}
static void prog_version(void)
static void prog_version()
{
printf("%s\n", GameConstants::VCMI_VERSION.c_str());
std::cout << VCMIDirs::get().genHelpString();

View File

@ -40,7 +40,7 @@ static void soundFinishedCallbackC(int channel)
CCS->soundh->soundFinishedCallback(channel);
}
static void musicFinishedCallbackC(void)
static void musicFinishedCallbackC()
{
CCS->musich->musicFinishedCallback();
}
@ -487,7 +487,7 @@ void CMusicHandler::setVolume(ui32 percent)
Mix_VolumeMusic((MIX_MAX_VOLUME * volume)/100);
}
void CMusicHandler::musicFinishedCallback(void)
void CMusicHandler::musicFinishedCallback()
{
boost::mutex::scoped_lock guard(mutex);

View File

@ -147,7 +147,7 @@ public:
/// play specific track from set
void playMusicFromSet(std::string musicSet, int entryID, bool loop);
void stopMusic(int fade_ms=1000);
void musicFinishedCallback(void);
void musicFinishedCallback();
friend class MusicEntry;
};

View File

@ -130,7 +130,7 @@ void CClient::init()
terminate = false;
}
CClient::CClient(void)
CClient::CClient()
{
init();
}
@ -141,7 +141,7 @@ CClient::CClient(CConnection *con, StartInfo *si)
newGame(con,si);
}
CClient::~CClient(void)
CClient::~CClient()
{
delete applier;
}

View File

@ -147,9 +147,9 @@ public:
//void sendRequest(const CPackForServer *request, bool waitForRealization);
CClient(void);
CClient();
CClient(CConnection *con, StartInfo *si);
~CClient(void);
~CClient();
void init();
void newGame(CConnection *con, StartInfo *si); //con - connection to server

View File

@ -200,11 +200,12 @@ static void setGem(AdventureMapConfig &ac, const int gem, const JsonNode &g)
ac.gemG.push_back(g["graphic"].String());
}
CConfigHandler::CConfigHandler(void): current(nullptr)
CConfigHandler::CConfigHandler()
: current(nullptr)
{
}
CConfigHandler::~CConfigHandler(void)
CConfigHandler::~CConfigHandler()
{
}

View File

@ -169,8 +169,8 @@ namespace config
typedef std::map<std::pair<int,int>, GUIOptions > GuiOptionsMap;
GuiOptionsMap guiOptions;
void init();
CConfigHandler(void);
~CConfigHandler(void);
CConfigHandler();
~CConfigHandler();
GUIOptions *go() { return current; };
void SetResolution(int x, int y)

View File

@ -163,7 +163,7 @@ int CConnection::read(void * data, unsigned size)
throw;
}
}
CConnection::~CConnection(void)
CConnection::~CConnection()
{
if(handler)
handler->join();

View File

@ -43,7 +43,7 @@ typedef boost::asio::basic_socket_acceptor<boost::asio::ip::tcp, boost::asio::so
class DLL_LINKAGE CConnection
: public IBinaryReader, public IBinaryWriter
{
CConnection(void);
CConnection();
void init();
void reportState(vstd::CLoggerBase * out) override;
@ -75,7 +75,7 @@ public:
bool isHost() const;
template<class T>
CConnection &operator&(const T&);
virtual ~CConnection(void);
virtual ~CConnection();
CPack *retreivePack(); //gets from server next pack (allocates it with new)
void sendPackToServer(const CPack &pack, PlayerColor player, ui32 requestID);

View File

@ -1388,7 +1388,7 @@ int CGameHandler::moveStack(int stack, BattleHex dest)
return ret;
}
CGameHandler::CGameHandler(void)
CGameHandler::CGameHandler()
{
QID = 1;
//gs = nullptr;
@ -1400,7 +1400,7 @@ CGameHandler::CGameHandler(void)
spellEnv = new ServerSpellCastEnvironment(this);
}
CGameHandler::~CGameHandler(void)
CGameHandler::~CGameHandler()
{
delete spellEnv;
delete applier;

View File

@ -108,8 +108,8 @@ public:
void setupBattle(int3 tile, const CArmedInstance *armies[2], const CGHeroInstance *heroes[2], bool creatureBank, const CGTownInstance *town);
void setBattleResult(BattleResult::EResult resultType, int victoriusSide);
CGameHandler(void);
~CGameHandler(void);
CGameHandler();
~CGameHandler();
//////////////////////////////////////////////////////////////////////////
//from IGameCallback

View File

@ -55,7 +55,7 @@ CQuery::CQuery(Queries * Owner):
}
CQuery::~CQuery(void)
CQuery::~CQuery()
{
logGlobal->trace("Destructed the query with id %d", queryID);
}

View File

@ -54,7 +54,7 @@ public:
virtual void setReply(const JsonNode & reply);
virtual ~CQuery(void);
virtual ~CQuery();
protected:
Queries * owner;
void addPlayer(PlayerColor color);