From 22baa22bc23e1202285de3e640911047ea7b395d Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Thu, 15 May 2014 21:37:39 +0200 Subject: [PATCH] [STYLE] remove (void) in () to be c++ coherent --- enet/Ftp.h | 4 ++-- enet/Http.cpp | 14 +++++++------- enet/Http.h | 18 +++++++++--------- enet/Tcp.cpp | 8 ++++---- enet/Tcp.h | 16 ++++++++-------- enet/Udp.h | 4 ++-- enet/debug.cpp | 2 +- enet/debug.h | 2 +- test/debug.cpp | 2 +- test/debug.h | 2 +- 10 files changed, 36 insertions(+), 36 deletions(-) diff --git a/enet/Ftp.h b/enet/Ftp.h index 915d0c2..94eff46 100644 --- a/enet/Ftp.h +++ b/enet/Ftp.h @@ -12,8 +12,8 @@ namespace enet { class Ftp { public: - Ftp(void) { }; - virtual ~Ftp(void) { }; + Ftp() { }; + virtual ~Ftp() { }; }; }; diff --git a/enet/Http.cpp b/enet/Http.cpp index b1a2298..4536835 100644 --- a/enet/Http.cpp +++ b/enet/Http.cpp @@ -16,22 +16,22 @@ #endif #define __class__ ("Http") -static std::map getErrorList(void) { +static std::map getErrorList() { static std::map g_list; return g_list; } -enet::Http::Http(void) : +enet::Http::Http() : m_keepAlive(false) { m_connection.setPort(80); m_connection.setServer(false); } -enet::Http::~Http(void) { +enet::Http::~Http() { reset(); } -bool enet::Http::connect(void) { +bool enet::Http::connect() { if (m_connection.getConnectionStatus() == enet::Tcp::statusLink) { return true; } @@ -61,7 +61,7 @@ std::string enet::Http::getReceiveHeaderProperties(const std::string& _key) { return ""; } -bool enet::Http::reset(void) { +bool enet::Http::reset() { if (m_connection.getConnectionStatus() != enet::Tcp::statusLink) { m_connection.unlink(); } @@ -95,7 +95,7 @@ bool enet::Http::setPort(uint16_t _port) { return true; } -bool enet::Http::receiveData(void) { +bool enet::Http::receiveData() { std::string header; // Get data char data[1025]; @@ -298,7 +298,7 @@ bool enet::Http::post(const std::string& _address, const std::string& _contentTy } -std::string enet::Http::dataString(void) { +std::string enet::Http::dataString() { std::string data; for (auto element : m_receiveData) { if (element == '\0') { diff --git a/enet/Http.h b/enet/Http.h index 7b94600..dd649e7 100644 --- a/enet/Http.h +++ b/enet/Http.h @@ -17,8 +17,8 @@ namespace enet { class Http { public: - Http(void); - virtual ~Http(void); + Http(); + virtual ~Http(); private: enet::Tcp m_connection; private: @@ -27,7 +27,7 @@ namespace enet { void setKeepAlive(bool _keepAlive) { m_keepAlive = true; } - bool getKeepAlive(void) { + bool getKeepAlive() { return m_keepAlive; } private: @@ -35,8 +35,8 @@ namespace enet { std::map m_sendHeader; std::map m_receiveHeader; std::vector m_receiveData; - bool connect(void); - bool reset(void); + bool connect(); + bool reset(); public: void setSendHeaderProperties(const std::string& _key, const std::string& _val); std::string getSendHeaderProperties(const std::string& _key); @@ -47,16 +47,16 @@ namespace enet { bool post(const std::string& _address, const std::map& _values); bool post(const std::string& _address, const std::string& _contentType, const std::string& _data); - int32_t dataSize(void) { + int32_t dataSize() { return m_receiveData.size(); } - const std::vector& data(void) { + const std::vector& data() { return m_receiveData; } - std::string dataString(void); + std::string dataString(); std::string escapeChar(const std::string& _value); std::string unEscapeChar(const std::string& _value); - bool receiveData(void); + bool receiveData(); }; }; diff --git a/enet/Tcp.cpp b/enet/Tcp.cpp index e5cc2f9..c806904 100644 --- a/enet/Tcp.cpp +++ b/enet/Tcp.cpp @@ -20,7 +20,7 @@ #endif #define __class__ ("Tcp") -enet::Tcp::Tcp(void) : +enet::Tcp::Tcp() : m_socketId(-1), m_socketIdClient(-1), m_host("127.0.0.1"), @@ -30,7 +30,7 @@ enet::Tcp::Tcp(void) : } -enet::Tcp::~Tcp(void) { +enet::Tcp::~Tcp() { unlink(); } @@ -79,7 +79,7 @@ void enet::Tcp::setServer(bool _status) { m_server = _status; } -bool enet::Tcp::link(void) { +bool enet::Tcp::link() { if (m_status == statusLink) { ENET_ERROR("Connection is already started"); return false; @@ -177,7 +177,7 @@ bool enet::Tcp::link(void) { } -bool enet::Tcp::unlink(void) { +bool enet::Tcp::unlink() { if (m_socketIdClient >= 0) { ENET_INFO(" close client socket"); close(m_socketIdClient); diff --git a/enet/Tcp.h b/enet/Tcp.h index 41ad226..ebcc47d 100644 --- a/enet/Tcp.h +++ b/enet/Tcp.h @@ -15,8 +15,8 @@ namespace enet { int32_t m_socketId; //!< socket linux interface generic int32_t m_socketIdClient; public: - Tcp(void); - virtual ~Tcp(void); + Tcp(); + virtual ~Tcp(); private: std::string m_host; //!< hostname/IP to connect with. public: @@ -37,7 +37,7 @@ namespace enet { * @brief Get the decriptive name hot the host * @return the string requested */ - const std::string& getHostName(void) { + const std::string& getHostName() { return m_host; } private: @@ -52,7 +52,7 @@ namespace enet { * @brief Get the port number. * @return The requested port number. */ - uint16_t getPort(void) { + uint16_t getPort() { return m_port; } private: @@ -67,7 +67,7 @@ namespace enet { * @brief Get the server mode status. * @return true: the tcp interface is configure as a server. */ - int32_t getServer(void) { + int32_t getServer() { return m_server; } public: @@ -83,7 +83,7 @@ namespace enet { * @brief Get the current Status of the connection * @return The status. */ - enum status getConnectionStatus(void) { + enum status getConnectionStatus() { return m_status; } public: @@ -92,13 +92,13 @@ namespace enet { * @return true if connection is done * @return false otherwise ... */ - bool link(void); + bool link(); /** * @brief Unlink on a specific interface. * @return true if connection is removed * @return false otherwise ... */ - bool unlink(void); + bool unlink(); /** * @brief Read a chunk of data on the socket * @param[in] _data pointer on the data might be write diff --git a/enet/Udp.h b/enet/Udp.h index 3aa56ff..ccafb0c 100644 --- a/enet/Udp.h +++ b/enet/Udp.h @@ -12,8 +12,8 @@ namespace enet { class Udp { public: - Udp(void) { }; - virtual ~Udp(void) { }; + Udp() { }; + virtual ~Udp() { }; }; }; diff --git a/enet/debug.cpp b/enet/debug.cpp index 64a8e1f..5c45c32 100644 --- a/enet/debug.cpp +++ b/enet/debug.cpp @@ -8,7 +8,7 @@ #include -int32_t enet::getLogId(void) { +int32_t enet::getLogId() { static int32_t g_val = etk::log::registerInstance("enet"); return g_val; } diff --git a/enet/debug.h b/enet/debug.h index f3dc907..a355f04 100644 --- a/enet/debug.h +++ b/enet/debug.h @@ -12,7 +12,7 @@ #include namespace enet { - int32_t getLogId(void); + int32_t getLogId(); }; // TODO : Review this problem of multiple intanciation of "std::stringbuf sb" diff --git a/test/debug.cpp b/test/debug.cpp index abd89f2..5c57b19 100644 --- a/test/debug.cpp +++ b/test/debug.cpp @@ -8,7 +8,7 @@ #include -int32_t appl::getLogId(void) { +int32_t appl::getLogId() { static int32_t g_val = etk::log::registerInstance("enettest"); return g_val; } diff --git a/test/debug.h b/test/debug.h index 5f3de63..760af70 100644 --- a/test/debug.h +++ b/test/debug.h @@ -12,7 +12,7 @@ #include namespace appl { - int32_t getLogId(void); + int32_t getLogId(); }; // TODO : Review this problem of multiple intanciation of "std::stringbuf sb"