From 6aba3a6f57b9d7a2e05aea1489d64ce0ab0b78fa Mon Sep 17 00:00:00 2001 From: crs Date: Sun, 14 Oct 2001 16:58:01 +0000 Subject: [PATCH] removed exception specifications. thread exceptions weren't being listed and they'd have to be added to every one. just doesn't seem worth the trouble. --- io/CBufferedInputStream.cpp | 14 ++++++------ io/CBufferedInputStream.h | 14 ++++++------ io/CBufferedOutputStream.cpp | 14 ++++++------ io/CBufferedOutputStream.h | 14 ++++++------ io/CInputStreamFilter.cpp | 2 +- io/CInputStreamFilter.h | 8 +++---- io/COutputStreamFilter.cpp | 2 +- io/COutputStreamFilter.h | 8 +++---- io/CStreamBuffer.cpp | 8 +++---- io/CStreamBuffer.h | 8 +++---- io/IInputStream.h | 6 ++--- io/IOutputStream.h | 6 ++--- mt/CCondVar.cpp | 16 ++++++------- mt/CCondVar.h | 14 ++++++------ mt/CLock.cpp | 6 ++--- mt/CLock.h | 6 ++--- mt/CMutex.cpp | 8 +++---- mt/CMutex.h | 4 ++-- net/CNetworkAddress.cpp | 7 +++--- net/CNetworkAddress.h | 8 +++---- net/CSocketInputStream.cpp | 10 ++++----- net/CSocketInputStream.h | 10 ++++----- net/CSocketOutputStream.cpp | 14 ++++++------ net/CSocketOutputStream.h | 14 ++++++------ net/CSocketStreamBuffer.cpp | 8 +++---- net/CSocketStreamBuffer.h | 8 +++---- net/CTCPListenSocket.cpp | 6 ++--- net/CTCPListenSocket.h | 6 ++--- net/CTCPSocket.cpp | 20 ++++++++--------- net/CTCPSocket.h | 22 +++++++++--------- net/IListenSocket.h | 6 ++--- net/ISocket.h | 10 ++++----- synergy/CInputPacketStream.cpp | 10 ++++----- synergy/CInputPacketStream.h | 10 ++++----- synergy/COutputPacketStream.cpp | 6 ++--- synergy/COutputPacketStream.h | 6 ++--- synergy/CProtocolUtil.cpp | 12 +++++----- synergy/CProtocolUtil.h | 12 +++++----- synergy/CScreenMap.cpp | 2 +- synergy/CScreenMap.h | 2 +- synergy/CServer.cpp | 10 ++++----- synergy/CServer.h | 8 +++---- synergy/CServerProtocol.cpp | 8 +++---- synergy/CServerProtocol.h | 40 ++++++++++++++++----------------- synergy/CServerProtocol1_0.cpp | 32 +++++++++++++------------- synergy/CServerProtocol1_0.h | 32 +++++++++++++------------- synergy/CTCPSocketFactory.cpp | 4 ++-- synergy/CTCPSocketFactory.h | 4 ++-- synergy/IServerProtocol.h | 32 +++++++++++++------------- synergy/ISocketFactory.h | 4 ++-- 50 files changed, 269 insertions(+), 272 deletions(-) diff --git a/io/CBufferedInputStream.cpp b/io/CBufferedInputStream.cpp index d0978dfb..98c8fbe9 100644 --- a/io/CBufferedInputStream.cpp +++ b/io/CBufferedInputStream.cpp @@ -27,7 +27,7 @@ CBufferedInputStream::~CBufferedInputStream() } void CBufferedInputStream::write( - const void* data, UInt32 n) throw() + const void* data, UInt32 n) { if (!m_hungup && n > 0) { m_buffer.write(data, n); @@ -36,14 +36,14 @@ void CBufferedInputStream::write( } } -void CBufferedInputStream::hangup() throw() +void CBufferedInputStream::hangup() { m_hungup = true; m_empty.broadcast(); } UInt32 CBufferedInputStream::readNoLock( - void* dst, UInt32 n) throw(XIO) + void* dst, UInt32 n) { if (m_closed) { throw XIOClosed(); @@ -74,12 +74,12 @@ UInt32 CBufferedInputStream::readNoLock( return n; } -UInt32 CBufferedInputStream::getSizeNoLock() const throw() +UInt32 CBufferedInputStream::getSizeNoLock() const { return m_buffer.getSize(); } -void CBufferedInputStream::close() throw(XIO) +void CBufferedInputStream::close() { CLock lock(m_mutex); if (m_closed) { @@ -93,13 +93,13 @@ void CBufferedInputStream::close() throw(XIO) } UInt32 CBufferedInputStream::read( - void* dst, UInt32 n) throw(XIO) + void* dst, UInt32 n) { CLock lock(m_mutex); return readNoLock(dst, n); } -UInt32 CBufferedInputStream::getSize() const throw() +UInt32 CBufferedInputStream::getSize() const { CLock lock(m_mutex); return getSizeNoLock(); diff --git a/io/CBufferedInputStream.h b/io/CBufferedInputStream.h index 8a4dd7be..28fbdd27 100644 --- a/io/CBufferedInputStream.h +++ b/io/CBufferedInputStream.h @@ -19,25 +19,25 @@ class CBufferedInputStream : public IInputStream { // manipulators // write() appends n bytes to the buffer - void write(const void*, UInt32 n) throw(); + void write(const void*, UInt32 n); // causes read() to always return immediately. if there is no // more data then it returns 0. further writes are discarded. - void hangup() throw(); + void hangup(); // same as read() but caller must lock the mutex - UInt32 readNoLock(void*, UInt32 count) throw(XIO); + UInt32 readNoLock(void*, UInt32 count); // accessors // same as getSize() but caller must lock the mutex - UInt32 getSizeNoLock() const throw(); + UInt32 getSizeNoLock() const; // IInputStream overrides // these all lock the mutex for their duration - virtual void close() throw(XIO); - virtual UInt32 read(void*, UInt32 count) throw(XIO); - virtual UInt32 getSize() const throw(); + virtual void close(); + virtual UInt32 read(void*, UInt32 count); + virtual UInt32 getSize() const; private: CMutex* m_mutex; diff --git a/io/CBufferedOutputStream.cpp b/io/CBufferedOutputStream.cpp index bf3d9165..bf1603c6 100644 --- a/io/CBufferedOutputStream.cpp +++ b/io/CBufferedOutputStream.cpp @@ -23,22 +23,22 @@ CBufferedOutputStream::~CBufferedOutputStream() delete m_closeCB; } -const void* CBufferedOutputStream::peek(UInt32 n) throw() +const void* CBufferedOutputStream::peek(UInt32 n) { return m_buffer.peek(n); } -void CBufferedOutputStream::pop(UInt32 n) throw() +void CBufferedOutputStream::pop(UInt32 n) { m_buffer.pop(n); } -UInt32 CBufferedOutputStream::getSize() const throw() +UInt32 CBufferedOutputStream::getSize() const { return m_buffer.getSize(); } -void CBufferedOutputStream::close() throw(XIO) +void CBufferedOutputStream::close() { CLock lock(m_mutex); if (m_closed) { @@ -52,7 +52,7 @@ void CBufferedOutputStream::close() throw(XIO) } UInt32 CBufferedOutputStream::write( - const void* data, UInt32 n) throw(XIO) + const void* data, UInt32 n) { CLock lock(m_mutex); if (m_closed) { @@ -63,7 +63,7 @@ UInt32 CBufferedOutputStream::write( return n; } -void CBufferedOutputStream::flush() throw(XIO) +void CBufferedOutputStream::flush() { // wait until all data is written while (getSizeWithLock() > 0) { @@ -71,7 +71,7 @@ void CBufferedOutputStream::flush() throw(XIO) } } -UInt32 CBufferedOutputStream::getSizeWithLock() const throw() +UInt32 CBufferedOutputStream::getSizeWithLock() const { CLock lock(m_mutex); return m_buffer.getSize(); diff --git a/io/CBufferedOutputStream.h b/io/CBufferedOutputStream.h index ab43aecb..a88e2357 100644 --- a/io/CBufferedOutputStream.h +++ b/io/CBufferedOutputStream.h @@ -19,22 +19,22 @@ class CBufferedOutputStream : public IOutputStream { // peek() returns a buffer of n bytes (which must be <= getSize()). // pop() discards the next n bytes. - const void* peek(UInt32 n) throw(); - void pop(UInt32 n) throw(); + const void* peek(UInt32 n); + void pop(UInt32 n); // accessors // return the number of bytes in the buffer - UInt32 getSize() const throw(); + UInt32 getSize() const; // IOutputStream overrides // these all lock the mutex for their duration - virtual void close() throw(XIO); - virtual UInt32 write(const void*, UInt32 count) throw(XIO); - virtual void flush() throw(XIO); + virtual void close(); + virtual UInt32 write(const void*, UInt32 count); + virtual void flush(); private: - UInt32 getSizeWithLock() const throw(); + UInt32 getSizeWithLock() const; private: CMutex* m_mutex; diff --git a/io/CInputStreamFilter.cpp b/io/CInputStreamFilter.cpp index 486a6298..254c2313 100644 --- a/io/CInputStreamFilter.cpp +++ b/io/CInputStreamFilter.cpp @@ -19,7 +19,7 @@ CInputStreamFilter::~CInputStreamFilter() } } -IInputStream* CInputStreamFilter::getStream() const throw() +IInputStream* CInputStreamFilter::getStream() const { return m_stream; } diff --git a/io/CInputStreamFilter.h b/io/CInputStreamFilter.h index 51f40b35..0e4dd41b 100644 --- a/io/CInputStreamFilter.h +++ b/io/CInputStreamFilter.h @@ -13,12 +13,12 @@ class CInputStreamFilter : public IInputStream { // accessors // IInputStream overrides - virtual void close() throw(XIO) = 0; - virtual UInt32 read(void*, UInt32 maxCount) throw(XIO) = 0; - virtual UInt32 getSize() const throw() = 0; + virtual void close() = 0; + virtual UInt32 read(void*, UInt32 maxCount) = 0; + virtual UInt32 getSize() const = 0; protected: - IInputStream* getStream() const throw(); + IInputStream* getStream() const; private: IInputStream* m_stream; diff --git a/io/COutputStreamFilter.cpp b/io/COutputStreamFilter.cpp index 3f62075c..8adc2862 100644 --- a/io/COutputStreamFilter.cpp +++ b/io/COutputStreamFilter.cpp @@ -19,7 +19,7 @@ COutputStreamFilter::~COutputStreamFilter() } } -IOutputStream* COutputStreamFilter::getStream() const throw() +IOutputStream* COutputStreamFilter::getStream() const { return m_stream; } diff --git a/io/COutputStreamFilter.h b/io/COutputStreamFilter.h index 11499d80..c6b02a46 100644 --- a/io/COutputStreamFilter.h +++ b/io/COutputStreamFilter.h @@ -13,12 +13,12 @@ class COutputStreamFilter : public IOutputStream { // accessors // IOutputStream overrides - virtual void close() throw(XIO) = 0; - virtual UInt32 write(const void*, UInt32 count) throw(XIO) = 0; - virtual void flush() throw(XIO) = 0; + virtual void close() = 0; + virtual UInt32 write(const void*, UInt32 count) = 0; + virtual void flush() = 0; protected: - IOutputStream* getStream() const throw(); + IOutputStream* getStream() const; private: IOutputStream* m_stream; diff --git a/io/CStreamBuffer.cpp b/io/CStreamBuffer.cpp index d2ce3140..e9d1b5a9 100644 --- a/io/CStreamBuffer.cpp +++ b/io/CStreamBuffer.cpp @@ -17,7 +17,7 @@ CStreamBuffer::~CStreamBuffer() // do nothing } -const void* CStreamBuffer::peek(UInt32 n) throw() +const void* CStreamBuffer::peek(UInt32 n) { assert(n <= m_size); @@ -36,7 +36,7 @@ const void* CStreamBuffer::peek(UInt32 n) throw() return reinterpret_cast(head->begin()); } -void CStreamBuffer::pop(UInt32 n) throw() +void CStreamBuffer::pop(UInt32 n) { m_size -= n; @@ -58,7 +58,7 @@ void CStreamBuffer::pop(UInt32 n) throw() } void CStreamBuffer::write( - const void* vdata, UInt32 n) throw() + const void* vdata, UInt32 n) { assert(vdata != NULL); @@ -100,7 +100,7 @@ void CStreamBuffer::write( } } -UInt32 CStreamBuffer::getSize() const throw() +UInt32 CStreamBuffer::getSize() const { return m_size; } diff --git a/io/CStreamBuffer.h b/io/CStreamBuffer.h index cb5bb864..7333de90 100644 --- a/io/CStreamBuffer.h +++ b/io/CStreamBuffer.h @@ -14,16 +14,16 @@ class CStreamBuffer { // peek() returns a buffer of n bytes (which must be <= getSize()). // pop() discards the next n bytes. - const void* peek(UInt32 n) throw(); - void pop(UInt32 n) throw(); + const void* peek(UInt32 n); + void pop(UInt32 n); // write() appends n bytes to the buffer - void write(const void*, UInt32 n) throw(); + void write(const void*, UInt32 n); // accessors // return the number of bytes in the buffer - UInt32 getSize() const throw(); + UInt32 getSize() const; private: static const UInt32 kChunkSize; diff --git a/io/IInputStream.h b/io/IInputStream.h index e4f93394..3650dfd4 100644 --- a/io/IInputStream.h +++ b/io/IInputStream.h @@ -10,12 +10,12 @@ class IInputStream : public IInterface { // manipulators // close the stream - virtual void close() throw(XIO) = 0; + virtual void close() = 0; // read up to maxCount bytes into buffer, return number read. // blocks if no data is currently available. if buffer is NULL // then the data is discarded. - virtual UInt32 read(void* buffer, UInt32 maxCount) throw(XIO) = 0; + virtual UInt32 read(void* buffer, UInt32 maxCount) = 0; // accessors @@ -23,7 +23,7 @@ class IInputStream : public IInterface { // (i.e. a number not greater than the actual number of bytes). // some streams may not be able to determine this and will always // return zero. - virtual UInt32 getSize() const throw() = 0; + virtual UInt32 getSize() const = 0; }; #endif diff --git a/io/IOutputStream.h b/io/IOutputStream.h index f0b46244..ca1a196c 100644 --- a/io/IOutputStream.h +++ b/io/IOutputStream.h @@ -10,13 +10,13 @@ class IOutputStream : public IInterface { // manipulators // close the stream - virtual void close() throw(XIO) = 0; + virtual void close() = 0; // write count bytes to stream - virtual UInt32 write(const void*, UInt32 count) throw(XIO) = 0; + virtual UInt32 write(const void*, UInt32 count) = 0; // flush the stream - virtual void flush() throw(XIO) = 0; + virtual void flush() = 0; // accessors }; diff --git a/mt/CCondVar.cpp b/mt/CCondVar.cpp index e2d441ae..ca0d8526 100644 --- a/mt/CCondVar.cpp +++ b/mt/CCondVar.cpp @@ -21,12 +21,12 @@ CCondVarBase::~CCondVarBase() fini(); } -void CCondVarBase::lock() const throw() +void CCondVarBase::lock() const { m_mutex->lock(); } -void CCondVarBase::unlock() const throw() +void CCondVarBase::unlock() const { m_mutex->unlock(); } @@ -37,7 +37,7 @@ bool CCondVarBase::wait(double timeout) const return wait(timer, timeout); } -CMutex* CCondVarBase::getMutex() const throw() +CMutex* CCondVarBase::getMutex() const { return m_mutex; } @@ -65,14 +65,14 @@ void CCondVarBase::fini() delete cond; } -void CCondVarBase::signal() throw() +void CCondVarBase::signal() { pthread_cond_t* cond = reinterpret_cast(m_cond); int status = pthread_cond_signal(cond); assert(status == 0); } -void CCondVarBase::broadcast() throw() +void CCondVarBase::broadcast() { pthread_cond_t* cond = reinterpret_cast(m_cond); int status = pthread_cond_broadcast(cond); @@ -143,7 +143,7 @@ bool CCondVarBase::wait( CThread::testCancel(); // check wait status - if (status != ETIMEDOUT) + if (status != ETIMEDOUT && status != EINTR) break; } @@ -199,7 +199,7 @@ void CCondVarBase::fini() delete[] events; } -void CCondVarBase::signal() throw() +void CCondVarBase::signal() { // is anybody waiting? bool hasWaiter; @@ -213,7 +213,7 @@ void CCondVarBase::signal() throw() SetEvent(reinterpret_cast(m_cond)[kSignal]); } -void CCondVarBase::broadcast() throw() +void CCondVarBase::broadcast() { // is anybody waiting? bool hasWaiter; diff --git a/mt/CCondVar.h b/mt/CCondVar.h index a42e25ab..083962ab 100644 --- a/mt/CCondVar.h +++ b/mt/CCondVar.h @@ -17,13 +17,13 @@ class CCondVarBase { // manipulators // lock/unlock the mutex. see CMutex. - void lock() const throw(); - void unlock() const throw(); + void lock() const; + void unlock() const; // signal the condition. Signal() wakes one waiting thread. // Broadcast() wakes all waiting threads. - void signal() throw(); - void broadcast() throw(); + void signal(); + void broadcast(); // accessors @@ -43,7 +43,7 @@ class CCondVarBase { bool wait(CStopwatch&, double timeout) const; // get the mutex passed to the c'tor - CMutex* getMutex() const throw(); + CMutex* getMutex() const; private: void init(); @@ -83,7 +83,7 @@ class CCondVar : public CCondVarBase { // get the const value. this object should be locked before // calling this method. - operator const T&() const throw(); + operator const T&() const; private: T m_data; @@ -131,7 +131,7 @@ CCondVar& CCondVar::operator=(const T& data) template inline -CCondVar::operator const T&() const throw() +CCondVar::operator const T&() const { return m_data; } diff --git a/mt/CLock.cpp b/mt/CLock.cpp index 86aa721e..41ceae9c 100644 --- a/mt/CLock.cpp +++ b/mt/CLock.cpp @@ -6,17 +6,17 @@ // CLock // -CLock::CLock(const CMutex* mutex) throw() : m_mutex(mutex) +CLock::CLock(const CMutex* mutex) : m_mutex(mutex) { m_mutex->lock(); } -CLock::CLock(const CCondVarBase* cv) throw() : m_mutex(cv->getMutex()) +CLock::CLock(const CCondVarBase* cv) : m_mutex(cv->getMutex()) { m_mutex->lock(); } -CLock::~CLock() throw() +CLock::~CLock() { m_mutex->unlock(); } diff --git a/mt/CLock.h b/mt/CLock.h index 9bd81942..9ab933ce 100644 --- a/mt/CLock.h +++ b/mt/CLock.h @@ -8,9 +8,9 @@ class CCondVarBase; class CLock { public: - CLock(const CMutex* mutex) throw(); - CLock(const CCondVarBase* cv) throw(); - ~CLock() throw(); + CLock(const CMutex* mutex); + CLock(const CCondVarBase* cv); + ~CLock(); private: // not implemented diff --git a/mt/CMutex.cpp b/mt/CMutex.cpp index 854d52e5..3b203d50 100644 --- a/mt/CMutex.cpp +++ b/mt/CMutex.cpp @@ -48,7 +48,7 @@ void CMutex::fini() delete mutex; } -void CMutex::lock() const throw() +void CMutex::lock() const { pthread_mutex_t* mutex = reinterpret_cast(m_mutex); int status = pthread_mutex_lock(mutex); @@ -71,7 +71,7 @@ void CMutex::lock() const throw() } } -void CMutex::unlock() const throw() +void CMutex::unlock() const { pthread_mutex_t* mutex = reinterpret_cast(m_mutex); int status = pthread_mutex_unlock(mutex); @@ -110,12 +110,12 @@ void CMutex::fini() delete mutex; } -void CMutex::lock() const throw() +void CMutex::lock() const { ::EnterCriticalSection(reinterpret_cast(m_mutex)); } -void CMutex::unlock() const throw() +void CMutex::unlock() const { ::LeaveCriticalSection(reinterpret_cast(m_mutex)); } diff --git a/mt/CMutex.h b/mt/CMutex.h index f9423827..77612366 100644 --- a/mt/CMutex.h +++ b/mt/CMutex.h @@ -20,8 +20,8 @@ class CMutex { // accessors - void lock() const throw(); - void unlock() const throw(); + void lock() const; + void unlock() const; private: void init(); diff --git a/net/CNetworkAddress.cpp b/net/CNetworkAddress.cpp index 024965ce..6d780b2f 100644 --- a/net/CNetworkAddress.cpp +++ b/net/CNetworkAddress.cpp @@ -8,7 +8,7 @@ // CNetworkAddress // -CNetworkAddress::CNetworkAddress(UInt16 port) throw(XSocketAddress) +CNetworkAddress::CNetworkAddress(UInt16 port) { if (port == 0) throw XSocketAddress(XSocketAddress::kBadPort, CString(), port); @@ -21,7 +21,6 @@ CNetworkAddress::CNetworkAddress(UInt16 port) throw(XSocketAddress) } CNetworkAddress::CNetworkAddress(const CString& hostname, UInt16 port) - throw(XSocketAddress) { if (port == 0) throw XSocketAddress(XSocketAddress::kBadPort, hostname, port); @@ -54,12 +53,12 @@ CNetworkAddress::~CNetworkAddress() // do nothing } -const struct sockaddr* CNetworkAddress::getAddress() const throw() +const struct sockaddr* CNetworkAddress::getAddress() const { return &m_address; } -int CNetworkAddress::getAddressLength() const throw() +int CNetworkAddress::getAddressLength() const { return sizeof(m_address); } diff --git a/net/CNetworkAddress.h b/net/CNetworkAddress.h index f9394b32..95e377ce 100644 --- a/net/CNetworkAddress.h +++ b/net/CNetworkAddress.h @@ -9,16 +9,16 @@ class CString; class CNetworkAddress { public: - CNetworkAddress(UInt16 port) throw(XSocketAddress); - CNetworkAddress(const CString& hostname, UInt16 port) throw(XSocketAddress); + CNetworkAddress(UInt16 port); + CNetworkAddress(const CString& hostname, UInt16 port); ~CNetworkAddress(); // manipulators // accessors - const struct sockaddr* getAddress() const throw(); - int getAddressLength() const throw(); + const struct sockaddr* getAddress() const; + int getAddressLength() const; private: struct sockaddr m_address; diff --git a/net/CSocketInputStream.cpp b/net/CSocketInputStream.cpp index d6f9d7ae..e17e0229 100644 --- a/net/CSocketInputStream.cpp +++ b/net/CSocketInputStream.cpp @@ -27,7 +27,7 @@ CSocketInputStream::~CSocketInputStream() } void CSocketInputStream::write( - const void* data, UInt32 n) throw() + const void* data, UInt32 n) { if (!m_hungup && n > 0) { m_buffer.write(data, n); @@ -36,13 +36,13 @@ void CSocketInputStream::write( } } -void CSocketInputStream::hangup() throw() +void CSocketInputStream::hangup() { m_hungup = true; m_empty.broadcast(); } -void CSocketInputStream::close() throw(XIO) +void CSocketInputStream::close() { CLock lock(m_mutex); if (m_closed) { @@ -56,7 +56,7 @@ void CSocketInputStream::close() throw(XIO) } UInt32 CSocketInputStream::read( - void* dst, UInt32 n) throw(XIO) + void* dst, UInt32 n) { CLock lock(m_mutex); if (m_closed) { @@ -86,7 +86,7 @@ UInt32 CSocketInputStream::read( return n; } -UInt32 CSocketInputStream::getSize() const throw() +UInt32 CSocketInputStream::getSize() const { CLock lock(m_mutex); return m_buffer.getSize(); diff --git a/net/CSocketInputStream.h b/net/CSocketInputStream.h index 46cb1c5b..38096538 100644 --- a/net/CSocketInputStream.h +++ b/net/CSocketInputStream.h @@ -16,19 +16,19 @@ class CSocketInputStream : public IInputStream { // manipulators // write() appends n bytes to the buffer - void write(const void*, UInt32 n) throw(); + void write(const void*, UInt32 n); // causes read() to always return immediately. if there is no // more data then it returns 0. further writes are discarded. - void hangup() throw(); + void hangup(); // accessors // IInputStream overrides // these all lock the mutex for their duration - virtual void close() throw(XIO); - virtual UInt32 read(void*, UInt32 count) throw(XIO); - virtual UInt32 getSize() const throw(); + virtual void close(); + virtual UInt32 read(void*, UInt32 count); + virtual UInt32 getSize() const; private: CMutex* m_mutex; diff --git a/net/CSocketOutputStream.cpp b/net/CSocketOutputStream.cpp index a1d36c18..fe9998be 100644 --- a/net/CSocketOutputStream.cpp +++ b/net/CSocketOutputStream.cpp @@ -23,22 +23,22 @@ CSocketOutputStream::~CSocketOutputStream() delete m_closeCB; } -const void* CSocketOutputStream::peek(UInt32 n) throw() +const void* CSocketOutputStream::peek(UInt32 n) { return m_buffer.peek(n); } -void CSocketOutputStream::pop(UInt32 n) throw() +void CSocketOutputStream::pop(UInt32 n) { m_buffer.pop(n); } -UInt32 CSocketOutputStream::getSize() const throw() +UInt32 CSocketOutputStream::getSize() const { return m_buffer.getSize(); } -void CSocketOutputStream::close() throw(XIO) +void CSocketOutputStream::close() { CLock lock(m_mutex); if (m_closed) { @@ -52,7 +52,7 @@ void CSocketOutputStream::close() throw(XIO) } UInt32 CSocketOutputStream::write( - const void* data, UInt32 n) throw(XIO) + const void* data, UInt32 n) { CLock lock(m_mutex); if (m_closed) { @@ -63,7 +63,7 @@ UInt32 CSocketOutputStream::write( return n; } -void CSocketOutputStream::flush() throw(XIO) +void CSocketOutputStream::flush() { // wait until all data is written while (getSizeWithLock() > 0) { @@ -71,7 +71,7 @@ void CSocketOutputStream::flush() throw(XIO) } } -UInt32 CSocketOutputStream::getSizeWithLock() const throw() +UInt32 CSocketOutputStream::getSizeWithLock() const { CLock lock(m_mutex); return m_buffer.getSize(); diff --git a/net/CSocketOutputStream.h b/net/CSocketOutputStream.h index d55443c7..c959c140 100644 --- a/net/CSocketOutputStream.h +++ b/net/CSocketOutputStream.h @@ -16,22 +16,22 @@ class CSocketOutputStream : public IOutputStream { // peek() returns a buffer of n bytes (which must be <= getSize()). // pop() discards the next n bytes. - const void* peek(UInt32 n) throw(); - void pop(UInt32 n) throw(); + const void* peek(UInt32 n); + void pop(UInt32 n); // accessors // return the number of bytes in the buffer - UInt32 getSize() const throw(); + UInt32 getSize() const; // IOutputStream overrides // these all lock the mutex for their duration - virtual void close() throw(XIO); - virtual UInt32 write(const void*, UInt32 count) throw(XIO); - virtual void flush() throw(XIO); + virtual void close(); + virtual UInt32 write(const void*, UInt32 count); + virtual void flush(); private: - UInt32 getSizeWithLock() const throw(); + UInt32 getSizeWithLock() const; private: CMutex* m_mutex; diff --git a/net/CSocketStreamBuffer.cpp b/net/CSocketStreamBuffer.cpp index 0a2848ce..5ee20c28 100644 --- a/net/CSocketStreamBuffer.cpp +++ b/net/CSocketStreamBuffer.cpp @@ -17,7 +17,7 @@ CSocketStreamBuffer::~CSocketStreamBuffer() // do nothing } -const void* CSocketStreamBuffer::peek(UInt32 n) throw() +const void* CSocketStreamBuffer::peek(UInt32 n) { assert(n <= m_size); @@ -36,7 +36,7 @@ const void* CSocketStreamBuffer::peek(UInt32 n) throw() return reinterpret_cast(head->begin()); } -void CSocketStreamBuffer::pop(UInt32 n) throw() +void CSocketStreamBuffer::pop(UInt32 n) { m_size -= n; @@ -58,7 +58,7 @@ void CSocketStreamBuffer::pop(UInt32 n) throw() } void CSocketStreamBuffer::write( - const void* vdata, UInt32 n) throw() + const void* vdata, UInt32 n) { assert(vdata != NULL); @@ -100,7 +100,7 @@ void CSocketStreamBuffer::write( } } -UInt32 CSocketStreamBuffer::getSize() const throw() +UInt32 CSocketStreamBuffer::getSize() const { return m_size; } diff --git a/net/CSocketStreamBuffer.h b/net/CSocketStreamBuffer.h index ea6234b4..545fd25f 100644 --- a/net/CSocketStreamBuffer.h +++ b/net/CSocketStreamBuffer.h @@ -14,16 +14,16 @@ class CSocketStreamBuffer { // peek() returns a buffer of n bytes (which must be <= getSize()). // pop() discards the next n bytes. - const void* peek(UInt32 n) throw(); - void pop(UInt32 n) throw(); + const void* peek(UInt32 n); + void pop(UInt32 n); // write() appends n bytes to the buffer - void write(const void*, UInt32 n) throw(); + void write(const void*, UInt32 n); // accessors // return the number of bytes in the buffer - UInt32 getSize() const throw(); + UInt32 getSize() const; private: static const UInt32 kChunkSize; diff --git a/net/CTCPListenSocket.cpp b/net/CTCPListenSocket.cpp index 959e8c52..d7fdaa93 100644 --- a/net/CTCPListenSocket.cpp +++ b/net/CTCPListenSocket.cpp @@ -31,7 +31,7 @@ CTCPListenSocket::~CTCPListenSocket() } void CTCPListenSocket::bind( - const CNetworkAddress& addr) throw(XSocket) + const CNetworkAddress& addr) { if (::bind(m_fd, addr.getAddress(), addr.getAddressLength()) == -1) { if (errno == EADDRINUSE) { @@ -44,7 +44,7 @@ void CTCPListenSocket::bind( } } -ISocket* CTCPListenSocket::accept() throw(XSocket) +ISocket* CTCPListenSocket::accept() { for (;;) { struct sockaddr addr; @@ -60,7 +60,7 @@ ISocket* CTCPListenSocket::accept() throw(XSocket) } } -void CTCPListenSocket::close() throw(XIO) +void CTCPListenSocket::close() { if (m_fd == -1) { throw XIOClosed(); diff --git a/net/CTCPListenSocket.h b/net/CTCPListenSocket.h index 8807fba8..30310b52 100644 --- a/net/CTCPListenSocket.h +++ b/net/CTCPListenSocket.h @@ -13,9 +13,9 @@ class CTCPListenSocket : public IListenSocket { // accessors // IListenSocket overrides - virtual void bind(const CNetworkAddress&) throw(XSocket); - virtual ISocket* accept() throw(XSocket); - virtual void close() throw(XIO); + virtual void bind(const CNetworkAddress&); + virtual ISocket* accept(); + virtual void close(); private: int m_fd; diff --git a/net/CTCPSocket.cpp b/net/CTCPSocket.cpp index 86a1b0bd..d38ee738 100644 --- a/net/CTCPSocket.cpp +++ b/net/CTCPSocket.cpp @@ -20,7 +20,7 @@ // CTCPSocket // -CTCPSocket::CTCPSocket() throw(XSocket) +CTCPSocket::CTCPSocket() { m_fd = socket(PF_INET, SOCK_STREAM, 0); if (m_fd == -1) { @@ -29,7 +29,7 @@ CTCPSocket::CTCPSocket() throw(XSocket) init(); } -CTCPSocket::CTCPSocket(int fd) throw() : +CTCPSocket::CTCPSocket(int fd) : m_fd(fd) { assert(m_fd != -1); @@ -60,7 +60,6 @@ CTCPSocket::~CTCPSocket() } void CTCPSocket::bind(const CNetworkAddress& addr) - throw(XSocket) { if (::bind(m_fd, addr.getAddress(), addr.getAddressLength()) == -1) { if (errno == EADDRINUSE) { @@ -71,7 +70,6 @@ void CTCPSocket::bind(const CNetworkAddress& addr) } void CTCPSocket::connect(const CNetworkAddress& addr) - throw(XSocket) { CThread::testCancel(); if (::connect(m_fd, addr.getAddress(), addr.getAddressLength()) == -1) { @@ -85,7 +83,7 @@ void CTCPSocket::connect(const CNetworkAddress& addr) this, &CTCPSocket::service)); } -void CTCPSocket::close() throw(XIO) +void CTCPSocket::close() { // shutdown I/O thread before close if (m_thread != NULL) { @@ -114,17 +112,17 @@ void CTCPSocket::close() throw(XIO) } } -IInputStream* CTCPSocket::getInputStream() throw() +IInputStream* CTCPSocket::getInputStream() { return m_input; } -IOutputStream* CTCPSocket::getOutputStream() throw() +IOutputStream* CTCPSocket::getOutputStream() { return m_output; } -void CTCPSocket::init() throw(XIO) +void CTCPSocket::init() { m_mutex = new CMutex; m_thread = NULL; @@ -137,7 +135,7 @@ void CTCPSocket::init() throw(XIO) this, &CTCPSocket::closeOutput)); } -void CTCPSocket::service(void*) throw(XThread) +void CTCPSocket::service(void*) { assert(m_fd != -1); @@ -211,14 +209,14 @@ void CTCPSocket::service(void*) throw(XThread) } } -void CTCPSocket::closeInput(void*) throw() +void CTCPSocket::closeInput(void*) { // note -- m_mutex should already be locked shutdown(m_fd, 0); m_connected &= ~kRead; } -void CTCPSocket::closeOutput(void*) throw() +void CTCPSocket::closeOutput(void*) { // note -- m_mutex should already be locked shutdown(m_fd, 1); diff --git a/net/CTCPSocket.h b/net/CTCPSocket.h index 8218bbad..208774ff 100644 --- a/net/CTCPSocket.h +++ b/net/CTCPSocket.h @@ -13,8 +13,8 @@ class CBufferedOutputStream; class CTCPSocket : public ISocket { public: - CTCPSocket() throw(XSocket); - CTCPSocket(int fd) throw(); + CTCPSocket(); + CTCPSocket(int fd); ~CTCPSocket(); // manipulators @@ -22,17 +22,17 @@ class CTCPSocket : public ISocket { // accessors // ISocket overrides - virtual void bind(const CNetworkAddress&) throw(XSocket); - virtual void connect(const CNetworkAddress&) throw(XSocket); - virtual void close() throw(XIO); - virtual IInputStream* getInputStream() throw(); - virtual IOutputStream* getOutputStream() throw(); + virtual void bind(const CNetworkAddress&); + virtual void connect(const CNetworkAddress&); + virtual void close(); + virtual IInputStream* getInputStream(); + virtual IOutputStream* getOutputStream(); private: - void init() throw(XIO); - void service(void*) throw(XThread); - void closeInput(void*) throw(); - void closeOutput(void*) throw(); + void init(); + void service(void*); + void closeInput(void*); + void closeOutput(void*); private: enum { kClosed = 0, kRead = 1, kWrite = 2, kReadWrite = 3 }; diff --git a/net/IListenSocket.h b/net/IListenSocket.h index eb8d7903..f411412e 100644 --- a/net/IListenSocket.h +++ b/net/IListenSocket.h @@ -13,13 +13,13 @@ class IListenSocket : public IInterface { // manipulators // bind the socket to a particular address - virtual void bind(const CNetworkAddress&) throw(XSocket) = 0; + virtual void bind(const CNetworkAddress&) = 0; // wait for a connection - virtual ISocket* accept() throw(XSocket) = 0; + virtual ISocket* accept() = 0; // close the socket - virtual void close() throw(XIO) = 0; + virtual void close() = 0; // accessors }; diff --git a/net/ISocket.h b/net/ISocket.h index 98d1fd45..2c86e561 100644 --- a/net/ISocket.h +++ b/net/ISocket.h @@ -15,19 +15,19 @@ class ISocket : public IInterface { // manipulators // bind the socket to a particular address - virtual void bind(const CNetworkAddress&) throw(XSocket) = 0; + virtual void bind(const CNetworkAddress&) = 0; // connect the socket - virtual void connect(const CNetworkAddress&) throw(XSocket) = 0; + virtual void connect(const CNetworkAddress&) = 0; // close the socket. this will flush the output stream if it // hasn't been closed yet. - virtual void close() throw(XIO) = 0; + virtual void close() = 0; // get the input and output streams for the socket. closing // these streams closes the appropriate half of the socket. - virtual IInputStream* getInputStream() throw() = 0; - virtual IOutputStream* getOutputStream() throw() = 0; + virtual IInputStream* getInputStream() = 0; + virtual IOutputStream* getOutputStream() = 0; // accessors }; diff --git a/synergy/CInputPacketStream.cpp b/synergy/CInputPacketStream.cpp index c7642e45..607ac4f5 100644 --- a/synergy/CInputPacketStream.cpp +++ b/synergy/CInputPacketStream.cpp @@ -20,13 +20,13 @@ CInputPacketStream::~CInputPacketStream() // do nothing } -void CInputPacketStream::close() throw(XIO) +void CInputPacketStream::close() { getStream()->close(); } UInt32 CInputPacketStream::read( - void* buffer, UInt32 n) throw(XIO) + void* buffer, UInt32 n) { CLock lock(&m_mutex); @@ -50,13 +50,13 @@ UInt32 CInputPacketStream::read( return n; } -UInt32 CInputPacketStream::getSize() const throw() +UInt32 CInputPacketStream::getSize() const { CLock lock(&m_mutex); return getSizeNoLock(); } -UInt32 CInputPacketStream::getSizeNoLock() const throw() +UInt32 CInputPacketStream::getSizeNoLock() const { while (!hasFullMessage()) { // read more data @@ -76,7 +76,7 @@ UInt32 CInputPacketStream::getSizeNoLock() const throw() return m_size; } -bool CInputPacketStream::hasFullMessage() const throw() +bool CInputPacketStream::hasFullMessage() const { // get payload length if we don't have it yet if (m_size == 0) { diff --git a/synergy/CInputPacketStream.h b/synergy/CInputPacketStream.h index 5bd31772..50be260c 100644 --- a/synergy/CInputPacketStream.h +++ b/synergy/CInputPacketStream.h @@ -15,13 +15,13 @@ class CInputPacketStream : public CInputStreamFilter { // accessors // IInputStream overrides - virtual void close() throw(XIO); - virtual UInt32 read(void*, UInt32 maxCount) throw(XIO); - virtual UInt32 getSize() const throw(); + virtual void close(); + virtual UInt32 read(void*, UInt32 maxCount); + virtual UInt32 getSize() const; private: - UInt32 getSizeNoLock() const throw(); - bool hasFullMessage() const throw(); + UInt32 getSizeNoLock() const; + bool hasFullMessage() const; private: CMutex m_mutex; diff --git a/synergy/COutputPacketStream.cpp b/synergy/COutputPacketStream.cpp index cffd050a..1895b782 100644 --- a/synergy/COutputPacketStream.cpp +++ b/synergy/COutputPacketStream.cpp @@ -15,13 +15,13 @@ COutputPacketStream::~COutputPacketStream() // do nothing } -void COutputPacketStream::close() throw(XIO) +void COutputPacketStream::close() { getStream()->close(); } UInt32 COutputPacketStream::write( - const void* buffer, UInt32 count) throw(XIO) + const void* buffer, UInt32 count) { // write the length of the payload UInt8 length[4]; @@ -49,7 +49,7 @@ UInt32 COutputPacketStream::write( return count; } -void COutputPacketStream::flush() throw(XIO) +void COutputPacketStream::flush() { getStream()->flush(); } diff --git a/synergy/COutputPacketStream.h b/synergy/COutputPacketStream.h index 20293386..a41d63e7 100644 --- a/synergy/COutputPacketStream.h +++ b/synergy/COutputPacketStream.h @@ -13,9 +13,9 @@ class COutputPacketStream : public COutputStreamFilter { // accessors // IOutputStream overrides - virtual void close() throw(XIO); - virtual UInt32 write(const void*, UInt32 count) throw(XIO); - virtual void flush() throw(XIO); + virtual void close(); + virtual UInt32 write(const void*, UInt32 count); + virtual void flush(); }; #endif diff --git a/synergy/CProtocolUtil.cpp b/synergy/CProtocolUtil.cpp index d35b2867..ec0cc2cc 100644 --- a/synergy/CProtocolUtil.cpp +++ b/synergy/CProtocolUtil.cpp @@ -11,7 +11,7 @@ // void CProtocolUtil::writef(IOutputStream* stream, - const char* fmt, ...) throw(XIO) + const char* fmt, ...) { assert(stream != NULL); assert(fmt != NULL); @@ -48,7 +48,7 @@ void CProtocolUtil::writef(IOutputStream* stream, } void CProtocolUtil::readf(IInputStream* stream, - const char* fmt, ...) throw(XIO) + const char* fmt, ...) { assert(stream != NULL); assert(fmt != NULL); @@ -171,7 +171,7 @@ void CProtocolUtil::readf(IInputStream* stream, } UInt32 CProtocolUtil::getLength( - const char* fmt, va_list args) throw() + const char* fmt, va_list args) { UInt32 n = 0; while (*fmt) { @@ -214,7 +214,7 @@ UInt32 CProtocolUtil::getLength( } void CProtocolUtil::writef(void* buffer, - const char* fmt, va_list args) throw(XIO) + const char* fmt, va_list args) { UInt8* dst = reinterpret_cast(buffer); @@ -285,7 +285,7 @@ void CProtocolUtil::writef(void* buffer, } } -UInt32 CProtocolUtil::eatLength(const char** pfmt) throw() +UInt32 CProtocolUtil::eatLength(const char** pfmt) { const char* fmt = *pfmt; UInt32 n = 0; @@ -310,7 +310,7 @@ UInt32 CProtocolUtil::eatLength(const char** pfmt) throw() } void CProtocolUtil::read(IInputStream* stream, - void* vbuffer, UInt32 count) throw(XIO) + void* vbuffer, UInt32 count) { assert(stream != NULL); assert(vbuffer != NULL); diff --git a/synergy/CProtocolUtil.h b/synergy/CProtocolUtil.h index 346accda..70bd5851 100644 --- a/synergy/CProtocolUtil.h +++ b/synergy/CProtocolUtil.h @@ -22,7 +22,7 @@ class CProtocolUtil { // %4i -- converts integer argument to 4 byte integer in NBO // %s -- converts integer N and const UInt8* to stream of N bytes static void writef(IOutputStream*, - const char* fmt, ...) throw(XIO); + const char* fmt, ...); // read formatted binary data from a buffer. this performs the // reverse operation of writef(). @@ -34,13 +34,13 @@ class CProtocolUtil { // %4i -- reads an NBO 4 byte integer; arg is SInt32* or UInt32* // %s -- reads bytes; argument must be a CString*, *not* a char* static void readf(IInputStream*, - const char* fmt, ...) throw(XIO); + const char* fmt, ...); private: - static UInt32 getLength(const char* fmt, va_list) throw(); - static void writef(void*, const char* fmt, va_list) throw(XIO); - static UInt32 eatLength(const char** fmt) throw(); - static void read(IInputStream*, void*, UInt32) throw(XIO); + static UInt32 getLength(const char* fmt, va_list); + static void writef(void*, const char* fmt, va_list); + static UInt32 eatLength(const char** fmt); + static void read(IInputStream*, void*, UInt32); }; class XIOReadMismatch : public XIO { diff --git a/synergy/CScreenMap.cpp b/synergy/CScreenMap.cpp index eb2b4d7f..39d7d7f2 100644 --- a/synergy/CScreenMap.cpp +++ b/synergy/CScreenMap.cpp @@ -76,7 +76,7 @@ void CScreenMap::disconnect(const CString& srcName, } CString CScreenMap::getNeighbor(const CString& srcName, - EDirection srcSide) const throw() + EDirection srcSide) const { // find source cell CCellMap::const_iterator index = m_map.find(srcName); diff --git a/synergy/CScreenMap.h b/synergy/CScreenMap.h index 816b8f93..80c571f6 100644 --- a/synergy/CScreenMap.h +++ b/synergy/CScreenMap.h @@ -31,7 +31,7 @@ class CScreenMap { // get the neighbor in the given direction. returns the empty string // if there is no neighbor in that direction. - CString getNeighbor(const CString&, EDirection) const throw(); + CString getNeighbor(const CString&, EDirection) const; // get the name of a direction (for debugging) static const char* dirName(EDirection); diff --git a/synergy/CServer.cpp b/synergy/CServer.cpp index 5a579c30..31f6e65e 100644 --- a/synergy/CServer.cpp +++ b/synergy/CServer.cpp @@ -96,7 +96,7 @@ void CServer::getScreenMap(CScreenMap* screenMap) const } void CServer::setInfo(const CString& client, - SInt32 w, SInt32 h, SInt32 zoneSize) throw() + SInt32 w, SInt32 h, SInt32 zoneSize) { CLock lock(&m_mutex); @@ -732,7 +732,7 @@ void CServer::handshakeClient(void* vsocket) } } -void CServer::quit() throw() +void CServer::quit() { CLock lock(&m_mutex); m_done = true; @@ -761,7 +761,7 @@ void CServer::openPrimaryScreen() // FIXME -- need way for primary screen to call us back } -void CServer::closePrimaryScreen() throw() +void CServer::closePrimaryScreen() { assert(m_primary != NULL); @@ -802,7 +802,7 @@ void CServer::removeCleanupThread(const CThread& thread) } } -void CServer::cleanupThreads() throw() +void CServer::cleanupThreads() { log((CLOG_DEBUG "cleaning up threads")); m_mutex.lock(); @@ -839,7 +839,7 @@ void CServer::removeConnection(const CString& name) log((CLOG_DEBUG "removing connection \"%s\"", name.c_str())); CLock lock(&m_mutex); CScreenList::iterator index = m_screens.find(name); - assert(index == m_screens.end()); + assert(index != m_screens.end()); delete index->second; m_screens.erase(index); } diff --git a/synergy/CServer.h b/synergy/CServer.h index e7fc814e..0274b2fe 100644 --- a/synergy/CServer.h +++ b/synergy/CServer.h @@ -41,7 +41,7 @@ class CServer { // handle messages from clients void setInfo(const CString& clientName, - SInt32 w, SInt32 h, SInt32 zoneSize) throw(); + SInt32 w, SInt32 h, SInt32 zoneSize); // accessors @@ -52,7 +52,7 @@ class CServer { protected: bool onCommandKey(KeyID, KeyModifierMask, bool down); - void quit() throw(); + void quit(); private: class CCleanupNote { @@ -111,10 +111,10 @@ class CServer { // open/close the primary screen void openPrimaryScreen(); - void closePrimaryScreen() throw(); + void closePrimaryScreen(); // cancel running threads - void cleanupThreads() throw(); + void cleanupThreads(); // thread method to accept incoming client connections void acceptClients(void*); diff --git a/synergy/CServerProtocol.cpp b/synergy/CServerProtocol.cpp index eb52afd8..f4d05697 100644 --- a/synergy/CServerProtocol.cpp +++ b/synergy/CServerProtocol.cpp @@ -26,22 +26,22 @@ CServerProtocol::~CServerProtocol() // do nothing } -CServer* CServerProtocol::getServer() const throw() +CServer* CServerProtocol::getServer() const { return m_server; } -CString CServerProtocol::getClient() const throw() +CString CServerProtocol::getClient() const { return m_client; } -IInputStream* CServerProtocol::getInputStream() const throw() +IInputStream* CServerProtocol::getInputStream() const { return m_input; } -IOutputStream* CServerProtocol::getOutputStream() const throw() +IOutputStream* CServerProtocol::getOutputStream() const { return m_output; } diff --git a/synergy/CServerProtocol.h b/synergy/CServerProtocol.h index 485ee2c3..5fb552a7 100644 --- a/synergy/CServerProtocol.h +++ b/synergy/CServerProtocol.h @@ -18,35 +18,35 @@ class CServerProtocol : public IServerProtocol { // accessors - virtual CServer* getServer() const throw(); - virtual CString getClient() const throw(); - virtual IInputStream* getInputStream() const throw(); - virtual IOutputStream* getOutputStream() const throw(); + virtual CServer* getServer() const; + virtual CString getClient() const; + virtual IInputStream* getInputStream() const; + virtual IOutputStream* getOutputStream() const; static IServerProtocol* create(SInt32 major, SInt32 minor, CServer*, const CString& clientName, IInputStream*, IOutputStream*); // IServerProtocol overrides - virtual void run() throw(XIO,XBadClient) = 0; - virtual void queryInfo() throw(XIO,XBadClient) = 0; - virtual void sendClose() throw(XIO) = 0; - virtual void sendEnter(SInt32 xAbs, SInt32 yAbs) throw(XIO) = 0; - virtual void sendLeave() throw(XIO) = 0; - virtual void sendGrabClipboard() throw(XIO) = 0; - virtual void sendQueryClipboard() throw(XIO) = 0; - virtual void sendScreenSaver(bool on) throw(XIO) = 0; - virtual void sendKeyDown(KeyID, KeyModifierMask) throw(XIO) = 0; - virtual void sendKeyRepeat(KeyID, KeyModifierMask) throw(XIO) = 0; - virtual void sendKeyUp(KeyID, KeyModifierMask) throw(XIO) = 0; - virtual void sendMouseDown(ButtonID) throw(XIO) = 0; - virtual void sendMouseUp(ButtonID) throw(XIO) = 0; - virtual void sendMouseMove(SInt32 xAbs, SInt32 yAbs) throw(XIO) = 0; - virtual void sendMouseWheel(SInt32 delta) throw(XIO) = 0; + virtual void run() = 0; + virtual void queryInfo() = 0; + virtual void sendClose() = 0; + virtual void sendEnter(SInt32 xAbs, SInt32 yAbs) = 0; + virtual void sendLeave() = 0; + virtual void sendGrabClipboard() = 0; + virtual void sendQueryClipboard() = 0; + virtual void sendScreenSaver(bool on) = 0; + virtual void sendKeyDown(KeyID, KeyModifierMask) = 0; + virtual void sendKeyRepeat(KeyID, KeyModifierMask) = 0; + virtual void sendKeyUp(KeyID, KeyModifierMask) = 0; + virtual void sendMouseDown(ButtonID) = 0; + virtual void sendMouseUp(ButtonID) = 0; + virtual void sendMouseMove(SInt32 xAbs, SInt32 yAbs) = 0; + virtual void sendMouseWheel(SInt32 delta) = 0; protected: //IServerProtocol overrides - virtual void recvInfo() throw(XIO,XBadClient) = 0; + virtual void recvInfo() = 0; private: CServer* m_server; diff --git a/synergy/CServerProtocol1_0.cpp b/synergy/CServerProtocol1_0.cpp index 2efe6aa1..746e0c1a 100644 --- a/synergy/CServerProtocol1_0.cpp +++ b/synergy/CServerProtocol1_0.cpp @@ -22,7 +22,7 @@ CServerProtocol1_0::~CServerProtocol1_0() // do nothing } -void CServerProtocol1_0::run() throw(XIO,XBadClient) +void CServerProtocol1_0::run() { // handle messages until the client hangs up for (;;) { @@ -53,7 +53,7 @@ void CServerProtocol1_0::run() throw(XIO,XBadClient) } } -void CServerProtocol1_0::queryInfo() throw(XIO,XBadClient) +void CServerProtocol1_0::queryInfo() { log((CLOG_INFO "querying client \"%s\" info", getClient().c_str())); @@ -71,93 +71,93 @@ void CServerProtocol1_0::queryInfo() throw(XIO,XBadClient) recvInfo(); } -void CServerProtocol1_0::sendClose() throw(XIO) +void CServerProtocol1_0::sendClose() { log((CLOG_INFO "send close to \"%s\"", getClient().c_str())); CProtocolUtil::writef(getOutputStream(), kMsgCClose); } void CServerProtocol1_0::sendEnter( - SInt32 xAbs, SInt32 yAbs) throw(XIO) + SInt32 xAbs, SInt32 yAbs) { log((CLOG_INFO "send enter to \"%s\", %d,%d", getClient().c_str(), xAbs, yAbs)); CProtocolUtil::writef(getOutputStream(), kMsgCEnter, xAbs, yAbs); } -void CServerProtocol1_0::sendLeave() throw(XIO) +void CServerProtocol1_0::sendLeave() { log((CLOG_INFO "send leave to \"%s\"", getClient().c_str())); CProtocolUtil::writef(getOutputStream(), kMsgCLeave); } -void CServerProtocol1_0::sendGrabClipboard() throw(XIO) +void CServerProtocol1_0::sendGrabClipboard() { log((CLOG_INFO "send grab clipboard to \"%s\"", getClient().c_str())); CProtocolUtil::writef(getOutputStream(), kMsgCClipboard); } -void CServerProtocol1_0::sendQueryClipboard() throw(XIO) +void CServerProtocol1_0::sendQueryClipboard() { log((CLOG_INFO "query clipboard to \"%s\"", getClient().c_str())); CProtocolUtil::writef(getOutputStream(), kMsgQClipboard); } -void CServerProtocol1_0::sendScreenSaver(bool on) throw(XIO) +void CServerProtocol1_0::sendScreenSaver(bool on) { log((CLOG_INFO "send screen saver to \"%s\"", getClient().c_str())); CProtocolUtil::writef(getOutputStream(), kMsgCScreenSaver, on ? 1 : 0); } void CServerProtocol1_0::sendKeyDown( - KeyID key, KeyModifierMask mask) throw(XIO) + KeyID key, KeyModifierMask mask) { log((CLOG_INFO "send key down to \"%s\" id=%d, mask=0x%04x", getClient().c_str(), key, mask)); CProtocolUtil::writef(getOutputStream(), kMsgDKeyDown, key, mask); } void CServerProtocol1_0::sendKeyRepeat( - KeyID key, KeyModifierMask mask) throw(XIO) + KeyID key, KeyModifierMask mask) { log((CLOG_INFO "send key repeat to \"%s\" id=%d, mask=0x%04x", getClient().c_str(), key, mask)); CProtocolUtil::writef(getOutputStream(), kMsgDKeyRepeat, key, mask); } void CServerProtocol1_0::sendKeyUp( - KeyID key, KeyModifierMask mask) throw(XIO) + KeyID key, KeyModifierMask mask) { log((CLOG_INFO "send key up to \"%s\" id=%d, mask=0x%04x", getClient().c_str(), key, mask)); CProtocolUtil::writef(getOutputStream(), kMsgDKeyUp, key, mask); } void CServerProtocol1_0::sendMouseDown( - ButtonID button) throw(XIO) + ButtonID button) { log((CLOG_INFO "send mouse down to \"%s\" id=%d", getClient().c_str(), button)); CProtocolUtil::writef(getOutputStream(), kMsgDMouseDown, button); } void CServerProtocol1_0::sendMouseUp( - ButtonID button) throw(XIO) + ButtonID button) { log((CLOG_INFO "send mouse up to \"%s\" id=%d", getClient().c_str(), button)); CProtocolUtil::writef(getOutputStream(), kMsgDMouseUp, button); } void CServerProtocol1_0::sendMouseMove( - SInt32 xAbs, SInt32 yAbs) throw(XIO) + SInt32 xAbs, SInt32 yAbs) { log((CLOG_INFO "send mouse move to \"%s\" %d,%d", getClient().c_str(), xAbs, yAbs)); CProtocolUtil::writef(getOutputStream(), kMsgDMouseMove, xAbs, yAbs); } void CServerProtocol1_0::sendMouseWheel( - SInt32 delta) throw(XIO) + SInt32 delta) { log((CLOG_INFO "send mouse wheel to \"%s\" %+d", getClient().c_str(), delta)); CProtocolUtil::writef(getOutputStream(), kMsgDMouseWheel, delta); } -void CServerProtocol1_0::recvInfo() throw(XIO,XBadClient) +void CServerProtocol1_0::recvInfo() { // parse the message SInt32 w, h, zoneInfo; diff --git a/synergy/CServerProtocol1_0.h b/synergy/CServerProtocol1_0.h index eec2d156..00cc58cb 100644 --- a/synergy/CServerProtocol1_0.h +++ b/synergy/CServerProtocol1_0.h @@ -13,25 +13,25 @@ class CServerProtocol1_0 : public CServerProtocol { // accessors // IServerProtocol overrides - virtual void run() throw(XIO,XBadClient); - virtual void queryInfo() throw(XIO,XBadClient); - virtual void sendClose() throw(XIO); - virtual void sendEnter(SInt32 xAbs, SInt32 yAbs) throw(XIO); - virtual void sendLeave() throw(XIO); - virtual void sendGrabClipboard() throw(XIO); - virtual void sendQueryClipboard() throw(XIO); - virtual void sendScreenSaver(bool on) throw(XIO); - virtual void sendKeyDown(KeyID, KeyModifierMask) throw(XIO); - virtual void sendKeyRepeat(KeyID, KeyModifierMask) throw(XIO); - virtual void sendKeyUp(KeyID, KeyModifierMask) throw(XIO); - virtual void sendMouseDown(ButtonID) throw(XIO); - virtual void sendMouseUp(ButtonID) throw(XIO); - virtual void sendMouseMove(SInt32 xAbs, SInt32 yAbs) throw(XIO); - virtual void sendMouseWheel(SInt32 delta) throw(XIO); + virtual void run(); + virtual void queryInfo(); + virtual void sendClose(); + virtual void sendEnter(SInt32 xAbs, SInt32 yAbs); + virtual void sendLeave(); + virtual void sendGrabClipboard(); + virtual void sendQueryClipboard(); + virtual void sendScreenSaver(bool on); + virtual void sendKeyDown(KeyID, KeyModifierMask); + virtual void sendKeyRepeat(KeyID, KeyModifierMask); + virtual void sendKeyUp(KeyID, KeyModifierMask); + virtual void sendMouseDown(ButtonID); + virtual void sendMouseUp(ButtonID); + virtual void sendMouseMove(SInt32 xAbs, SInt32 yAbs); + virtual void sendMouseWheel(SInt32 delta); protected: // IServerProtocol overrides - virtual void recvInfo() throw(XIO,XBadClient); + virtual void recvInfo(); }; #endif diff --git a/synergy/CTCPSocketFactory.cpp b/synergy/CTCPSocketFactory.cpp index cecbb348..7b10ff8d 100644 --- a/synergy/CTCPSocketFactory.cpp +++ b/synergy/CTCPSocketFactory.cpp @@ -16,12 +16,12 @@ CTCPSocketFactory::~CTCPSocketFactory() // do nothing } -ISocket* CTCPSocketFactory::create() const throw(XSocket) +ISocket* CTCPSocketFactory::create() const { return new CTCPSocket; } -IListenSocket* CTCPSocketFactory::createListen() const throw(XSocket) +IListenSocket* CTCPSocketFactory::createListen() const { return new CTCPListenSocket; } diff --git a/synergy/CTCPSocketFactory.h b/synergy/CTCPSocketFactory.h index db38ee6e..d5d689e7 100644 --- a/synergy/CTCPSocketFactory.h +++ b/synergy/CTCPSocketFactory.h @@ -13,8 +13,8 @@ class CTCPSocketFactory : public ISocketFactory { // accessors // ISocketFactory overrides - virtual ISocket* create() const throw(XSocket); - virtual IListenSocket* createListen() const throw(XSocket); + virtual ISocket* create() const; + virtual IListenSocket* createListen() const; }; #endif diff --git a/synergy/IServerProtocol.h b/synergy/IServerProtocol.h index cf5ece9f..360c9d7e 100644 --- a/synergy/IServerProtocol.h +++ b/synergy/IServerProtocol.h @@ -14,32 +14,32 @@ class IServerProtocol : public IInterface { // process messages from the client and insert the appropriate // events into the server's event queue. return when the client // disconnects. - virtual void run() throw(XIO,XBadClient) = 0; + virtual void run() = 0; // send client info query and process reply - virtual void queryInfo() throw(XIO,XBadClient) = 0; + virtual void queryInfo() = 0; // send various messages to client - virtual void sendClose() throw(XIO) = 0; - virtual void sendEnter(SInt32 xAbs, SInt32 yAbs) throw(XIO) = 0; - virtual void sendLeave() throw(XIO) = 0; - virtual void sendGrabClipboard() throw(XIO) = 0; - virtual void sendQueryClipboard() throw(XIO) = 0; - virtual void sendScreenSaver(bool on) throw(XIO) = 0; - virtual void sendKeyDown(KeyID, KeyModifierMask) throw(XIO) = 0; - virtual void sendKeyRepeat(KeyID, KeyModifierMask) throw(XIO) = 0; - virtual void sendKeyUp(KeyID, KeyModifierMask) throw(XIO) = 0; - virtual void sendMouseDown(ButtonID) throw(XIO) = 0; - virtual void sendMouseUp(ButtonID) throw(XIO) = 0; - virtual void sendMouseMove(SInt32 xAbs, SInt32 yAbs) throw(XIO) = 0; - virtual void sendMouseWheel(SInt32 delta) throw(XIO) = 0; + virtual void sendClose() = 0; + virtual void sendEnter(SInt32 xAbs, SInt32 yAbs) = 0; + virtual void sendLeave() = 0; + virtual void sendGrabClipboard() = 0; + virtual void sendQueryClipboard() = 0; + virtual void sendScreenSaver(bool on) = 0; + virtual void sendKeyDown(KeyID, KeyModifierMask) = 0; + virtual void sendKeyRepeat(KeyID, KeyModifierMask) = 0; + virtual void sendKeyUp(KeyID, KeyModifierMask) = 0; + virtual void sendMouseDown(ButtonID) = 0; + virtual void sendMouseUp(ButtonID) = 0; + virtual void sendMouseMove(SInt32 xAbs, SInt32 yAbs) = 0; + virtual void sendMouseWheel(SInt32 delta) = 0; // accessors protected: // manipulators - virtual void recvInfo() throw(XIO,XBadClient) = 0; + virtual void recvInfo() = 0; // accessors }; diff --git a/synergy/ISocketFactory.h b/synergy/ISocketFactory.h index e919432d..2bb8ce2f 100644 --- a/synergy/ISocketFactory.h +++ b/synergy/ISocketFactory.h @@ -14,8 +14,8 @@ class ISocketFactory : public IInterface { // accessors // create sockets - virtual ISocket* create() const throw(XSocket) = 0; - virtual IListenSocket* createListen() const throw(XSocket) = 0; + virtual ISocket* create() const = 0; + virtual IListenSocket* createListen() const = 0; }; #endif