diff --git a/DPlusProtocolHandlerPool.cpp b/DPlusProtocolHandlerPool.cpp index 1e56488..2e981bf 100644 --- a/DPlusProtocolHandlerPool.cpp +++ b/DPlusProtocolHandlerPool.cpp @@ -17,15 +17,18 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include + #include "DPlusProtocolHandlerPool.h" +#include "Log.h" -CDPlusProtocolHandlerPool::CDPlusProtocolHandlerPool(unsigned int n, unsigned int port, const wxString& addr) : +CDPlusProtocolHandlerPool::CDPlusProtocolHandlerPool(unsigned int n, unsigned int port, const std::string& addr) : m_pool(NULL), m_n(n), m_index(0U) { - wxASSERT(port > 0U); - wxASSERT(n > 0U); + assert(port > 0U); + assert(n > 0U); m_pool = new CDPlusProtocolHandlerEntry[n]; @@ -35,7 +38,7 @@ m_index(0U) m_pool[i].m_inUse = false; } - wxLogMessage(wxT("Allocated UDP ports %u-%u to D-Plus"), port, port + n - 1U); + wxLogMessage("Allocated UDP ports %u-%u to D-Plus", port, port + n - 1U); } CDPlusProtocolHandlerPool::~CDPlusProtocolHandlerPool() @@ -75,14 +78,14 @@ CDPlusProtocolHandler* CDPlusProtocolHandlerPool::getHandler(unsigned int port) } } - wxLogError(wxT("Cannot find a free D-Plus port in the pool")); + wxLogError("Cannot find a free D-Plus port in the pool"); return NULL; } void CDPlusProtocolHandlerPool::release(CDPlusProtocolHandler* handler) { - wxASSERT(handler != NULL); + assert(handler != NULL); for (unsigned int i = 0U; i < m_n; i++) { if (m_pool[i].m_handler == handler && m_pool[i].m_inUse) { @@ -91,7 +94,7 @@ void CDPlusProtocolHandlerPool::release(CDPlusProtocolHandler* handler) } } - wxLogError(wxT("Trying to release an unused D-Plus port")); + wxLogError("Trying to release an unused D-Plus port"); } DPLUS_TYPE CDPlusProtocolHandlerPool::read() diff --git a/DPlusProtocolHandlerPool.h b/DPlusProtocolHandlerPool.h index fbaede1..9ab0ac7 100644 --- a/DPlusProtocolHandlerPool.h +++ b/DPlusProtocolHandlerPool.h @@ -20,8 +20,6 @@ #ifndef DPlusProtocolHandlerPool_H #define DPlusProtocolHandlerPool_H -#include - #include "DPlusProtocolHandler.h" class CDPlusProtocolHandlerEntry { @@ -33,7 +31,7 @@ public: class CDPlusProtocolHandlerPool { public: - CDPlusProtocolHandlerPool(unsigned int n, unsigned int port, const wxString& addr = wxEmptyString); + CDPlusProtocolHandlerPool(unsigned int n, unsigned int port, const std::string& addr = ""); ~CDPlusProtocolHandlerPool(); bool open();