Răsfoiți Sursa

Code style: remove void from constructors without arguments

Arseniy Shestakov 8 ani în urmă
părinte
comite
da117e9255

+ 2 - 2
AI/BattleAI/BattleAI.cpp

@@ -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)
 	{

+ 2 - 2
AI/BattleAI/BattleAI.h

@@ -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();

+ 2 - 2
AI/StupidAI/StupidAI.cpp

@@ -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");
 }

+ 2 - 2
AI/StupidAI/StupidAI.h

@@ -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

+ 2 - 2
AI/VCAI/VCAI.cpp

@@ -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();

+ 2 - 2
AI/VCAI/VCAI.h

@@ -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);

+ 1 - 1
client/CMT.cpp

@@ -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();

+ 2 - 2
client/CMusicHandler.cpp

@@ -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);
 

+ 1 - 1
client/CMusicHandler.h

@@ -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;
 };

+ 2 - 2
client/Client.cpp

@@ -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;
 }

+ 2 - 2
client/Client.h

@@ -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

+ 3 - 2
lib/CConfigHandler.cpp

@@ -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()
 {
 }
 

+ 2 - 2
lib/CConfigHandler.h

@@ -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)

+ 1 - 1
lib/serializer/Connection.cpp

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

+ 2 - 2
lib/serializer/Connection.h

@@ -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);

+ 2 - 2
server/CGameHandler.cpp

@@ -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;

+ 2 - 2
server/CGameHandler.h

@@ -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

+ 1 - 1
server/CQuery.cpp

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

+ 1 - 1
server/CQuery.h

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